PredicateHook on Ethereum

Uniswap v4 Hook Contract 0xfffa86faf2704fe4ec0c3caa51b2f3a890732880 on Ethereum · Access control · Verified contract

Volume (24h)
$0
Value locked (TVL)
$0
All-time volume
$0
Pools using this hook
1
Swaps (24h)
0 (0 traders)
Total swaps
0

What it does

A Uniswap v4 pool hook that only lets through swaps carrying a valid Predicate authorization message and only lets allowlisted addresses add liquidity, while requiring a zero pool fee.

This read was written for the hook 0xa9ba…a880 on Ethereum and reused here: the two run the same code.

How it works step by step

  • Enforces a zero pool fee in beforeInitialize, reverting for any other fee.
  • Gates beforeSwap on an offchain Predicate authorization proof passed in hookData.
  • Lets allowlisted swappers bypass the Predicate check by router-reported msgSender.
  • Gates beforeAddLiquidity to allowlisted LPs by sender or router msgSender.
  • Exposes owner-only functions to manage allowlists, policy ID, Predicate manager and router.
Swap behaviour
beforeSwap checks whether the router's msgSender is on the swapper allowlist and skips the check if so; otherwise it decodes hookData into a Predicate message and reverts with PredicateAuthorizationFailed unless the Predicate service authorizes the swap against the configured policy. The hook applies no fee and no delta.
Liquidity behaviour
beforeAddLiquidity reverts unless the sender or the router's msgSender is an authorized LP. beforeRemoveLiquidity is not enabled, so removals are unrestricted by the hook.
Fee behaviour
Requires pool fee to be zero at initialization (reverts InvalidPoolFee otherwise); returns no fee override, so the pool's static fee of zero applies. No fee is taken or shared by the hook.
Owner & admin controls
Owner (Ownable2Step, two-step transfer and renounce available) can set the policy ID, set the Predicate manager address, set the router address, add or remove authorized LPs, and add or remove authorized swappers that bypass the Predicate check. No pause or upgrade mechanism found; contract is not a proxy.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeAddLiquidity, beforeSwap

beforeInitialize enforces zero pool fee. beforeAddLiquidity gates liquidity provision to allowlisted LPs. beforeSwap requires a valid Predicate authorization message in hookData unless the end user is on the swapper allowlist.

Security & trust assessment

Risk level: medium (verified source, high confidence).

Who controls it: The owner controls the allowlists of LPs and swappers, the Predicate service manager address, the policy ID and the router. Swapping the Predicate manager or policy changes which transactions are authorized, and adding an address to the swapper allowlist exempts it from the Predicate check entirely. The owner can also add LPs who can then deposit into gated pools.

Risk to user funds: The hook does not hold, move or take tokens (no return deltas enabled). It can block user swaps that lack a valid Predicate message and block liquidity additions from non-allowlisted addresses, so funds can be locked from interacting with the pool but are not directly seized.

Security findings

  • [medium] Owner can replace the authorization backend: The owner can change the Predicate manager and policy ID at any time, altering which swaps are accepted for all users of the pool.
  • [medium] Swapper allowlist bypasses authorization and depends on router: Addresses on isAuthorizedSwapper skip the Predicate check in beforeSwap, and the router's msgSender is used for this check, so a compromised or misconfigured router would bypass or misattribute authorization.
  • [medium] Router trust assumption: setRouter lets the owner point msgSender resolution at any contract; a malicious router could report any address as the sender and so grant allowlist access or LP rights.
  • [info] Single owner key, no timelock: Ownable2Step is used, so ownership transfer requires acceptance, reducing accidental transfer risk, but a single key still holds all privileges with no timelock.
  • [info] No direct fund custody: Hook takes no tokens and has no return-delta permissions, so it cannot hold or move pool funds; it can only block swaps and liquidity additions.

Contract details

Verified source
Yes (PredicateHook)
Compiler
solc 0.8.26+commit.8a97fa7a
Bytecode size
14,774 bytes
Upgradeable proxy
No
Detected patterns
ownable

Pools using PredicateHook