Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: medium
Invalid

Cannot change status in checkTwice

Summary

In the natspec of the contract we have:

A function that changes an address to a new Status of NICE, EXTRA_NICE, NAUGHTY, or UNKNOWN on the new s_theListCheckedTwice list only if someone has already been marked on the s_theListCheckedOnce.

But the code checks if the first status is the same as the second status we input.
Resulting that we can NOT change the status as intended, only to make it the same as in the first check.

Vulnerability Details

Santa will not be able to change the status to a NEW status as intended in the protocol.

Impact

Tools Used

Manual review

Recommendations

Implement new value in enum STATUS:

enum Status {
UNCHECKED
NICE,
EXTRA_NICE,
NAUGHTY,
NOT_CHECKED_TWICE
}

Change code to

- if (s_theListCheckedOnce[person] != status) {
+ if (s_theListCheckedOnce[person] != Status.UNCHECKED) {
revert SantasList__SecondCheckDoesntMatchFirst();
}
Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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