Custom pricing hook on Base

Uniswap v4 Hook Contract 0xe4c66e50af1fcdf85f87cd25adfc6be1eaf9a58b 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 uses custom accounting with return deltas to adjust swap and liquidity amounts, and its owner can change fee parameters, but the precise direction of fees and which trades pay more or less cannot be determined from the decoded bytecode.

How it works step by step

  • Hook is registered for beforeInitialize, beforeSwap, afterAddLiquidity and afterRemoveLiquidity with return-delta flags, so it can alter the swap and liquidity deltas it returns to the pool manager.
  • Stores a fee-related uint16 value in slot 0 that is written during beforeInitialize and by a dedicated setter selector, and read during swaps and liquidity callbacks.
  • Tracks a per-pool, per-address debt mapping (slot 1) that is updated during liquidity callbacks and read through debtOf, suggesting it settles amounts owed between the hook and liquidity providers.
  • Uses a take(address,address,uint256) call to the pool manager to pull or send currency, so the hook moves tokens during callbacks.
  • Keeps a feeReceiver address and a payable entry point (0xb8216c95) that appears to accept value and interact with the debt and fee accounting.
  • Implements the Uniswap V3 style swap callbacks (uniswapV3SwapCallback and pancakeV3SwapCallback), indicating it can perform swaps against underlying pools as part of its logic.
Swap behaviour
beforeSwap is implemented and can return a delta, so the hook can change how much a swap receives or pays; the exact pricing direction and which trades pay more or less cannot be determined from decoded bytecode alone.
Liquidity behaviour
afterAddLiquidity and afterRemoveLiquidity are implemented with return deltas; they update per-pool debt accounting and can take or send currency on each liquidity change.
Fee behaviour
The hook appears to set a dynamic fee using a uint16 stored in slot 0 and a feeReceiver address; the precise fee formula and split cannot be determined from decoded bytecode.
Owner & admin controls
An owner exists (owner(), transferOwnership, renounceOwnership) and can call setFeeReceiver and the uint16 setter (0x534eb4cf or 0xcb9442e2), so the owner can change the fee receiver and fee-related parameters.

Enabled Uniswap v4 callbacks

beforeInitialize, afterAddLiquidity, afterRemoveLiquidity, beforeSwap, beforeSwapReturnDelta, afterAddLiquidityReturnDelta, afterRemoveLiquidityReturnDelta

beforeInitialize sets up per-pool configuration; beforeSwap adjusts swap deltas and possibly fees; afterAddLiquidity and afterRemoveLiquidity settle debt and take currency and return deltas; beforeSwapReturnDelta and the liquidity return-delta flags let the hook alter the amounts the pool manager credits or debits.

Security & trust assessment

Risk level: high, estimated (decoded bytecode, low confidence).

Who controls it: The owner key can change the fee receiver and fee-related uint16 parameters, and can transfer ownership, which affects user costs and where fees are sent.

Risk to user funds: The hook can hold and move currency through take() and return deltas during swaps and liquidity changes, so user and pool funds are exposed to its accounting logic.

Security findings

  • [high] Return-delta permissions on swaps and liquidity: The hook enables beforeSwapReturnDelta and afterAdd/RemoveLiquidityReturnDelta and moves currency via take(), so it can alter amounts that users receive or pay.
  • [medium] Owner-controlled fee parameters: The owner can change the uint16 fee-related value and the fee receiver through setter selectors, which could raise fees or redirect fee revenue.
  • [medium] Ownable with transferOwnership: Ownership can be transferred or renounced; control of the owner key determines control over fee and receiver settings.
  • [low] Payable entry point handling debt: A payable function (0xb8216c95) touches debt and fee receiver storage, and its exact accounting cannot be verified without source.
  • [info] Analysis from bytecode only: No verified source is available, so function purposes are inferred from selectors and storage access 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