Calling collectPresent
addresses should not be able to collect more than once. This is apparently enforced by enforced by
This will not work if a misjudge NICE
address send his NFT to another address before calling collectPresent
a second time.
The next test should fail if the protocol work correctly:
A NICE attacker can claim an "infinite" amount of gift.
Use a mapping mapping(address person => bool claimed) private s_claimed;
to keep track of addresses that already claimed the gift.
Replace the check:
With:
And in the collectPresent
function in the lines before the _mintAndIncrement();
add s_claimed[msg.sender] = true;
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.