SantasList:_mintAndIncrement() mints NFT to msg.sender which results in SantasList:buyPresent() not working as expected, which is for the NFT to be minted to the intended recipient.
Calling SantasList:buyPresent() will result in the caller ("gifter") obtaining an additional NFT, which is not the expected behavior. It is expected that the "recipient" will get the newly minted NFT.
High Overall (High impact, High likelihood)
The Foundry test below will fail due to this vulnerability on the assertion of recipient's NFT balance (if submitted finding for wrong address for token burn has been addressed -- if not, this will still fail due to arithmetic underflow)...
Visual Studio Code, Foundry
Add an overloaded function for SantasList:_mintAndIncrement() that takes a parameter representing the address to which the NFT will be minted as shown below...
Note: overloaded function is recommended as minimizes the amount of changes needed to address this issue. Alternately, you could change the original SantasList:_mintAndIncrement() function to take a parameter and change all existing calls to the function.
Next, change the SantasList:buyPresent() function as shown below to call the new overload function with parameter for address to mint NFT to...
Note: the function above does not reflect the change for submission related to incorrect address for burning token.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.