Normal behavior: ERC20 transfers should either succeed or revert; the caller should know the transfer outcome.
Issue: The Pot contract calls i_token.transfer(player, reward) without checking the return value. Some ERC20 tokens (older or non-standard) return false instead of reverting on failure. Ignoring the return value allows the contract to behave as if the transfer succeeded, even though no tokens were actually transferred.
Likelihood:
High when interacting with non-standard ERC20 tokens that return false instead of reverting.
Common in third-party token integrations, DeFi contracts, or legacy ERC20 implementations.
Impact:
Users may be marked as paid without receiving tokens, resulting in funds remaining locked in the contract.
In extreme cases, this can break reward distribution logic and cause loss of user trust.
Severity: Medium (M)
This PoC demonstrates the bug using a token that returns false on insufficient balance instead of reverting:
Deploy a malicious ERC20 (FalseReturnERC20) that simulates the problematic behavior.
Deploy the Pot contract with a reward schedule requiring 4 ETH total.
Fund the Pot with only 1 ETH, deliberately insufficient to pay Player1’s 3 ETH reward.
Player1 claims their reward. The Pot contract ignores the false return, decrements internal remainingRewards, but Player1 receives no tokens.
The test asserts that Player1’s token balance is less than the expected reward, proving the bug.
Expected outcome:
Player1 balance: 0 (or less than reward)
Pot.remainingRewards still decremented internally
Confirms that ignoring ERC20 return values can break reward distribution
Always check the return value of ERC20 transfers to prevent silent failures:
Explanation:
require() ensures that the transaction reverts if the transfer fails, preventing inconsistencies between internal accounting and actual token balances.
This protects users from losing rewards due to non-standard ERC20 implementations.
Ensures deterministic and safe behavior, compliant with modern Solidity practices.
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.