The current smart contract lacks appropriate access control for users claiming an airdrop. Consequently, a prize winner can exhaust the prize pool, preventing other users from claiming their prizes.
The smart contract doesn't restrict prize winners who have already claimed their rewards from claiming again. If they're deemed eligible for a reward, these users can execute the MerkleAirdrop:: claim
function repeatedly as long as they provide the correct address and the amount they're eligible to receive.
As a result, a single prize winner can deplete the prize pool by calling the MerkleAirdrop:: claim
function four times. This would prevent other prize winners from claiming their prizes.
The following code, when added to the MerkleAirdropTest.t.sol
file and run, demonstrates this issue.
A prize winner can deplete the prize pool by calling the MerkleAirdrop:: claim
function four times, hence other prize winners won't be able to claim their prizes.
Copy the following code to the MerkleAirdropTest.t.sol
file and run the test.
Introduce access control mechanisms to prevent prize winners who have already claimed their prizes from claiming 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.