20,000 USDC
View results
Submission Details
Severity: medium

Unchecked ERC20 Transfer Vulnerability

Summary

It is not safe to use the ERC20 transfer function without checking the results. Use a safe transfer library like OpenZeppelin SafeERC20 to ensure consistent handling of ERC20 return values and abstract over inconsistent ERC20 implementations.

Vulnerability Details

The contract uses the ERC20 transfer function without checking the return value. This can lead to unexpected behavior as not all ERC20 tokens return a boolean value on success. Some might revert on failure, while others return false, leading to inconsistencies.

Impact

The potential impact of this vulnerability is significant. If a transfer fails but is not properly checked, the contract may continue to execute, leading to incorrect state changes, loss of funds, or other unintended behavior. It could compromise the integrity of the entire contract's logic.

Tools Used

Manual Review

Recommendations

Use a safe transfer library like OpenZeppelin's SafeERC20 to ensure consistent handling of ERC20 return values and mitigate the risk of incorrect contract behavior.

Support

FAQs

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