IBalanceTrackerAtSnapshotByPartition
Asset Tokenization Studio Team
IBalanceTrackerAtSnapshotByPartition
Interface for querying snapshotted partition-scoped token balances and total supply, resolved against a previously taken snapshot identifier.
Reads are delegated to SnapshotsStorageWrapper and operate on the snapshot index recorded by takeSnapshot. Reverts with SnapshotIdNull for _snapshotID == 0 and with SnapshotIdDoesNotExists for unknown identifiers.
Methods
balanceOfAtSnapshotByPartition
function balanceOfAtSnapshotByPartition(bytes32 _partition, uint256 _snapshotID, address _tokenHolder) external view returns (uint256 balance_)
Returns the balance of an account for a given partition at the time of a given snapshot.
Parameters
| Name | Type | Description |
|---|---|---|
| _partition | bytes32 | The partition identifier. |
| _snapshotID | uint256 | The snapshot identifier returned by a prior takeSnapshot call. |
| _tokenHolder | address | The address of the token holder. |
Returns
| Name | Type | Description |
|---|---|---|
| balance_ | uint256 | The balance of _tokenHolder in _partition recorded at _snapshotID. |
initializeBalanceTrackerAtSnapshotByPartition
function initializeBalanceTrackerAtSnapshotByPartition() external nonpayable
Initialises the partition snapshot balance tracker capability on the token.
Callable once; subsequent calls revert with FacetAlreadyRegistered. Requires DEFAULT_ADMIN_ROLE. Called by the factory during deployment.
totalSupplyAtSnapshotByPartition
function totalSupplyAtSnapshotByPartition(bytes32 _partition, uint256 _snapshotID) external view returns (uint256 totalSupply_)
Returns the total supply for a given partition at the time of a given snapshot.
Parameters
| Name | Type | Description |
|---|---|---|
| _partition | bytes32 | The partition identifier. |
| _snapshotID | uint256 | The snapshot identifier returned by a prior takeSnapshot call. |
Returns
| Name | Type | Description |
|---|---|---|
| totalSupply_ | uint256 | The total supply for _partition recorded at _snapshotID. |
Events
BalanceTrackerAtSnapshotByPartitionInitialized
event BalanceTrackerAtSnapshotByPartitionInitialized()
Emitted once when the partition snapshot balance tracker capability is initialised on a token.
Fires exclusively from initializeBalanceTrackerAtSnapshotByPartition after the storage write succeeds.