Skip to main content

HoldByPartitionFacet

Asset Tokenization Studio Team

HoldByPartitionFacet

Diamond facet that exposes all hold operations scoped to a specific partition through the IHoldByPartition interface, registered under RESOLVER_KEY_HOLD_BY_PARTITION.

Inherits hold logic from HoldByPartition and satisfies the IStaticFunctionSelectors contract required by the Diamond proxy for selector registration. Exposes nine selectors: five write operations (createHoldByPartition, createHoldFromByPartition, executeHoldByPartition, releaseHoldByPartition, reclaimHoldByPartition) and four partition-scoped read operations (getHeldAmountForByPartition, getHoldCountForByPartition, getHoldsIdForByPartition, getHoldForByPartition).

Methods​

createHoldByPartition​

function createHoldByPartition(bytes32 _partition, IHoldTypes.Hold _hold) external nonpayable returns (bool success_, uint256 holdId_)

Parameters​

NameTypeDescription
_partitionbytes32undefined
_holdIHoldTypes.Holdundefined

Returns​

NameTypeDescription
success_boolundefined
holdId_uint256undefined

createHoldFromByPartition​

function createHoldFromByPartition(bytes32 _partition, address _from, IHoldTypes.Hold _hold, bytes _operatorData) external nonpayable returns (bool success_, uint256 holdId_)

Parameters​

NameTypeDescription
_partitionbytes32undefined
_fromaddressundefined
_holdIHoldTypes.Holdundefined
_operatorDatabytesundefined

Returns​

NameTypeDescription
success_boolundefined
holdId_uint256undefined

executeHoldByPartition​

function executeHoldByPartition(IHoldTypes.HoldIdentifier _holdIdentifier, address _to, uint256 _amount) external nonpayable returns (bool success_, bytes32 partition_)

Parameters​

NameTypeDescription
_holdIdentifierIHoldTypes.HoldIdentifierundefined
_toaddressundefined
_amountuint256undefined

Returns​

NameTypeDescription
success_boolundefined
partition_bytes32undefined

getHeldAmountForByPartition​

function getHeldAmountForByPartition(bytes32 _partition, address _tokenHolder) external view returns (uint256 amount_)

Returns the total amount of tokens held for a token holder on a specific partition.

Parameters​

NameTypeDescription
_partitionbytes32The partition to query.
_tokenHolderaddressThe address of the token holder.

Returns​

NameTypeDescription
amount_uint256The total held amount on the given partition.

getHoldCountForByPartition​

function getHoldCountForByPartition(bytes32 _partition, address _tokenHolder) external view returns (uint256 holdCount_)

Returns the number of active holds for a token holder on a specific partition.

Parameters​

NameTypeDescription
_partitionbytes32The partition to query.
_tokenHolderaddressThe address of the token holder.

Returns​

NameTypeDescription
holdCount_uint256The number of holds on the given partition.

getHoldForByPartition​

function getHoldForByPartition(IHoldTypes.HoldIdentifier _holdIdentifier) external view returns (uint256 amount_, uint256 expirationTimestamp_, address escrow_, address destination_, bytes data_, bytes operatorData_, enum ThirdPartyType thirdPartyType_)

Parameters​

NameTypeDescription
_holdIdentifierIHoldTypes.HoldIdentifierundefined

Returns​

NameTypeDescription
amount_uint256undefined
expirationTimestamp_uint256undefined
escrow_addressundefined
destination_addressundefined
data_bytesundefined
operatorData_bytesundefined
thirdPartyType_enum ThirdPartyTypeundefined

getHoldsIdForByPartition​

function getHoldsIdForByPartition(bytes32 _partition, address _tokenHolder, uint256 _pageIndex, uint256 _pageLength) external view returns (uint256[] holdsId_)

Returns a paginated list of hold IDs for a token holder on a specific partition.

Parameters​

