Skip to main content

Owner Renounce Module

@perfect-abstractions/compose/access/Owner/Renounce/OwnerRenounceMod.sol

Helper functions for renouncing ownership and storage access.

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

Import this module into facets or shared setup code. See Facets & Modules for more information.

Storage

State Variables

PropertyTypeDescription
STORAGE_POSITIONbytes32Owner storage position within the diamond (Value: keccak256("erc173.owner"))

OwnerStorage

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

Functions

getStorage

Returns a pointer to the OwnerStorage struct.

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

Returns:

PropertyTypeDescription
sOwnerStorage storageThe struct in storage.

renounceOwnership

Internal renounce path: requires msg.sender to be the current owner before setting the owner to address(0)

function renounceOwnership();

Events

Errors

Best Practices

  • Call renounceOwnership only from a trusted external wrapper after you intend to give up owner control permanently.
  • Keep the same STORAGE_POSITION and OwnerStorage layout as other owner modules; do not fork a second owner slot.

Integration Notes

OwnerStorage lives at keccak256("erc173.owner") inside the diamond. The same slot as OwnerDataMod, OwnerDataFacet, and OwnerRenounceFacet. Renouncing here updates what owner() reads elsewhere.

Last updated:

Newsletter

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

No spam. Unsubscribe anytime.