Skip to main content

IBalanceTracker

Asset Tokenization Studio Team

IBalanceTracker

Interface for querying token balances and total supply across all partitions, with support for time-adjusted values that simulate pending balance adjustments.

All read operations resolve the current block timestamp via TimeTravelStorageWrapper, enabling deterministic results in test environments without altering production behaviour.

Methods​

balanceOf​

function balanceOf(address _tokenHolder) external view returns (uint256)

Returns the total token balance of a token holder across all partitions, including locked and held amounts, simulating non-triggered balance adjustments up to the current timestamp.

Parameters​

NameTypeDescription
_tokenHolderaddressThe address of the token holder

Returns​

NameTypeDescription
_0uint256The adjusted total balance

getTotalBalanceFor​

function getTotalBalanceFor(address _account) external view returns (uint256)

Returns the total balance held by an account across all partitions, including locked tokens, held tokens and clearing amounts, simulating non-triggered adjustments up to the current timestamp.

Parameters​

NameTypeDescription
_accountaddressThe address of the account

Returns​

NameTypeDescription
_0uint256The adjusted total balance for the account

initializeBalanceTracker​

function initializeBalanceTracker() external nonpayable

Initialises the balance tracker capability on the token.

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

totalSupply​

function totalSupply() external view returns (uint256)

Returns the total token supply across all partitions, simulating non-triggered supply adjustments up to the current timestamp.

Returns​

NameTypeDescription
_0uint256The adjusted total supply

Events​

BalanceTrackerInitialized​

event BalanceTrackerInitialized()

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

Fires exclusively from initializeBalanceTracker after the storage write succeeds.