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

Santa cannot mints themselves tokens

Summary

Only SantasList can call the SantaToken::mint() function rejecting any call from Santa.

Vulnerability Details

As said in the docs:

Additionally, it's OK if Santa mints themselves tokens.
Santa should be able to mint themselves tokens but there is a check at the start of the function making sure the only acceptable msg.sender will be SantaToken::i_santasList.

Impact

Santa can't call the SantaToken::mint() function.

Tools Used

Manual review.

Recommendations

function mint(address to) external {
if (msg.sender != i_santasList) {
+ if (msg.sender != i_santa && to != i_santa) {
+ revert SantaToken__NotSanta();
+ }
revert SantaToken__NotSantasList();
}
_mint(to, 1e18);
}
Updates

Lead Judging Commences

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.