AgentGateHook on Ethereum

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

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

What it does

Every buy and sell in the ETH/AGENT pool pays an ETH tax that starts at 85% when trading opens and drops to 1% over 20 minutes, so early trades pay far more than later ones, while the 0.3% LP fee still goes to liquidity providers.

How it works step by step

  • Creates the ETH/AGENT pool only through openPool(), which the deployer calls once, and adds AGENT-only single-sided liquidity minted as a position NFT to the deployer
  • Gates trading behind a one-time ignite() call; beforeSwap reverts with NotIgnitedYet until trading is opened
  • Charges a tax on buys and sells that starts at 85% when trading opens and decays linearly to 1% over 20 minutes, then stays at 1%
  • Takes the tax in ETH via beforeSwapReturnDelta or afterSwapReturnDelta depending on whether the trader fixed the ETH side, and holds it as ERC-6909 claims in the PoolManager
  • Lets anyone call sendTax() to forward collected ETH to a deployer-set taxSink, and lets only the deployer call withdraw() to send it to any address
  • Rejects any external attempt to initialize a pool with this hook via beforeInitialize
Swap behaviour
Buys (ETH to AGENT) and sells (AGENT to ETH) both pay the tax, which is 85% at ignition and falls linearly to 1% over 20 minutes, then stays at 1%. Swaps revert before ignite(). For buys with an exact-input ETH amount and sells with an exact-output ETH amount, the tax is taken in beforeSwap as a share of the ETH amount; otherwise it is computed on the ETH side in afterSwap and taken on top of the net amount. Early trades therefore pay far more than late trades, and the tax is identical for buys and sells at any given moment.
Liquidity behaviour
No liquidity callbacks. The hook does not act on liquidity additions or removals, but the initial position is minted by the deployer through openPool() and the deployer holds the position NFT and can remove it at any time.
Fee behaviour
The pool's static LP fee is 0.3%, paid to liquidity providers. On top of that the hook applies a time-decaying tax of 85% falling to 1%, always denominated in ETH, collected by the hook as claims in the PoolManager. Collected tax goes to taxSink via sendTax() (permissionless) or to any address via withdraw() (deployer only). The tax rate is fixed in code and cannot be changed.
Owner & admin controls
The deployer, an immutable address, can call openPool() once, ignite() once, setTaxSink() before ignition, withdraw() at any time, and controls the LP position NFT, including collecting its fees or removing liquidity. The deployer cannot pause trading, blacklist addresses, change the tax rate, change the LP fee, or upgrade the contract; the contract is not a proxy.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize rejects all pool creation except the hook's own openPool() call. beforeSwap gates trading until ignition and applies the tax on exact-input buys and exact-output sells. afterSwap applies the tax on exact-output buys and exact-input sells, based on the actual ETH delta. beforeSwapReturnDelta and afterSwapReturnDelta allow the hook to take the tax amount from the swap.

Security & trust assessment

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

Who controls it: The deployer alone controls pool creation, trading start, the tax sink, tax withdrawal to any address, and the LP position including its removal, so a compromised deployer key could drain both the liquidity and the accrued tax.

Risk to user funds: The hook holds tax as ERC-6909 claims in the PoolManager and can move them only through sendTax() to the set sink or withdraw() by the deployer. Traders' swap funds pass through the PoolManager with a tax taken by the hook, and the hook can block all swaps before ignition, but it does not otherwise freeze or confiscate user funds. The liquidity itself is controlled by the deployer through the position NFT.

Security findings

  • [medium] Deployer controls the LP position and can withdraw liquidity: The position NFT is minted to the deployer in openPool(), so the deployer can remove the liquidity at any time and drain the pool's AGENT side; the code notes the position is not locked.
  • [medium] Deployer can withdraw all collected tax: withdraw() is restricted to the deployer and sends the full pending ETH balance of tax claims to any address, so accrued tax is controlled by a single key.
  • [low] Swaps revert until the deployer ignites trading: beforeSwap reverts with NotIgnitedYet while ignitedAt is zero, so trading depends on a deployer transaction that can be delayed indefinitely.
  • [info] Heavy initial tax: The tax starts at 85% when trading opens and decays over 20 minutes, which makes early buys and sells very costly for traders, and the tax is paid in ETH into the PoolManager as claims.
  • [info] Return-delta hook takes funds from swaps: Both beforeSwapReturnDelta and afterSwapReturnDelta are enabled, so the hook takes a share of every swap's ETH, and the logic depends on the tax math being correct.

Contract details

Verified source
Yes (AgentGateHook)
Compiler
solc 0.8.26+commit.8a97fa7a
Bytecode size
8,386 bytes
Upgradeable proxy
No
Detected patterns
return-delta, self-unlock, tax

Pools using AgentGateHook