@perfect-abstractions/compose/access/Owner/Data/OwnerDataMod.solHelper functions for owner storage, reads, and owner check based on ERC-173
requireOwner() guards by requiring msg.sender is the stored owner.setContractOwner has no access control validation (Trusted initialization only).OwnershipTransferred from setContractOwner with previousOwner == address(0).You can use modules to wrap around you own project logic while using the default Compose building blocks. Modules provides all the necessary internal helpers for maximum integration.
See Facets & Modules for more information.
STORAGE_POSITIONbytes32keccak256("erc173.owner"))Returns a pointer to the OwnerStorage struct.
Returns:
sOwnerStorage storageGet the address of the owner
Returns:
-addressaddress(0) if never set or cleared.Verify if the message sender is the current diamond owner. Useful for gating specify logic inside your own facets.
Reverts:
OwnerUnauthorizedAccounterrorWrites the inital owner address to storage and emits OwnershipTransferred(address(0), _initialOwner).
There is no msg.sender or role check performed. Use only from trusted initialization code, or wrap with your own checks in a facet.
Parameters:
_initialOwneraddresssetContractOwner only from trusted init paths (constructor, one-off setup). For transfers, use OwnerTransferMod.transferOwnership or an equivalent facet so events record the real previous owner.requireOwner() or equivalent before state changes restricted to the owner.OwnerStorage is located at keccak256("erc173.owner") inside the diamond.
All Compose Owner contracts use that slot, so owner() and transfer logic observe the same address.