The TSender::airdropERC20
function does not check if the lengths of the recipients
and amounts
arrays are non-zero.
The airdropERC20
function is designed to distribute ERC20
tokens to multiple recipients. The function currently checks if the lengths of the recipients
and amounts
arrays match. But the function does not verify if the lengths of the recipients
and amounts
arrays are non-zero. This is done in the areListsValid
function, but it is not used in the airdropERC20
.
If the airdropERC20
function is called with empty arrays, the function will revert with out of bounds error. The following test demonstrates that:
And the result:
[FAIL. Reason: panic: array out-of-bounds access (0x32)] test_EmptyArrays() (gas: 84911)
That leads to unnecessary consume of gas for the initial checks and setup.
Manual Review
Use the areListsValids
to check the valididty of the arrays before proceeding with the execution logic of the airdropERC20
function.
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.