The TSender.sol::airdropERC20
function does not ensure that the sender has provided a sufficient allowance to the contract for transferring the specified amount of tokens. This omission can result in failed transactions, causing the airdrop process to be disrupted.
The TSender.sol::airdropERC20
function attempts to transfer tokens from the sender to the contract using the transferFrom method of the ERC20 token. However, it does not check whether the sender has granted the necessary allowance for the contract to perform this transfer. As a result, if the allowance is insufficient, the transferFrom call will fail, causing the entire transaction to revert.
Transactions may fail due to insufficient allowance, resulting in an incomplete airdrop. Users who have not provided the required allowance will experience failed transactions, leading to dissatisfaction and potential disruptions in token distribution.
Add the test in Base_Test.t.sol
and then run -> forge test --mt test_successfulAirdropWithApproval
Manual Review
Add IERC20 interface to define standard functions for ERC20
Add custom error and check for allowance before sending the transaction.
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.