Skip to content
critical Token Standards No SWC entry CWE-284

Unsafe / Unprotected Minting

SAFE-0053 Token Standards Checked automatically by the scanner
1

What goes wrong

A mint function lacks access control, supply caps, or proper accounting, letting an attacker mint unlimited tokens and dump or drain liquidity (infinite mint).

2

How to fix it

the pattern that is safe
function mint(address to, uint256 amt) external onlyRole(MINTER_ROLE) {
    require(totalSupply() + amt <= MAX_SUPPLY, "cap");
    _mint(to, amt);
}
Gate and cap all minting.
Check your own contract for this

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