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

SantasList _mintAndIncrement() will always be minted to msg.sender which shouldn't be allowed

Summary

_mintAndIncrement() will always mint an NFT to msg.sender, it will never mint the NFT to someone else if the msg.sender's purpose is to mint the NFT to someone else.

Vulnerability Details

msg.sender will never be able to mint the NFT to someone else.

Impact

breaks the rule that only one NFT can be minted to someone, malicious users can take advantage of this to mint as many NFTs they want for themselves.

Tools Used

Manual Review

Recommendations

- function _mintAndIncrement() private {
+ function _mintAndIncrement(address presentReceiver) private {
+ if (balanceOf(presentReceiver) > 0) {
+ revert SantasList__AlreadyCollected();
+ }
- _safeMint(msg.sender, s_tokenCounter++);
+ _safeMint(presentReceiver, s_tokenCounter++);
}
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.