Skip to content

Handling ERC20 token transfers that don't have a return value#

Low Risk

Fixed

Fixed according to the recommendation.

The ERC20TransferProxy contract transfers ERC20 tokens however it expects that the transfers return a bool value. This is correct and according to the ERC20 standard. However some non-standard ERC20 tokens on Ethereum do not return a value. You still might want to support these ERC20 tokens, such as USDT.

More information about this here: https://medium.com/coinmonks/missing-return-value-bug-at-least-130-tokens-affected-d67bf08521ca

Recommendation#

A way to handle this problem is to use code that correctly handles transfer return values and transfers that don't have return values. Here is a link to a library that does this: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/utils/SafeERC20.sol