Likely custom pricing hook on Ethereum

Uniswap v4 Hook Contract 0x93ae82d2281a911c37d2bf5c46d48b89abe3afcc on Ethereum · Custom pricing

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

What it does

A Uniswap v4 hook that takes a configurable fee on swaps and forwards it to a fee collector, with owner-controlled fee settings and fee exclusions.

How it works step by step

  • Charges a fee on swaps through beforeSwapReturnDelta and afterSwapReturnDelta
  • Stores the fee rate in storage and exposes it via fee and calculateFee
  • Forwards collected fees to a feeCollector address
  • Allows an owner-managed list of addresses to be excluded from fees
  • Runs hook callbacks on pool initialization, liquidity changes and donations
  • Lets the owner withdraw stuck tokens from the hook
Swap behaviour
beforeSwap and afterSwap run hook logic, and the return delta permissions let the hook take a share of each swap as a fee before settlement.
Liquidity behaviour
Callbacks exist for before and after add liquidity and before and after remove liquidity, plus beforeDonate and afterDonate views. The exact logic inside these callbacks cannot be fully determined from decoded bytecode alone.
Fee behaviour
A hook-level fee is stored in storage slot 2 (uint128) and set by the owner via setFee, with a calculateFee view and a FeeExceedsMax error indicating a cap. Fees are collected to a feeCollector address and addFees/exitSwap selectors suggest fees are taken through return deltas and then forwarded. Some addresses can be excluded from fees via a mapping.
Owner & admin controls
Owner (Ownable) can call setFee(uint128), setFeeCollector(address), setExcludeFromFees(address,bool), withdrawStuck(address,uint256), transferOwnership(address) and renounceOwnership(). The owner can change the fee rate and the fee recipient at will and withdraw tokens held by the hook.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity, afterRemoveLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize and afterInitialize check pool setup; beforeAddLiquidity and afterAddLiquidity and beforeRemoveLiquidity and afterRemoveLiquidity run hook logic around liquidity changes; beforeSwap and afterSwap run fee and accounting logic; beforeSwapReturnDelta and afterSwapReturnDelta allow the hook to take a share of swap amounts as a return delta, which is how the fee is extracted from swaps.

Security & trust assessment

Risk level: medium, estimated (decoded bytecode, medium confidence).

Who controls it: The owner can raise the fee up to the cap, redirect fees by changing the fee collector, exclude addresses from fees, and withdraw stuck tokens from the hook. Ownership can be transferred or renounced, and there is no timelock visible.

Risk to user funds: The hook takes a fee on swaps through return deltas and may hold tokens transiently, and the owner can withdraw stuck balances, so funds routed through the hook are exposed to the owner's discretion.

Security findings

  • [medium] Owner controls fee rate and recipient: Owner can change the fee via setFee and redirect collected fees via setFeeCollector, so fee terms can change without user consent.
  • [medium] Owner can withdraw hook-held tokens: withdrawStuck lets the owner move any token balance held by the hook, which could include user funds routed through swap return deltas.
  • [info] Swap return delta takes a fee from swaps: Return deltas on swaps let the hook take a portion of trader input or output before settlement with the pool manager.
  • [info] Ownable without visible upgradeability: The contract uses Ownable, and no proxy or upgrade pattern was detected in the selectors.

Contract details

Verified source
No
Bytecode size
7,246 bytes
Upgradeable proxy
No
Detected patterns
moves-currency, ownable, return-delta

Pools using Likely custom pricing hook