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

Santa should give people a second chance

Summary

Santa should give people a second chance and not check in the second pass if the status is the same. Only the status from the second pass should actually count for a present.

Vulnerability Details

In the following code from the function SantasList.checkTwice Santa is checking if the person has the same status as before. The function call will fail if for example, the person was first naughty and then became nice. The current implementation is very unfair and I'm sure that Santa would not agree with this.

if (s_theListCheckedOnce[person] != status) {
revert SantasList__SecondCheckDoesntMatchFirst();
}

Impact

I consider the impact to be very high, as people will stop believing in Santa if they see they changed from naughty to nice and Santa didn't give them a present.

Tools Used

Manual code review.

Recommendations

The checkTwicefunction should only verify that Santa checked the person once and record the status of the second check. The default status of the persons in both lists should be NOT_CHECKED (separate issue).

function checkTwice(address person, Status status) external onlySanta {
if (s_theListCheckedOnce[person] == Status.NOT_CHECKED) {
revert SantasList__NotCheckedOnce();
}
s_theListCheckedTwice[person] = status;
emit CheckedTwice(person, status);
}
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.