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

collectPresent can be called several times

Summary

Function collectPresent supposed to mint only one present to a person but can be called several times if NFT is transferred

Vulnerability Details

To make sure present is not minted twice, balanceOf(msg.sender) > 0 is used. However balance can be 0 if user collected NFT and transferred it to another account

Impact

Person can unlimitedly mint gifts

Tools Used

Recommendations

Store information about given NFTS in mapping. Consider to prohibit NFT transferring

Updates

Lead Judging Commences

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

Weak Already Collected Check

Relying on balanceOf > 0 in collectPresent() allows the msg.sender to send their present to another address and then collect again.

Support

FAQs

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