A malicous user can obtained more than one NFT per address
Thou present are given to only nice and extranice users, A nice user can also be malicious and can advantage of the vulnerability in the collectPresent function , the balance of each user is what is used to determine if a user has collected a present which is actually not valid if a user transfer the NFT to another address in other to claim more NFT for nice user and more NFT and santaToken for Extra Nice user as much as they want to keep claiming present.
A malicious user can claim more NFT than expected by each user.
The above code is a proof of concept of a user who claimed present 200 times and can also keep claiming for as long as possible
Add the above function to santaListTest.t.sol and run with forge test --mt testCanCollectPresentIfAlreadyCollected -vvvvv
manual review and foundry
Add a mapping to the stateVariable that keep track if a user has claimed a present or not i.e
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.