Skip to main content

Owner Two Step Data Module

Diamond storage and read helpers for ERC-173 pending owner (two-step)

Key Features
  • Single slot erc8042:erc173.owner.pending (keccak256("erc173.owner.pending")), shared with Owner Two Step Transfer Module, renounce/two-step flows, and Owner Two Step Data Facet.
  • File-level getStorage() returns a PendingOwnerStorage pointer; pendingOwner() reads pendingOwner (or address(0) when unset).
  • Read-only from this module’s perspective—facets or modules that perform two-step transfer/renounce write pendingOwner.
Module Usage

Import this module into facets or shared setup code. Its helpers are file-level (effectively internal to your compilation unit). Use them from your facet’s external entrypoints or other modules.

Storage follows the diamond slot in this file; any code using the same STORAGE_POSITION shares state.

See Facets & Modules for more information.

Storage

State Variables

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

PendingOwnerStorage

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

Functions

getStorage

Returns a storage pointer to PendingOwnerStorage at STORAGE_POSITION using inline assembly.

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

Returns:

PropertyTypeDescription
sPendingOwnerStorage storageThe pending-owner struct in diamond storage.

pendingOwner

Returns getStorage().pendingOwner.

function pendingOwner() view returns (address);

Returns:

PropertyTypeDescription
-addressThe pending owner, or address(0) when no transfer is pending.

Best Practices

  • Import this module (or match the same slot and struct) when adding facets so pending-owner reads stay aligned with Owner Two Step Data Facet and two-step transfer/renounce code.
  • Coordinate writes with two-step transfer or renounce modules (or facets built on them); this module does not assign pendingOwner itself.
  • For read-only access through the diamond proxy, register Owner Two Step Data Facet and expose pendingOwner() externally.

Integration Notes

PendingOwnerStorage lives at keccak256("erc173.owner.pending"). Any code using that slot—including modules that define their own accessor with the same hash—shares the same pendingOwner field.

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.