Description:
The claim
function in the smart contract does not implement a mechanism to prevent accounts that have already claimed tokens from claiming again. This allows accounts to repeatedly claim tokens, potentially draining the contract of its token funds.
Impact:
If one person claims all the tokens, other winners will not be able to claim any. This not only disadvantages the other winners but also undermines the fairness and integrity of the token distribution process.
Proof of Concept:
An attacker can repeatedly call the claim
function with the same account address and amount, exploiting the lack of a check for already claimed accounts. This can be demonstrated by observing the contract's token balance decrease over time as the same account repeatedly claims tokens.
Add the following test to MerkleAirdropTest.t.sol
and run forge test --zksync --mt testNoCheckForAlreadyClaimedAccounts
.
Recommended Mitigation:
Implement a check within the claim
function to ensure that an account cannot claim tokens more than once. This can be achieved by maintaining a mapping of claimed accounts and checking against this mapping before allowing a token transfer.
Tools Used: Manual Review and Foundry for POC
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.