Skip to main content

BatchBurn

Asset Tokenization Studio Team

BatchBurn

Abstract implementation of IBatchBurn that burns tokens from multiple addresses in a single, atomic transaction.

Caller must hold ROLE_CONTROLLER or ROLE_AGENT. The token must be unpaused and configured for a single partition. Delegates burn execution to TokenCoreOps and emits IControllerTypes.ControllerRedemption for each address processed. Intended to be inherited by BatchBurnFacet.

Methods​

batchBurn​

function batchBurn(address[] _userAddresses, uint256[] _amounts) external nonpayable

Burns tokens from multiple addresses in a single transaction.

Caller must hold ROLE_CONTROLLER or ROLE_AGENT. The token must not be paused and must not be configured for multi-partition. Emits IController.ControllerRedemption for each address processed.

Parameters​

NameTypeDescription
_userAddressesaddress[]Addresses from which tokens will be burnt.
_amountsuint256[]Corresponding token amounts to burn. Must be the same length as _userAddresses.

initializeBatchBurn​

function initializeBatchBurn() external nonpayable

Initialises the batch burn capability on the token.

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

Events​

BatchBurnInitialized​

event BatchBurnInitialized()

Emitted once when the batch burn capability is initialised on a token.

Fires exclusively from initializeBatchBurn after the storage write succeeds.

ControllerRedemption​

event ControllerRedemption(address controller, address indexed tokenHolder, uint256 value, bytes data, bytes operatorData)

Emitted when an authorised controller redeems (burns) tokens on behalf of a holder.

Parameters​

NameTypeDescription
controlleraddressThe address of the controller that initiated the redemption.
tokenHolder indexedaddressThe account whose tokens are redeemed.
valueuint256The amount of tokens redeemed.
databytesOptional data attached to the redemption for validation.
operatorDatabytesOptional data attached by the controller for event attribution.

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.

AccountHasNoRoles​

error AccountHasNoRoles(address account, bytes32[] roles)

Thrown when an account does not hold any of the specified roles.

Parameters​

NameTypeDescription
accountaddressThe account that lacks the roles.
rolesbytes32[]The roles that are 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​

NameTypeDescription
configIdbytes32Resolver-proxy configuration whose operational status was checked.
versionIduint256Configuration 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.

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.

InputAmountsArrayLengthMismatch​

error InputAmountsArrayLengthMismatch()

Thrown when the lengths of two input amount arrays do not match.

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).

NotAllowedInMultiPartitionMode​

error NotAllowedInMultiPartitionMode()

Thrown when a single-partition operation is attempted on a multi-partition token.

TokenIsNotControllable​

error TokenIsNotControllable()

Thrown when an operation requires the token to be controllable but it is not.

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.