Skip to content

Role Revocation Failure

SAFE-0012 Access Control Checked automatically by the scanner
1

What goes wrong

The contract can grant roles but offers no working path to revoke them, or revocation logic is broken, so a compromised or deprecated key retains privileges indefinitely.

2

How to fix it

the pattern that is safe
function addAdmin(address a) external onlyOwner { isAdmin[a] = true; }
function removeAdmin(address a) external onlyOwner { isAdmin[a] = false; }
Always pair grant with revoke.
Check your own contract for this

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