Function: assertLiquidityFunding()
assertLiquidityFunding(
operation:string,chain:EVMChain,poolAddress:string,account:string,amount:bigint):Promise<void>
Defined in: cct/evm/token-pool/contracts.ts:754
Pre-flights a provideLiquidity deposit against the rebalancer's ERC-20 position: it must hold
amount of the pool's token and have approved the pool to pull it, since the pool deposits
with safeTransferFrom.
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 deposited into. |
account | string | The depositing rebalancer. |
amount | bigint | Deposit amount, in the token's smallest unit. |
Returns
Promise<void>
Remarks
Cross-family parity with Solana, whose provideLiquidity likewise refuses to build
without the SPL delegation (validateDelegation) and the balance behind it. Without this the
only signal is an ERC20InsufficientAllowance revert at wallet-confirmation time, naming
neither the token to approve nor the pool to approve it to. The error names approveToken,
which grants exactly this allowance.
Throws
CCTTxFailedError if account holds less than amount, or has approved the
pool for less than amount