Skip to main content

Pause

Asset Tokenization Studio Team

Pause

Abstract contract implementing pause and unpause logic for a security token.

Implements IPause. Pause state is stored via PauseStorageWrapper, which evaluates both the internal flag and any registered external onlyOperational pause contracts. Event emission is handled inside PauseStorageWrapper.setPause. Intended to be inherited exclusively by PauseFacet.

Methods​

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.

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​

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.

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.