Dynamic fee hook on Robinhood Chain

Uniswap v4 Hook Contract 0x4eafa1c72ca13c6a9f93095b686afc7dd5bc60cc on Robinhood Chain · Dynamic fee

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

What it does

A dynamic-fee hook that sets swap fees on the fly within owner-configured bounds and takes a share of swap flows for a dev or keeper-managed split.

How it works step by step

  • Sets a dynamic LP fee in beforeSwap, using an override fee flag and a fee ceiling and floor
  • Records observation or pair state in afterSwap for use in later fee calculations
  • Takes a portion of swap currency through return deltas and take(), with a dev share in basis points
  • Exposes quoteFee so front ends can preview the fee a swap would pay
  • Lets a keeper address call maintenance functions such as poke to refresh fee state
  • Restricts configuration setters to the owner, with two-step ownership transfer
Swap behaviour
beforeSwap computes and may override the fee for each swap, and afterSwap updates internal state. Return deltas let the hook take a portion of the swap currency via take().
Liquidity behaviour
No liquidity callbacks are enabled (no before/after add or remove liquidity permissions). The hook reads getLiquidity(bytes32) externally and a pairs mapping, which suggests it tracks pool liquidity for its own accounting but does not alter liquidity add or remove flows.
Fee behaviour
Likely a dynamic fee: quoteFee (0x1c2c3cb4) and the beforeSwap path read fee parameters from packed storage (slots 4, 5, 6 and 9), and setters write a fee ceiling (FEE_CEILING, FEE_FLOOR, CAP_CEILING, GUARD_FLOOR constants) and a fee value (ccfb5a81 writes a uint24 into slot 6). The hook also has devShareBps and a dev/share split (slot 8 uint16 and slot 6 uint24 reads), suggesting a portion of fees is routed to a dev address. Exact fee formula could not be determined without source.
Owner & admin controls
Owner (Ownable with two-step transfer: transferOwnership/acceptOwnership, renounceOwnership) can call setKeeper (0x748747e6) and fbb0a4db/98c40e85/ccfb5a81/352ec6c8/2045de98-selector setters that write fee and parameter storage slots (slot 6 for uint32/uint128/uint24 values, slot 9 for a uint24 and uint32 config, slot 0 for owner), plus cec6df00 which writes the addresses in slots 7 and 8. A keeper address (keyOf/keeper) can call poke and other maintenance selectors. No pause function was identified in the dispatch table.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize: validates or records pool state when a pool is created. beforeSwap: computes the dynamic fee and may set the override fee flag for the swap. afterSwap: updates observation or accounting state after the swap. beforeSwapReturnDelta and afterSwapReturnDelta: allow the hook to take or give currency during swaps, so it can skim a portion of swap amounts via take(address,address,uint256) (0x0b0d9c09).

Security & trust assessment

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

Who controls it: The owner can change fee parameters, the keeper address, and the dev/share configuration, and can transfer ownership. A malicious or compromised owner could raise fees toward the ceiling on pools using this hook, redirect the dev share, or change the keeper to an address that updates fee state. The owner can also renounce ownership, which would freeze parameters.

Risk to user funds: Because beforeSwapReturnDelta and afterSwapReturnDelta are enabled and the hook calls take, the hook can directly move swap currency. Users are exposed to whatever fee or devShare split the owner configures. No pause or blocking path was clearly identified, so swaps are unlikely to be fully blocked, but the amount taken per swap depends on owner-set parameters.

Security findings

  • [medium] Owner-adjustable fee parameters: Setter selectors write fee-related storage (for example a uint24 in slot 6 and a uint32 in slot 6 and slot 9). Owner can change these, subject to bounds defined by FEE_CEILING and FEE_FLOOR constants, which could be set to large ranges.
  • [medium] Return deltas allow the hook to take currency: The hook can take currency from swaps via take(address,address,uint256) and return deltas are enabled on both before and after swap. This lets the hook hold or skim a share of pool funds during swaps.
  • [low] Privileged keeper role: Ownable with a keeper role controlled by the owner. Keeper can call poke and update state, and the owner can replace the keeper address.
  • [info] Access control present but partly unverified: Contract uses Ownable with two-step ownership and includes OwnableUnauthorizedAccount and a standard custom error set, so access checks are present, but the full set of guarded selectors could not be confirmed from bytecode alone.

Contract details

Verified source
No
Bytecode size
17,923 bytes
Upgradeable proxy
No
Detected patterns
moves-currency, ownable, return-delta

Pools using Dynamic fee hook