The TSender_NoCheck
contract omits certain checks to save gas. However, one critical check that should be implemented is to ensure no ERC20 balance remains in the contract. This issue is not about someone intentionally sending ERC20 tokens or ether to the contract, as anyone can do that to any contract. The problem arises when the totalAmount
transferred to the contract does not match the sum of amounts sent to recipients. This discrepancy could result in the contract retaining an ERC20 balance. Since the totalAmount
is not checked, anyone can steal the remaining balance by setting totalAmount
to 0 and designating themselves as the only recipient.
Likelyhood: Low
Users are aware of the risks associated with using Huff_NoCheck and are expected to double-check the amounts, but human error has always a probability.
Impact: High
TSender_NoCheck::airdropERC20
can lead to an indirect state: balance of ERC20.
Theft of funds.
One possible solution is to send all the remaining balance to the sender at the end of the contract execution. However, this will increase gas consumption as two functions need to be called: balanceOf(address(this))
and transfer(sender, remainingAmount)
.
Alternatively, since gas efficiency is a priority for this contract, this issue could be documented as a known problem and users could be warned about it.
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.