Class: GrantMintAndBurnRoles
Defined in: cct/evm/token/operations/grant-mint-and-burn-roles.ts:34
Grants both mint and burn roles on a supported CCT token.
Extends
EVMOperation<GrantMintAndBurnRolesParams>
Constructors
Constructor
new GrantMintAndBurnRoles():
GrantMintAndBurnRoles
Returns
GrantMintAndBurnRoles
Inherited from
EVMOperation<GrantMintAndBurnRolesParams>.constructor
Properties
name
readonlyname:"grantMintAndBurnRoles"='grantMintAndBurnRoles'
Defined in: cct/evm/token/operations/grant-mint-and-burn-roles.ts:35
camelCase id; matches the token-manager facade method and error context.
Overrides
EVMOperation.name
Methods
buildUnsigned()
protectedbuildUnsigned(chain:EVMChain,params:GrantMintAndBurnRolesParams):Promise<UnsignedEVMTx>
Defined in: cct/evm/token/operations/grant-mint-and-burn-roles.ts:65
Reads both role states, then — when sender is known — confirms it owns the token.
Rejected only when the account holds both roles already: holding one still builds, since
completing the pair is what this call is for.
The role reads run first because they are also the family check (resolveTokenRoleHandler), which
owner() cannot make: a token pool and a v2.0.0 CrossChainToken declare owner() too, and
v2.0.0 declares grantMintAndBurnRoles itself. Both checks run here rather than in
execute, so the offline / multisig path gets them.
Parameters
| Parameter | Type |
|---|---|
chain | EVMChain |
params | GrantMintAndBurnRolesParams |
Returns
Promise<UnsignedEVMTx>
Throws
CCTContractTypeInvalidError if tokenAddress is neither a BurnMintERC677 token
nor a supported CrossChainToken
Throws
CCTContractVersionUnsupportedError if CrossChainToken reports an unsupported version
Throws
CCTParamsInvalidError if burnAndMinter already holds both roles, or sender
lacks the version's role-admin permission
Overrides
EVMOperation.buildUnsigned
execute()
execute(
chain:EVMChain,params:EVMExecuteParams<GrantMintAndBurnRolesParams>):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<GrantMintAndBurnRolesParams> |
Returns
Promise<TransactionResult>
Inherited from
EVMOperation.execute
generate()
generate(
chain:EVMChain,params:GrantMintAndBurnRolesParams):Promise<UnsignedEVMTx>
Defined in: cct/evm/operation.ts:110
Run prepare and buildUnsigned, applying optional sender; no signing.
Parameters
| Parameter | Type |
|---|---|
chain | EVMChain |
params | GrantMintAndBurnRolesParams |
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:GrantMintAndBurnRolesParams):GrantMintAndBurnRolesParams
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 | GrantMintAndBurnRolesParams |
Returns
Inherited from
EVMOperation.parse
prepare()
protectedprepare(params:GrantMintAndBurnRolesParams):GrantMintAndBurnRolesParams
Defined in: cct/operation.ts:48
validate then parse — the single pre-RPC step, before any chain access.
Parameters
| Parameter | Type |
|---|---|
params | GrantMintAndBurnRolesParams |
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:GrantMintAndBurnRolesParams):void
Defined in: cct/evm/token/operations/grant-mint-and-burn-roles.ts:44
Validates both addresses before any RPC. Neither may be zero: a tx to 0x0 hits no code, and
granting roles to 0x0 mines as a no-op nobody can use.
Parameters
| Parameter | Type |
|---|---|
__namedParameters | GrantMintAndBurnRolesParams |
Returns
void
Overrides
EVMOperation.validate