Owner Two Step Renounce Module
@perfect-abstractions/compose/access/Owner/TwoSteps/Renounce/OwnerTwoStepRenounceMod.solHelper functions for renouncing ownership and clearing pending-owner state.
renounceOwnershipguards by requiringmsg.senderis the current owner.- Emits
OwnershipTransferredwithnewOwner == address(0).
Use modules through your facet’s to extend Compose base logic. See Facets & Modules for more information.
Storage
State Variables
| Property | Type | Description |
|---|---|---|
OWNER_STORAGE_POSITION | bytes32 | Owner storage position within the diamond (Value: keccak256("erc173.owner")) |
PENDING_OWNER_STORAGE_POSITION | bytes32 | Pending owner storage position within the diamond (Value: keccak256("erc173.owner.pending")) |
OwnerStorage
PendingOwnerStorage
Functions
getOwnerStorage
Returns a pointer to the OwnerStorage struct.
Returns:
| Property | Type | Description |
|---|---|---|
s | OwnerStorage | The OwnerStorage struct in storage. |
getPendingOwnerStorage
Returns a pointer to the PendingOwnerStorage struct.
Returns:
| Property | Type | Description |
|---|---|---|
s | PendingOwnerStorage | The 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.
Events
Errors
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.