Likely fee sharing hook on MegaETH

Uniswap v4 Hook Contract 0x14faad03bbbc089f694bdfad9826d36f30ce80c4 on MegaETH · Fee sharing

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

What it does

A Uniswap v4 hook that charges configurable buy and sell fees on swaps in registered pools and routes them to protocol, team and treasury wallets.

This read was written for the hook 0xeecb…00c4 on MegaETH and reused here: the two run the same code.

How it works step by step

  • Restricts swaps to pools registered by the owner
  • Applies buy and sell fees, with a sniper fee during the early launch window
  • Takes fees from swap output using afterSwapReturnDelta
  • Distributes collected fees to protocol, team and treasury wallets
  • Owner can launch trading and adjust fees and wallets
Swap behaviour
beforeSwap checks registration and launch status and applies the dynamic fee. afterSwap takes a fee from the swap output and transfers it to the configured wallets.
Liquidity behaviour
beforeAddLiquidity and beforeRemoveLiquidity are exposed in the dispatch table but are not among the enabled permissions, so the hook does not intercept liquidity changes. Pools must be registered by the owner before they are tracked.
Fee behaviour
Owner-set buyFee and sellFee (stored in slots 1 and 2, bounded by MAX_FEE and BPS) are applied by beforeSwap and afterSwap, with a higher SNIPER_FEE applied during the launch window. Fees are split between protocol, team and treasury wallets.
Owner & admin controls
Owner (Ownable) can call setFees to set buy and sell fees, setWallets to change protocol, team and treasury wallets, launch to start trading, registerPool and unregisterPool to manage which pools are registered, and transferOwnership or renounceOwnership. Owner is stored in slot 0.

Enabled Uniswap v4 callbacks

beforeSwap, afterSwap, afterSwapReturnDelta

beforeSwap: checks pool registration and launch status and sets the dynamic fee. afterSwap: takes the fee amount from the swap output via return delta and moves it to the fee recipient wallets. afterSwapReturnDelta: allows the hook to take a share of the swap's unspecified currency.

Security & trust assessment

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

Who controls it: The owner can change buy and sell fees up to MAX_FEE, redirect fee recipients via setWallets, and register or unregister pools. A malicious or compromised owner could set fees to the cap on trades and redirect all collected fees.

Risk to user funds: The hook can take a portion of each swap's output token through afterSwap return delta and send it to protocol, team and treasury wallets. It does not appear to hold a custody balance of pool funds, and it does not block swaps except when a pool is unregistered or the launch condition is not met.

Security findings

  • [medium] Owner-adjustable swap fees: Owner can call setFees; fee values are capped by MAX_FEE according to the decoded constant, but the cap is set by the contract and not visible from source.
  • [info] Hook takes currency via return delta: afterSwapReturnDelta lets the hook take tokens from swap output and transfer them to wallets via the take and transfer selectors.
  • [medium] Single owner key controls configuration: Ownable pattern with owner in slot 0; renounceOwnership and transferOwnership are present, so the owner key controls all privileged settings.

Contract details

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

Pools using Likely fee sharing hook