Skip to main content

Owner Two Step Renounce Module

@perfect-abstractions/compose/access/Owner/TwoSteps/Renounce/OwnerTwoStepRenounceMod.sol

Helper functions for renouncing ownership and clearing pending-owner state.

Key Features
  • renounceOwnership guards by requiring msg.sender is the current owner.
  • Emits OwnershipTransferred with newOwner == address(0).
Module Usage

Use modules through your facet’s to extend Compose base logic. See Facets & Modules for more information.

Storage

State Variables

PropertyTypeDescriptionOWNER_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

getOwnerStorage

Returns a pointer to the OwnerStorage struct.

function getOwnerStorage() pure returns (OwnerStorage storage s);

Returns:

PropertyTypeDescriptionsOwnerStorageThe OwnerStorage struct in storage.

getPendingOwnerStorage

Returns a pointer to the PendingOwnerStorage struct.

function getPendingOwnerStorage() pure returns (PendingOwnerStorage storage s);

Returns:

PropertyTypeDescriptionsPendingOwnerStorageThe PendingOwnerStorage struct in storage.

renounceOwnership

Renounce ownership of the contract. Sets the owner to address(0) and clears any pending owner, disabling all functions restricted to the owner.

function renounceOwnership() ;

Events

Errors

Best Practices

Integration Notes

This module interacts with diamond storage at the slots defined by OWNER_STORAGE_POSITION and PENDING_OWNER_STORAGE_POSITION.

The renounceOwnership function directly modifies the owner & pendingOwner fields within the storage structs, setting it to address(0). These changes are immediately visible to all facets that access the same storage slots.

Last updated:

Newsletter

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

No spam. Unsubscribe anytime.