Owner Two Step Transfer Module | Compose
Library Access Control Owner Two Steps Transfer Module On this page
Owner Two Step Transfer Module @perfect-abstractions/compose/access/Owner/TwoSteps/Transfer/OwnerTwoStepTransferMod.solCopy
Helpers for the two step handoff ownership for your diamonds
Storage
State Variables
Property Type DescriptionOWNER_STORAGE_POSITIONbytes32 Owner storage position within the diamond (Value: keccak256("erc173.owner"))PENDING_OWNER_STORAGE_POSITIONbytes32Pending owner storage position within the diamond (Value: keccak256("erc173.owner.pending"))
OwnerStorage
Definition
struct OwnerStorage {
address owner ;
}
PendingOwnerStorage
Definition
struct PendingOwnerStorage {
address pendingOwner ;
}
Functions
getOwnerStorage
Returns a storage pointer to OwnerStorage.
function getOwnerStorage ( ) pure returns ( OwnerStorage storage s ) ;
Returns:
Property Type DescriptionsOwnerStorage storageThe owner struct in diamond storage.
getPendingOwnerStorage
Returns a storage pointer to PendingOwnerStorage.
function getPendingOwnerStorage ( ) pure returns ( PendingOwnerStorage storage s ) ;
Returns:
Property Type DescriptionsPendingOwnerStorage storageThe pending-owner struct in diamond storage.
transferOwnership
Requires msg.sender == owner; otherwise reverts OwnerUnauthorizedAccount. Sets pendingOwner to _newOwner and emits OwnershipTransferStarted(owner, _newOwner). Does not change owner until acceptOwnership.
function transferOwnership ( address _newOwner ) ;
Parameters:
Property Type Description_newOwneraddressAddress that must call acceptOwnership to become owner.
acceptOwnership
Requires msg.sender == pendingOwner; otherwise reverts OwnerUnauthorizedAccount. Assigns owner to the pending address, clears pendingOwner, and emits OwnershipTransferred(previousOwner, newOwner).
function acceptOwnership ( ) ;
Events
Emitted when the current owner calls transferOwnership (pending owner set).
Signature: event OwnershipTransferStarted ( address indexed _previousOwner , address indexed _newOwner ) ;
Emitted when the pending owner calls acceptOwnership and ownership is updated.
Signature: event OwnershipTransferred ( address indexed _previousOwner , address indexed _newOwner ) ;
Errors
Thrown when transferOwnership is called by anyone other than the current owner, or when acceptOwnership is called by anyone other than the pending owner.
Signature: error OwnerUnauthorizedAccount ( ) ;
Best Practices
Expose transferOwnership and acceptOwnership only through trusted external facet entrypoints; confirm _newOwner before initiating.
Keep the same OwnerStorage / PendingOwnerStorage layout as Owner Two Step Transfer Facet and Owner Two Step Data Module
owner is shared with OwnerDataMod and single-step owner code at keccak256("erc173.owner").
Last updated: June 5, 2026