Owner Two Step Renounce Module | Compose
Library Access Control Owner Two Steps Renounce Module On this page
Owner Two Step Renounce Module @perfect-abstractions/compose/access/Owner/TwoSteps/Renounce/OwnerTwoStepRenounceMod.solCopy
Helper functions for renouncing ownership and clearing pending-owner state.
renounceOwnership guards by requiring msg.sender is the current owner.
Emits OwnershipTransferred with newOwner == address(0).
Storage
State Variables
Property Type DescriptionOWNER_STORAGE_POSITIONbytes32 Owner 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
struct OwnerStorage {
address owner ;
}
PendingOwnerStorage
Definition
struct PendingOwnerStorage {
address pendingOwner ;
}
Functions
getOwnerStorage
Returns a pointer to the OwnerStorage struct.
function getOwnerStorage ( ) pure returns ( OwnerStorage storage s ) ;
Returns:
Property Type DescriptionsOwnerStorageThe OwnerStorage struct in storage.
getPendingOwnerStorage
Returns a pointer to the PendingOwnerStorage struct.
function getPendingOwnerStorage ( ) pure returns ( PendingOwnerStorage storage s ) ;
Returns:
Property Type DescriptionsPendingOwnerStorageThe 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
This emits when ownership of a contract changes.
Signature: event OwnershipTransferred ( address indexed previousOwner , address indexed newOwner ) ;
Errors
Signature: error OwnerUnauthorizedAccount ( ) ;
Best Practices
Ensure the caller is the owner before invoking state-changing functions.
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: March 13, 2026