Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: low
Valid

`SantasList::buyPresent` mints NFT to wrong address

Summary

SantasList::buyPresent mints NFT to wrong address

Vulnerability Details

SantasList::buyPresent is a function that allows any user to burn SantaTokens and mint NFT presents to a receiver address. After burning SANTA ERC20 tokens, it then calls the internal function _mintAndIncrement which mints the NFT present to the msg.sender, when it should be minted to the presentReceiver.

Impact

MEDIUM.

Tools Used

  • Manual Review

Recommendations

Instead of using the internal _mintAndIncrement function, use the safe mint directly

function buyPresent(address presentReceiver) external {
i_santaToken.burn(presentReceiver);
- _mintAndIncrement();
+ _safeMint(presentReceiver, s_tokenCounter++)
}
Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

buyPresent should send to presentReceiver

Support

FAQs

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