Determine which Uniswap v4 hook callbacks a pool can invoke

A hook contract exposing a method with the right name does not automatically receive that callback. The reference v4 manager uses permission bits encoded in the hook address.

Decode bits from the pool key’s actual hook address

Take the uint160 address from the verified pool key and apply the Hooks library masks. For example the beforeSwap bit is 0x80. Check return-delta permissions separately from callback permissions and use the correct masks for the deployed implementation.

beforeSwap flag = 1 << 7
(addressBits & 0x80) != 0 → beforeSwap permission bit set

A contract ABI containing beforeSwap with this bit clear does not make the standard manager call it for ordinary swaps. Conversely, a set bit requires investigation of the actual implementation and callback return behavior.

Avoid using permissions as a safety verdict

The bits select callbacks; they do not describe what the implementation does with them or what data it accepts. Inspect the code and any upgrade path, and simulate the intended call with its hookData and relevant pool state. github.com Hooks.sol