Owner Renounce Facet
Renounce diamond ownership
- Renounces diamond ownership via an external function.
- Emits
OwnershipTransferredevent 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
State Variables
| Property | Type | Description |
|---|---|---|
STORAGE_POSITION | bytes32 | Diamond storage slot position for this module (Value: keccak256("erc173.owner")) |
Functions
renounceOwnership
exportSelectors
Exports the function selectors of the OwnerRenounceFacet This function is use as a selector discovery mechanism for diamonds
Returns:
| Property | Type | Description |
|---|---|---|
- | bytes | selectors The exported function selectors of the OwnerRenounceFacet |
Events
Errors
Best Practices
- Call
renounceOwnershiponly when permanent relinquishment of ownership is intended. - Ensure the caller is the current owner before executing
renounceOwnership. - Verify that the
OwnershipTransferredevent is emitted after successful execution.
Security Considerations
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.