Dynamic fee hook on MegaETH
Uniswap v4 Hook Contract 0x92385e5b370901f5a8d5bf2d36b694cb31eb4088 on MegaETH · Dynamic fee
- Volume (24h)
- $0
- Value locked (TVL)
- $3.18
- All-time volume
- <$0.01
- Pools using this hook
- 26
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 51
What it does
A dynamic-fee hook for Uniswap v4 pools on chain 4326 that can override swap fees and take a share of swap currency through its beforeSwap return delta, controlled by an owner and an executor.
How it works step by step
- Runs beforeSwap on each swap to determine the fee applied to that swap
- Returns a before-swap delta so the hook can take or settle currency during the swap
- Stores per-pool configuration (enabled flag, fee) keyed by pool id
- Lets the owner enable or disable pools and set pool fees
- Lets the owner designate an executor address with privileged swap-related access
- Allows the owner to withdraw tokens the hook holds
- Swap behaviour
- beforeSwap runs on every swap; it can set a dynamic LP fee, apply a hook fee, and move currency through take/settle/sync using a return delta.
- Liquidity behaviour
- No liquidity callbacks.
- Fee behaviour
- Pool fees are stored per registered pool and updated by owner-controlled functions (setPoolFee, updateDynamicLPFee call). The hook can override the LP fee in beforeSwap, with a MAX_LP_FEE and MAX_HOOK_FEE_BPS cap. Exact fee formula cannot be determined from decoded bytecode.
- Owner & admin controls
- Owner (0x8da5cb5b) sets the executor (setExecutor), enables or disables pools (setPoolEnabled), sets per-pool fees (setPoolFee and related selectors 0x83d99f3f, 0xb2df5b86, 0xe433c4fe), and withdraws tokens (withdrawToken). Owner is an address held in storage slot 0; selectors 0x8d1227ac and 0xfae97998 are unnamed and appear to configure pool parameters, so the exact scope cannot be confirmed without source.
Enabled Uniswap v4 callbacks
beforeSwap, beforeSwapReturnDelta
beforeSwap: runs before each swap to determine fee and possibly take or settle currency via return delta. beforeSwapReturnDelta: lets the hook return a delta that changes the amounts settled in the swap, which the bytecode uses together with take/settle/sync calls to move currency.
Security & trust assessment
Risk level: high, estimated (decoded bytecode, low confidence).
Who controls it: The owner controls pool enablement, fee levels, the executor address that can act on the hook, and can withdraw tokens held by the contract. A malicious or compromised owner could set fees to the cap, disable pools, or drain balances held by the hook.
Risk to user funds: The hook takes and settles currency during swaps via return delta, and holds token balances that the owner can withdraw. Users swapping through enabled pools are exposed to fee changes and to any balance the hook keeps.
Security findings
- [high] Owner can withdraw hook-held tokens: withdrawToken(address,address,uint256) lets the owner move tokens held by the hook contract.
- [medium] Privileged executor role: setExecutor sets an address with privileged access to the hook's swap flow; its permissions are not visible without source.
- [medium] Return delta takes currency during swaps: beforeSwap returns a delta and moves currency via take/settle/sync, so the hook can take a portion of swap amounts.
- [info] Owner-adjustable fees: Owner can change pool fees at any time, bounded only by MAX_LP_FEE and MAX_HOOK_FEE_BPS constants.
Contract details
- Verified source
- No
- Bytecode size
- 14,558 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, moves-currency, return-delta
Pools using Dynamic fee hook
- ETH / MEGACAT (Dynamic fee) — 24h volume $0, TVL $0.07, 0 swaps today
- ETH / RABBIT (Dynamic fee) — 24h volume $0, TVL $0.07, 0 swaps today
- ETH / OMEGA (Dynamic fee) — 24h volume $0, TVL $0.07, 0 swaps today
- ETH / KUMA (Dynamic fee) — 24h volume $0, TVL $0.07, 0 swaps today
- ETH / RONNIE (Dynamic fee) — 24h volume $0, TVL $0.07, 0 swaps today
- ETH / Σ: (Dynamic fee) — 24h volume $0, TVL $0.07, 0 swaps today
- ETH / CUM (Dynamic fee) — 24h volume $0, TVL $0.07, 0 swaps today
- ETH / MEKA (Dynamic fee) — 24h volume $0, TVL $0.07, 0 swaps today
- ETH / FLUFFEY (Dynamic fee) — 24h volume $0, TVL $0.07, 0 swaps today
- ETH / Fluffey (Dynamic fee) — 24h volume $0, TVL $0.07, 0 swaps today
- ETH / BIGBALLS (Dynamic fee) — 24h volume $0, TVL $0.07, 0 swaps today
- ETH / SPICY (Dynamic fee) — 24h volume $0, TVL $0.07, 0 swaps today
- ETH / MEGAMAFIA (Dynamic fee) — 24h volume $0, TVL $0.07, 0 swaps today
- ETH / SIGMA (Dynamic fee) — 24h volume $0, TVL $0.07, 0 swaps today
- ETH / RTM (Dynamic fee) — 24h volume $0, TVL $0.07, 0 swaps today
- ETH / MEGA (Dynamic fee) — 24h volume $0, TVL $0.46, 0 swaps today
- ETH / DUCK (Dynamic fee) — 24h volume $0, TVL $0.07, 0 swaps today
- ETH / USDT0 (Dynamic fee) — 24h volume $0, TVL $1.00, 0 swaps today
- MEGA / USDm (Dynamic fee) — 24h volume $0, TVL $0.53, 0 swaps today
- stcUSD / USDm (Dynamic fee) — 24h volume $0, TVL <$0.01, 0 swaps today