Skip to content

Two-Step Ownership Transfer Missing

SAFE-0011 Access Control Checked automatically by the scanner
1

What goes wrong

Ownership transfers in a single step. A typo or wrong address permanently locks all owner-gated functionality because the new (wrong) owner can never accept or be corrected.

2

How to fix it

the pattern that is safe
address public pendingOwner;
function transferOwnership(address n) external onlyOwner { pendingOwner = n; }
function acceptOwnership() external {
    require(msg.sender == pendingOwner, "not pending");
    owner = pendingOwner; pendingOwner = address(0);
}
Use OpenZeppelin Ownable2Step.
Check your own contract for this

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