20,000 USDC
View results
Submission Details
Severity: high

Ignores return value from IERC20

Summary

Unchecked return values from transferFrom and transfer functions of an ERC20 token can lead to vulnerabilities.

Vulnerability Details

The transferFrom and transfer functions of an ERC20 token return a boolean value indicating whether the transfer was successful or not. If the return value of these functions is not checked, it means that if the transfer fails, the contract will not be aware of it and will continue to execute as if the transfer was successful.

Impact

If the transfer or transferFrom functions fail, the contract will continue running and emit events as if everything is fine. This leaves the system in an inconsistent state and can result in unexpected behavior and vulnerabilities.

Tools Used

Slither and manual code review.

Recommendations

It is recommended to check the boolean return value of the transfer and transferFrom functions and revert the transaction if it returns false. This will ensure that the contract is aware of any failed transfers and can handle them appropriately.

Support

FAQs

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