Fee sharing hook on HyperEVM

Uniswap v4 Hook Contract 0xdaa7c21ee5e99ab8fc9823e199e3fd98ccd560cc on HyperEVM · Fee sharing

Volume (24h)
$0
Value locked (TVL)
$0
All-time volume
$652
Pools using this hook
1
Swaps (24h)
0 (0 traders)
Total swaps
2

What it does

A fee hook that charges configurable buy and sell fees on swaps in its pool and sends the collected fees to a fee recipient.

How it works step by step

  • Stores a buy fee and a sell fee in basis points in packed storage slot 1.
  • Caps configured fees at MAX_FEE_BPS.
  • Takes a fee portion of each swap through beforeSwap and afterSwap return deltas.
  • Sends collected fees to feeRecipient through the pool manager take call.
  • Records the pool id and initialization state during beforeInitialize.
  • Lets the owner change fees, the fee recipient, and ownership.
Swap behaviour
beforeSwap and afterSwap run on every swap, computing the buy or sell fee from the stored basis points and taking that portion of the currency via return deltas to the fee recipient.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
Charges a buy fee and a sell fee in basis points, set by the owner via setFees and capped by MAX_FEE_BPS. Collected fees are taken from the swap and routed to feeRecipient through the pool manager's take function.
Owner & admin controls
Owner (slot 0) can call setFees(uint16,uint16) to set buy and sell fee bps (bounded by MAX_FEE_BPS), setFeeRecipient(address) to redirect collected fees, and transferOwnership(address) to hand over control. No pause or upgrade mechanism was identified in the decoded selectors.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize records the pool id and marks the pool initialized. beforeSwap and afterSwap read the fee configuration and adjust the swap amounts. beforeSwapReturnDelta and afterSwapReturnDelta let the hook take a fee portion of the swap currency, which is sent to the fee recipient.

Security & trust assessment

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

Who controls it: The owner can change buy and sell fees up to the cap and can redirect all future fee revenue by changing feeRecipient. A compromised owner key could raise fees to the maximum on traders and divert fee income.

Risk to user funds: The hook can take a portion of swap input or output currency through return deltas and send it to feeRecipient. It does not appear to hold user funds long term, and no function was found that blocks swaps.

Security findings

  • [medium] Hook takes currency on swaps: The hook uses return deltas and the take call to move swap currency, so it can extract value from every swap on pools using it.
  • [medium] Owner can change fees and recipient instantly: setFees and setFeeRecipient are callable only by the owner key, with no timelock visible in the bytecode, so fee and recipient changes take effect immediately.
  • [low] Single-step ownership transfer: Ownership is transferred in a single step through transferOwnership, so a wrong address would permanently lock admin control.
  • [info] No upgrade path observed: Owner is stored in slot 0 and the fee recipient in slot 1; no proxy or upgrade selectors were found, so the logic appears non-upgradeable.

Contract details

Verified source
No
Bytecode size
3,118 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee, fee-sharing, moves-currency, ownable, return-delta

Pools using Fee sharing hook