AdjustBalances
Asset Tokenization Studio Team
AdjustBalances
Abstract implementation of IAdjustBalances providing immediate balance adjustment corporate actions for tokenised assets.
Inherits access-control guards from Modifiers. Immediate adjustments are applied via AdjustBalancesStorageWrapper. Scheduled adjustments are handled by IScheduledBalanceAdjustment. Intended to be inherited by AdjustBalancesFacet.
Methods
adjustBalances
function adjustBalances(uint256 factor, uint8 decimals) external nonpayable returns (bool success_)
Applies a balance adjustment to all token holders immediately.
Emits {AdjustmentBalanceSet}.
Parameters
| Name | Type | Description |
|---|---|---|
| factor | uint256 | undefined |
| decimals | uint8 | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| success_ | bool | True if the adjustment was applied without reverting. |
initializeBalanceAdjustments
function initializeBalanceAdjustments() external nonpayable
Initialises the balance adjustment capability on the token.
Callable once; subsequent calls revert with FacetAlreadyRegistered. Requires DEFAULT_ADMIN_ROLE. Called by the factory during deployment.
triggerAndSyncAll
function triggerAndSyncAll(bytes32 _partition, address _from, address _to) external nonpayable
Triggers pending scheduled tasks and synchronises the balance snapshot for a transfer pair.
May emit {SnapshotTriggered} or {AdjustmentBalanceSet} depending on pending scheduled tasks.
Parameters
| Name | Type | Description |
|---|---|---|
| _partition | bytes32 | Partition identifier of the transfer. |
| _from | address | Sender address whose snapshot is synchronised. |
| _to | address | Recipient address whose snapshot is synchronised. |
Events
AdjustmentBalanceSet
event AdjustmentBalanceSet(address indexed operator, uint256 factor, uint8 decimals)
Emitted when an immediate balance adjustment is applied.
Parameters
| Name | Type | Description |
|---|---|---|
operator indexed | address | Address that triggered the adjustment. |
| factor | uint256 | Numerator of the adjustment ratio. |
| decimals | uint8 | Denominator exponent; effective ratio = factor / 10^decimals. |
BalanceAdjustmentsInitialized
event BalanceAdjustmentsInitialized()
Emitted once when the balance adjustment capability is initialised on a token.
Fires exclusively from initializeBalanceAdjustments after the storage write succeeds.
Errors
AccountHasNoRole
error AccountHasNoRole(address account, bytes32 role)
Thrown when an account does not hold a required role.
Parameters
| Name | Type | Description |
|---|---|---|
| account | address | The account that lacks the role. |
| role | bytes32 | The 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
| Name | Type | Description |
|---|---|---|
| configId | bytes32 | Resolver-proxy configuration whose operational status was checked. |
| versionId | uint256 | Configuration version whose operational status was checked. |
Deactivated
error Deactivated()
Thrown when an operation guarded by onlyActivated is attempted on a token whose deactivation flag has already been set.
DecimalsOverflow
error DecimalsOverflow()
Reverts when the cumulative decimals shift would overflow uint8.
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
| Name | Type | Description |
|---|---|---|
| facetId | bytes32 | Identifier of the offending facet. |
| lastVersion | uint256 | Last version recorded for that facet at the time of the check. |
FactorIsZero
error FactorIsZero()
Reverts when factor is zero, which would zero-out all holder balances.
FactorOverflow
error FactorOverflow()
Reverts when the proposed factor would overflow the cumulative ABAF.
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).
TotalSupplyOverflow
error TotalSupplyOverflow()
Reverts when the proposed factor would overflow the projected total supply.
UnexpectedError
error UnexpectedError(bytes4 _errorId)
Reverts when an unreachable validation state is detected.
Replaces assertions for defensive handling of logically impossible states.
Parameters
| Name | Type | Description |
|---|---|---|
| _errorId | bytes4 | Identifier of the unexpected validation condition. |
UnrecognizedResolverProxyVersion
error UnrecognizedResolverProxyVersion(bytes8 _resolverProxyVersion)
Thrown when the provided proxy version does not match any BLR compatible standard.
Parameters
| Name | Type | Description |
|---|---|---|
| _resolverProxyVersion | bytes8 | proxy version that is not compatible with the BLR. |
WalletRecovered
error WalletRecovered()
Thrown when attempting to recover a wallet that has already been recovered.