Likely fee sharing hook on MegaETH

Uniswap v4 Hook Contract 0x71af405e34b72e936f4b87408b09eca2768c40c4 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 launch-period sniper fee) on swaps and splits the collected fees between team, platform and creator wallets.

How it works step by step

  • Charges buy and sell fees on swaps for registered pools, with a sniper fee and decay schedule around launch
  • Takes its fee via afterSwapReturnDelta and take() during swaps
  • Accumulates fees per pool and currency in internal mappings
  • Splits accumulated fees between team, platform and creator shares by configured BPS values
  • Lets the team, platform and creator wallets claim their accrued fees
  • Owner can launch the pool, register or unregister pools and adjust parameters
Swap behaviour
beforeSwap applies the active fee (sniper or decaying buy/sell fee) and checks pool registration; afterSwap takes the fee via return delta and accumulates it for distribution.
Liquidity behaviour
beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity and afterRemoveLiquidity selectors are present in the dispatch table, but the hook permissions only enable swap callbacks, so these are not invoked by the PoolManager for this hook.
Fee behaviour
Buy and sell fees are stored in storage slots 1 and 2 and set via setFees, capped by a MAX_FEE constant. A sniper fee and a decaying currentFee (decayDuration, launchTime) apply near launch. Fees collected in beforeSwap/afterSwap are accumulated per pool and currency and split between team, platform and creator shares (teamShareBps, platformShareBps, creatorShareBps) and claimable through claimFees and claimCreatorFees.
Owner & admin controls
Owner (Ownable) can call setFees (bounded by MAX_FEE), setShares, setWallets (team and platform wallets), setCreatorWallet, launch, registerPool, unregisterPool, transferOwnership and renounceOwnership. Owner can change fee rates and revenue split parameters after deployment.

Enabled Uniswap v4 callbacks

beforeSwap, afterSwap, afterSwapReturnDelta

beforeSwap: applies the dynamic or sniper fee and registers the pool; afterSwap: takes a fee delta through the return-delta mechanism (afterSwapReturnDelta) and accumulates fees for the team, platform and creator; afterSwapReturnDelta: allows the hook to take a share of the swap output and move currency via take.

Security & trust assessment

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

Who controls it: The owner can raise fees up to MAX_FEE on buys and sells, change revenue split shares and redirect team, platform and creator wallets, so a compromised owner key could redirect accumulated fee revenue or tax traders heavily.

Risk to user funds: The hook can take a portion of swap output via the return-delta mechanism and holds accumulated fees until claimed, so it can move and hold trader and pool value. Owner-controlled fee and wallet parameters determine where that value goes.

Security findings

  • [medium] Privileged fee and wallet control: Owner can change buyFee/sellFee via setFees and the split via setShares and setWallets; the dispatch table shows these as nonpayable Ownable functions with no timelock visible in bytecode.
  • [medium] Hook takes currency via return delta: afterSwapReturnDelta with a take(address,address,uint256) call means the hook moves currency out of the PoolManager during swaps, so it can hold and forward user-side value.
  • [low] Custody of accumulated fees: Fee accumulation mapping (slot 9) and claim functions suggest fees are held inside the hook contract balance until claimed, creating custody of collected fees.
  • [info] Owner-gated pool registration: registerPool and unregisterPool control which pools are active; a pool can be unregistered by the owner, which may disable the hook logic for that pool.

Contract details

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

Pools using Likely fee sharing hook