Skip to main content
Version: 1.15.0

Class: WithdrawSiloedLiquidity

Defined in: cct/evm/token-pool/operations/withdraw-siloed-liquidity.ts:72

Withdraws tokens from one lane's silo to its rebalancer (v1.6.0–v1.6.1).

Extends​

Constructors​

Constructor​

new WithdrawSiloedLiquidity(): WithdrawSiloedLiquidity

Returns​

WithdrawSiloedLiquidity

Inherited from​

EVMOperation<WithdrawSiloedLiquidityParams>.constructor

Properties​

name​

readonly name: "withdrawSiloedLiquidity" = 'withdrawSiloedLiquidity'

Defined in: cct/evm/token-pool/operations/withdraw-siloed-liquidity.ts:73

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

Overrides​

EVMOperation.name

Methods​

buildUnsigned()​

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

Defined in: cct/evm/token-pool/operations/withdraw-siloed-liquidity.ts:122

Resolves the pool's type/version, floor-matches the encoder, confirms the lane is siloed and that sender (when given) is its rebalancer, then pre-flights the silo's balance.

Parameters​

ParameterType
chainEVMChain
paramsWithdrawSiloedLiquidityParams

Returns​

Promise<UnsignedEVMTx>

Remarks​

The lane check runs with or without sender, and first, for the reason given on ProvideSiloedLiquidity.buildUnsigned. The checks live here, not in execute, so the offline / multisig path gets them too.

Throws​

CCTContractTypeInvalidError if the pool is not a SiloedLockReleaseTokenPool

Throws​

CCTOperationUnsupportedError on a v2.0.0 pool, which escrows through per-lane lockboxes instead

Throws​

CCTParamsInvalidError if the lane is not siloed, or sender is given and is not the silo's rebalancer

Throws​

CCTTxFailedError if the silo holds less than amount

Throws​

CCTContractVersionUnsupportedError if the pool reports an unknown version

Overrides​

EVMOperation.buildUnsigned


execute()​

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

Defined in: cct/evm/token-pool/operations/withdraw-siloed-liquidity.ts:150

Signs and submits as the silo's rebalancer, defaulting sender to the signing wallet: the only address that can satisfy buildUnsigned's rebalancer check for a broadcast tx, and the address the tokens are sent to. See EVMOperation.resolveWalletSender for why a divergent sender is rejected rather than signed.

Parameters​

ParameterType
chainEVMChain
paramsEVMExecuteParams<WithdrawSiloedLiquidityParams>

Returns​

Promise<TransactionResult>

Throws​

CCIPWalletInvalidError if wallet is not a valid signer

Throws​

CCTParamsInvalidError if sender is given and is not the wallet's address, or the wallet is not the silo's rebalancer

Throws​

CCIPExecTxRevertedError if the tx reverts on-chain, e.g. InsufficientLiquidity

Overrides​

EVMOperation.execute


generate()​

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

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

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

Parameters​

ParameterType
chainEVMChain
paramsWithdrawSiloedLiquidityParams

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

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
paramsWithdrawSiloedLiquidityParams

Returns​

WithdrawSiloedLiquidityParams

Inherited from​

EVMOperation.parse


prepare()​

protected prepare(params: WithdrawSiloedLiquidityParams): WithdrawSiloedLiquidityParams

Defined in: cct/operation.ts:48

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

Parameters​

ParameterType
paramsWithdrawSiloedLiquidityParams

Returns​

WithdrawSiloedLiquidityParams

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

Defined in: cct/evm/token-pool/operations/withdraw-siloed-liquidity.ts:88

Validates the pool, lane and amount before any RPC. Lane 0 and a zero amount both revert on-chain (ChainNotSiloed, LiquidityAmountCannotBeZero).

Parameters​

ParameterType
__namedParametersWithdrawSiloedLiquidityParams

Returns​

void

Overrides​

EVMOperation.validate