Fee sharing hook on HyperEVM

Uniswap v4 Hook Contract 0x8917cfab83c98bea9f478b72d4e5dad502b0a0c4 on HyperEVM · Fee sharing

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

What it does

This hook charges a dynamic fee on swaps in pools it is attached to, which the owner can adjust, and routes a share of that fee to revenue, staking and burn, so traders pay a configurable extra cost while LPs are not directly affected.

How it works step by step

  • Attaches to Uniswap v4 pools and runs logic in beforeInitialize, beforeSwap, afterSwap and afterSwapReturnDelta
  • Charges a dynamic fee on swaps, split between buy-side, sell-side and general fee rates set in basis points
  • Routes a share of collected fees into a revenue address, a staking address and a burn share, with a collected balance tracked per token
  • Tracks registered pools and a swap counter in storage, and can be paused by the owner
  • Maintains an owner-managed list of modules (up to a maximum count) that are invoked alongside hook logic
  • Has an owner-controlled sweep function to move accumulated token balances out to a chosen address
Swap behaviour
Swap callbacks are present: beforeSwap can be gated by the paused flag, and afterSwap computes a fee from the buy and sell rate parameters, takes a share via afterSwapReturnDelta, and accrues the collected amount per token. Exact direction-dependent rates cannot be fully confirmed from bytecode alone, so which trades pay more or less is only partially determined.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
Fees are dynamic: setFees stores four uint16 values and the swap path uses buy, sell and a general fee expressed against BPS, capped by MAX_FEE_BPS. A portion is diverted to staking and burn shares, and the remainder goes to revenue.
Owner & admin controls
Owner (with two-step transfer via transferOwnership and acceptOwnership, and renounceOwnership) can pause or unpause swaps via setPaused, set fee parameters via setFees, change the staking and revenue addresses, replace the module list via setModules, and sweep balances via sweep.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap, afterSwap, afterSwapReturnDelta

beforeInitialize registers new pools in storage, beforeSwap checks the paused flag and runs module logic, afterSwap computes and accrues the fee and tracks swaps, and afterSwapReturnDelta lets the hook take a portion of the swap output as a delta.

Security & trust assessment

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

Who controls it: A single owner key can pause trading, raise fees within the cap, redirect staking and revenue destinations, swap in arbitrary modules, and sweep collected balances, with no timelock evident from the decoded functions.

Risk to user funds: The hook holds collected fee balances and takes a share of swap output through return deltas, so it can hold and move funds; the owner can withdraw those balances and pause pool activity.

Security findings

  • [medium] Owner can pause swaps: The paused flag is read in beforeSwap and set through setPaused by the owner, so a privileged key can halt trading on hooked pools.
  • [high] Owner can change fee parameters: setFees writes four uint16 fee values that are applied in afterSwap; the bytecode shows a MAX_FEE_BPS constant, but the owner-set values determine the effective trader cost and could be raised within that bound.
  • [medium] Hook takes tokens via return delta: afterSwapReturnDelta lets the hook claim part of swap output, and the contract moves currency (take and transfer selectors are present), so user proceeds are reduced by design.
  • [high] Owner can sweep accumulated balances: The sweep(address) function lets the owner withdraw collected token balances to any address, a centralization risk for accrued fees.
  • [medium] Module list is owner-controlled: setModules replaces an external module array that is called during swap and liquidity hooks, so a malicious or buggy module set could affect execution.

Contract details

Verified source
No
Bytecode size
7,750 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee, erc20, fee-sharing, moves-currency, ownable, pausable, return-delta, rewards

Pools using Fee sharing hook