Skip to content
low Input Validation No SWC entry CWE-20

Missing Zero-Address Validation

SAFE-0072 Input Validation Checked automatically by the scanner
1

What goes wrong

Setters for critical addresses (owner, treasury, token) don't reject address(0), risking permanent loss of control or funds sent to the zero address.

2

How to fix it

the pattern that is safe
function setTreasury(address t) external onlyOwner {
    require(t != address(0), "zero"); treasury = t;
}
Validate against the zero address.
Check your own contract for this

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