UniswapV4Hook on Unichain

Uniswap v4 Hook Contract 0xc1e1425c8059c1338731d7be16735e1437e180c0 on Unichain · Utility · Verified contract

Volume (24h)
$0.37
Value locked (TVL)
$22
All-time volume
$43
Pools using this hook
1
Swaps (24h)
6 (4 traders)
Total swaps
259

What it does

A Uniswap v4 hook that routes post-swap profit from a Reflex backrun back to the pool's LPs by donating it into the pool, while letting a configured router set fees for its own swaps.

How it works step by step

  • beforeSwap enables a router-specific fee override when the swap sender matches the configured Reflex router
  • afterSwap computes amountIn from the swap delta and calls the Reflex router to trigger a backrun for profit
  • Profit tokens received by the hook are matched against pool currencies, including WETH to native ETH equivalence
  • Matching profit is donated to in-range LPs through PoolManager.donate and then settled
  • If donation fails or the token does not match a currency, the profit is transferred to tx.origin as a fallback
  • Owner can update the router address and config ID used by the integration
Swap behaviour
beforeSwap restricts calls to the PoolManager and sets a fee override flag when the swap sender is the Reflex router; afterSwap computes the input amount, calls the Reflex router to extract profit, and distributes the hook's profit balance to pool LPs or to tx.origin.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
beforeSwap returns the OVERRIDE_FEE_FLAG for swaps whose sender is the configured Reflex router, letting the pool apply the fee override path for router-originated swaps; the hook itself does not take a fee and the returned fee value is governed by the pool's override logic, so for non-router swaps the pool's static fee applies.
Owner & admin controls
Owner (immutable, set at deployment) can call setReflexRouter and setReflexConfigId via _onlyReflexAdmin, redirecting which router is called on every swap and which profit-distribution config is used; owner is immutable so it cannot be transferred, and there is no pause or upgrade mechanism found.

Enabled Uniswap v4 callbacks

beforeSwap, afterSwap

beforeSwap: restricts to the PoolManager and returns a fee override flag for router-sent swaps. afterSwap: calls the Reflex router to backrun the swap, then donates any profit token received back to in-range LPs via PoolManager.donate (falling back to tx.origin if donation fails).

Security & trust assessment

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

Who controls it: The owner can point the hook at an arbitrary router address via setReflexRouter, so a malicious or compromised owner could route every swap's afterSwap callback to a contract that reroutes or drains tokens the hook holds, and can change the configId that determines profit distribution.

Risk to user funds: The hook holds profit tokens transiently and transfers them to the PoolManager or to tx.origin; it does not hold user principal, but a malicious router set by the owner could receive and route those profit balances, and the swap path is not paused by any mechanism.

Security findings

  • [medium] Profit fallback paid to tx.origin: afterSwap calls the router with tx.origin as recipient and sends any fallback profit to tx.origin, so proceeds are not bound to the pool's LPs when donation fails.
  • [medium] Owner can repoint trusted router instantly: setReflexRouter has no timelock or event-delay; a single owner transaction swaps the router that receives every afterSwap call and the hook's token balances are exposed to that router.
  • [low] Silent failure of external calls: The try/catch around the router call and the donate call swallow failures silently, so a failing router or donate reduces LP rewards without reverting the swap.
  • [low] Immutable owner key: The hook is deployed with an immutable owner that cannot be rotated; loss of that key permanently locks router and config administration.
  • [info] Router-only fee override: Pool-level swap fee is overridden for router-originated swaps via OVERRIDE_FEE_FLAG, a router-specific fee path.

Contract details

Verified source
Yes (UniswapV4Hook)
Compiler
solc 0.8.30+commit.73712a01
Bytecode size
5,333 bytes
Upgradeable proxy
No
Detected patterns
donates, moves-currency

Pools using UniswapV4Hook