Skip to main content

MintFacet

Asset Tokenization Studio Team

MintFacet

Diamond facet exposing the consolidated token issuance entry points.

Registers four selectors: initializeERC1594, isIssuable, issue and mint. Inherits the business logic from the Mint abstract contract.

Methods​

disableIssuance​

function disableIssuance() external nonpayable

Permanently disables issuance of new tokens.

Restricted to DEFAULT_ADMIN_ROLE. Sets the issuance flag to false and emits IssuanceDisabled. Reverts if issuance has already been disabled.

finalizeIssuance​

function finalizeIssuance() external nonpayable

Permanently finalizes issuance of new tokens.

Restricted to DEFAULT_ADMIN_ROLE. Sets the issuance flag to false and emits IssuanceFinalized. Reverts if issuance has already been disabled.

getStaticFunctionSelectors​

function getStaticFunctionSelectors() external pure returns (bytes4[])

Gets all function selectors of a facet

Returns​

NameTypeDescription
_0bytes4[]Face functions selectors

getStaticInterfaceIds​

function getStaticInterfaceIds() external pure returns (bytes4[])

Gets all interfaces ids of a facet.

Returns​

NameTypeDescription
_0bytes4[]Face interface ids

getStaticResolverKey​

function getStaticResolverKey() external pure returns (bytes32 staticResolverKey_)

Gets the static resolver key

Returns​

NameTypeDescription
staticResolverKey_bytes32Static resolver key

initializeERC1594​

function initializeERC1594() external nonpayable

Initialises the ERC-1594 StorageWrapper on the calling contract.

Can only be invoked once per contract; subsequent calls revert via onlyFacetNotRegistered.

isIssuable​

function isIssuable() external view returns (bool)

Returns whether further issuance is permitted for this security.

Once a token returns false it must never return true again. Implementations read the issuance flag maintained by ERC1594StorageWrapper.

Returns​

NameTypeDescription
_0boolTrue while new tokens may still be issued or minted.

issue​

function issue(address _tokenHolder, uint256 _value, bytes _data) external nonpayable

Issues new tokens to a token holder under the ERC-1594 semantics.

Restricted to issuer or agent roles. Increases the total supply and emits IERC1594.Issued. Only callable in single-partition mode and when the token is unpaused; the destination must pass identity and compliance checks.

Parameters​

NameTypeDescription
_tokenHolderaddressRecipient of the newly issued tokens.
_valueuint256Amount of tokens to issue, denominated in base units.
_databytesArbitrary data forwarded alongside the issuance for off-chain consumers.

mint​

function mint(address _to, uint256 _amount) external nonpayable

Mints new tokens to a recipient under the ERC-3643 semantics.

Behaves as a thin alias over issue with an empty data payload. Restricted to issuer or agent roles and subject to the same pause, supply, identity and compliance constraints. Emits IERC1594.Issued.

Parameters​

NameTypeDescription
_toaddressRecipient of the newly minted tokens.
_amountuint256Amount of tokens to mint, denominated in base units.

Events​

ERC1594Initialized​

event ERC1594Initialized()

/**Emitted once when the ERC-1594 capability is initialised on a token.

Fires exclusively from initializeERC1594 after the storage write succeeds.

IssuanceDisabled​

event IssuanceDisabled(address indexed operator)

Emitted when token issuance is disabled.

Parameters​

NameTypeDescription
operator indexedaddressAccount that disabled issuance.

IssuanceFinalized​

event IssuanceFinalized(address indexed operator)

Emitted when token issuance is finalized.

Parameters​

NameTypeDescription
operator indexedaddressAccount that finalized issuance.

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.

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.