Fee sharing hook on Ethereum

Uniswap v4 Hook Contract 0x0ff90a3871a32cd8c517e068c89eda7d93d7c088 on Ethereum · Fee sharing

Volume (24h)
$0
Value locked (TVL)
<$0.01
All-time volume
$2.58
Pools using this hook
1
Swaps (24h)
0 (0 traders)
Total swaps
15

What it does

A swap-fee hook that charges an owner-configurable fee on trades routed through the pool and lets the owner withdraw the collected fees.

How it works step by step

  • Runs beforeSwap to enforce a global swapsEnabled switch and compute the hook fee.
  • Uses beforeSwapReturnDelta to take the fee from swap amounts before settlement.
  • Accumulates fee balances per token, readable via feeBalance.
  • Lets the owner adjust the fee in basis points up to a maximum cap.
  • Allows the owner to withdraw accumulated fees to a chosen address.
Swap behaviour
On every swap, beforeSwap runs and can reject the swap when swaps are disabled, then takes the configured hook fee via return deltas, with the fee balance accumulated for the owner.
Liquidity behaviour
No liquidity callbacks are enabled; liquidity add and remove functions exist in the dispatcher but the hook permissions do not include them, so the pool manager will not call them.
Fee behaviour
Takes a hook fee expressed in basis points (HOOK_FEE_BPS, bounded by MAX_HOOK_FEE_BPS and BPS_DENOMINATOR) on swaps, accumulating balances tracked per token via feeBalance and withdrawable by the owner. The hook also references V4_POOL_FEE, suggesting it interacts with the pool's fee tier, but the exact formula is not determinable from bytecode alone.
Owner & admin controls
Owner (transferable via transferOwnership) can set the hook fee in basis points (setHookFeeBps, capped by MAX_HOOK_FEE_BPS), toggle swaps on or off (setSwapsEnabled), set an executor address (setExecutor), withdraw accumulated fees (withdrawFees), and transfer ownership. Owner check selectors and the exact cap value could not be fully verified without source.

Enabled Uniswap v4 callbacks

beforeSwap, beforeSwapReturnDelta

beforeSwap: runs before each swap to apply the hook fee and possibly enforce the swapsEnabled flag. beforeSwapReturnDelta: lets the hook adjust the swap's amount deltas so it can take its fee from the swap amounts before settlement.

Security & trust assessment

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

Who controls it: The owner can raise the hook fee up to the configured maximum on every swap, disable swaps entirely via setSwapsEnabled, redirect operations via setExecutor, and withdraw all accrued fee balances. A compromised owner key could halt trading or drain accumulated hook fees.

Risk to user funds: The hook can hold fee balances and move swap currency through return deltas, and the owner can withdraw accumulated fees and disable swaps, which can block user trades. User LP principal is not affected since liquidity callbacks are not enabled.

Security findings

  • [high] Owner can halt swaps: The owner can disable swaps through setSwapsEnabled, which causes beforeSwap to revert with SwapsDisabled, blocking all trading in the pool.
  • [medium] Hook takes tokens via return deltas: beforeSwapReturnDelta lets the hook move currency deltas during swaps and the bytecode contains take and transfer calls, so the hook holds and moves tokens to collect fees.
  • [medium] Adjustable fee controlled by owner: The owner can change the hook fee via setHookFeeBps up to MAX_HOOK_FEE_BPS, so fee increases on traders are possible without a timelock visible in bytecode.
  • [low] Single privileged role with no visible timelock: Ownership is transferable via transferOwnership and an executor role exists, with no timelock or multisig evident from the decoded functions.
  • [info] Not upgradeable: No proxy or upgrade selectors were detected, so the contract appears non-upgradeable from the bytecode.

Contract details

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

Pools using Fee sharing hook