Skip to main content

Nonces

Asset Tokenization Studio Team

Nonces

Abstract contract implementing per-account nonce reads for off-chain signature schemes such as EIP-2612 permit.

Implements INonces. Nonce state is stored in diamond storage via NonceStorageWrapper. Nonces are incremented by other facets (e.g. ERC-20 permit) after consuming a valid signature; this contract exposes only the read path. Intended to be inherited exclusively by NoncesFacet.

Methods​

initializeNonces​

function initializeNonces() external nonpayable

Initialises the nonces capability on the token.

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

nonces​

function nonces(address _owner) external view returns (uint256)

Returns the current nonce for owner.

Parameters​

NameTypeDescription
_owneraddressAddress whose nonce is queried.

Returns​

NameTypeDescription
_0uint256Current nonce value for owner.

protectedClearingCreateHoldByPartitionNonce​

function protectedClearingCreateHoldByPartitionNonce(address _owner) external view returns (uint256)

Returns the current nonce for _owner used in protected clearing partition hold creations.

Incremented internally upon consumption of a valid signed protectedClearingCreateHoldByPartition operation.

Parameters​

NameTypeDescription
_owneraddressAddress whose clearing partition hold creation nonce is queried.

Returns​

NameTypeDescription
_0uint256Current nonce value for _owner.

protectedClearingRedeemByPartitionNonce​

function protectedClearingRedeemByPartitionNonce(address _owner) external view returns (uint256)

Returns the current nonce for _owner used in protected clearing partition redemptions.

Incremented internally upon consumption of a valid signed protectedClearingRedeemByPartition operation.

Parameters​

NameTypeDescription
_owneraddressAddress whose clearing partition redemption nonce is queried.

Returns​

NameTypeDescription
_0uint256Current nonce value for _owner.

protectedClearingTransferByPartitionNonce​

function protectedClearingTransferByPartitionNonce(address _owner) external view returns (uint256)

Returns the current nonce for _owner used in protected clearing partition transfers.

Incremented internally upon consumption of a valid signed protectedClearingTransferByPartition operation.

Parameters​

NameTypeDescription
_owneraddressAddress whose clearing partition transfer nonce is queried.

Returns​

NameTypeDescription
_0uint256Current nonce value for _owner.

protectedCreateHoldByPartitionNonce​

function protectedCreateHoldByPartitionNonce(address _owner) external view returns (uint256)

Returns the current nonce for _owner used in protected partition hold creations.

Incremented internally upon consumption of a valid signed protectedCreateHoldByPartition operation.

Parameters​

NameTypeDescription
_owneraddressAddress whose partition hold creation nonce is queried.

Returns​

NameTypeDescription
_0uint256Current nonce value for _owner.

protectedRedeemFromByPartitionNonce​

function protectedRedeemFromByPartitionNonce(address _owner) external view returns (uint256)

Returns the current nonce for _owner used in protected partition redemptions.

Incremented internally upon consumption of a valid signed protectedRedeemFromByPartition operation.

Parameters​

NameTypeDescription
_owneraddressAddress whose partition redemption nonce is queried.

Returns​

NameTypeDescription
_0uint256Current nonce value for _owner.

protectedTransferFromByPartitionNonce​

function protectedTransferFromByPartitionNonce(address _owner) external view returns (uint256)

Returns the current nonce for _owner used in protected partition transfers.

Incremented internally upon consumption of a valid signed protectedTransferFromByPartition operation.

Parameters​

NameTypeDescription
_owneraddressAddress whose partition transfer nonce is queried.

Returns​

NameTypeDescription
_0uint256Current nonce value for _owner.

Events​

NoncesInitialized​

event NoncesInitialized()

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

Fires exclusively from initializeNonces.

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.

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.