Fee sharing hook on Robinhood Chain

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

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

What it does

This hook charges a configurable buy fee and sell fee on swaps in basis points, so trades in the fee direction pay more while trades in the other direction are charged less or nothing, with the collected amount accruing to the owner.

How it works step by step

  • Hook charges a buy fee and a sell fee expressed in basis points (buyBps and sellBps storage slots, with MAX_BPS and BPS_DENOMINATOR constants) on swaps against a token pool.
  • beforeSwap and afterSwap both touch an accrued amount stored in slot 2; the afterSwap path updates this accumulator and withdraw() pays it out.
  • Uses beforeSwapReturnDelta and afterSwapReturnDelta to take a portion of swap amounts as a hook delta, so the fee is collected from the swap itself.
  • unlockCallback with self-unlock and take(address,address,uint256) selector indicates the hook calls PoolManager unlock to move currency it accrued.
  • withdraw() lets the owner collect accrued fees; accrued() exposes the pending balance.
  • Pool fee is held in POOL_FEE and TICK_SPACING is exposed, indicating the hook is bound to one pool configuration set at initialization.
Swap behaviour
beforeSwap and afterSwap run on every swap; a configured buy or sell fee in basis points is taken as a return delta, so trades in the fee direction pay the hook fee and the opposite direction is not charged by this hook, but the exact direction mapping cannot be confirmed without source.
Liquidity behaviour
beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity and afterRemoveLiquidity are dispatched but appear to be stubs or revert paths; no liquidity fee logic was identified.
Fee behaviour
Hook-level buy and sell fees stored in buyBps and sellBps, applied through return deltas on swaps, accumulated in slot 2 and withdrawable by the owner; the pool's static fee is also referenced via POOL_FEE.
Owner & admin controls
Owner (Ownable with two-step transfer via transferOwnership and acceptOwnership) can call withdraw() to collect accrued fees, set buyBps and sellBps via the selectors 26f9482b and db1b37e6 (uint24 setters), and transfer ownership. renounceOwnership is present but its selector reverts with RenounceDisabled.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize validates the pool; beforeSwap sets the pre-swap return delta to charge the fee; afterSwap updates the accumulator and sets the post-swap return delta; beforeSwapReturnDelta and afterSwapReturnDelta are enabled so the hook can take a share of the swap amounts.

Security & trust assessment

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

Who controls it: A single owner can raise buy and sell fees, withdraw all accrued fees, and transfer ownership; renounceOwnership is disabled, so control cannot be fully abandoned.

Risk to user funds: The hook holds accrued fee balances in its own storage and takes currency from swaps through return deltas; these balances are withdrawable by the owner, and a high fee setting could reduce trader output.

Security findings

  • [medium] Owner can change fee rates: Two uint24 setter selectors (0x26f9482b and 0xdb1b37e6) write to the buy and sell fee slots, so the owner can raise either fee at any time, up to MAX_BPS, which could be set to a punitive level.
  • [medium] Hook takes currency via return deltas: beforeSwapReturnDelta and afterSwapReturnDelta are enabled and the hook calls take, so it extracts tokens from swaps and holds accrued balances that the owner can withdraw.
  • [info] Single owner key controls withdrawal: Ownable with two-step transfer; withdraw() is callable only by owner, so compromise of the owner key would allow draining accrued fees.
  • [info] Unverified source: No verified source is available, so behaviour is inferred from decoded selectors and storage and may differ from intent.

Contract details

Verified source
No
Bytecode size
5,076 bytes
Upgradeable proxy
No
Detected patterns
moves-currency, ownable, return-delta, self-unlock

Pools using Fee sharing hook