DragonXHook on Ethereum

Uniswap v4 Hook Contract 0xd10538020a7cff713604f96434ca9c70727cdacc on Ethereum · Fee sharing · Verified contract

Volume (24h)
$0
Value locked (TVL)
$0
All-time volume
$26
Pools using this hook
2
Swaps (24h)
0 (0 traders)
Total swaps
21

What it does

DragonX is a Uniswap v4 hook on ETH pools that applies a 10% tax to market sells, funnels that tax to genesis wallets and a buy-and-stake address, and adds on-chain limit orders that fill as the price crosses their range.

How it works step by step

  • Places single-sided limit orders across tick ranges and tracks them as epochs per pool, tick range and direction.
  • Fills crossed epochs automatically in afterSwap by removing liquidity and holding the proceeds as ERC6909 claims.
  • Applies a 10% tax to market sells, split between genesis wallets and a buy-and-stake address.
  • Charges a 0.5% tax on limit order sell withdrawals, split half to genesis wallets and half to buy-and-stake.
  • Maintains a TruncGeo oracle of tick and seconds-per-liquidity observations for each pool.
  • Allows the owner to configure genesis wallet recipients and tax splits, per pool or by default.
Swap behaviour
Exact-input market sells (zeroForOne=false) pay a 10% tax, taken as a before-swap return delta on the input and as an after-swap delta on ETH output, distributed to genesis wallets (WETH) and buyAndStake. After each swap the hook fills any crossed limit-order epochs by removing liquidity and minting ERC6909 claims to the hook. Oracle observations are updated before and after swaps.
Liquidity behaviour
place() adds single-sided liquidity at a tick range (tickLower to tickLower+spacing) as a limit order and records the depositor in an epoch. kill() removes a depositor's share and returns tokens, distributing accrued fees to remaining placers unless it is the last order. withdraw() pays out filled epochs pro-rata via ERC6909 claims burned from the hook. beforeAddLiquidity/beforeRemoveLiquidity only update the TruncGeo oracle.
Fee behaviour
Market sells (ETH output direction, zeroForOne=false with exact-input swaps) are charged a 10% tax, taken via beforeSwap return delta and afterSwap return delta (sell tax on output). The tax is split 30/(30+70) to genesis wallets (distributed by the owner-configured split, WETH-wrapped) and 70/(30+70) to buyAndStake. Limit order withdrawals of the sell side pay a 0.5% tax, half to genesis wallets and half to buyAndStake. Pool fees are otherwise the pool's own fee.
Owner & admin controls
Owner (Ownable) can set the buy-and-stake recipient address via setBuyAndStake, replace default genesis wallets and their tax splits via setDefaultGenesisWallets, and set per-pool genesis wallets via setGenesisWallets; ownership can be transferred or renounced. Owner cannot pause swaps or withdraw user funds directly. No upgrade proxy is evident.

Enabled Uniswap v4 callbacks

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

afterInitialize: records the initial oracle observation and tick-lower baseline and requires currency0 to be native ETH. beforeAddLiquidity/beforeRemoveLiquidity: update the TruncGeo oracle observations. beforeSwap: updates oracle and applies a 10% market sell tax as a return delta on exact-input sells. afterSwap: fills crossed limit order epochs by removing liquidity and minting ERC6909 claims, and applies the sell tax as an afterSwap return delta. beforeSwapReturnDelta and afterSwapReturnDelta: allow the hook to take a portion of swap output as tax.

Security & trust assessment

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

Who controls it: The owner can redirect the buyAndStake recipient and change genesis wallet addresses and tax splits for all pools (or per pool), redirecting all future tax revenue. The owner cannot directly seize existing limit order liquidity or ERC6909 balances, and cannot pause the pool.

Risk to user funds: The hook holds ERC6909 claims and transiently holds native ETH during swaps and withdrawals. Limit order liquidity is custodied by the hook in epochs; depositors can exit via kill() and withdraw() without owner involvement. Sell tax is taken from swap output by the hook, reducing what sellers receive, and the owner can redirect where that tax goes.

Security findings

  • [high] Owner can redirect tax revenue instantly: setBuyAndStake and setDefaultGenesisWallets/setGenesisWallets take effect immediately with no timelock, so a compromised owner key could redirect all future sell tax revenue to an arbitrary address.
  • [medium] Swaps can be taxed twice in some paths, and hook moves pool funds via return deltas: beforeSwap and afterSwap both apply a sell tax on the same swap path (beforeSwap taxes netRequested when zeroForOne is false and amountSpecified>0; afterSwap taxes ETH output via _applySellTax). The hook takes funds via return deltas and transfers ETH to recipients through poolManager.take, so swap economics for sellers depend on this logic.
  • [medium] Tax distribution can block swaps on transfer failure: The hook takes native ETH from the pool manager and forwards it to genesis wallets and buyAndStake via WETH deposit/transfer; if a genesis wallet or buyAndStake contract reverts on receipt, swaps and withdrawals could revert, blocking trades.
  • [low] Unbounded fill loop in afterSwap: Limit order epochs are filled inside afterSwap using a tick crossing loop; a large tick range crossing could consume substantial gas, potentially causing swaps to fail for crossing large ranges.
  • [info] Tax rates are hardcoded constants: The contract uses fixed 10% and 0.5% tax rates hardcoded as constants, with no owner-adjustable tax rate, which limits the owner's ability to raise the rate.

Contract details

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

Pools using DragonXHook