Fee sharing hook on Robinhood Chain

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

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

What it does

A Uniswap v4 hook that takes a protocol fee on swaps through a before-swap return delta and routes the accumulated fees to a configured receiver or treasury.

How it works step by step

  • Runs custom logic in beforeSwap on every pool swap
  • Takes a fee from the swap via beforeSwapReturnDelta
  • Tracks accumulated protocol fees per recipient in storage
  • Flushes accumulated fees to a fee receiver or protocol treasury
  • Stores a per-pool protocol fee in basis points with a default
  • Owner can set the default fee and transfer ownership
Swap behaviour
beforeSwap runs on every swap and uses beforeSwapReturnDelta to take a protocol fee from the swap amounts, with the rate read from per-pool or default fee settings.
Liquidity behaviour
Liquidity callbacks are present in the selector table (beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity, afterRemoveLiquidity) but their bodies are not confirmed as active; treat as possibly view or pass-through stubs.
Fee behaviour
Protocol fees are stored per pool and a default protocol fee in basis points is settable by the owner (bounded by PROTOCOL_FEE_BPS_MAX). Fees are taken from swaps via the beforeSwap return delta, and accumulated balances are tracked per recipient and flushed to a feeReceiver or protocolTreasury.
Owner & admin controls
Owner (slot 1) can transfer ownership, set the default protocol fee via setDefaultProtocolFeeBps, toggle a bool flag at slot 13 via 0x8f9a7b6f, and a 0x4eb36b5f setter writes a uint16 at slot 1 offset 20. Owner-only status is inferred from the Ownable-style selectors and storage, not verified.

Enabled Uniswap v4 callbacks

beforeSwap, beforeSwapReturnDelta

beforeSwap: runs custom logic before each swap and returns a delta that can take a fee from the swap amount. beforeSwapReturnDelta: lets the hook adjust the swap's token amounts, which is how the fee is taken.

Security & trust assessment

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

Who controls it: The owner can change the default protocol fee and possibly the boolean flag that gates behaviour, and can reassign ownership. Without source, the exact bounds on fee changes and flag effects cannot be confirmed.

Risk to user funds: The hook can take tokens on each swap through its return delta, so traders' swap amounts are exposed to the configured fee. Accumulated protocol fees are held by the hook contract until flushed to a receiver. Whether funds can be blocked depends on the unverified flag at slot 13.

Security findings

  • [medium] Return delta can take value from swaps: beforeSwapReturnDelta lets the hook take tokens from every swap, so a fee setter with an unbounded value could drain swap output.
  • [medium] Single owner key controls fee parameters: Owner is stored in slot 1 and transferOwnership (0xf2fde38b) is callable; compromise of the owner key lets an attacker change fees.
  • [low] Packed fee parameters in shared storage slot: The contract uses a 0x5afb5687 setter and a 0x4eb36b5f setter for uint16 values packed into slot 1, with no visible upgrade path, but the setter bounds could not be verified without source.
  • [info] Analysis limited to bytecode: No verified source is available, so function behaviour is inferred from selectors and storage access patterns only.

Contract details

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

Pools using Fee sharing hook