Custom pricing hook on Base
Uniswap v4 Hook Contract 0x0efaa19a32df43693b97765d67c617ebec88e58b on Base · Custom pricing
- Volume (24h)
- $0
- Value locked (TVL)
- $0.02
- All-time volume
- $0
- Pools using this hook
- 1
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 0
What it does
This hook takes over part of swap and liquidity settlement using return deltas and an owner-adjustable fee, but without verified source it cannot be confirmed which trades pay more or less.
How it works step by step
- Uses beforeSwap with return deltas, so the hook can take over part of a swap's settlement instead of the pool's standard AMM path.
- Records per-pool and per-address amounts in a nested mapping (slot 1) during afterAddLiquidity and afterRemoveLiquidity, tracking debt rather than only passing through liquidity.
- Returns liquidity-change deltas from afterAddLiquidity and afterRemoveLiquidity, so it can adjust the principal or fees settled with the pool manager.
- Calls take(address,address,uint256) on the pool manager to move currency out of the pool during callbacks.
- Stores a fee receiver address and a uint16 fee-like parameter that is set in beforeInitialize and updated by separate setters.
- Implements Uniswap V3 style swap callbacks (uniswapV3SwapCallback and pancakeV3SwapCallback), suggesting it routes or settles swaps through an external pool.
- Swap behaviour
- beforeSwap runs with return-delta permission, so it can alter the amounts settled for a swap; the exact fee or pricing rule cannot be fully determined without source. Swap callbacks indicate the hook can route or settle swaps through an external V3-style pool.
- Liquidity behaviour
- afterAddLiquidity and afterRemoveLiquidity both run and return deltas. They update debt-like balances in a mapping keyed by pool id and address and may take currency from the pool manager.
- Fee behaviour
- Uses a dynamic fee: the hook stores uint16 fee parameters (slots 0 and 2) that are written by setter functions 0x534eb4cf and 0xcb9442e2, and it has a fee receiver address that can be changed by the owner. Which trades pay more or less cannot be determined from the bytecode alone.
- Owner & admin controls
- Owner-controlled via Ownable: transferOwnership and renounceOwnership exist, and setFeeReceiver and the uint16 setters (0x534eb4cf, 0xcb9442e2) are restricted, with an Unauthorized error present. The owner can change the fee receiver and fee-related parameters.
Enabled Uniswap v4 callbacks
beforeInitialize, afterAddLiquidity, afterRemoveLiquidity, beforeSwap, beforeSwapReturnDelta, afterAddLiquidityReturnDelta, afterRemoveLiquidityReturnDelta
beforeInitialize sets initial pool parameters; beforeSwap can override swap settlement through return deltas; afterAddLiquidity and afterRemoveLiquidity adjust deltas and settle debt; the return-delta flags let the hook move currency.
Security & trust assessment
Risk level: high, estimated (decoded bytecode, low confidence).
Who controls it: The owner can change the fee receiver and fee parameters and can transfer or renounce ownership; a compromised owner key could redirect fees or alter swap economics for all pools using this hook.
Risk to user funds: The hook can take currency from the pool manager and settle return deltas on swaps and liquidity changes, so it can hold, move or effectively redirect user and pool funds.
Security findings
- [high] Hook moves currency via return deltas: The hook has beforeSwap and liquidity return-delta permissions and calls take on the pool manager, so it can extract or redirect user and pool funds during swaps and liquidity changes.
- [medium] Owner can change fee parameters and receiver: Setter functions for uint16 fee values and setFeeReceiver are gated by ownership, so a privileged key could raise fees sharply or redirect fee revenue to an arbitrary address.
- [medium] Debt accounting in storage: A nested mapping of debt per pool and address is updated in liquidity callbacks; errors in this accounting could leave positions unsettled or let accounting drift from actual balances.
- [info] Unverified source: No verified source is available, so the exact fee formula, access checks and settlement logic are inferred from bytecode and may be incomplete.
Contract details
- Verified source
- No
- Bytecode size
- 13,511 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, moves-currency, ownable, return-delta
Pools using Custom pricing hook
- ETH / USDC (0.00% fee) — 24h volume $0, TVL $0.02, 0 swaps today