ICapByPartition
Asset Tokenization Studio Team
ICapByPartition
Interface for managing the per-partition maximum supply cap of a token.
The partition-scoped cap sits underneath the global cap declared in ICap. Setting a partition cap requires the ROLE_CAP and the token to be unpaused; the cap value is validated against the partition's current total supply and the global max supply both adjusted for any pending balance adjustments. Reads expose the same balance-adjusted view, so values returned reflect scheduled adjustments effective at the current block timestamp.
Methods
getMaxSupplyByPartition
function getMaxSupplyByPartition(bytes32 _partition) external view returns (uint256 maxSupply_)
Returns the maximum supply cap currently in effect for a partition.
The returned value is adjusted for pending balance adjustments effective at the current block timestamp.
Parameters
| Name | Type | Description |
|---|---|---|
| _partition | bytes32 | The partition identifier to query. |
Returns
| Name | Type | Description |
|---|---|---|
| maxSupply_ | uint256 | The balance-adjusted maximum supply for _partition. |
initializeCapByPartition
function initializeCapByPartition() external nonpayable
Initialises the CapByPartition capability on the token.
Callable once; subsequent calls revert with FacetAlreadyRegistered. Requires DEFAULT_ADMIN_ROLE. Called by the factory during deployment.
setMaxSupplyByPartition
function setMaxSupplyByPartition(bytes32 _partition, uint256 _maxSupply) external nonpayable returns (bool success_)
Sets the maximum supply cap for a specific partition of the token.
Reverts with NewMaxSupplyCannotBeZero when _maxSupply is zero, and with NewMaxSupplyForPartitionTooLow when it is below the partition's adjusted total supply. Emits {MaxSupplyByPartitionSet}.
Parameters
| Name | Type | Description |
|---|---|---|
| _partition | bytes32 | The partition identifier whose cap is being updated. |
| _maxSupply | uint256 | The new maximum supply value for the partition. |
Returns
| Name | Type | Description |
|---|---|---|
| success_ | bool | True when the cap is updated. |
Events
CapByPartitionInitialized
event CapByPartitionInitialized()
Emitted once when the CapByPartition capability is initialised on a token.
Fires exclusively from initializeCapByPartition after the storage write succeeds.