ZeroTraceTaxHook on Ethereum

Uniswap v4 Hook Contract 0x798066ee6b03822ac0789ba355b4005bc05560cc on Ethereum · Dynamic fee · Verified contract

Volume (24h)
$29.57K
Value locked (TVL)
$48.17K
All-time volume
$305.53K
Pools using this hook
1
Swaps (24h)
191 (57 traders)
Total swaps
1,814

What it does

A Uniswap v4 hook for the ETH/ZKTRACE pool that charges a configurable tax of up to 10% on swaps and sends it to a tax wallet.

How it works step by step

  • Restricts the hook to a single ETH/ZKTRACE pool keyed to this hook address and rejects other pools
  • Charges a buy tax and sell tax (buyTaxBps, sellTaxBps) each capped at 10%
  • Takes tax in ETH whenever ETH is the charged currency and in ZKTRACE in rare exact-ETH sell cases
  • Sends collected tax to a configurable taxWallet via poolManager.take
  • Emits Taxed events for each tax collection
Swap behaviour
On buys with exact ETH input the tax is taken from the ETH before the swap (beforeSwap). On sells, buys with exact token output, and exact-out sells, the tax is taken on the unspecified side in afterSwap and returned as a delta.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
Charges a configurable buy tax (buyTaxBps) and sell tax (sellTaxBps), each capped at 10%. Tax is taken from the swap amount via poolManager.take and sent to taxWallet; it is not added to pool LP fees. Buy with exact ETH input is taxed in beforeSwap; sell with exact token input is taxed in afterSwap on the ETH output; buy with exact token output is taxed on the ETH input in afterSwap; sell for exact ETH is taxed in ZKTRACE.
Owner & admin controls
Owner (verified source) can call setTax to change buy and sell tax between 0 and the immutable 10% cap (MAX_TAX_BPS=1000), setTaxWallet to redirect all tax to a new address, and transferOwnership, including to address(0) to renounce. No pause, no upgrade proxy, no withdrawal function.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize: restricts pool initialization to the ETH/ZKTRACE pool keyed to this hook and records the pool id. beforeSwap: computes and takes the buy tax on exact-input ETH buys. afterSwap: computes and takes the tax on the unspecified currency for the remaining swap directions. beforeSwapReturnDelta and afterSwapReturnDelta: allow the hook to return deltas so the tax amount is withheld from the trader's settlement.

Security & trust assessment

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

Who controls it: The owner can set buy and sell tax anywhere from 0% to 10% at any time, including instantly before a trade, and can redirect all tax revenue to any wallet. Owner can also renounce or transfer ownership. Tax can therefore be raised to the 10% cap to extract value from traders, though it cannot exceed that cap.

Risk to user funds: The hook takes a percentage of swap amounts in ETH or ZKTRACE and sends it to taxWallet during each swap. It does not hold a persistent balance and cannot block swaps via a pause. Exposure is limited to the owner-set tax (max 10%) per trade.

Security findings

  • [medium] Owner can change tax rates instantly: Owner can raise buyTaxBps and sellTaxBps up to 1000 bps (10%) with setTax, effective immediately for the next swap.
  • [low] Tax recipient is owner-controlled: setTaxWallet lets the owner redirect all collected tax to any non-zero address with no timelock.
  • [info] Tax taken via return deltas: Hook takes tokens via poolManager.take and return deltas, so tax is withheld from swap settlement; the hook does not custody user funds beyond the same-transaction flow.
  • [info] No upgrade path or pause: The hook is not upgradeable and has no withdrawal or pause function; MAX_TAX_BPS is immutable.

Contract details

Verified source
Yes (ZeroTraceTaxHook)
Compiler
solc 0.8.26+commit.8a97fa7a
Bytecode size
5,919 bytes
Upgradeable proxy
No
Detected patterns
ownable, return-delta, tax

Pools using ZeroTraceTaxHook