ClearingByPartition
Asset Tokenization Studio Team
ClearingByPartition
Provides partition-scoped clearing lifecycle, creation, and query operations.
Implements IClearingByPartition through shared clearing orchestrators and facet initialisation storage. Mutating entry points depend on operational, activation, pause, partition, identity, recovery, role, and clearing-state modifiers.
Methods
approveClearingOperationByPartition
function approveClearingOperationByPartition(IClearingTypes.ClearingOperationIdentifier _clearingOperationIdentifier) external nonpayable returns (bool success_, bytes32 partition_)
Parameters
| Name | Type | Description |
|---|---|---|
| _clearingOperationIdentifier | IClearingTypes.ClearingOperationIdentifier | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| success_ | bool | undefined |
| partition_ | bytes32 | undefined |
cancelClearingOperationByPartition
function cancelClearingOperationByPartition(IClearingTypes.ClearingOperationIdentifier _clearingOperationIdentifier) external nonpayable returns (bool success_)
Parameters
| Name | Type | Description |
|---|---|---|
| _clearingOperationIdentifier | IClearingTypes.ClearingOperationIdentifier | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| success_ | bool | undefined |
clearingRedeemByPartition
function clearingRedeemByPartition(IClearingTypes.ClearingOperation _clearingOperation, uint256 _amount) external nonpayable returns (bool success_, uint256 clearingId_)
Parameters
| Name | Type | Description |
|---|---|---|
| _clearingOperation | IClearingTypes.ClearingOperation | undefined |
| _amount | uint256 | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| success_ | bool | undefined |
| clearingId_ | uint256 | undefined |
clearingRedeemFromByPartition
function clearingRedeemFromByPartition(IClearingTypes.ClearingOperationFrom _clearingOperationFrom, uint256 _amount) external nonpayable returns (bool success_, uint256 clearingId_)
Parameters
| Name | Type | Description |
|---|---|---|
| _clearingOperationFrom | IClearingTypes.ClearingOperationFrom | undefined |
| _amount | uint256 | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| success_ | bool | undefined |
| clearingId_ | uint256 | undefined |
clearingTransferByPartition
function clearingTransferByPartition(IClearingTypes.ClearingOperation _clearingOperation, uint256 _amount, address _to) external nonpayable returns (bool success_, uint256 clearingId_)
Parameters
| Name | Type | Description |
|---|---|---|
| _clearingOperation | IClearingTypes.ClearingOperation | undefined |
| _amount | uint256 | undefined |
| _to | address | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| success_ | bool | undefined |
| clearingId_ | uint256 | undefined |
clearingTransferFromByPartition
function clearingTransferFromByPartition(IClearingTypes.ClearingOperationFrom _clearingOperationFrom, uint256 _amount, address _to) external nonpayable returns (bool success_, uint256 clearingId_)
Parameters
| Name | Type | Description |
|---|---|---|
| _clearingOperationFrom | IClearingTypes.ClearingOperationFrom | undefined |
| _amount | uint256 | undefined |
| _to | address | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| success_ | bool | undefined |
| clearingId_ | uint256 | undefined |
getClearedAmountForByPartition
function getClearedAmountForByPartition(bytes32 _partition, address _tokenHolder) external view returns (uint256 amount_)
Gets the total cleared amount for a token holder by partition
Parameters
| Name | Type | Description |
|---|---|---|
| _partition | bytes32 | The partition of the token |
| _tokenHolder | address | The address of the token holder |
Returns
| Name | Type | Description |
|---|---|---|
| amount_ | uint256 | Total amount of tokens currently locked in clearing for the holder |
getClearingCountForByPartition
function getClearingCountForByPartition(bytes32 _partition, address _tokenHolder, enum IClearingTypes.ClearingOperationType _clearingOperationType) external view returns (uint256 clearingCount_)
Gets the total clearing count for a token holder by partition and clearing operation type
Parameters
| Name | Type | Description |
|---|---|---|
| _partition | bytes32 | The partition of the token |
| _tokenHolder | address | The address of the token holder |
| _clearingOperationType | enum IClearingTypes.ClearingOperationType | Type of clearing operation (Transfer, Redeem, or HoldCreation) |
Returns
| Name | Type | Description |
|---|---|---|
| clearingCount_ | uint256 | Number of active clearing operations of the given type |
getClearingRedeemForByPartition
function getClearingRedeemForByPartition(bytes32 _partition, address _tokenHolder, uint256 _clearingId) external view returns (struct IClearingTypes.ClearingRedeemData clearingRedeemData_)
Gets the clearing redeem data for a given partition, token holder and clearing ID
Parameters
| Name | Type | Description |
|---|---|---|
| _partition | bytes32 | The partition of the token |
| _tokenHolder | address | The address of the token holder |
| _clearingId | uint256 | The ID of the clearing operation |
Returns
| Name | Type | Description |
|---|---|---|
| clearingRedeemData_ | IClearingTypes.ClearingRedeemData | The clearing redeem data |
getClearingTransferForByPartition
function getClearingTransferForByPartition(bytes32 _partition, address _tokenHolder, uint256 _clearingId) external view returns (struct IClearingTypes.ClearingTransferData clearingTransferData_)
Gets the clearing transfer data for a given partition, token holder and clearing ID
Parameters
| Name | Type | Description |
|---|---|---|
| _partition | bytes32 | The partition of the token |
| _tokenHolder | address | The address of the token holder |
| _clearingId | uint256 | The ID of the clearing operation |
Returns
| Name | Type | Description |
|---|---|---|
| clearingTransferData_ | IClearingTypes.ClearingTransferData | The clearing transfer data |
getClearingsIdForByPartition
function getClearingsIdForByPartition(bytes32 _partition, address _tokenHolder, enum IClearingTypes.ClearingOperationType _clearingOperationType, uint256 _pageIndex, uint256 _pageLength) external view returns (uint256[] clearingsId_)
Gets the ids of the clearings for a token holder by partition and clearing operation type
Parameters
| Name | Type | Description |
|---|---|---|
| _partition | bytes32 | The partition of the token |
| _tokenHolder | address | The address of the token holder |
| _clearingOperationType | enum IClearingTypes.ClearingOperationType | Type of clearing operation (Transfer, Redeem, or HoldCreation) |
| _pageIndex | uint256 | Zero-based page index for pagination |
| _pageLength | uint256 | Maximum number of IDs to return per page |
Returns
| Name | Type | Description |
|---|---|---|
| clearingsId_ | uint256[] | Array of clearing operation IDs for the given page |
initializeClearingByPartition
function initializeClearingByPartition() external nonpayable
Initialises the clearing-by-partition capability on the token.
Callable once; subsequent calls revert with FacetAlreadyRegistered. Requires DEFAULT_ADMIN_ROLE. Called by the factory during deployment.
reclaimClearingOperationByPartition
function reclaimClearingOperationByPartition(IClearingTypes.ClearingOperationIdentifier _clearingOperationIdentifier) external nonpayable returns (bool success_)
Parameters
| Name | Type | Description |
|---|---|---|
| _clearingOperationIdentifier | IClearingTypes.ClearingOperationIdentifier | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| success_ | bool | undefined |
Events
ClearedHoldByPartition
event ClearedHoldByPartition(address indexed operator, address indexed tokenHolder, bytes32 partition, uint256 clearingId, IHoldTypes.Hold hold, uint256 expirationDate, bytes data, bytes operatorData)
Emitted when a token holder registers a clearing-guarded hold creation on a partition.
Parameters
| Name | Type | Description |
|---|---|---|
operator indexed | address | Address that submitted the clearing operation. |
tokenHolder indexed | address | Address of the holder whose tokens are to be placed under hold. |
| partition | bytes32 | ERC-1400 partition the tokens belong to. |
| clearingId | uint256 | Sequential identifier for the registered operation. |
| hold | IHoldTypes.Hold | Hold parameters that will be used on approval. |
| expirationDate | uint256 | Unix timestamp after which the clearing operation may be reclaimed. |
| data | bytes | Caller-supplied data attached to the operation. |
| operatorData | bytes | Data provided by the operator. |
ClearedHoldFromByPartition
event ClearedHoldFromByPartition(address indexed operator, address indexed tokenHolder, bytes32 partition, uint256 clearingId, IHoldTypes.Hold hold, uint256 expirationDate, bytes data, bytes operatorData)
Emitted when a clearing-guarded hold creation is registered on behalf of a token holder via holdFromByPartition.
Parameters
| Name | Type | Description |
|---|---|---|
operator indexed | address | Address that submitted the clearing operation on behalf of the holder. |
tokenHolder indexed | address | Address of the holder whose tokens are to be placed under hold. |
| partition | bytes32 | ERC-1400 partition the tokens belong to. |
| clearingId | uint256 | Sequential identifier for the registered operation. |
| hold | IHoldTypes.Hold | Hold parameters that will be used on approval. |
| expirationDate | uint256 | Unix timestamp after which the clearing operation may be reclaimed. |
| data | bytes | Caller-supplied data attached to the operation. |
| operatorData | bytes | Data provided by the operator. |
ClearedOperatorRedeemByPartition
event ClearedOperatorRedeemByPartition(address indexed operator, address indexed tokenHolder, bytes32 partition, uint256 clearingId, uint256 amount, uint256 expirationDate, bytes data, bytes operatorData)
Emitted when an operator registers a clearing-guarded redemption using operator-level permissions.
Parameters
| Name | Type | Description |
|---|---|---|
operator indexed | address | Authorised operator that submitted the clearing operation. |
tokenHolder indexed | address | Address of the holder whose tokens are pending redemption. |
| partition | bytes32 | ERC-1400 partition the tokens belong to. |
| clearingId | uint256 | Sequential identifier for the registered operation. |
| amount | uint256 | Token quantity pending redemption. |
| expirationDate | uint256 | Unix timestamp after which the operation may be reclaimed. |
| data | bytes | Caller-supplied data attached to the operation. |
| operatorData | bytes | Data provided by the operator. |
ClearedOperatorTransferByPartition
event ClearedOperatorTransferByPartition(address indexed operator, address indexed tokenHolder, address indexed to, bytes32 partition, uint256 clearingId, uint256 amount, uint256 expirationDate, bytes data, bytes operatorData)
Emitted when an operator registers a clearing-guarded transfer using operator-level permissions.
Parameters
| Name | Type | Description |
|---|---|---|
operator indexed | address | Authorised operator that submitted the clearing operation. |
tokenHolder indexed | address | Address of the holder whose tokens are pending transfer. |
to indexed | address | Intended recipient of the tokens upon approval. |
| partition | bytes32 | ERC-1400 partition the tokens belong to. |
| clearingId | uint256 | Sequential identifier for the registered operation. |
| amount | uint256 | Token quantity pending transfer. |
| expirationDate | uint256 | Unix timestamp after which the operation may be reclaimed. |
| data | bytes | Caller-supplied data attached to the operation. |
| operatorData | bytes | Data provided by the operator. |
ClearedRedeemByPartition
event ClearedRedeemByPartition(address indexed operator, address indexed tokenHolder, bytes32 partition, uint256 clearingId, uint256 amount, uint256 expirationDate, bytes data, bytes operatorData)
Emitted when a token holder registers a clearing-guarded redemption on a partition.
Parameters
| Name | Type | Description |
|---|---|---|
operator indexed | address | Address that submitted the clearing operation. |
tokenHolder indexed | address | Address of the holder whose tokens are pending redemption. |
| partition | bytes32 | ERC-1400 partition the tokens belong to. |
| clearingId | uint256 | Sequential identifier for the registered operation. |
| amount | uint256 | Token quantity pending redemption. |
| expirationDate | uint256 | Unix timestamp after which the operation may be reclaimed. |
| data | bytes | Caller-supplied data attached to the operation. |
| operatorData | bytes | Data provided by the operator. |
ClearedRedeemFromByPartition
event ClearedRedeemFromByPartition(address indexed operator, address indexed tokenHolder, bytes32 partition, uint256 clearingId, uint256 amount, uint256 expirationDate, bytes data, bytes operatorData)
Emitted when a clearing-guarded redemption is registered on behalf of a token holder via redeemFromByPartition.
Parameters
| Name | Type | Description |
|---|---|---|
operator indexed | address | Address that submitted the clearing operation on behalf of the holder. |
tokenHolder indexed | address | Address of the holder whose tokens are pending redemption. |
| partition | bytes32 | ERC-1400 partition the tokens belong to. |
| clearingId | uint256 | Sequential identifier for the registered operation. |
| amount | uint256 | Token quantity pending redemption. |
| expirationDate | uint256 | Unix timestamp after which the operation may be reclaimed. |
| data | bytes | Caller-supplied data attached to the operation. |
| operatorData | bytes | Data provided by the operator. |
ClearedTransferByPartition
event ClearedTransferByPartition(address indexed operator, address indexed tokenHolder, address indexed to, bytes32 partition, uint256 clearingId, uint256 amount, uint256 expirationDate, bytes data, bytes operatorData)
Emitted when a token holder registers a clearing-guarded transfer on a partition.
Parameters
| Name | Type | Description |
|---|---|---|
operator indexed | address | Address that submitted the clearing operation. |
tokenHolder indexed | address | Address of the holder whose tokens are pending transfer. |
to indexed | address | Intended recipient of the tokens upon approval. |
| partition | bytes32 | ERC-1400 partition the tokens belong to. |
| clearingId | uint256 | Sequential identifier for the registered operation. |
| amount | uint256 | Token quantity pending transfer. |
| expirationDate | uint256 | Unix timestamp after which the operation may be reclaimed. |
| data | bytes | Caller-supplied data attached to the operation. |
| operatorData | bytes | Data provided by the operator. |
ClearedTransferFromByPartition
event ClearedTransferFromByPartition(address indexed operator, address indexed tokenHolder, address indexed to, bytes32 partition, uint256 clearingId, uint256 amount, uint256 expirationDate, bytes data, bytes operatorData)
Emitted when a clearing-guarded transfer is registered on behalf of a token holder via transferFromByPartition.
Parameters
| Name | Type | Description |
|---|---|---|
operator indexed | address | Address that submitted the clearing operation on behalf of the holder. |
tokenHolder indexed | address | Address of the holder whose tokens are pending transfer. |
to indexed | address | Intended recipient of the tokens upon approval. |
| partition | bytes32 | ERC-1400 partition the tokens belong to. |
| clearingId | uint256 | Sequential identifier for the registered operation. |
| amount | uint256 | Token quantity pending transfer. |
| expirationDate | uint256 | Unix timestamp after which the operation may be reclaimed. |
| data | bytes | Caller-supplied data attached to the operation. |
| operatorData | bytes | Data provided by the operator. |
ClearingActivated
event ClearingActivated(address indexed operator)
Emitted when the clearing feature is enabled for the token.
Parameters
| Name | Type | Description |
|---|---|---|
operator indexed | address | Address of the administrator that activated clearing. |
ClearingByPartitionInitialized
event ClearingByPartitionInitialized()
Emitted once when the clearing-by-partition capability is initialised on a token.
Fires exclusively from initializeClearingByPartition.
ClearingDeactivated
event ClearingDeactivated(address indexed operator)
Emitted when the clearing feature is disabled for the token.
Parameters
| Name | Type | Description |
|---|---|---|
operator indexed | address | Address of the administrator that deactivated clearing. |
ClearingOperationApproved
event ClearingOperationApproved(address indexed operator, address indexed tokenHolder, bytes32 indexed partition, uint256 clearingId, enum IClearingTypes.ClearingOperationType clearingOperationType, bytes operationData)
Emitted when a pending clearing operation is approved and the underlying token operation is executed.
Parameters
| Name | Type | Description |
|---|---|---|
operator indexed | address | Address that approved the operation. |
tokenHolder indexed | address | Address of the holder whose tokens were pending. |
partition indexed | bytes32 | ERC-1400 partition the tokens belong to. |
| clearingId | uint256 | Sequential identifier of the approved operation. |
| clearingOperationType | enum IClearingTypes.ClearingOperationType | Discriminant indicating the kind of operation approved. |
| operationData | bytes | Encoded data forwarded to the underlying token call. |
ClearingOperationCanceled
event ClearingOperationCanceled(address indexed operator, address indexed tokenHolder, bytes32 indexed partition, uint256 clearingId, enum IClearingTypes.ClearingOperationType clearingOperationType)
Emitted when a pending clearing operation is cancelled before it expires.
Parameters
| Name | Type | Description |
|---|---|---|
operator indexed | address | Address that cancelled the operation. |
tokenHolder indexed | address | Address of the holder whose tokens were pending. |
partition indexed | bytes32 | ERC-1400 partition the tokens belong to. |
| clearingId | uint256 | Sequential identifier of the cancelled operation. |
| clearingOperationType | enum IClearingTypes.ClearingOperationType | Discriminant indicating the kind of operation cancelled. |
ClearingOperationReclaimed
event ClearingOperationReclaimed(address indexed operator, address indexed tokenHolder, bytes32 indexed partition, uint256 clearingId, enum IClearingTypes.ClearingOperationType clearingOperationType)
Emitted when an expired clearing operation is reclaimed, releasing the locked tokens back to the holder.
Parameters
| Name | Type | Description |
|---|---|---|
operator indexed | address | Address that reclaimed the operation. |
tokenHolder indexed | address | Address of the holder whose tokens were pending. |
partition indexed | bytes32 | ERC-1400 partition the tokens belong to. |
| clearingId | uint256 | Sequential identifier of the reclaimed operation. |
| clearingOperationType | enum IClearingTypes.ClearingOperationType | Discriminant indicating the kind of operation reclaimed. |
Errors
AccountHasNoRole
error AccountHasNoRole(address account, bytes32 role)
Thrown when an account does not hold a required role.
Parameters
| Name | Type | Description |
|---|---|---|
| account | address | The account that lacks the role. |
| role | bytes32 | The 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
| Name | Type | Description |
|---|---|---|
| configId | bytes32 | Resolver-proxy configuration whose operational status was checked. |
| versionId | uint256 | Configuration version whose operational status was checked. |
ClearingIsActivated
error ClearingIsActivated()
Thrown when an administration action requires clearing to be inactive but it is currently enabled.
ClearingIsDisabled
error ClearingIsDisabled()
Thrown when a clearing-dependent operation is attempted while the clearing feature is disabled on the token.
Deactivated
error Deactivated()
Thrown when an operation guarded by onlyActivated is attempted on a token whose deactivation flag has already been set.
ExpirationDateNotReached
error ExpirationDateNotReached()
Thrown when an action requires the clearing operation to have expired (e.g., a reclaim attempt) but the expiration timestamp has not yet passed.
ExpirationDateReached
error ExpirationDateReached()
Thrown when an action requires the clearing operation to still be within its validity window but its expiration timestamp has already passed.
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
| Name | Type | Description |
|---|---|---|
| facetId | bytes32 | Identifier of the offending facet. |
| lastVersion | uint256 | Last version recorded for that facet at the time of the check. |
InvalidClearingAmount
error InvalidClearingAmount()
Thrown when the token amount supplied for a clearing operation is invalid (e.g., zero or exceeding the holder's available balance).
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).
PartitionNotAllowedInSinglePartitionMode
error PartitionNotAllowedInSinglePartitionMode(bytes32 partition)
Thrown when a multi-partition operation specifies a partition not permitted in single-partition mode.
Parameters
| Name | Type | Description |
|---|---|---|
| partition | bytes32 | The disallowed partition supplied by the caller. |
PartitionsAreProtectedAndNoRole
error PartitionsAreProtectedAndNoRole(address account, bytes32 role)
Reverts when a transfer is attempted while partitions are protected and the caller does not hold the required partition role.
Parameters
| Name | Type | Description |
|---|---|---|
| account | address | The caller lacking the required role. |
| role | bytes32 | The role that would have been needed to proceed. |
UnrecognizedResolverProxyVersion
error UnrecognizedResolverProxyVersion(bytes8 _resolverProxyVersion)
Thrown when the provided proxy version does not match any BLR compatible standard.
Parameters
| Name | Type | Description |
|---|---|---|
| _resolverProxyVersion | bytes8 | proxy version that is not compatible with the BLR. |
WalletRecovered
error WalletRecovered()
Thrown when attempting to recover a wallet that has already been recovered.
WrongClearingId
error WrongClearingId()
Thrown when the supplied clearingId does not correspond to an existing or active clearing operation for the given holder and partition.
WrongExpirationTimestamp
error WrongExpirationTimestamp()
Reverts when an expiration timestamp is invalid.
Used for expired, past, or otherwise unacceptable expiration values.
ZeroAddressNotAllowed
error ZeroAddressNotAllowed()
Reverts when the zero address is supplied where it is not permitted.
Prevents invalid account, contract, or recipient references.