The TSender.sol::areListsValid
and TSender.huff::areListsValid
functions do not verify if the sender or the contract itself are included in the recipient list. This could lead to unintended consequences in scenarios where this contract is used for airdrops or other reward distribution processes.
If the sender's address is included in the recipient list, the areListsValid
function should alert the sender that the recipient list is not valid. This is because the function would take the sender's assets and redistribute them, which not only wastes gas but also generates logs where the sender transfers tokens to the contract and the contract transfers the same tokens back to them. This could lead to trust issues among users.
A more significant issue arises if the contract's address is included in the recipient list. This would cause the function to succeed but the funds would be stuck in the contract. This is similar to sending any ERC20 to the contract, but adding a check to prevent this would reduce the likelihood of human error.
Likelyhood: Low
The probability of this happening seems low, but the functions would always pass without alerting or reverting.
Impact: Medium
The contract could end up with an ERC20 balance via its functions: indirect state.
Users can not fully trust the areListValid
functions.
Waste of gas.
Funds can get stuck in the contract via its functions.
To demonstrate this issue, apply the recommended mitigation and run a fuzzing test. The test will revert when attempting to include msg.sender in the recipient list. Fuzzing tools are sophisticated enough to test msg.sender in address variables.
Implement the following checks:
These checks are implemented in view functions, so they won't consume gas if called by an externally owned account (EOA). If these checks are not implemented, a comment about them should be added to the documentation.
Another good solution would be to send all the remaining balance to the sender at the end of airdropERC20
to clear the ERC20 balance of the contract.
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.