Skip to main content
Version: 1.11.0

Function: simulateLockOrBurn()

simulateLockOrBurn(opts: SimulateLockOrBurnOpts): Promise<{ destPoolData: string; destTokenAddress: string; destTokenAmount: bigint; poolInterface: PoolInterfaceVersion; }>

Defined in: evm/simulate.ts:371

Simulate the source pool's lockOrBurn to obtain destPoolData (the value the destination releaseOrMint consumes as sourcePoolData) and destTokenAmount — the post-fee amount the OnRamp writes into the emitted message (TokenTransferV1.amount), which for fee-charging IPoolV2 pools differs from the input amount. Needed for any destination check that must match the real message (every base-TokenPool pool returns abi.encode(uint256(localDecimals)) and deducts its configured bps fee, if any).

Note this is a superset of "fetch destPoolData": it also exercises the source pool's _validateLockOrBurn gates (onRamp check, allowlist, outbound rate limit, finality gate), so a revert here may equally indicate a source-side block.

Parameters

ParameterTypeDescription
optsSimulateLockOrBurnOptsSimulateLockOrBurnOpts

Returns

Promise<{ destPoolData: string; destTokenAddress: string; destTokenAmount: bigint; poolInterface: PoolInterfaceVersion; }>

pool interface used, destTokenAddress and destPoolData as returned by the pool, and destTokenAmount (post-fee for IPoolV2; the legacy 1-arg overload never deducts, so it equals input.amount there)

Throws

CCIPContractTypeInvalidError if the pool supports neither IPoolV2 nor CCIP_POOL_V1

Throws

CCIPArgumentInvalidError if tokenArgs is non-empty for an IPoolV1 pool (the OnRamp would revert TokenArgsNotSupportedOnPoolV1)

Throws

The raw eth_call provider error on any revert