Skip to main content

Developers

Hook Policies

The Verified Pools hook contract utilizes different policies for the different hook actions when interacting with liquidity (beforeSwap, beforeAddLiquidity, beforeRemoveLiquidity, beforeDonate). Each of these policies implements the following interface:

interface IHookPolicy {
function verify(address sender, bytes calldata data) external view returns (bool);
}

The `data` argument refers to the `hookData` passed to the transaction. All the current policies do not utilize this value, and so the empty bytes or “” should be used.

It is possible to query the hook contract either onchain or offchain to establish whether a given user is verified to interact with the pools.

The address of the currently active policy for each hook action can be obtained by calling the hook contract directly.

TODO: Add an example for querying the hook for a given policy contract and calling the policy's verify function.