QwireHook on Ink

Uniswap v4 Hook Contract 0x2a2b25be7ac490a9468be03a9a300fd4a9328fcc on Ink · Fee sharing · Verified contract

Volume (24h)
$1.44K
Value locked (TVL)
$11.64K
All-time volume
$959.24K
Pools using this hook
1
Swaps (24h)
13 (8 traders)
Total swaps
2,710

What it does

A Uniswap v4 hook for the QWIRE/WETH pool that skims a fixed 3% WETH tax on swaps to a treasury address and restricts liquidity management to a designated LP manager.

How it works step by step

  • Takes a fixed 3 percent tax on WETH flow in swaps and sends it to the treasury address via poolManager.take
  • Restricts swaps to the canonical router or quoter and to the single registered pool
  • Rejects exact-output swaps to keep tax accounting unambiguous
  • Limits liquidity adds and removals to the lpManager address
  • Forwards QWIRE deltas from liquidity and swap events to the QWIRE token contract for authorization
  • Allows the owner to permanently lock removals and freeze treasury and routing before handing off or renouncing ownership
Swap behaviour
Only the canonical router or quoter may swap, exact-output is rejected, and a 3% tax is taken on WETH-input swaps in beforeSwap and on WETH-output swaps in afterSwap, with the tax sent to the treasury.
Liquidity behaviour
Adds are only permitted from lpManager and remove-liquidity is permitted only from lpManager until removalsLocked is set, after which removals revert permanently. Each add/remove reports the QWIRE side of the delta to the QWIRE token contract via authorizePoolTransfer.
Fee behaviour
Fixed 3% (300 bps) tax on WETH-side flow: on WETH-input swaps it is taken from the input in beforeSwap, on WETH-output swaps it is taken from the output in afterSwap, and the full amount is sent to the treasury address. Pool LP fee is unaffected by this hook.
Owner & admin controls
Owner (two-step transfer, renounce allowed only after all locks fire) can: register the single pool once, set treasury until finalizeTreasury(), set canonical router, quoter and lpManager until finalizeRouter(), and permanently lock liquidity removals via lockRemovals(). No pausing or upgrade mechanism is present; the contract is not a proxy.

Enabled Uniswap v4 callbacks

beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity, afterRemoveLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeAddLiquidity and afterAddLiquidity gate liquidity adds to lpManager and forward QWIRE deltas to the token; beforeRemoveLiquidity and afterRemoveLiquidity do the same for removals and additionally revert when removals are locked; beforeSwap enforces canonical router/quoter sender, the registered pool, rejects exact-output, and takes a 3% WETH-input tax via return delta; afterSwap enforces the registered pool, forwards QWIRE deltas to the token, and takes a 3% WETH-output tax via return delta.

Security & trust assessment

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

Who controls it: The owner can rotate the tax treasury, router, quoter and lpManager until those are finalized, so a compromised key could redirect all tax revenue or route swaps and liquidity through attacker-chosen contracts before finalization. After finalization and lockRemovals the owner cannot change tax destination or remove liquidity, but can still be the one to call renounceOwnership or transfer ownership.

Risk to user funds: The hook can take 3% of WETH from every swap in the registered pool and send it to the treasury address; it does not custody pool balances otherwise. Until treasury is finalized the owner can redirect those taxes, and until removals are locked the lpManager is the only address able to withdraw liquidity.

Security findings

  • [medium] Owner can repoint tax treasury and routing before finalization: Treasury, router, quoter and lpManager are all owner-settable until finalizeTreasury() and finalizeRouter() are called, so the owner can redirect tax flows or swap routing.
  • [low] Hook extracts funds via return deltas: The hook calls poolManager.take to send 3% of WETH to the treasury inside the swap, so the hook directly moves user-side funds; a malicious or misconfigured treasury address would receive them.
  • [low] Trading depends on a single canonical router: Swaps and liquidity operations revert unless sent via the canonical router or quoter and the registered pool, so a router outage or a bug in the router blocks trading in this pool.
  • [info] External QWIRE token authorization dependency: The hook forwards each QWIRE delta to qwire.authorizePoolTransfer, which is an external dependency whose behaviour is not in the reviewed source; if that token contract misbehaves, swaps and liquidity actions in this pool could revert.

Contract details

Verified source
Yes (QwireHook)
Compiler
solc 0.8.26+commit.8a97fa7a
Bytecode size
6,833 bytes
Upgradeable proxy
No
Detected patterns
moves-currency, ownable, return-delta, tax

Pools using QwireHook