PredicateHook on Ethereum
Uniswap v4 Hook Contract 0x41837c10df7598a5517de2cf1c48e50ab8556880 on Ethereum · Access control · Verified contract
- Volume (24h)
- $0
- Value locked (TVL)
- $277
- All-time volume
- $0
- Pools using this hook
- 2
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 0
What it does
A compliance gate for a Uniswap v4 pool where swaps must carry a valid Predicate attestation and liquidity can only be added by allowlisted providers, with the owner managing policy and allowlists.
This read was written for the hook 0xd75a…6880 on Ethereum and reused here: the two run the same code.
How it works step by step
- Enforces a zero fee on the pool at initialization so the ghost pool carries no fee.
- Restricts beforeAddLiquidity to addresses in the authorized LP allowlist, reverting otherwise.
- Requires a valid Predicate policy attestation in hookData for each swap by non-allowlisted users.
- Lets allowlisted users bypass the predicate check for swaps.
- Provides owner-only functions to set policy ID, predicate manager, router and manage allowlists.
- Swap behaviour
- On each swap, the hook skips checks for allowlisted users (by router msgSender or sender); otherwise it decodes hookData into a Predicate message and verifies the attestation against the current policy, reverting with PredicateAuthorizationFailed if invalid. It returns a zero delta and zero fee override.
- Liquidity behaviour
- beforeAddLiquidity reverts unless the sender or router.msgSender() is an authorized LP. No remove-liquidity callbacks.
- Fee behaviour
- Uses the pool's static fee; the hook returns a zero LP fee override and takes no fees. The ghost pool must be initialized with zero fee (beforeInitialize reverts otherwise).
- Owner & admin controls
- Owner (Ownable) can set the policy ID, set the predicate manager (service manager) address, set the router, add or remove authorized LPs and authorized users, and renounce or transfer ownership. Owner-set policy and predicate manager determine which swaps are authorized.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeAddLiquidity, beforeSwap
beforeInitialize: enforces zero pool fee on initialization. beforeAddLiquidity: restricts liquidity addition to authorized LPs. beforeSwap: validates each swap against a Predicate attestation (policy-based compliance check), with bypass for authorized users.
Security & trust assessment
Risk level: medium (verified source, high confidence).
Who controls it: The owner controls the predicate manager, policy ID, router address and the allowlists. Changing the predicate manager or policy can change which swaps pass, and the owner can add themselves or others as authorized users to bypass checks. Owner can also reassign the router, which determines the msgSender used for authorization.
Risk to user funds: The hook does not hold tokens and returns zero deltas, so it cannot directly take user funds. It can block swaps (predicate failure, pause-like misconfiguration) and block liquidity additions for non-authorized LPs, but it cannot move pool funds.
Security findings
- [medium] Swaps depend on external Predicate attestation: Swaps are gated by an external Predicate service attestation; if the service manager or policy is misconfigured or the service is unavailable, legitimate swaps revert and the pool becomes unusable for non-authorized users.
- [medium] Owner can bypass compliance checks via allowlists and router: The owner can add addresses to isAuthorizedUser and isAuthorizedLP, allowing them to bypass the predicate policy on swaps and add liquidity, and can reassign the router whose msgSender() is used for authorization checks.
- [low] Trust in router and hookData fields: Authorization for swaps trusts the router-reported msgSender and the msgSender and msgValue fields decoded from user-supplied hookData, so the check depends on the honesty of the configured router.
- [info] Single-owner key control: Owner is set via Ownable with single-step transfer and renounceOwnership; loss of the key leaves policy and allowlists frozen, and renouncing removes the ability to update the policy or manager.
Contract details
- Verified source
- Yes (PredicateHook)
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Bytecode size
- 14,515 bytes
- Upgradeable proxy
- No
- Detected patterns
- ownable
Pools using PredicateHook
- wUSDL / USDC (0.00% fee) — 24h volume $0, TVL $277, 0 swaps today
- USDC / USDT (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today