Fee sharing hook on Robinhood Chain

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

Volume (24h)
$200
Value locked (TVL)
$2.09K
All-time volume
$20.28K
Pools using this hook
1
Swaps (24h)
26 (19 traders)
Total swaps
994

What it does

A Uniswap v4 hook that charges configurable buy and sell fees on swaps, gates trading behind an owner-triggered open step, and routes a capped protocol share of fees to a treasury.

This read was written for the hook 0x9270…80cc on Base and reused here: the two share a code shape, so constants such as fees, owners and addresses can differ.

How it works step by step

  • Gates swaps behind an openTrading() step that records when trading began
  • Applies buy and sell fees that can ramp or decay after opening
  • Takes a protocol share of swap currency via beforeSwapReturnDelta and afterSwapReturnDelta
  • Transfers the protocol share to a configurable treasury address
  • Exposes role-based controls to set treasury, vault and protocol share with an enforced cap
Swap behaviour
beforeSwap and afterSwap run on every swap, applying fee logic and taking a protocol share of swap currency through return deltas, with trading blocked until openTrading() is called.
Liquidity behaviour
beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity and afterRemoveLiquidity selectors are dispatched, but their exact behaviour cannot be confirmed from bytecode alone; they appear to be hook-level callbacks without custom accounting.
Fee behaviour
Buy and sell fees are tracked in storage (currentBuyFeeBps, currentSellFeeBps, restingSellFeeBps, OPENING_FEE_BPS, RAMP_DURATION) and appear to decay or ramp after trading opens. A portion of collected fees is routed to the protocol treasury according to protocolShareBps, which is bounded by MAX_PROTOCOL_SHARE_BPS.
Owner & admin controls
Role-based access control with DEFAULT_ADMIN_ROLE and GOVERNOR_ROLE (roles checked via hasRole, grantRole, revokeRole, renounceRole). Admin/governor can set the protocol treasury (setProtocolTreasury), the protocol share in basis points (setProtocolShareBps, capped by MAX_PROTOCOL_SHARE_BPS), and the vault (setVault). openTrading() is callable by a role holder and flips the tradingOpen flag, gating trading and recording tradingOpenedAt.

Enabled Uniswap v4 callbacks

beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeSwap and afterSwap: apply fee logic and move currency to the protocol treasury. beforeSwapReturnDelta and afterSwapReturnDelta: let the hook take a share of swap amounts via return deltas, so it can alter the net amounts settled for the swap. Liquidity and donate callbacks are dispatched by selector but have no clear permission-driven role in this analysis.

Security & trust assessment

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

Who controls it: A governor or admin key can change the treasury address, the protocol share (up to the cap), and the vault address. Because the hook takes tokens via return deltas and transfers them to the treasury, a malicious or compromised treasury/vault change could redirect fee flows. Opening trading is a one-way gate controlled by a role holder.

Risk to user funds: The hook can hold and move swap currency: it calls take() and transfers tokens to the protocol treasury/vault, and its return deltas change swap settlement amounts. Users are exposed to fee rates set by privileged roles and to the destination of fees. Exact behaviour is inferred from selectors without verified source, so these conclusions carry medium confidence.

Security findings

  • [medium] Hook takes a share of swap value via return deltas: The hook can take currency through take() and transfer(), and affects swap settlement via before/after return deltas. It can siphon a protocol share of every swap.
  • [medium] Privileged key can redirect fee destination: setProtocolTreasury and setVault are role-gated and take effect immediately with no timelock visible in the bytecode, so a privileged key can redirect future fee flows.
  • [info] Protocol share is capped on-chain: setProtocolShareBps is capped by MAX_PROTOCOL_SHARE_BPS and reverts with ProtocolShareTooHigh above it, which limits the damage from a compromised key.
  • [low] Trading gated by a single admin action: Trading is blocked until openTrading() is called (TradingNotOpen error), so swaps are unavailable before the role holder opens the pool.

Contract details

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

Pools using Fee sharing hook