Skip to main content

Ownership

Asset Tokenization Studio Team

Ownership

Diamond facet implementing two-step ownership transfers per configuration.

Composes {OwnershipWrapper} storage helpers with the pause gate from {Pause} so that ownership handovers are blocked while the diamond is paused. Each configId carries its own owner and pending owner, enabling multi-tenant configurations on a single diamond. State changes are emitted via {IOwnership} events; access is enforced by the onlyConfigurationOwner / onlyConfigurationPendingOwner modifiers inherited from {OwnershipWrapper}.

Methods​

acceptOwnership​

function acceptOwnership(bytes32 _configId) external nonpayable

Finalises an ownership handover initiated by the current owner.

Gated by {onlyUnpaused} and {onlyConfigurationPendingOwner}: only the nominated pending owner can finalise the handover, and only while the diamond is unpaused. Snapshots the outgoing owner via {_getOwner} before overwriting it, promotes the caller to owner via {_setOwner}, and clears the pending slot via {_removePendingOwner}. Emits {OwnershipAccepted} with the captured previous owner and the caller as the new owner.

Parameters​

NameTypeDescription
_configIdbytes32Configuration whose pending handover is being accepted.

getOwner​

function getOwner(bytes32 _configId) external view returns (address owner_)

Returns the current owner of a configuration.

Parameters​

NameTypeDescription
_configIdbytes32Configuration to query.

Returns​

NameTypeDescription
owner_addressAddress that currently owns configId, or the zero address when no owner has been recorded.

getPendingOwner​

function getPendingOwner(bytes32 _configId) external view returns (address pendingOwner_)

Returns the pending owner of a configuration, if any.

Parameters​

NameTypeDescription
_configIdbytes32Configuration to query.

Returns​

NameTypeDescription
pendingOwner_addressAddress currently nominated to accept ownership, or the zero address when no transfer is in flight.

initializePause​

function initializePause() external nonpayable

Initialises the pause capability on the token.

Callable once; subsequent calls revert with FacetAlreadyRegistered. Requires DEFAULT_ADMIN_ROLE. Called by the factory during deployment.

pause​

function pause() external nonpayable returns (bool success_)

Sets the token's internal pause flag, blocking all guarded operations.

Requires ROLE_PAUSER and the token to be currently unpaused. Reverts with IsPaused if the token is already paused. Emits Paused.

Returns​

NameTypeDescription
success_boolTrue if the token was successfully paused.

paused​

function paused() external view returns (bool)

Checks whether the token is currently paused.

Returns true if the token's own pause flag is set, or if any registered external pause contract returns true from its isPaused() call (OR semantics). created to be compatible with ERC3643

Returns​

NameTypeDescription
_0boolTrue if the token is paused by any source, false otherwise.

transferOwnership​

function transferOwnership(bytes32 _configId, address _newOwner) external nonpayable

Nominates _newOwner as the pending owner of _configId.

Gated by {onlyUnpaused} and {onlyConfigurationOwner}: only the existing owner can nominate a successor, and only while the diamond is unpaused. Stores _newOwner as the pending owner without touching the current owner; finalisation happens in {acceptOwnership}. Emits {OwnershipTransfered} with the caller as the outgoing owner.

Parameters​

NameTypeDescription
_configIdbytes32Configuration whose ownership is being handed over.
_newOwneraddressAddress to record as pending owner.

unpause​

function unpause() external nonpayable returns (bool success_)

Clears the token's internal pause flag, restoring guarded operations.

Requires ROLE_PAUSER and the token's internal flag to be set. Reverts with IsUnpaused if the internal flag is already cleared. Emits Unpaused. Note: if any external pause contract remains paused, isPaused will still return true after this call.

Returns​

NameTypeDescription
success_boolTrue if the internal pause flag was successfully cleared.

Events​

OwnershipAccepted​

event OwnershipAccepted(bytes32 indexed configId, address previousOwner, address newOwner)

Emitted when the pending owner finalises the ownership handover.

Fired by {acceptOwnership} after the configuration owner has been updated and the pending owner slot cleared.

Parameters​

NameTypeDescription
configId indexedbytes32Configuration whose ownership has changed.
previousOwneraddressAddress that previously owned the configuration.
newOwneraddressCaller that accepted ownership and now holds the configuration.

OwnershipTransfered​

event OwnershipTransfered(bytes32 indexed configId, address owner, address pendingOwner)

Emitted when the current owner nominates a new owner for a configuration.

Fired by {transferOwnership} before the handover is accepted; the existing owner remains in control until {acceptOwnership} is invoked by newOwner.

Parameters​

NameTypeDescription
configId indexedbytes32Configuration whose ownership is being transferred.
owneraddressCurrent owner that initiated the transfer.
pendingOwneraddressAddress nominated as the pending owner.

PauseInitialized​

event PauseInitialized()

Emitted once when the pause capability is initialised on a token.

Fires exclusively from initializePause.

Paused​

event Paused(address indexed operator)

Emitted when the token's internal pause flag is set to true.

Parameters​

NameTypeDescription
operator indexedaddressAddress of the caller who triggered the pause.

Unpaused​

event Unpaused(address indexed operator)

Emitted when the token's internal pause flag is cleared to false.

Parameters​

NameTypeDescription
operator indexedaddressAddress of the caller who triggered the unpause.

Errors​

AccountHasNoRole​

error AccountHasNoRole(address account, bytes32 role)

Thrown when an account does not hold a required role.

Parameters​

NameTypeDescription
accountaddressThe account that lacks the role.
rolebytes32The role that is not held.

FacetAlreadyRegistered​

error FacetAlreadyRegistered(bytes32 facetId, uint256 lastVersion)

Raised when an initialiser tries to register a facet that already has a non-zero last registered version (i.e. the facet is being re-initialised on a fresh install).

Parameters​

NameTypeDescription
facetIdbytes32Identifier of the offending facet.
lastVersionuint256Last version recorded for that facet at the time of the check.

IsPaused​

error IsPaused()

Thrown when an operation that requires the token to be unpaused is attempted while the token is paused (own flag or any external pause contract).

IsUnpaused​

error IsUnpaused()

Thrown when unpause is called while the token's internal pause flag is already cleared.

NotOwner​

error NotOwner(bytes32 configId, address sender, address owner)

Raised when the caller is not the current owner of the configuration.

Parameters​

NameTypeDescription
configIdbytes32Configuration that was accessed.
senderaddressCaller that attempted the owner-only action.
owneraddressAddress currently holding ownership of configId.

NotPendingOwner​

error NotPendingOwner(bytes32 configId, address sender, address pendingOwner)

Raised when the caller is not the pending owner of the configuration.

Parameters​

NameTypeDescription
configIdbytes32Configuration whose pending handover was targeted.
senderaddressCaller that attempted to accept ownership.
pendingOwneraddressAddress currently nominated as pending owner of configId.

UnrecognizedResolverProxyVersion​

error UnrecognizedResolverProxyVersion(bytes8 _resolverProxyVersion)

Thrown when the provided proxy version does not match any BLR compatible standard.

Parameters​

NameTypeDescription
_resolverProxyVersionbytes8proxy version that is not compatible with the BLR.

WalletRecovered​

error WalletRecovered()

Thrown when attempting to recover a wallet that has already been recovered.