AtlasHook on Ethereum

Uniswap v4 Hook Contract 0x0921d61880392b92de54f2a17a7f3b73da78e888 on Ethereum · Custom pricing · Verified contract

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

What it does

A swap-routing hook that splits trades across hardcoded Uniswap v4 and v3/PancakeV3 pools, taking a small donation fee for the pool.

How it works step by step

  • Holds a hardcoded list of Uniswap v4 pools and V3/PancakeV3 pools (USDC/WETH variants) in immutable bytecode.
  • Computes effective prices per pool, adjusting for each pool's fee, and sorts pools to find the best route for a given swap direction.
  • Executes swaps across the chosen pools in sequence, settling and taking currency deltas via the PoolManager.
  • Takes a service fee of 1/16384 of the trade amount and donates it back to the hook's pool.
  • Restricts pool initialization and liquidity addition to a single hardcoded admin address.
Swap behaviour
On every swap the hook computes an on-chain RFQ quote over its embedded pools, sorts them by effective price, routes the amount through the best pools (V4 swap or V3 swap with settle/take), and returns a custom delta so the core pool does not run its own swap.
Liquidity behaviour
beforeAddLiquidity is restricted to ADMIN (tx.origin check), so only the admin can add liquidity to pools using this hook. No liquidity removal callbacks are implemented.
Fee behaviour
Swaps apply a service fee taken as a donation to the pool: the fee is shr(14, amount), a 1/16384 fraction (about 0.006%) donated back via PM.donate to the hook's pool key. Routing compares effective prices adjusted by the fee of each candidate pool; the pool fee itself is the pool's static fee.
Owner & admin controls
ADMIN is hardcoded as 0xEC08EfF77496601BE56c11028A516366DbF03F13 in Constants. beforeAddLiquidity and beforeInitialize revert unless tx.origin equals ADMIN, so only that address can initialize pools or add liquidity through this hook. There is no owner, pause, upgrade proxy or parameter setter; routing data (pool list, fees, RFQ quote) is fixed in immutable bytecode.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeAddLiquidity, beforeSwap, beforeSwapReturnDelta

beforeInitialize restricts pool initialization to ADMIN. beforeAddLiquidity restricts liquidity addition to ADMIN. beforeSwap (with BEFORE_SWAP_RETURNS_DELTA) executes the whole swap itself: it routes amounts across embedded Uniswap v4 and v3/PancakeV3 pools, takes and settles currency deltas, and returns a custom delta so the hook intercepts the swap instead of the core pool logic.

Security & trust assessment

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

Who controls it: The ADMIN key controls which pools can be initialized and who can add liquidity. It cannot change routing, fees, or the pool list, which are fixed in immutable bytecode. Because tx.origin is used, a phishing contract cannot exploit this directly, but ADMIN itself is a single point of trust.

Risk to user funds: The hook takes custody of user input during swaps (via take and settle through PoolManager), executes routes against external pools, and can return custom deltas; funds can be affected by external pool behaviour and by mispriced routing. There is no admin withdrawal function, so the admin cannot directly drain hook balances per the verified source.

Security findings

  • [medium] Hook fully intercepts swaps via return delta: beforeSwap returns a custom delta, so the hook executes swaps by itself and settles against external V3/PancakeV3 pools and V4 pools whose addresses are hardcoded. Users trust the embedded routing data and external pool addresses.
  • [medium] Routing depends on external pool state: beforeSwap uses hardcoded pool addresses and an on-chain RFQ quote (computed from pool slot0 values) to choose routes; pricing depends on the state of the external pools it calls, so manipulated or thin pools could route user swaps poorly.
  • [medium] tx.origin usage and approval exposure: The router path uses tx.origin to pull ERC20 from the signer and to send ETH/token refunds, and the hook uses tx.origin for its admin check. Phishing contracts that call through a user may abuse approvals given to the router.
  • [info] Admin-only liquidity: Pool initialization and liquidity addition are restricted to a single hardcoded ADMIN address, so the hook cannot be used for liquidity by third parties.
  • [low] Debug logging present in router: Several console.log calls remain in the MinimalRouter contract source, indicating test/debug code shipped alongside the hook.

Contract details

Verified source
Yes (AtlasHook)
Compiler
solc 0.8.31+commit.fd3a2265
Bytecode size
6,924 bytes
Upgradeable proxy
No
Detected patterns
return-delta

Pools using AtlasHook