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
EVMOperation<MintParams>
Constructors
Constructor
new Mint():
Mint
Returns
Mint
Inherited from
EVMOperation<MintParams>.constructor
Properties
name
readonlyname:"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()
protectedbuildUnsigned(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
| Parameter | Type |
|---|---|
chain | EVMChain |
__namedParameters | MintParams |
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
| Parameter | Type |
|---|---|
chain | EVMChain |
params | EVMExecuteParams<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
| Parameter | Type |
|---|---|
chain | EVMChain |
params | MintParams |
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()
protectedparse(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
| Parameter | Type |
|---|---|
params | MintParams |
Returns
Inherited from
EVMOperation.parse
prepare()
protectedprepare(params:MintParams):MintParams
Defined in: cct/operation.ts:48
validate then parse — the single pre-RPC step, before any chain access.
Parameters
| Parameter | Type |
|---|---|
params | MintParams |
Returns
Inherited from
EVMOperation.prepare
resolveWalletSender()
protectedresolveWalletSender(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
| Parameter | Type |
|---|---|
wallet | unknown |
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()
protectedvalidate(__namedParameters:MintParams):void
Defined in: cct/evm/token/operations/mint.ts:45
Validates the token, recipient and amount before any RPC.
Parameters
| Parameter | Type |
|---|---|
__namedParameters | MintParams |
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