DragonXHook on Ethereum

Uniswap v4 Hook Contract 0x6f7243ae6b4ccad256aa6fecd3081f51253b1acc on Ethereum · Limit orders · Verified contract

Volume (24h)
$16
Value locked (TVL)
$41.45K
All-time volume
$156.32K
Pools using this hook
2
Swaps (24h)
1 (1 traders)
Total swaps
1,058

What it does

A Uniswap v4 hook on an ETH pool that adds limit orders implemented as single-tick liquidity epochs and charges a 10% sell tax on market sells and a 0.5% tax on limit order withdrawals, distributing the tax to genesis wallets and a buy-and-stake address.

How it works step by step

  • Places single-tick limit orders as epochs: users deposit liquidity into a tick range, which the hook tracks per epoch and per owner.
  • Fills limit orders in afterSwap when the pool tick crosses a stored epoch boundary, minting ERC6909 claims to the hook for the filled amounts.
  • Lets owners withdraw filled epochs pro rata and cancel unfilled positions via kill, with a 0.5% tax on limit order sells.
  • Applies a 10% tax on market sells, split 30 percent to genesis wallets as WETH and 70 percent to a buyAndStake address as ETH, through return deltas.
  • Maintains a TruncGeoOracle observation array updated on every swap and liquidity change, exposed through observe and observations getters.
Swap behaviour
beforeSwap updates the oracle and, for market sells (zeroForOne false with exact input), takes a 10% tax via return delta. afterSwap fills any limit order epochs crossed by the price move, applies the sell tax on the ETH output for market sells, and updates the tick lower tracker.
Liquidity behaviour
beforeAddLiquidity and beforeRemoveLiquidity only update the TruncGeoOracle observation array. Limit order placement, cancellation and withdrawal are handled through the place, kill and withdraw entry points, which add single-tick liquidity positions and track per-epoch ownership.
Fee behaviour
Sell-side tax is taken via return deltas: market sells (zeroForOne false, exact-input or output path) pay a 10% tax, split 30/100 to genesis wallets (via WETH) and 70/100 to buyAndStake recipient as native ETH; limit order withdrawals pay 0.5% tax, split half to genesis wallets and half to buyAndStake. Pool LP fees are unaffected by the hook.
Owner & admin controls
Owner (Ownable) can set buyAndStake recipient address for all pools, set default genesis wallets and their tax split, and set per-pool genesis wallets and split; owner can renounce or transfer ownership. No pause or upgrade mechanism found.

Enabled Uniswap v4 callbacks

afterInitialize, beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

afterInitialize records the oracle and initial tick lower; beforeAddLiquidity and beforeRemoveLiquidity update the TruncGeoOracle observations; beforeSwap updates the oracle and applies the 10% market sell tax via return delta; afterSwap fills crossed limit order epochs, applies the limit-order sell tax via return delta and updates tick lower last; beforeSwapReturnDelta and afterSwapReturnDelta are enabled so the hook can take a share of swap amounts.

Security & trust assessment

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

Who controls it: The owner can redirect the buyAndStake tax recipient to any address and change genesis wallet addresses and split percentages for default and per-pool configurations, redirecting future tax flows. The owner cannot directly touch user limit order liquidity or deposits.

Risk to user funds: The hook holds ERC6909 claims and temporary balances while settling limit orders and takes ETH and WETH for taxes; users who place limit orders deposit funds that the hook holds until fill or kill. Traders on market sells pay a 10% tax via return delta. The owner cannot directly withdraw user limit order funds, but can change tax recipients.

Security findings

  • [high] Owner can redirect all tax revenue: The owner can set the buyAndStake address and genesis wallets at any time, and these apply immediately to all pools, so a compromised key could redirect all tax revenue.
  • [medium] Swaps carry a 10% sell tax taken by return delta: Market sells are taxed 10% through beforeSwap and afterSwap return deltas, and limit order withdrawals are taxed 0.5%; the hook takes these amounts from the swap outcome, so traders receive less than the pool output.
  • [low] Self-unlock generic callback router: The hook calls poolManager.unlock on itself and uses a generic unlockCallback that executes arbitrary encoded self-calls, which is gated to the pool manager but expands the internal attack surface.
  • [low] Unbounded tick-crossing loop in afterSwap: Limit order fills are triggered from afterSwap by crossing ticks, and the fill loop iterates over all crossed ticks, so large tick moves could make a swap expensive in gas.
  • [info] Permissionless oracle cardinality growth: Oracle observation storage and TruncGeoOracle functions are public, so price history can be read by anyone; increaseCardinalityNext is permissionless and only costs gas.

Contract details

Verified source
Yes (DragonXHook)
Compiler
solc 0.8.30+commit.73712a01
Bytecode size
24,436 bytes
Upgradeable proxy
No
Detected patterns
erc6909-claims, moves-currency, oracle, ownable, return-delta, self-unlock, tax

Pools using DragonXHook