Fee sharing hook on Robinhood Chain

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

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

What it does

This hook takes a share of the output token on each swap and sends it to a fee recipient set by the owner, so swappers receive slightly less than the pool price gives while liquidity providers are not directly affected.

How it works step by step

  • Initializes a single Uniswap v4 pool through initializePool(uint160), which calls the PoolManager initialize path using a stored pool key
  • Enables beforeInitialize as a gate so only the hook's own pool configuration can be initialized
  • Runs afterSwap and sets a return delta, so the hook can take a share of each swap's output currency and forward it to a fee recipient
  • Stores a feeRecipient address and a 16-bit fee-related parameter pair (slot 3 offsets 21 and 23) that can be changed by the owner
  • Uses transfer and take calls to move the collected currency out of the PoolManager to the fee recipient
  • Inherits Ownable with two-step ownership transfer (transferOwnership, acceptOwnership, renounceOwnership) and a reentrancy guard
Swap behaviour
After each swap, afterSwap runs and the hook can claim a portion of the swap's output currency through its return delta, which is then sent to feeRecipient. Swappers receive less output than the pool price alone would give on the affected side; the exact percentage is set by the stored 16-bit parameters, which cannot be read precisely from bytecode alone.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
Uses the pool's dynamic-fee flag and a hook-controlled fee-sharing mechanism: a share of swap output is taken as a return delta and routed to feeRecipient. The 16-bit values at slot 3 offsets 21 and 23 most likely hold the fee share and a cap or threshold, but their semantics are not confirmed without source.
Owner & admin controls
The owner can change feeRecipient (setFeeRecipient), set the 16-bit fee parameters (selector 0x573df8f9), transfer or renounce ownership, and an additional owner-only function at 0x44980fc7 and 0xf13ae65f touches the initialization or pool configuration. Ownership changes use a two-step transfer.

Enabled Uniswap v4 callbacks

beforeInitialize, afterSwap, afterSwapReturnDelta

beforeInitialize gates pool creation so only the configured pool can be initialized through this hook. afterSwap reads swap parameters and computes the fee-sharing amount. afterSwapReturnDelta lets the hook take part of the output currency from the swap.

Security & trust assessment

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

Who controls it: A single owner key controls the fee recipient and fee parameters and can renounce or transfer ownership. A compromised key could redirect or inflate fee extraction across the pool.

Risk to user funds: The hook can take a portion of swap output currency and forward it to feeRecipient on every swap, so traders' output is directly reduced. It does not appear to hold a custodial balance of user liquidity, but it does handle currency during swaps.

Security findings

  • [medium] Owner can redirect fee revenue: setFeeRecipient (0xe74b981b) lets the owner change the address receiving the hook's share of swap output at any time, so a compromised owner key could divert all collected fees.
  • [medium] Owner can change fee parameters: The owner-gated setter at selector 0x573df8f9 writes two uint16 values in storage slot 3, which likely set the fee share; raising it could extract a large portion of swap output from traders.
  • [medium] Hook takes currency via return delta: afterSwapReturnDelta means the hook can take output tokens on every swap and send them out with take/transfer calls, so it actively moves user-facing funds and any bug in the delta calculation would directly affect traders.
  • [info] Two-step ownership: Ownership transfer requires pendingOwner to call acceptOwnership, which reduces the risk of accidentally transferring control to a wrong address.
  • [info] Reentrancy guard present: The reentrancy-guard error selector is present, indicating non-reentrant protection on state-changing paths.

Contract details

Verified source
No
Bytecode size
6,196 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee, erc20, fee-sharing, moves-currency, ownable, return-delta

Pools using Fee sharing hook