The check on line 151 if (balanceOf(msg.sender) > 0)
in collectPresent
can be bypassed and user can mint unlimited amount of NFTs.
Lets consider the following scenario. User got NICE
status, but he is malicious and will take advantage of his status. When Christmas comes, he will collect his present, but he will transfer it to a brand new account he made. This will make the check on line 151 if (balanceOf(msg.sender) > 0)
return true and he will be able to collect another present. He can do this unlimited amount of times.
Have more presents that a user should have
Manual Review, Foundry
Added the following test case
Test result:
Instead of checking balanceOf(msg.sender) > 0
create a mapping (address user => bool isCollected) hasCollectedPresent;
. Set the mapping to true and use it in the check.
Relying on balanceOf > 0 in collectPresent() allows the msg.sender to send their present to another address and then collect again.
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.