Skip to main content

Owner Two Step Renounce Facet

Renounce ownership and clear pending owner for two-step ERC-173 diamonds

Key Features
  • renounceOwnership() clears owner and pending owner in one call.
  • Owner-only function; otherwise reverts OwnerUnauthorizedAccount.
  • Emits OwnershipTransferred to address(0).

Storage

State Variables

PropertyTypeDescription
OWNER_STORAGE_POSITIONbytes32Owner storage position within the diamond (Value: keccak256("erc173.owner"))
PENDING_OWNER_STORAGE_POSITIONbytes32Pending owner storage position within the diamond (Value: keccak256("erc173.owner.pending"))

OwnerStorage

Definition
/** storage-location erc8042:erc173.owner */
struct OwnerStorage {
address owner;
}

PendingOwnerStorage

Definition
/** storage-location erc8042:erc173.owner.pending */
struct PendingOwnerStorage {
address pendingOwner;
}

Functions

renounceOwnership

Requires msg.sender to equal the stored owner; otherwise reverts OwnerUnauthorizedAccount. Sets owner to address(0), sets pendingOwner to address(0), and emits OwnershipTransferred(previousOwner, address(0)). After success, owner-only checks that read this storage should no longer authorize any account.

function renounceOwnership() external;

Events

Errors

Best Practices

  • Only the current owner can renounce; there is no pending step for renounce itself, but clearing pendingOwner avoids leaving a nominated successor after you renounce

Security Considerations

Renouncing is immediate and irreversible on-chain: the owner becomes address(0) in the same transaction.

Was this helpful?
Last updated:

Newsletter

Get notified about releases, feature announcements, and technical deep-dives on building smart contracts with Compose.

No spam. Unsubscribe anytime.