Skip to main content
Version: 1.15.0

Class: Mint

Defined in: cct/evm/token/operations/mint.ts:35

Mints new supply of a token to an account. Gated on the mint role for recognized CCT tokens.

Extends​

Constructors​

Constructor​

new Mint(): Mint

Returns​

Mint

Inherited from​

EVMOperation<MintParams>.constructor

Properties​

name​

readonly name: "mint" = 'mint'

Defined in: cct/evm/token/operations/mint.ts:36

camelCase id; matches the token-manager facade method and error context.

Overrides​

EVMOperation.name

Methods​

buildUnsigned()​

protected buildUnsigned(chain: EVMChain, __namedParameters: MintParams): Promise<UnsignedEVMTx>

Defined in: cct/evm/token/operations/mint.ts:67

Confirms sender holds the token's mint role before encoding, for a recognized CCT token.

Gated on the mint role, not owner(): mint is role-gated (onlyMinter on v1, MINTER_ROLE on v2), and the owner is only the role admin, who need not hold the role. The role is resolved version-aware — isMinter(sender) on a v1 BurnMintERC677, hasRole(MINTER_ROLE, sender) on a v2.0.0 CrossChainToken — via resolveTokenRoleHandler (resolveToken picks the version). It runs here rather than in execute so the offline / multisig path is gated too. A mint past a capped token's maxSupply is not pre-flighted.

For a token the SDK does not recognize (one that declares neither isMinter nor hasRole) the pre-flight is skipped and the mint is built best-effort — the chain enforces the role at broadcast.

Parameters​

ParameterType
chainEVMChain
__namedParametersMintParams

Returns​

Promise<UnsignedEVMTx>

Throws​

CCTParamsInvalidError if sender is given and does not hold the mint role of a recognized CCT token

Overrides​

EVMOperation.buildUnsigned


execute()​

execute(chain: EVMChain, params: EVMExecuteParams<MintParams>): Promise<TransactionResult>

Defined in: cct/evm/operation.ts:150

generate, then sign and submit; returns the confirmed tx hash.

Parameters​

ParameterType
chainEVMChain
paramsEVMExecuteParams<MintParams>

Returns​

Promise<TransactionResult>

Inherited from​

EVMOperation.execute


generate()​

generate(chain: EVMChain, params: MintParams): Promise<UnsignedEVMTx>

Defined in: cct/evm/operation.ts:110

Run prepare and buildUnsigned, applying optional sender; no signing.

Parameters​

ParameterType
chainEVMChain
paramsMintParams

Returns​

Promise<UnsignedEVMTx>

Remarks​

Also pins every built transaction to chain.network.chainId (no RPC, known at construction). This is the one point every CCT builder and both execute paths pass through; unpinned, ethers would infer the chain from the eventual signer's provider.

Inherited from​

EVMOperation.generate


parse()​

protected parse(params: MintParams): MintParams

Defined in: cct/operation.ts:42

Normalize validated params for the builder — defaults, conversions, derived values. Identity by default, so an op that needs no normalization declares nothing.

Parameters​

ParameterType
paramsMintParams

Returns​

MintParams

Inherited from​

EVMOperation.parse


prepare()​

protected prepare(params: MintParams): MintParams

Defined in: cct/operation.ts:48

validate then parse — the single pre-RPC step, before any chain access.

Parameters​

ParameterType
paramsMintParams

Returns​

MintParams

Inherited from​

EVMOperation.prepare


resolveWalletSender()​

protected resolveWalletSender(wallet: unknown, sender?: string): Promise<string>

Defined in: cct/evm/operation.ts:130

Resolves the address a signed submission is authorized against: the signing wallet's own. The chain gates on msg.sender, and submit clears any builder-set tx.from before populating the tx (so ethers' own from/signer guard never fires) — an explicit sender that differs from the wallet would therefore let an op's pre-tx checks authorize one address while a different one actually signs, passing every local guard and reverting on-chain. Ops that gate on an on-chain role call this from execute; build with generateUnsigned* instead when the eventual signer isn't known yet, where sender is trusted as given.

Parameters​

ParameterType
walletunknown
sender?string

Returns​

Promise<string>

Throws​

CCIPWalletInvalidError if wallet is not a valid signer

Throws​

CCTParamsInvalidError if sender is given and is not the wallet's address

Inherited from​

EVMOperation.resolveWalletSender


validate()​

protected validate(__namedParameters: MintParams): void

Defined in: cct/evm/token/operations/mint.ts:45

Validates the token, recipient and amount before any RPC.

Parameters​

ParameterType
__namedParametersMintParams

Returns​

void

Remarks​

account is rejected as the zero address, which the token's own _mint reverts on (ERC20: mint to the zero address). A zero amount is not rejected: it mines successfully as a Transfer of nothing, and accepting it keeps this op's contract the token's own.

Throws​

CCTParamsInvalidError if any param is invalid

Overrides​

EVMOperation.validate