SwapFeeHook on Robinhood Chain
Uniswap v4 Hook Contract 0xf8da5ccbdcf2240b055331e694e4c32f848e00cc on Robinhood Chain · Fee sharing · Verified contract
- Volume (24h)
- $16.85K
- Value locked (TVL)
- $34.02K
- All-time volume
- $2.70M
- Pools using this hook
- 2
- Swaps (24h)
- 258 (159 traders)
- Total swaps
- 23,145
What it does
Charges a configurable buy and sell fee on swaps in a pool and routes the collected amount to a treasury address.
How it works step by step
- Applies separate buy and sell fees in basis points on swaps
- Caps fees with maxFeeBps and an absolute maximum fee
- Takes the fee via before and after swap return deltas
- Forwards collected fees to a configurable treasury address
- Exposes previewFee so front ends can quote the fee before a swap
- Owner can update fees and treasury through two-step ownership
- Swap behaviour
- beforeSwap and afterSwap apply the buy or sell fee based on swap direction, using return deltas to skim the fee from the swap and send it to the treasury.
- Liquidity behaviour
- Has before/after add, remove and donate callbacks, but the decoded bytecode indicates they are pass-through with no special logic evident from selectors alone.
- Fee behaviour
- Charges separate buy and sell fees in basis points (buyFeeBps and sellFeeBps, storage slot 0). previewFee(uint256,bool) exposes the fee for a given amount and direction. Fees are bounded by maxFeeBps and an absolute cap, and the owner can adjust them via setFees.
- Owner & admin controls
- Owner (two-step ownership via transferOwnership/acceptOwnership, pending owner stored in slot 2) can call setFees(uint16,uint16) to change buy and sell fee bps (capped by maxFeeBps/ABSOLUTE_MAX_FEE_BPS, reverting with FeeAboveCap) and setTreasury(address) to redirect the fee recipient. No pause, upgrade proxy or emergency withdraw selectors were found.
Enabled Uniswap v4 callbacks
beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeSwap and afterSwap run fee logic on swaps; beforeSwapReturnDelta and afterSwapReturnDelta allow the hook to take a portion of the swap amount as a delta, which is how the fee is collected and forwarded to the treasury.
Security & trust assessment
Risk level: medium (decoded bytecode, medium confidence).
Who controls it: A single owner key can raise fees up to the absolute cap on both buys and sells, and can redirect all collected fees by changing the treasury address. Ownership transfer is two-step, which reduces accidental loss of control.
Risk to user funds: The hook takes a fee delta on swaps via return-delta permissions and forwards it to the treasury, so it can hold or move the portion of swap amounts it charges. Liquidity operations are not intercepted beyond pass-through callbacks.
Security findings
- [medium] Owner-adjustable swap fees: The owner can set buy and sell fees within the cap. Traders could face sudden fee increases up to the protocol-defined maximum.
- [medium] Owner can redirect fee recipient: setTreasury lets the owner redirect collected fees to any address, with no timelock visible in the selectors.
- [info] Hook moves currency during swaps: The hook uses return deltas and a take(address,address,uint256) call to move currency, so it directly sits in the swap settlement path.
- [info] Unverified source: Verified source is unavailable, so the exact fee math, cap values and any edge-case behaviour could not be confirmed from the bytecode alone.
Contract details
- Verified source
- Yes (SwapFeeHook)
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Bytecode size
- 5,253 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, moves-currency, ownable, return-delta
Pools using SwapFeeHook
- PAWS / USDG (0.00% fee) — 24h volume $16.85K, TVL $34.02K, 258 swaps today
- DEMO / USDG (0.00% fee) — 24h volume $0, TVL $1.49, 0 swaps today