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

SantasList buyPresent() allows user to buyPresent even if Christmas time is not reached.

Summary

buyPresent() has no way of knowing if CHRISTMAS_2023_BLOCK_TIME is reached so if someone decided to they could call this and get a present before CHRISTMAS_2023_BLOCK_TIME.

Vulnerability Details

Allows the user to buy themselves or others a present before Christmas, the whole purpose of the contract is that people can get a present when CHRISTMAS_2023_BLOCK_TIME time is reached.

Impact

Users can exploit this to allow themselves to get a present before CHRISTMAS_2023_BLOCK_TIME.

Tools Used

Manual Review

Recommendations

function buyPresent(address presentReceiver) external {
+ if (block.timestamp < CHRISTMAS_2023_BLOCK_TIME) {
+ revert SantasList__NotChristmasYet();
+ }
i_santaToken.burn(presentReceiver);
_mintAndIncrement();
}
Updates

Lead Judging Commences

inallhonesty Lead Judge
over 1 year ago
inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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