Skip to main content
Version: 1.15.0

Function: assertAdvancedPoolHooksContract()

assertAdvancedPoolHooksContract(chain: EVMChain, address: string): Promise<void>

Defined in: cct/evm/advanced-pool-hooks/contracts.ts:234

Pre-flights an address a pool is about to be bound to, confirming it really is an AdvancedPoolHooks, in one eth_call.

Parameters​

ParameterTypeDescription
chainEVMChainChain to probe the address on.
addressstringCandidate hooks contract; must be non-zero (callers skip this for a detach).

Returns​

Promise<void>

Remarks​

The pool accepts any address unchecked, so a mis-pasted one succeeds and only then does every transfer start reverting, far from the cause. Exact match on the type (so a bespoke IAdvancedPoolHooks is rejected); the version is not checked, so 2.1.0 still binds.

Throws​

CCTContractTypeInvalidError if the address reports no typeAndVersion (an EOA or a non-CCIP contract) or reports a type other than AdvancedPoolHooks