The "SantasList::buyPresent" function is intended to buy a present for someone else.
However, there is no check to control whether the receiver already has a present.
This allows anyone to mint an NFT to any receiver, regardless of whether they already have one or not.
Likelihood:
Whenever someone wants to buy a present to a receiver.
Impact:
An address could have multiple NFTs, breaking the protocol invariant of "1 NFT per address".
Add the following code to "SantasListTest.t.sol":
Add a balance check before minting to follow CEI best practice.
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.