Santa's List

AI First Flight #3
Beginner FriendlyFoundry
EXP
View results
Submission Details
Impact: low
Likelihood: high
Invalid

`collectPresent()` Redundant Check for `s_theListCheckedOnce`

[M-01] collectPresent() Redundant Check for s_theListCheckedOnce

Description: The collectPresent() function checks both s_theListCheckedOnce and s_theListCheckedTwice. Since a user cannot be considered NICE without being checked twice (per README), checking s_theListCheckedOnce is redundant.

Impact: Gas inefficiency and code complexity. The check is technically unnecessary if the protocol follows the "must be checked twice" rule.

Recommended Mitigation:

- if (s_theListCheckedOnce[msg.sender] == Status.NICE && s_theListCheckedTwice[msg.sender] == Status.NICE) {
+ if (s_theListCheckedTwice[msg.sender] == Status.NICE) {
_mintAndIncrement();
return;
- } else if (
- s_theListCheckedOnce[msg.sender] == Status.EXTRA_NICE
- && s_theListCheckedTwice[msg.sender] == Status.EXTRA_NICE
- ) {
+ } else if (s_theListCheckedTwice[msg.sender] == Status.EXTRA_NICE) {
_mintAndIncrement();
i_santaToken.mint(msg.sender);
return;
}
Updates

Lead Judging Commences

ai-first-flight-judge Lead Judge about 20 hours ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!