NameTypeDescription
_partitionbytes32The partition to query.
_tokenHolderaddressThe address of the token holder.
_pageIndexuint256The zero-based index of the page to retrieve.
_pageLengthuint256The maximum number of hold IDs to return.

Returns​

NameTypeDescription
holdsId_uint256[]The array of hold IDs for the given page.

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

initializeHoldByPartition​

function initializeHoldByPartition() external nonpayable

Initialises the hold-by-partition capability on the token.

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

reclaimHoldByPartition​

function reclaimHoldByPartition(IHoldTypes.HoldIdentifier _holdIdentifier) external nonpayable returns (bool success_)

Parameters​

NameTypeDescription
_holdIdentifierIHoldTypes.HoldIdentifierundefined

Returns​

NameTypeDescription
success_boolundefined

releaseHoldByPartition​

function releaseHoldByPartition(IHoldTypes.HoldIdentifier _holdIdentifier, uint256 _amount) external nonpayable returns (bool success_)

Parameters​

NameTypeDescription
_holdIdentifierIHoldTypes.HoldIdentifierundefined
_amountuint256undefined

Returns​

NameTypeDescription
success_boolundefined

Events​

ControllerHeldByPartition​

event ControllerHeldByPartition(address indexed operator, address indexed tokenHolder, bytes32 partition, uint256 holdId, IHoldTypes.Hold hold, bytes operatorData)

Emitted when a controller creates a hold on a holder's behalf.

Parameters​

NameTypeDescription
operator indexedaddressThe controller initiating the hold.
tokenHolder indexedaddressThe holder whose balance is being held.
partitionbytes32Partition over which the hold is placed.
holdIduint256Sequence id assigned to the hold.
holdIHoldTypes.HoldThe hold definition.
operatorDatabytesOperator-supplied metadata.

HeldByPartition​

event HeldByPartition(address indexed operator, address indexed tokenHolder, bytes32 partition, uint256 holdId, IHoldTypes.Hold hold, bytes operatorData)

Emitted when a holder creates a hold over its own partitioned balance.

Parameters​

NameTypeDescription
operator indexedaddressThe address that initiated the hold (the holder itself).
tokenHolder indexedaddressThe holder whose balance is being held.
partitionbytes32Partition over which the hold is placed.
holdIduint256Sequence id assigned to the hold.
holdIHoldTypes.HoldThe hold definition (escrow, recipient, expiration, amount, data).
operatorDatabytesOperator-supplied metadata.

HeldFromByPartition​

event HeldFromByPartition(address indexed operator, address indexed tokenHolder, bytes32 partition, uint256 holdId, IHoldTypes.Hold hold, bytes operatorData)

Emitted when an authorised third party creates a hold on a holder's behalf.

Parameters​

NameTypeDescription
operator indexedaddressThe third-party caller initiating the hold.
tokenHolder indexedaddressThe holder whose balance is being held.
partitionbytes32Partition over which the hold is placed.
holdIduint256Sequence id assigned to the hold.
holdIHoldTypes.HoldThe hold definition (escrow, recipient, expiration, amount, data).
operatorDatabytesOperator-supplied metadata.

HoldByPartitionExecuted​

event HoldByPartitionExecuted(address indexed tokenHolder, bytes32 indexed partition, uint256 holdId, uint256 amount, address to)

Emitted when an existing hold is executed and balance transferred to a recipient.

Parameters​

NameTypeDescription
tokenHolder indexedaddressThe holder whose hold was executed.
partition indexedbytes32Partition over which the hold lived.
holdIduint256Sequence id of the executed hold.
amountuint256Amount released to the recipient.
toaddressRecipient of the executed balance.

HoldByPartitionInitialized​

event HoldByPartitionInitialized()

Emitted once when the hold-by-partition capability is initialised on a token.

Fires exclusively from initializeHoldByPartition.

HoldByPartitionReclaimed​

event HoldByPartitionReclaimed(address indexed operator, address indexed tokenHolder, bytes32 indexed partition, uint256 holdId, uint256 amount)

