Skip to content

Missing SafeERC20 / Non-Standard Token Handling

SAFE-0051 Token Standards Checked automatically by the scanner
1

What goes wrong

Direct ERC-20 calls assume standard behavior; fee-on-transfer, rebasing, no-return, and reverting-vs-false tokens break accounting and can be exploited.

2

How to fix it

the pattern that is safe
using SafeERC20 for IERC20;
uint256 before = token.balanceOf(address(this));
token.safeTransferFrom(msg.sender, address(this), amt);
uint256 received = token.balanceOf(address(this)) - before; // fee-on-transfer safe
Use SafeERC20 and measure actual received amounts.
Check your own contract for this

The SaferICO scanner runs 201 detectors over your Solidity source, SAFE-0051 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