Many non-compilant ERC20 tokens with no return value will fail to transfer.
The ERC20 standard recommends that a successful token transfer should return true.
However, numerous tokens, including prominent ones like USDT, do not comply with this recommendation and do not return true on success.
As a consequence, when using the transfer()
function, it will revert even if the transfer is successful since Solidity checks whether the size of the returned data matches the ERC20 interface.
ERC20 tokens with no return value will fail to transfer
Manual review
Consider using OpenZeppelin’s SafeERC20
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.