Fee sharing hook on Robinhood Chain

Uniswap v4 Hook Contract 0xb95ca5b92989263bd607bf5278e891e1ea3420cc on Robinhood Chain · Fee sharing

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

What it does

On pools registered with this hook, every swap, in either direction, pays an extra levy of LEVY_BPS basis points that is sent to the pool's fee recipient, while liquidity providers are not charged.

How it works step by step

  • Hook is deployed with beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta and afterSwapReturnDelta permissions, so it can take a share of swap amounts through return deltas.
  • registerPool(key, address) is callable by the launcher and records a fee recipient for a pool in a per-pool mapping (slot 2).
  • beforeInitialize checks the pool and sets up per-pool state when a pool is initialized.
  • beforeSwap and afterSwap run on every swap and, using the stored recipient and a LEVY_BPS constant, route a fee portion to the recipient via PoolManager take calls.
  • ledgerOf(address) and feeRecipient(address) expose the accrued ledger and recipient per pool, and the contract has admin and factory roles set with setAdmin and setFactory.
Swap behaviour
Swaps pass through beforeSwap and afterSwap, which can alter the swap amounts and pull a levy (LEVY_BPS basis points) out of the traded currency to the pool's fee recipient, so swaps on registered pools pay this extra levy.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
The hook takes a levy of LEVY_BPS basis points on swaps via return deltas and sends it to the recipient registered for the pool; the pool's own fee is otherwise unchanged.
Owner & admin controls
The admin address can be replaced through setAdmin and the factory through setFactory; the launcher can register pools and set fee recipients. Upgradeability and pause functions were not identified.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize sets up pool state at creation; beforeSwap and afterSwap apply and collect the levy on swaps; beforeSwapReturnDelta and afterSwapReturnDelta let the hook take a portion of the swap amount.

Security & trust assessment

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

Who controls it: The admin and launcher can change the admin, factory and fee recipients, which controls where levies are sent for registered pools.

Risk to user funds: The hook can take currency from swaps on registered pools through return deltas and take() calls, and hold accrued balances in its ledger, but it does not appear to block liquidity removal.

Security findings

  • [medium] Return-delta fee levy: beforeSwap and afterSwap use return deltas and take() calls to move currency on every swap, so the hook can take tokens from swappers and direct them to the recipient.
  • [medium] Admin and factory can be reassigned: setAdmin and setFactory are unrestricted in the decoded selectors and the admin address is stored in slot 0, so a compromised key could redirect levy flows or change roles.
  • [low] Launcher-controlled pool registration: registerPool writes fee recipients into the per-pool mapping; only launcher-gated access was indicated by the OnlyLauncher error, so misconfiguration would affect the recipient of levies.
  • [info] No source for verification: Analysis is based on decoded bytecode only; exact conditions for the levy and access checks could not be confirmed.

Contract details

Verified source
No
Bytecode size
3,575 bytes
Upgradeable proxy
No
Detected patterns
fee-sharing, launchpad, moves-currency, return-delta

Pools using Fee sharing hook