ERC20THook on Ethereum
Uniswap v4 Hook Contract 0x05e1934d8b52a8ded4f3f42aa9a7a12244192544 on Ethereum · Launchpad · Verified contract
- Volume (24h)
- $4.74K
- Value locked (TVL)
- $0
- All-time volume
- $4.74K
- Pools using this hook
- 6
- Swaps (24h)
- 187 (53 traders)
- Total swaps
- 187
What it does
This hook taxes trades in ERC20T launch tokens: buys and sells pay a token-configured tax taken from the output, which is converted to ETH and paid to the token's fee recipients, with a fixed 0.15% protocol cut, while LP removals are always allowed and LP additions are only allowed during launch or when external liquidity is enabled.
How it works step by step
- Acts as the shared hook for ERC20T launch tokens: each token gets one canonical pool against ETH, an opted-in native ERC20T quote, or a registered external base token, validated in beforeInitialize.
- On afterSwap, takes a token-level tax (taxBps read from the token, floor 30 bps and cap 9900 bps) from the swap output via afterSwapReturnDelta, and reports that amount back to PoolManager as a return delta.
- For buys where the output is the token, converts the collected token fee into the quote currency and then into ETH through the quote's direct ETH pool before distributing.
- Pays collected fees out as native ETH to the token's fee recipient, a decay recipient, and a protocol recipient; the protocol share is a fixed 0.15% of the swap output (PROTOCOL_FEE_BPS = 15).
- Tracks settlement by forwarding post-tax deltas to the token via accountTransferDelta and enforces transfer allowances via increaseTransferAllowance.
- Gates liquidity additions (afterAddLiquidity) so they are only permitted while the token is launching or external liquidity is enabled; removals always remain allowed.
- Swap behaviour
- Only exact-input swaps are accepted; exact-output reverts. Each swap has the token's current tax (taxBps, between the resting rate and 99%) taken from the output side as a return delta, so the trader receives output minus that tax. Buys of the token pay this tax (converted to ETH and distributed); sells of the token also pay it in the quote currency. The protocol takes an additional 0.15% share of the ETH proceeds, and the amount for the decay recipient is the portion of the rate above the resting rate. Swaps revert if a fee conversion is partial or if the required ETH/quote liquidity is missing.
- Liquidity behaviour
- afterAddLiquidity reverts with ExternalLiquidityDisabled unless the token is still launching or external liquidity is enabled by the token. afterRemoveLiquidity has no restriction beyond the pool being a configured token pool. In both callbacks the hook forwards the caller's deltas to the token's accountTransferDelta so settlement permissions stay in sync; no return delta is taken from liquidity actions.
- Fee behaviour
- The hook does not use the pool's static fee; the pool fee is required to be 0 (dynamic-fee flag) with tick spacing 60. Actual tax is read from the token on every swap: taxBps (capped at 9900 bps and at least the restingTaxBps, which must be between 30 and 500 bps). Collected fees are split into a regular recipient share, a protocol share (0.15% of the swap output), and a decay share (the portion of the rate above the resting rate), all paid out in native ETH; rounding remainder goes to the regular recipient.
- Owner & admin controls
- The hook is Ownable (solady). The owner can register external base tokens and their ETH pools, enable or disable new launches on external bases, set the protocol fee recipient (zero, hook, and PoolManager addresses rejected), and add or remove supplemental distributor addresses. Ownership can be transferred or handed over via a request/complete flow, and can be renounced. The globalDistributorRegistry is immutable. No pause or upgrade mechanism is present in the decoded ABI, and the hook is not a proxy. The per-token tax, recipients and launch policy are controlled by each token contract, not by this hook owner.
Enabled Uniswap v4 callbacks
beforeInitialize, afterAddLiquidity, afterRemoveLiquidity, afterSwap, afterSwapReturnDelta
beforeInitialize: validates pool key and token configuration and marks the token's pool as initialized. afterAddLiquidity: enforces launch/external-liquidity gating and forwards settlement deltas. afterRemoveLiquidity: forwards settlement deltas so LPs can always exit. afterSwap: charges the token tax and performs fee conversion and ETH distribution. afterSwapReturnDelta: lets the hook take the tax as a return delta in the swap output.
Security & trust assessment
Risk level: medium (verified source, medium confidence).
Who controls it: A single hook owner key can redirect the shared protocol fee to an arbitrary address, register new external base tokens with ETH conversion pools that receive trader-paid fee flow, and add or remove supplemental distributors that are exempt from certain transfer rules, affecting every ERC20T token using this hook. Individual tokens control their own tax rates and recipients.
Risk to user funds: The hook holds ETH and token balances transiently during fee conversion and distributes them immediately to recipients in the same transaction; it does not appear to custody user principal. It can block trades by reverting when liquidity is insufficient or when token configuration checks fail, and it can take up to the token-configured tax (up to 99%) from swap output.
Security findings
- [info] Hook takes swap output as return delta: afterSwap returns a positive int128 fee, so the trader's received amount is reduced by the token tax and the hook receives the value through PoolManager accounting; the tax rate is read live from the token contract, not fixed in the hook.
- [medium] Owner can set protocol fee recipient and external bases: The owner can redirect the protocol share of all token fees to any non-zero address via setProtocolFeeRecipient and can register new external base tokens with arbitrary ETH pools (validated only against zero/self/PoolManager/code checks and a non-zero sqrtPrice), which then route fee conversions through that pool.
- [medium] Fee conversion depends on external ETH pool liquidity: Buy-side fees are converted to ETH through the quote's ETH pool; insufficient liquidity or a partial fill causes PartialFeeSwap and reverts the user's trade, meaning a drained or hostile ETH/quote pool can block swaps for that token.
- [low] Registered external base pools can carry their own hooks: Registration deliberately preserves the external pool's hook and fee, so fee conversions execute through hooks and fees not controlled by this contract, adding a trust dependency on those pools.
- [info] Ownable admin with ownership handover: The owner (solady Ownable) can transfer ownership or renounce it; a single compromised owner key can change protocol fee destination and external base registration for all tokens using this hook.
Contract details
- Verified source
- Yes (ERC20THook)
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Bytecode size
- 11,981 bytes
- Upgradeable proxy
- No
- Detected patterns
- erc20, fee-sharing, launchpad, moves-currency, ownable, return-delta, tax
Pools using ERC20THook
- ETH / REWARDS (0.00% fee) — 24h volume $4.74K, TVL $0, 12 swaps today
- ERC20T / IMD (0.00% fee) — 24h volume $0, TVL $0, 169 swaps today
- ETH / GARDEN (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- ETH / GARDEN (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- ETH / PILL (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- ADAM / IMD (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today