Skip to main content

Owner Renounce Facet

Renounce diamond ownership

Key Features
  • Renounces diamond ownership via an external function.
  • Emits OwnershipTransferred event upon successful renouncement.
  • Interacts with shared diamond storage for owner management.
  • Exports selectors for facet discovery.

Overview

This facet provides functionality to renounce ownership of a diamond. It allows the current owner to permanently relinquish their ownership rights, making the diamond effectively unowned. This facet interacts with diamond storage to manage the owner state.

Storage

OwnerStorage

Definition
struct OwnerStorage {
address owner;
}

State Variables

PropertyTypeDescription
STORAGE_POSITIONbytes32Diamond storage slot position for this module (Value: keccak256("erc173.owner"))

Functions

renounceOwnership

function renounceOwnership() external;

exportSelectors

Exports the function selectors of the OwnerRenounceFacet This function is use as a selector discovery mechanism for diamonds

function exportSelectors() external pure returns (bytes memory);

Returns:

PropertyTypeDescription
-bytesselectors The exported function selectors of the OwnerRenounceFacet

Events

Errors

Best Practices

Best Practice
  • Call renounceOwnership only when permanent relinquishment of ownership is intended.
  • Ensure the caller is the current owner before executing renounceOwnership.
  • Verify that the OwnershipTransferred event is emitted after successful execution.

Security Considerations

Security

The renounceOwnership function can only be called by the current owner. If called, ownership is permanently relinquished, and the owner address in storage becomes zero. There is no mechanism to reclaim ownership after this action. The OwnerUnauthorizedAccount error is reverted if the caller is not the owner. Follow standard Solidity security practices for input validation and access control.

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.