20,000 USDC
View results
Submission Details
Severity: medium

Unverified Return Values from ERC20 Token Transfers

Summary

ERC20 transfer and transferFrom methods missing checks their return values.

Vulnerability Details

The ERC20 standard does not mandate that transfer and transferFrom methods revert if they fail. Some implementations might return false instead of reverting. The provided smart contract does not verify the return values of these methods, assuming that they always succeed.

Impact

If a token transfer fails but doesn't revert (instead, it returns false), the subsequent logic of the contract will still execute, potentially leading to undesired outcomes.
Unchecked transfers could lead to scenarios where the contract believes it has more funds than it does or thinks it has paid out funds when it hasn't.

Tools Used

Manual review

Recommendations

Always check the return value of transfer and transferFrom methods. If they return false, the transaction should be reverted.

Example fix:

bool success = IERC20(tokenAddress).transferFrom(sender, recipient, amount);
require(success, "Token transfer failed");

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.