Skip to main content

BatchMint

Asset Tokenization Studio Team

BatchMint

Abstract contract implementing the batchMint operation for the ERC-3643 standard.

Provides a single external onlyOperational function, batchMint, which issues tokens to an ordered list of recipients in a single transaction. The function enforces two sequential passes: a validation pass (identity, compliance, and cap checks for every address) followed by an issuance pass (calling TokenCoreOps.issue for each). Inherits modifier guards from Modifiers and is intended to be used only through the BatchMintFacet Diamond facet.

Methods​

batchMint​

function batchMint(address[] _toList, uint256[] _amounts) external nonpayable

Batch mint tokens to multiple addresses.

Iterates over _toList and _amounts in two passes: first validates identity, compliance, and cap constraints for every recipient, then issues tokens to each address via ERC1594StorageWrapper.issue. Reverts if the token is paused, if the arrays differ in length, if the caller lacks the issuer or agent role, if a recipient fails identity or compliance checks, or if any single mint would exceed the maximum supply. Restricted to non-multi-partition tokens.

Parameters​

NameTypeDescription
_toListaddress[]Ordered list of recipient addresses.
_amountsuint256[]Ordered list of token amounts corresponding to each recipient.

initializeBatchMint​

function initializeBatchMint() external nonpayable

Initialises the batch mint capability on the token.

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

Events​

BatchMintInitialized​

event BatchMintInitialized()

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

Fires exclusively from initializeBatchMint after the storage write succeeds.

Issued​

event Issued(address indexed operator, address indexed to, uint256 value, bytes data)

Emitted when new tokens are issued to a holder.

Parameters​

NameTypeDescription
operator indexedaddressAccount that invoked the issuance (issuer or agent).
to indexedaddressRecipient of the newly issued tokens.
valueuint256Amount of tokens issued, denominated in base units.
databytesArbitrary payload forwarded alongside the issuance.

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

IssuanceIsDisabled​

error IssuanceIsDisabled()

Thrown when an issuance operation is attempted after issuance has been permanently disabled.

MaxSupplyReached​

error MaxSupplyReached(uint256 maxSupply)

Thrown when a mint would cause the total supply to exceed the global maximum.

Parameters​

NameTypeDescription
maxSupplyuint256The current global maximum supply.

NotAllowedInMultiPartitionMode​

error NotAllowedInMultiPartitionMode()

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

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.