Skip to main content

BalanceTrackerByPartition

Asset Tokenization Studio Team

BalanceTrackerByPartition

Abstract implementation of IBalanceTrackerByPartition that consolidates partition-scoped token balance and total supply queries into a single, time-aware read layer.

Delegates all storage reads to ERC1410StorageWrapper and ERC3643StorageWrapper, passing the resolved timestamp from TimeTravelStorageWrapper to support non-triggered adjustment simulation. Intended to be inherited by BalanceTrackerByPartitionFacet.

Methods​

balanceOfByPartition​

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

Returns the token balance of a holder within a specific partition, simulating non-triggered balance adjustments up to the current timestamp.

Parameters​

NameTypeDescription
_partitionbytes32The partition identifier
_tokenHolderaddressThe address of the token holder

Returns​

NameTypeDescription
_0uint256The adjusted balance of the token holder in the partition

getTotalBalanceForByPartition​

function getTotalBalanceForByPartition(bytes32 _partition, address _account) external view returns (uint256)

Returns the total balance held by an account within a specific partition, including locked tokens, held tokens, and clearing amounts, simulating non-triggered adjustments up to the current timestamp.

Parameters​

NameTypeDescription
_partitionbytes32The partition identifier
_accountaddressThe address of the account

Returns​

NameTypeDescription
_0uint256The adjusted total balance for the account in the partition

initializeBalanceTrackerByPartition​

function initializeBalanceTrackerByPartition() external nonpayable

Initialises the partition balance tracker capability on the token.

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

totalSupplyByPartition​

function totalSupplyByPartition(bytes32 _partition) external view returns (uint256)

Returns the total token supply within a specific partition, simulating non-triggered supply adjustments up to the current timestamp.

Parameters​

NameTypeDescription
_partitionbytes32The partition identifier

Returns​

NameTypeDescription
_0uint256The adjusted total supply for the partition

Events​

BalanceTrackerByPartitionInitialized​

event BalanceTrackerByPartitionInitialized()

Emitted once when the partition balance tracker capability is initialised on a token.

Fires exclusively from initializeBalanceTrackerByPartition after the storage write succeeds.

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.