Skip to content
medium Access Control No SWC entry CWE-547

Hardcoded Privileged Address

SAFE-0014 Access Control Checked automatically by the scanner
1

What goes wrong

A privileged operator/treasury/admin address is hardcoded as a constant. If that key is lost or compromised there is no rotation path, and on a different chain/deploy it may be wrong or attacker-controlled.

2

How to fix it

the pattern that is safe
address public admin;
constructor(address a){ admin = a; }
function setAdmin(address a) external onlyAdmin { admin = a; }
Make privileged addresses governable.
Check your own contract for this

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