Function: assertPoolLiquidity()
assertPoolLiquidity(
operation:string,chain:EVMChain,poolAddress:string,type:"BurnMintTokenPool"|"BurnFromMintTokenPool"|"BurnWithFromMintTokenPool"|"BurnToAddressTokenPool"|"BurnMintWithLockReleaseFlagTokenPool"|"LockReleaseTokenPool"|"SiloedLockReleaseTokenPool",amount:bigint):Promise<void>
Defined in: cct/evm/token-pool/contracts.ts:792
Pre-flights a withdrawLiquidity against what the pool can pay out of: its own ERC-20 balance,
or on a SiloedLockReleaseTokenPool its unsiloed liquidity (readTokenPoolLiquidity).
Parameters
| Parameter | Type | Description |
|---|---|---|
operation | string | Operation name, for the error's operation field. |
chain | EVMChain | Chain to read from. |
poolAddress | string | LockRelease pool being withdrawn from. |
type | "BurnMintTokenPool" | "BurnFromMintTokenPool" | "BurnWithFromMintTokenPool" | "BurnToAddressTokenPool" | "BurnMintWithLockReleaseFlagTokenPool" | "LockReleaseTokenPool" | "SiloedLockReleaseTokenPool" | Pool type, as resolved by resolveTokenPool. |
amount | bigint | Withdrawal amount, in the token's smallest unit. |
Returns
Promise<void>
Remarks
Weaker than assertLiquidityFunding: a pool's balance moves with every CCIP transfer through it, so this catches "withdraw more than was ever provided" rather than proving the amount will still fit when the tx mines.
Throws
CCTTxFailedError if the pool's withdrawable liquidity is below amount