Skip to main content

MaturityFacet

Asset Tokenization Studio Team

MaturityFacet

Diamond facet that exposes token maturity initialisation, redemption, and maturity date management via IMaturity, registered under RESOLVER_KEY_MATURITY.

Inherits maturity logic from Maturity and satisfies IStaticFunctionSelectors for Diamond proxy selector registration. Exposes four selectors: initializeMaturity, fullRedeemAtMaturity, updateMaturityDate, and getMaturityDate.

Methods​

fullRedeemAtMaturity​

function fullRedeemAtMaturity(address _tokenHolder) external nonpayable

Redeems all token partitions held by a token holder at maturity.

Intentionally does not enforce onlyListedAllowed or onlyValidKycStatus on _tokenHolder: this is an issuer-driven mandatory settlement, and the holder's own compliance status must not be able to block redemption of what they are owed.

Parameters​

NameTypeDescription
_tokenHolderaddressAddress of the token holder whose partitions are to be redeemed.

getMaturityDate​

function getMaturityDate() external view returns (uint256 maturityDate_)

Returns the current token maturity date.

Reads directly from MaturityDateStorageWrapper storage slot. No access-control gate — maturity date is public information.

Returns​

NameTypeDescription
maturityDate_uint256Current maturity timestamp (Unix epoch, in seconds). Returns zero if the date has not been set yet.

getStaticFunctionSelectors​

function getStaticFunctionSelectors() external pure returns (bytes4[])

Gets all function selectors of a facet

Returns​

NameTypeDescription
_0bytes4[]Face functions selectors

getStaticInterfaceIds​

function getStaticInterfaceIds() external pure returns (bytes4[])

Gets all interfaces ids of a facet.

Returns​

NameTypeDescription
_0bytes4[]Face interface ids

getStaticResolverKey​

function getStaticResolverKey() external pure returns (bytes32 staticResolverKey_)

Gets the static resolver key

Returns​

NameTypeDescription
staticResolverKey_bytes32Static resolver key

initializeMaturity​

function initializeMaturity(uint256 _maturityDate) external nonpayable

Sets the token maturity date exactly once during deployment.

Called by the Factory immediately after the proxy is deployed. No role gate — the one-time guard is enforced by onlyNotMaturityInitialized, which reverts with AlreadyInitialized on any subsequent call. Persists the date via MaturityDateStorageWrapper.initializeMaturity.Emits {MaturityInitialized} with the contract address and the maturity date.

Parameters​

NameTypeDescription
_maturityDateuint256Maturity timestamp to set (Unix epoch, in seconds). Must be strictly greater than zero and in the future at deployment time.

redeemAtMaturityByPartitionRange​

function redeemAtMaturityByPartitionRange(address _tokenHolder, uint256 _pageIndex, uint256 _pageLength) external nonpayable

Redeems a bounded page of the token partitions held by a token holder at maturity.

Intentionally does not enforce onlyListedAllowed or onlyValidKycStatus on _tokenHolder: this is an issuer-driven mandatory settlement, and the holder's own compliance status must not be able to block redemption of what they are owed.

Parameters​

NameTypeDescription
_tokenHolderaddressAddress of the token holder whose partitions are to be redeemed.
_pageIndexuint256Zero-based index of the page of partitions to redeem.
_pageLengthuint256Number of partitions per page.

updateMaturityDate​

function updateMaturityDate(uint256 _newMaturityDate) external nonpayable returns (bool success_)

Updates the token maturity date to a new timestamp.

Caller must hold ROLE_MATURITY_MANAGER. Contract must be unpaused. _newMaturityDate must satisfy the validity constraint enforced by onlyValidMaturityDate — the new date must be strictly greater than the current maturity date. Persists the new date via MaturityDateStorageWrapper.setMaturityDate.Emits {MaturityDateUpdated} with the contract address, the new maturity date, and the previous maturity date.

Parameters​

NameTypeDescription
_newMaturityDateuint256New maturity timestamp to set (Unix epoch, in seconds).

Returns​

NameTypeDescription
success_boolAlways true on successful execution.

Events​

FullyRedeemedAtMaturity​

event FullyRedeemedAtMaturity(address indexed tokenHolder)

Emitted once after fullRedeemAtMaturity has redeemed every partition held by tokenHolder.

Parameters​

NameTypeDescription
tokenHolder indexedaddressToken holder whose full partition list was redeemed.

MaturityDateUpdated​

event MaturityDateUpdated(address indexed tokenId, uint256 indexed maturityDate, uint256 indexed previousMaturityDate)

Emitted whenever the maturity date is updated via updateMaturityDate.

Parameters​

NameTypeDescription
tokenId indexedaddressAddress of the token proxy whose date was updated.
maturityDate indexeduint256New maturity timestamp (Unix epoch, seconds).
previousMaturityDate indexeduint256Previous maturity timestamp that was replaced.

MaturityInitialized​

event MaturityInitialized(uint256 indexed maturityDate)

Emitted once when the maturity date is set for the first time via initializeMaturity.

Parameters​

NameTypeDescription
maturityDate indexeduint256Initial maturity timestamp (Unix epoch, seconds).

RedeemedAtMaturityByPartitionRange​

event RedeemedAtMaturityByPartitionRange(address indexed tokenHolder, uint256 pageIndex, uint256 pageLength)

Emitted once after redeemAtMaturityByPartitionRange has redeemed the requested page of partitions held by tokenHolder.

Parameters​

NameTypeDescription
tokenHolder indexedaddressToken holder whose partitions were redeemed.
pageIndexuint256Zero-based index of the page that was redeemed.
pageLengthuint256Number of partitions per page, as requested by the caller.

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.

AssetNotOperational​

error AssetNotOperational(bytes32 configId, uint256 versionId)

Raised by InitializerStorageWrapper.checkOperational (and the related isConfigVersionOperational helper) when an operation is attempted on a configuration version that has not yet been marked operational.

Parameters​

NameTypeDescription
configIdbytes32Resolver-proxy configuration whose operational status was checked.
versionIduint256Configuration version whose operational status was checked.

ClearingIsActivated​

error ClearingIsActivated()

Thrown when an administration action requires clearing to be inactive but it is currently enabled.

Deactivated​

error Deactivated()

Thrown when an operation guarded by onlyActivated is attempted on a token whose deactivation flag has already been set.

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).

MaturityDateInvalid​

error MaturityDateInvalid()

Thrown when a maturity date fails validation.

Reverts when a proposed maturity date is not strictly in the future at the time it is set, or when a maturity-gated action is attempted before the stored maturity date has been reached.

UnexpectedError​

error UnexpectedError(bytes4 _errorId)

Reverts when an unreachable validation state is detected.

Replaces assertions for defensive handling of logically impossible states.

Parameters​

NameTypeDescription
_errorIdbytes4Identifier of the unexpected validation condition.

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.

ZeroAddressNotAllowed​

error ZeroAddressNotAllowed()

Reverts when the zero address is supplied where it is not permitted.

Prevents invalid account, contract, or recipient references.