AngstromL2 on Base

Uniswap v4 Hook Contract 0x631352aaa9d6554848af674106bcd8bb9e59a5cf on Base · MEV protection · Verified contract

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

What it does

A Uniswap v4 hook for native-ETH pools that taxes priority-fee MEV (top-of-block swaps and JIT liquidity) and redistributes the tax to in-range LPs, while charging a configurable swap fee split between a pool creator and the protocol.

How it works step by step

  • Charges a priority-fee-based MEV tax on swaps, scaled by swapMEVTaxFactor above a priorityFeeTaxFloor.
  • Charges a JIT tax on liquidity additions and removals when priority fee is above the floor, sent to the protocol factory.
  • Distributes the swap tax to LPs by crediting reward growth to ticks crossed by the swap and tracking per-position accrual.
  • Splits swap fees and taxes between the pool creator, the protocol factory and LPs using per-pool fee configuration.
  • Restricts pools to native ETH as currency0 with static fees and enters withdraw-only mode when the factory requests it.
Swap behaviour
beforeSwap charges a MEV tax based on priority fee and takes a pre-computed swap fee for exact-in swaps; afterSwap collects the exact-out fee, splits fees and taxes among creator, protocol and LPs, and records reward growth across the ticks crossed so in-range LPs are compensated.
Liquidity behaviour
afterAddLiquidity and afterRemoveLiquidity charge a JIT MEV tax when priority fee is above floor, sent to the factory, and track per-position reward growth; afterRemoveLiquidity burns and pays out pending LP tax rewards. Liquidity additions are blocked in withdraw-only mode.
Fee behaviour
Swap fee is a pool-level percentage (creator plus protocol swap fee in E6 units) charged in beforeSwap for exact-in and in afterSwap for exact-out via return deltas; priority-fee-based tax (swapMEVTaxFactor times TAXED_GAS times excess gas price over a floor) is charged on swaps and JIT tax on liquidity changes, with the tax split between LPs (compensated via rewards), creator and protocol.
Owner & admin controls
Owner (Solady Ownable with two-step handover) can withdraw accrued creator revenue via withdrawCreatorRevenue and transfer or renounce ownership; the factory controls setSwapMEVTaxFactor, setJITTaxEnabled, setPriorityFeeTaxFloor, setProtocolSwapFee and setProtocolTaxFee, and can initialize pools; no pause function on the hook itself, but a factory-driven withdraw-only mode blocks swaps and liquidity additions; no proxy/upgrade mechanism observed.

Enabled Uniswap v4 callbacks

beforeInitialize, afterAddLiquidity, afterRemoveLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta, afterAddLiquidityReturnDelta, afterRemoveLiquidityReturnDelta

beforeInitialize reverts to constrain pools to native ETH currency0 and static fees; afterAddLiquidity and afterRemoveLiquidity charge JIT MEV tax and distribute LP rewards; afterAddLiquidityReturnDelta and afterRemoveLiquidityReturnDelta let the hook take the tax from the caller's delta; beforeSwap charges MEV tax and swap fee; afterSwap distributes compensation to in-range LPs by tick and collects the exact-out fee; beforeSwapReturnDelta and afterSwapReturnDelta let the hook take those amounts from the swap delta.

Security & trust assessment

Risk level: medium (verified source, high confidence).

Who controls it: The factory holds broad control: it can change MEV tax factors, the tax floor, JIT tax toggle and protocol fee splits (bounded by total-fee checks), and can switch the contract into withdraw-only mode that reverts swaps and liquidity adds. The owner can withdraw accrued creator revenue to any address.

Risk to user funds: The hook takes tax and fee amounts from swaps and liquidity changes via return deltas and holds minted ERC-6909 claims and creator revenue, which are paid out to LPs or withdrawn by the owner. Users' pool principal is not directly held, but swaps and liquidity additions can be blocked by withdraw-only mode and taxed heavily by admin-set parameters.

Security findings

  • [medium] Adjustable MEV tax rate: Factory can raise swapMEVTaxFactor up to 9999 and priorityFeeTaxFloor up to 100 gwei, so the MEV tax on priority-fee-bearing swaps can be made very large, effectively taxing swaps heavily.
  • [medium] Protocol fee share adjustable by factory: Factory can set protocolSwapFee and protocolTaxFee, bounded only so that creator plus protocol fees stay at or below 100%, so the protocol share of a pool's swap fees and taxes can be raised to nearly all of it.
  • [medium] Withdraw-only mode can halt trading for a pool: When the factory sets withdraw-only mode, swaps and liquidity additions revert while removals still work; the mode is pulled by pullWithdrawOnly and cannot be reverted from this contract.
  • [low] Owner can withdraw creator revenue: Owner can call withdrawCreatorRevenue to transfer any currency held by the hook, which holds accrued creator fee and tax balances, to an arbitrary address.
  • [info] Hook custodies fee and reward balances: Hook holds ERC-6909 native currency claims (LP tax rewards) and creator fee balances; these are the funds at risk if the owner or factory keys are compromised.

Contract details

Verified source
Yes (AngstromL2)
Compiler
solc 0.8.26+commit.8a97fa7a
Bytecode size
23,156 bytes
Upgradeable proxy
No
Detected patterns
erc6909-claims, mev-protection, moves-currency, ownable, return-delta, rewards, tax

Pools using AngstromL2