Class: ProvideLiquidity
Defined in: cct/evm/token-pool/operations/provide-liquidity.ts:65
Deposits tokens into a LockRelease pool as its rebalancer (v1.5.0–v1.6.1).
Extends
EVMOperation<ProvideLiquidityParams>
Constructors
Constructor
new ProvideLiquidity():
ProvideLiquidity
Returns
ProvideLiquidity
Inherited from
EVMOperation<ProvideLiquidityParams>.constructor
Properties
name
readonlyname:"provideLiquidity"='provideLiquidity'
Defined in: cct/evm/token-pool/operations/provide-liquidity.ts:66
camelCase id; matches the token-manager facade method and error context.
Overrides
EVMOperation.name
Methods
buildUnsigned()
protectedbuildUnsigned(chain:EVMChain,params:ProvideLiquidityParams):Promise<UnsignedEVMTx>
Defined in: cct/evm/token-pool/operations/provide-liquidity.ts:104
Resolves the pool's type/version, floor-matches the encoder, then confirms the pool takes
deposits at all and that sender (when given) is its rebalancer.
Parameters
| Parameter | Type |
|---|---|
chain | EVMChain |
params | ProvideLiquidityParams |
Returns
Promise<UnsignedEVMTx>
Remarks
The v1.5.x canAcceptLiquidity() read is a property of the pool, not of the caller,
so it runs first: i_acceptLiquidity is set immutable in the constructor, so a pool
deployed with it false reverts every provideLiquidity for its whole lifetime and no
choice of sender helps. v1.6.x pools have no flag and always accept.
Throws
CCTContractTypeInvalidError if the pool is a BurnMint pool
Throws
CCTOperationUnsupportedError on a v2.0.0 pool, which escrows through an
ERC20LockBox instead
Throws
CCTParamsInvalidError if the pool cannot accept liquidity, or sender is
given and is not the pool's rebalancer
Throws
CCTTxFailedError if sender holds, or has approved the pool for, less than
amount
Throws
CCTContractVersionUnsupportedError if the pool reports an unknown version
Overrides
EVMOperation.buildUnsigned
execute()
execute(
chain:EVMChain,params:EVMExecuteParams<ProvideLiquidityParams>):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<ProvideLiquidityParams> |
Returns
Promise<TransactionResult>
Inherited from
EVMOperation.execute
generate()
generate(
chain:EVMChain,params:ProvideLiquidityParams):Promise<UnsignedEVMTx>
Defined in: cct/evm/operation.ts:110
Run prepare and buildUnsigned, applying optional sender; no signing.
Parameters
| Parameter | Type |
|---|---|
chain | EVMChain |
params | ProvideLiquidityParams |
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
prepare()
protectedprepare(params:ProvideLiquidityParams):ProvideLiquidityParams
Defined in: cct/evm/token-pool/operations/provide-liquidity.ts:78
Validates the pool address and amount before any RPC; a zero amount moves nothing.
Parameters
| Parameter | Type |
|---|---|
params | ProvideLiquidityParams |
Returns
Overrides
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