Rules › Solidity

ERC-20 transfer result ignored

mediumSolidityRule sol-unchecked-erc20

Some tokens return false instead of reverting; use SafeERC20 or check the returned bool.

Why it matters

The ERC-20 standard says transfer and transferFrom return a bool, but some tokens return false instead of reverting on failure, and some (USDT among them) return nothing at all, which breaks a plain require(token.transfer(...)) at the ABI level. SafeERC20 handles all of these.

Vulnerable

function pay(address to, uint256 amount) external {
    token.transfer(to, amount);
}

Fixed

using SafeERC20 for IERC20;

function pay(address to, uint256 amount) external {
    token.safeTransfer(to, amount);
}

What other tools call it

ToolDetector or reference
Slitherunchecked-transfer
Aderynunsafe-erc20-functions
SWC registrySWC-104

Check your code

Paste a contract into the in-browser checker, or let the Claude Code plugin scan before every deploy. The quick check for this rule is a pattern match: treat a hit as "look here", and a miss as no guarantee.

Static analysis finds known bug classes; it can't prove code is safe and isn't an audit. Get a professional audit before deploying code that will hold value.