Emitted when an expired hold is reclaimed by the holder.

Parameters​

NameTypeDescription
operator indexedaddressThe address that triggered the reclaim.
tokenHolder indexedaddressThe holder receiving the reclaimed balance.
partition indexedbytes32Partition over which the hold lived.
holdIduint256Sequence id of the reclaimed hold.
amountuint256Amount returned to the holder's available balance.

HoldByPartitionReleased​

event HoldByPartitionReleased(address indexed tokenHolder, bytes32 indexed partition, uint256 holdId, uint256 amount)

Emitted when a hold is partially or fully released back to the holder.

Parameters​

NameTypeDescription
tokenHolder indexedaddressThe holder receiving the released balance.
partition indexedbytes32Partition over which the hold lived.
holdIduint256Sequence id of the released hold.
amountuint256Amount returned to the holder's available balance.

OperatorHeldByPartition​

event OperatorHeldByPartition(address indexed operator, address indexed tokenHolder, bytes32 partition, uint256 holdId, IHoldTypes.Hold hold, bytes operatorData)

Emitted when an ERC-1410 operator creates a hold on a holder's behalf.

Parameters​

NameTypeDescription
operator indexedaddressThe authorised operator initiating the hold.
tokenHolder indexedaddressThe holder whose balance is being held.
partitionbytes32Partition over which the hold is placed.
holdIduint256Sequence id assigned to the hold.
holdIHoldTypes.HoldThe hold definition.
operatorDatabytesOperator-supplied metadata.

ProtectedHeldByPartition​

event ProtectedHeldByPartition(address indexed operator, address indexed tokenHolder, bytes32 partition, uint256 holdId, IHoldTypes.Hold hold, bytes operatorData)

Emitted when a protected hold authorised by an EIP-712 signature is created.

Parameters​

NameTypeDescription
operator indexedaddressThe address submitting the protected hold (signature relayer).
tokenHolder indexedaddressThe holder whose balance is being held; must match the signer.
partitionbytes32Partition over which the hold is placed.
holdIduint256Sequence id assigned to the hold.
holdIHoldTypes.HoldThe hold definition.
operatorDatabytesOperator-supplied metadata.

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.

HoldExpirationNotReached​

error HoldExpirationNotReached()

Reverts when a reclaim is attempted before the hold's expiration timestamp.

HoldExpirationReached​

error HoldExpirationReached()

Reverts when an operation requires an unexpired hold but the hold has expired.

InsufficientHoldBalance​

error InsufficientHoldBalance(uint256 holdAmount, uint256 amount)

Reverts when the requested release amount exceeds the hold's remaining balance.

Parameters​

NameTypeDescription
holdAmountuint256The amount still held.
amountuint256The amount requested.

InvalidDestinationAddress​

error InvalidDestinationAddress(address holdDestination, address to)

Reverts when the recipient supplied to {executeHoldByPartition} mismatches the hold.

Parameters​

NameTypeDescription
holdDestinationaddressThe recipient stored on the hold.
toaddressThe recipient supplied to the execute call.

InvalidHoldAmount​

error InvalidHoldAmount()

Reverts when a hold is created with a zero or otherwise invalid amount.

IsNotEscrow​

error IsNotEscrow()

Reverts when a caller that is not the recorded escrow attempts to execute the hold.

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​

NameTypeDescription
partitionbytes32The 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​

NameTypeDescription
accountaddressThe caller lacking the required role.
rolebytes32The 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​

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.

WrongExpirationTimestamp​

error WrongExpirationTimestamp()

Reverts when an expiration timestamp is invalid.

Used for expired, past, or otherwise unacceptable expiration values.

WrongHoldId​

error WrongHoldId()

Reverts when the supplied hold id does not exist for the (partition, holder) pair.

ZeroAddressNotAllowed​

error ZeroAddressNotAllowed()

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

Prevents invalid account, contract, or recipient references.