The collectPresent()
function reverts if msg.sender
balance is greater than 0
however this check is not sufficient because the user that collects the present can transfer it to another address and then collect the present again.
Copy paste the following function inside SantasListTest.t.sol
Users can claim unlimited presents
Foundry
Consider using a new enum value and setting it after the present is claimed:
Add a new value to Status
enum
Change the status of the person who collected the present so he can't collect it twice.
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.