Skip to main content
Version: 1.15.0

Class: TransferLiquidity

Defined in: cct/evm/token-pool/operations/transfer-liquidity.ts:156

Migrates liquidity from an older LockRelease pool into this one (v1.5.0–v1.6.1). Owner-only.

Extends​

Constructors​

Constructor​

new TransferLiquidity(): TransferLiquidity

Returns​

TransferLiquidity

Inherited from​

EVMOperation<TransferLiquidityParams>.constructor

Properties​

name​

readonly name: "transferLiquidity" = 'transferLiquidity'

Defined in: cct/evm/token-pool/operations/transfer-liquidity.ts:157

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

Overrides​

EVMOperation.name

Methods​

buildUnsigned()​

protected buildUnsigned(chain: EVMChain, params: TransferLiquidityParams): Promise<UnsignedEVMTx>

Defined in: cct/evm/token-pool/operations/transfer-liquidity.ts:203

Resolves the destination pool's type/version, floor-matches the encoder, then pre-flights what the two pools decide: assertSourcePool for everything about from, and sender (when given) owning the destination pool.

Parameters​

ParameterType
chainEVMChain
paramsTransferLiquidityParams

Returns​

Promise<UnsignedEVMTx>

Remarks​

Both live here, not in execute, so the offline / multisig path gets them too. Getting the rebalancer wiring wrong is this op's most likely failure, and would otherwise surface as an Unauthorized revert from a nested call.

Throws​

CCTContractTypeInvalidError if either pool is a BurnMint pool, or the destination is siloed

Throws​

CCTOperationUnsupportedError on a v2.0.0 destination pool, which escrows through an ERC20LockBox instead

Throws​

CCTParamsInvalidError if amount is MaxUint256 on a v1.5.x pool or from a siloed source, from is a v2.0.0 pool, the pools escrow different tokens, from does not have the destination pool as its rebalancer, or sender is given and does not own the destination pool

Throws​

CCTTxFailedError if from's withdrawable liquidity is below amount

Throws​

CCTContractVersionUnsupportedError if the pool reports an unknown version

Overrides​

EVMOperation.buildUnsigned


execute()​

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

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

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

Parameters​

ParameterType
chainEVMChain
paramsEVMExecuteParams<TransferLiquidityParams>

Returns​

Promise<TransactionResult>

Inherited from​

EVMOperation.execute


generate()​

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

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

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

Parameters​

ParameterType
chainEVMChain
paramsTransferLiquidityParams

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: TransferLiquidityParams): TransferLiquidityParams

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
paramsTransferLiquidityParams

Returns​

TransferLiquidityParams

Inherited from​

EVMOperation.parse


prepare()​

protected prepare(params: TransferLiquidityParams): TransferLiquidityParams

Defined in: cct/operation.ts:48

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

Parameters​

ParameterType
paramsTransferLiquidityParams

Returns​

TransferLiquidityParams

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: TransferLiquidityParams): void

Defined in: cct/evm/token-pool/operations/transfer-liquidity.ts:173

Validates both pool addresses and the amount before any RPC. from must differ from poolAddress: a pool is never its own rebalancer, so a self-transfer can only revert.

Parameters​

ParameterType
__namedParametersTransferLiquidityParams

Returns​

void

Overrides​

EVMOperation.validate