Likely fee sharing hook on MegaETH

Uniswap v4 Hook Contract 0x2f76dea4aec65aa8161f1ee4c15ec508c07980c4 on MegaETH · 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

A Uniswap v4 hook that charges configurable buy and sell fees with a decaying sniper fee after launch and splits the collected fees between platform, creator and team wallets.

How it works step by step

  • Charges owner-configured buy and sell fees on swaps, capped by MAX_FEE
  • Applies a decaying sniper fee for a period after launch using launchTime and decayDuration
  • Takes the fee from swap output via afterSwapReturnDelta and transfers it with take()
  • Splits collected fees into platform, creator and team shares by basis points
  • Tracks accumulated and pending creator fees that the creator can claim
  • Restricts which pools are active via registerPool and unregisterPool
Swap behaviour
beforeSwap checks pool registration and sets the applicable fee (including sniper fee during the decay window), and afterSwap takes the fee through return delta and records creator fee accruals.
Liquidity behaviour
beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity and afterRemoveLiquidity selectors are present in the dispatch table, but their behaviour cannot be determined without source.
Fee behaviour
Fees are owner-set via setFees and a decaying sniper fee after launch (decayDuration, launchTime, sniperFee, currentFee). Fee revenue is split among platform, creator and team wallets using owner-set basis-point shares, with claimable accumulated creator fees.
Owner & admin controls
Owner (Ownable) can call setFees, setShares, setWallets, registerPool, unregisterPool, launch, transferOwnership and renounceOwnership. Owner can set buy/sell/sniper fees and creator/platform/team share splits, change fee recipient wallets, and register or unregister pools.

Enabled Uniswap v4 callbacks

beforeSwap, afterSwap, afterSwapReturnDelta

beforeSwap: adjusts swap fees and gates swaps by registered pools. afterSwap: collects a fee via return delta and updates fee-share accounting. afterSwapReturnDelta: lets the hook take a portion of swap output as protocol/creator fees.

Security & trust assessment

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

Who controls it: The owner can change buy, sell and sniper fees, redirect fee recipient wallets, alter the creator/platform/team split, register or unregister pools, and transfer or renounce ownership. A malicious or compromised owner could raise fees toward MAX_FEE on swaps or redirect fee flows.

Risk to user funds: The hook can take a share of swap output tokens via return delta and hold accumulated creator fees until claimed. It can also affect swap pricing through the fee it sets, so it can reduce user proceeds but does not appear to block withdrawals from liquidity removal based on the selectors alone.

Security findings

  • [medium] Owner-adjustable swap fees and recipients: Owner can call setFees and setWallets, changing the fee charged on every swap and where fees are sent.
  • [medium] Hook takes tokens from swaps via return delta: afterSwapReturnDelta lets the hook take tokens from swap outputs via take() transfers to fee wallets.
  • [low] Pool registration controlled by owner: Owner can register and unregister pools, so pool eligibility is controlled by a single key.
  • [info] Unverified source: Source is unverified; behaviour is inferred from selectors and storage layout only.

Contract details

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

Pools using Likely fee sharing hook