Fee sharing hook on Robinhood Chain

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

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

What it does

This hook takes a share of swap volume as creator and holder fees on a Uniswap v4 pool, splitting buys and sells at configured basis point rates.

How it works step by step

  • Runs in beforeInitialize to set up the pool configuration.
  • On each swap, beforeSwap reads swap direction and amount and computes the fee split.
  • afterSwap applies post-swap accounting and fee carry handling.
  • Return deltas let the hook take part of the traded amounts as fees.
  • Module actions can be executed through executeModuleAction with a module registry (moduleCount, moduleAt, isModuleAction).
  • Views expose creator, token, pool key, fee bps values and a composition hash for off-chain inspection.
Swap behaviour
beforeSwap and afterSwap run on every swap, reading swap direction and amount, computing buy or sell fee splits, and returning deltas that capture part of the swapped amounts.
Liquidity behaviour
beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity, afterRemoveLiquidity and donate callbacks are present in the dispatch table, but the permission set enabled on the address does not include liquidity or donate hooks, so these functions are likely never called by the PoolManager.
Fee behaviour
Fees are split by direction using creator buy and sell fee bps, a total buy and sell fee bps, a holder fee bps, and a fee carry flag per direction; previewGrossFees and previewNetFees views compute the split. The hook uses before and after swap return deltas, so it can take a share of swap amounts in addition to the pool fee.
Owner & admin controls
Storage slot 2 (address-typed at offset 1, uint8 at offset 0) is checked by the isModuleAction and executeModuleAction paths and the hook exposes moduleCount, moduleAt and ledger views; executeModuleAction is nonpayable and callable, so an authorised role (likely the creator or owner stored in slot 2) can run module actions. Parameter setters for fee bps values are not dispatched as separate selectors, so fee parameters appear fixed at initialization or changed only through module actions. Source is unavailable so exact access checks cannot be confirmed.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize is used to set up the pool; beforeSwap and afterSwap are used to read swap parameters and apply fee logic; beforeSwapReturnDelta and afterSwapReturnDelta allow the hook to take or give part of the swap amounts, which is how it collects fees.

Security & trust assessment

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

Who controls it: A privileged key controlling module actions or stored creator or owner addresses could redirect fee shares or run arbitrary module logic against the pool, depending on what the modules can do; the exact reach cannot be verified without source.

Risk to user funds: The hook can take a share of swap amounts through return deltas, and module actions may be able to move or redirect fee balances; the exact amounts and destinations cannot be confirmed without source.

Security findings

  • [medium] Return-delta fee capture: The hook enables beforeSwapReturnDelta and afterSwapReturnDelta, so it can take a portion of every swap through return deltas; fee shares therefore come from user swap amounts.
  • [high] Privileged module execution: executeModuleAction is a nonpayable entry point that can run module logic; if the access check is weak or modules are mutable, arbitrary behaviour could be introduced.
  • [medium] Initialization surface: The bytecode references InvalidInitialization and an initializer view, suggesting an initializer pattern; if the hook is proxied or re-initialisable, configuration could be altered.
  • [info] Fee parameters appear fixed: Fee bps and parameter values are stored in storage slots that are read during swaps but are not written by any dispatched setter, which means they are likely set once at deployment.

Contract details

Verified source
No
Bytecode size
10,659 bytes
Upgradeable proxy
No
Detected patterns
return-delta

Pools using Fee sharing hook