Custom pricing hook on Base
Uniswap v4 Hook Contract 0xf4b67452c04017c706bec809f39209f770ef28cc on Base · Custom pricing
- Volume (24h)
- $0
- Value locked (TVL)
- $0
- All-time volume
- $0
- Pools using this hook
- 1
- Swaps (24h)
- 4 (2 traders)
- Total swaps
- 4
What it does
This hook charges swaps through a dynamic fee and routes part of the value to configured sinks or a buyback, with fee-exempt addresses treated differently, though the exact fee amounts and which trades pay more or less cannot be confirmed from the decoded bytecode.
How it works step by step
- Implements beforeInitialize to record a creator for each pool key and store it in a per-pool-id mapping at storage slot 0 (creatorOf(bytes32) reads it).
- Implements beforeSwap and afterSwap with return-delta permissions, so the hook can alter the amount a swap consumes and the delta it settles.
- Implements beforeAddLiquidity to gate or inspect liquidity additions made through the hook.
- Uses dynamic-fee tagging, indicating the hook can influence the fee applied to swaps rather than relying on the pool's static fee.
- Maintains registries of contract addresses (slots 1-3, 7), per-address fee-exemption flags (slot 6), and context-source flags (slots 4-5) that control which callers and trades are treated specially.
- Interacts with the pool manager via take(address,address,uint256) and extsload, and moves currency using balanceOf/take calls, with a buyback address and sinks referenced in storage.
- Swap behaviour
- Swaps pass through beforeSwap and afterSwap, both of which can return deltas that modify settlement; exact fee treatment depends on fee-exempt status and the sink/buyback routing, which cannot be fully determined from decoded bytecode.
- Liquidity behaviour
- beforeAddLiquidity is enabled and runs before liquidity is added; no removal hook is enabled, so removals are not intercepted by the hook.
- Fee behaviour
- Dynamic fee tagged by heuristics; fee-exempt addresses (feeExempt mapping) appear to be treated differently, and value is routed to sinks or a buyback address. The exact fee formula is not identifiable from decoded bytecode.
- Owner & admin controls
- An owner() function exists with NotOwner errors, so owner-restricted functions exist: setFeeExempt, setSink, setContextSource, setBuyback, and setCreator. Owner can change fee exemptions, routing sinks, the buyback address, and context sources. No pause or upgrade mechanism was identified.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeAddLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeInitialize records pool creator metadata; beforeAddLiquidity gates or inspects liquidity additions; beforeSwap and afterSwap take or modify currency via return deltas and route value to sinks/buyback; beforeSwapReturnDelta and afterSwapReturnDelta allow the hook to alter swap amounts.
Security & trust assessment
Risk level: high, estimated (decoded bytecode, low confidence).
Who controls it: The owner key can redirect swap value to chosen sinks or a buyback address, grant fee exemptions to favoured addresses, and change context sources that affect how swaps are handled.
Risk to user funds: The hook takes currency from swaps via return deltas and take calls, so it can hold or divert part of user swap amounts before settlement to the pool or configured sinks.
Security findings
- [high] Return-delta swap control: beforeSwapReturnDelta and afterSwapReturnDelta are enabled and the hook moves currency via take, so it can alter the amounts users receive or pay on swaps.
- [medium] Owner-controlled routing and exemptions: Owner can set sinks, buyback address, fee-exempt addresses and context sources, which can redirect value or change fees applied to specific traders.
- [medium] Unverified source: No verified source is available, so the exact fee formula, sink logic and gating conditions cannot be audited and are inferred only from selectors and storage.
Contract details
- Verified source
- No
- Bytecode size
- 19,743 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, moves-currency, ownable, return-delta
Pools using Custom pricing hook
- QUANT / FLASH (Dynamic fee) — 24h volume $0, TVL $0, 4 swaps today