Dynamic fee hook on Robinhood Chain

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

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

What it does

A Uniswap v4 hook that applies an owner-configurable dynamic swap fee, using a default fee plus per-tick overrides, to pools it is attached to.

How it works step by step

  • Stores a default fee in slot 1 that applies when no tick-specific fee is set
  • Stores per-tick fee overrides in a mapping from int24 tick to uint24 fee in slot 2
  • Applies the resolved fee to swaps in beforeSwap
  • Exposes getFee(int24) so the effective fee for a tick can be read
  • Lets the owner update the default and per-tick fees
  • Uses Ownable-style ownership with two-step transfer and renouncement
Swap behaviour
beforeSwap returns a fee override based on the tick and stored default fee, so swappers pay the dynamically set fee rather than the pool's static fee.
Liquidity behaviour
beforeAddLiquidity, beforeRemoveLiquidity, afterAddLiquidity and afterRemoveLiquidity are dispatched but appear to be pass-through hooks with no state changes, so liquidity is not restricted or altered.
Fee behaviour
The hook overrides the swap fee in beforeSwap, using a per-tick fee mapping (read by getFee(int24) and written by the 0xc2b7698c setter) and falling back to a stored default fee (defaultFee, set by setDefaultFee). Fee is returned as a dynamic override for the pool.
Owner & admin controls
Owner (slot 0) can set the default fee via setDefaultFee(uint24) and set per-tick fee overrides via the function at selector 0xc2b7698c(int24,uint24) writing a mapping(int24 => uint24) in slot 2. Ownership can be transferred (transferOwnership), renounced (renounceOwnership), and transferred in two steps via pendingOwner/acceptOwnership (slot 1 holds pending owner). No pause or upgrade functions were identified.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap

beforeInitialize: validates or sets up pool-specific state when a pool is created. beforeSwap: returns the dynamic fee override for each swap based on the tick and default fee settings. afterInitialize and afterSwap, liquidity callbacks and donate callbacks are dispatched by the contract but are not enabled in the permissions set derived from the address.

Security & trust assessment

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

Who controls it: A single owner key can change the default fee and any per-tick fee, which directly determines what traders pay on swaps. Ownership transfers and renouncement are controlled by this key.

Risk to user funds: The hook does not take custody of tokens or change liquidity amounts. Its exposure is through fees: an owner-set fee can extract value from swappers on pools using this hook. No token transfers or return deltas were identified in the decoded selectors.

Security findings

  • [medium] Owner-controlled swap fee: The owner can set the default fee and per-tick fees with setDefaultFee and the per-tick setter. A fee value set near the 24-bit maximum would make swaps in affected pools extremely costly.
  • [low] No visible fee cap or timelock: Fee overrides are applied at swap time without visible timelock or cap in the decoded code, so changes take effect immediately for all subsequent swaps.
  • [info] Two-step ownership transfer: Ownership uses a two-step transfer pattern (pendingOwner then acceptOwnership), which reduces the risk of transferring ownership to a wrong address.
  • [info] Unverified source: Source is not verified, so exact validation logic, fee bounds and revert conditions are inferred from bytecode and may be incomplete.

Contract details

Verified source
No
Bytecode size
3,291 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee, ownable

Pools using Dynamic fee hook