Skip to main content

PauseRead

Asset Tokenization Studio Team

PauseRead

Read-only base for Pause and PauseOperational. Implements the paused() view function of IPause. Write functions are implemented by subclasses with or without onlyOperational depending on whether the consumer is a proxy facet or a direct-inheritance contract.

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​

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.