The claim()
function currently lacks checks to prevent accounts from claiming more than once, allowing winners to receive a larger share of the drop than intended. Lucky winners can unfairly deplete the pool for other winners, leading to an improper distribution of tokens, eroding trust in the contract.
Lack of a mechanism to track and store the claimed status of accounts in claim()
function allows users to deplete the token reserves of the contract by claiming as many times as they want until the contract is depleted.
Without a check for duplicate claims, users can repeatedly claim USDC tokens, causing financial harm to the contract. This undermines fairness and integrity of the airdrop distribution process.
Manual Review
Have a collector i.e., collectorOne trigger claim function multiple times,
Logs:
MerkleAirdrop token balance before: 100000000
MerkleAirdrop token balance after: 0
Add the following test to MerkleAirdropTest.t.sol
There are a few recommendations.
Consider introducing an claimed mapping that stores accounts that have already claimed. Before processing a claim, verify whether the account has already claimed tokens and reject duplicate claims accordingly.
Consider introducing a flag in leaf data, indicating validity of a leaf, so an invalid leaf would be equivalent to a deleted leaf.. The Merkle root remains unchanged, but when verifying proofs involving the "deleted" leaf, you can check the invalidation flag before proceeding.
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.