Skip to content

DEFAULT_ADMIN_ROLE Retained by Deployer

SAFE-0119 Access Control Checked automatically by the scanner
1

What goes wrong

AccessControl is used and the deployer is granted DEFAULT_ADMIN_ROLE but never renounces or transfers it to a timelock/multisig. That single EOA can grant itself every role at any time — an unbounded centralization and single-point-of-compromise risk.

2

The vulnerable pattern

proof of concept — how it is exploited
// deployer keeps DEFAULT_ADMIN_ROLE
// if the deployer key leaks: grantRole(MINTER_ROLE, attacker)
// -> attacker mints unlimited tokens.
3

How to fix it

the pattern that is safe
_grantRole(DEFAULT_ADMIN_ROLE, timelock);
_revokeRole(DEFAULT_ADMIN_ROLE, msg.sender);   // deployer steps down
Move admin to a timelock/multisig and renounce the EOA.
Check your own contract for this

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