Skip to content

Latest commit

 

History

History
25 lines (22 loc) · 996 Bytes

ERC20 tokens with no return value will fail to transfer.md

File metadata and controls

25 lines (22 loc) · 996 Bytes

Although the ERC20 standard suggests that a transfer should return true on success, many tokens are non-compliant in this regard.

In that case, the .transfer() call here will revert even if the transfer is successful, because solidity will check that the RETURNDATASIZE matches the ERC20 interface.

Recommendation:

Consider using OpenZeppelin’s SafeERC20


Slide Screenshot

017.jpg


Slide Text

  • ConsenSys Audit bitbank Finding 5.1
  • Error Handling
  • Major Severity
  • Incorrect Return Value
  • Check on ERC20 transfer
  • Use SafeERC20 Wrapper

References


Tags