Skip to main content
Version: 1.15.0

Function: assertPolicyEngineContract()

assertPolicyEngineContract(operation: string, param: string, chain: EVMChain, policyEngine: string): Promise<void>

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

Pre-flights a non-zero policy engine address to ensure it has deployed code.

Parameters​

ParameterTypeDescription
operationstringOperation name for error context.
paramstringPolicy engine parameter name for error context.
chainEVMChain-
policyEnginestring-

Returns​

Promise<void>

Remarks​

Code presence rejects EOAs, whose attach() call otherwise succeeds as a no-op. The update itself verifies only attach() (and the old engine's detach()); run() is first called during a transfer, so callers remain responsible for supplying a compatible policy engine.

Throws​

CCTParamsInvalidError if the address has no deployed code.