Skip to content

Unchecked ERC-20 transfer/transferFrom Return

SAFE-0027 External Calls Checked automatically by the scanner
1

What goes wrong

Some ERC-20s (USDT, BNB legacy) return no boolean or return false instead of reverting. Calling transfer/transferFrom without SafeERC20 lets a non-reverting failed transfer pass, breaking accounting.

2

How to fix it

the pattern that is safe
using SafeERC20 for IERC20;
token.safeTransferFrom(msg.sender, address(this), amt);
Use OpenZeppelin SafeERC20 everywhere.
Check your own contract for this

The SaferICO scanner runs 201 detectors over your Solidity source, SAFE-0027 among them. Paste an address or the source itself — a small per-scan fee, shown before you sign, or unlimited on any plan.

Run the scanner See how it is attacked Read the docs