Dynamic fee hook on Robinhood Chain

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

Volume (24h)
$0
Value locked (TVL)
$68
All-time volume
$2.43K
Pools using this hook
1
Swaps (24h)
0 (0 traders)
Total swaps
29,860

What it does

Charges a configurable tax on ETH/token swaps in a native ETH pool, collecting it for a treasury address.

How it works step by step

  • Restricts the pool to native ETH as currency0 and the configured token as currency1 at initialization
  • Takes a buy tax in ETH from the swap input in beforeSwap via take() and a before-swap return delta
  • Takes a sell tax in ETH from the swap output in afterSwap via take() and an after-swap return delta
  • Accumulates collected ETH on the hook and tracks totalTaxCollected
  • Forwards the hook's ETH balance to the treasury through a permissionless collect() call
  • Lets the owner set buy and sell rates (capped at 10%) and the treasury address
Swap behaviour
Buys (ETH in, token out) pay a buyFeeBps tax on the ETH input, taken in beforeSwap. Sells (token in, ETH out) pay a sellFeeBps tax on the ETH output, taken in afterSwap. Exact-output swaps revert.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
Variable tax taken in ETH: on buys (ETH-in, zeroForOne) a buyFeeBps share of the specified input is taken in beforeSwap via a return delta; on sells (token-in) a sellFeeBps share of the ETH output is taken in afterSwap via a return delta. Fees accumulate on the hook and are forwarded to the treasury by collect(). Each rate is capped at 10%.
Owner & admin controls
Owner (Ownable) can set buyFeeBps and sellFeeBps up to a hard cap of 1000 bps (10%) via setTaxRates, can change the treasury address via setTreasury, and can renounce or transfer ownership. No pause or upgrade mechanism found.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize restricts pools to native ETH paired with the configured token. beforeSwap takes the buy tax and returns a before-swap delta. afterSwap takes the sell tax and returns an after-swap delta. beforeSwapReturnDelta and afterSwapReturnDelta are enabled so the hook can claim part of the swap amounts.

Security & trust assessment

Risk level: medium (verified source, high confidence).

Who controls it: The owner can set buy and sell tax to any value up to 10% at any time, redirect all collected fees by changing the treasury, and transfer or renounce ownership. Taxes can be raised instantly, affecting all subsequent swaps.

Risk to user funds: The hook holds ETH collected as tax until collect() is called and can take a bounded share (max 10%) of each buy input and sell output. It does not hold pool liquidity directly; the amounts it takes are capped by the configured rates.

Security findings

  • [medium] Owner can change tax rates instantly: setTaxRates is onlyOwner and can raise buy and sell fees up to MAX_FEE_BPS (1000 bps, 10%) with immediate effect on all swaps.
  • [medium] Owner controls fee destination: setTreasury is onlyOwner and sends future collected fees to any address; collect() forwards the full ETH balance to the current treasury.
  • [info] Hook takes funds from swaps by design: The hook takes ETH via take() and return deltas in both swap directions; the sell-side fee is taken from the ETH output in afterSwap, so it reduces what the swapper receives.
  • [low] Permissionless collect with external ETH call: collect() is permissionless, forwards the entire ETH balance to the treasury, and has no reentrancy guard; the treasury call is a plain value transfer.

Contract details

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

Pools using Dynamic fee hook