Unchecked return values from transferFrom
and transfer
functions of an ERC20 token can lead to vulnerabilities.
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.
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.
Slither and manual code review.
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.
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.