The TSender::airdropERC20
function is vulnerable to a denial-of-service (DoS) attack due to the potential for high gas costs when iterating over a large number of recipients.
The TSender::airdropERC20
function iterates through an array of recipients to transfer ERC20 tokens. If the number of recipients is over 1200, the transaction can exceed block gas limit, causing it to fail.
TSender::airdropERC20
function can not be used for more than 1200 recipients due to exceeding block gas limit.
Paste the test below in Base_Test.t.sol
forge test --mt testAirdropERC20ToLargeNumberOfRecipients --gas-limit 30000000
Manual Review
Foundry
Implement a claim functionality where eligible users can claim their airdrop tokens. This approach shifts the gas cost to individual users, reducing the risk of a DoS attack. Users can claim their tokens by calling a claimAirdrop
function, verifying their eligibility and receiving the tokens directly.
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.