Skip to content
low Token Standards No SWC entry CWE-703

Tokens Transferable to the Contract Itself (Locked)

SAFE-0210 Token Standards Checked automatically by the scanner
1

What goes wrong

transfer/mint allows the destination to be the token/contract's own address with no guard, silently locking tokens that no function can ever recover.

2

The vulnerable pattern

proof of concept — how it is exploited
// user fat-fingers transfer(tokenAddress, 1000)
// tokens now sit at address(this) with no sweep function -> gone.
3

How to fix it

the pattern that is safe
require(to != address(this) && to != address(0), "bad recipient");
Reject transfers to address(this) or add a rescue path.
Check your own contract for this

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