SpawnerHook on Base
Uniswap v4 Hook Contract 0xb476c448da4453208df4e371fee26f4e630d3044 on Base · Launchpad · Verified contract
- Volume (24h)
- $0
- Value locked (TVL)
- $22.34K
- All-time volume
- $4.35M
- Pools using this hook
- 15,228
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 29,283
What it does
Hook for the SPAWN token tree on Base: every swap in an ETH/spawn-token pool pays a tax of 1% to 99% (rising with token generation) to the hook, which splits the fee between the protocol owner, the token creator and parent-token buybacks, and then mints a new child token with its own pool.
How it works step by step
- beforeInitialize only allows pools where currency0 is native ETH and currency1 is a token registered as a spawn by the Spawner contract; any other pairing reverts with InvalidPairing.
- afterInitialize records the spawn's creator and its tax in basis points (taxInBps, immutable on the Spawn token) in the spawnerFees mapping.
- afterSwap takes a fee of swap amount times taxInBps / 10000 from the unspecified currency through the afterSwapReturnDelta mechanism, so the trader bears it.
- Fees in the spawn token are swapped to ETH inside the same pool. ETH fees accumulate until they reach minimumFeeDistribution (default 0.01 ETH), then are distributed: 50% buys parent-chain tokens for the creator, 25% goes to the creator's btc/acc deposit, 25% goes to the Spawner owner.
- After each taxed swap the hook calls spawner.createSpawn(swapper, spawnToken), which deploys a new child Spawn token (generation plus 1, higher tax) and seeds a single-sided pool for it, with the swapper as the new token's creator.
- Swaps are only accepted from whitelisted routers that expose msgSender(), so the real swapper can be identified.
- Swap behaviour
- No beforeSwap. In afterSwap, if the Spawner is killed it returns zero and takes nothing. Otherwise the sender must be a whitelisted router, or the swap reverts with RouterNotWhitelisted. The hook then calculates a fee from the unspecified-side amount, takes it from the PoolManager, converts it to ETH if needed (an extra internal swap in the same pool), may distribute accumulated fees through several buy swaps and an ETH deposit, creates a new spawn token and pool, emits HookFee and PriceUpdated, and returns the fee as the after-swap delta. A single swap is therefore gas-heavy and has many external calls.
- Liquidity behaviour
- No liquidity callbacks.
- Fee behaviour
- The pool's LP fee is set to 0 by the Spawner. The hook takes a tax of taxInBps per spawn token (1% at generation 0, plus 1% per generation, capped at 99%) as a hook fee on every swap. After the minimum distribution threshold it splits the fee 50% to parent-token buys sent to the creator, 25% to a btc/acc deposit for the creator, and 25% to the Spawner owner. LPs earn no swap fee from these pools.
- Owner & admin controls
- The Spawner owner (read live from spawner.owner()) can call setMinimumFeeDistribution, setParentDepth and whitelistRouters on the hook. The owner can also call kill() on the Spawner, which turns off fees and spawning in the hook, and transferEther on the Spawner. The hook itself is not a proxy and has no pause or upgrade function of its own; the owner role is inherited from the Spawner contract.
Enabled Uniswap v4 callbacks
beforeInitialize, afterInitialize, afterSwap, afterSwapReturnDelta
beforeInitialize checks that the pool is native ETH paired with a registered spawn token. afterInitialize stores the creator and tax rate for the spawn token. afterSwap takes the tax, runs the distribution and spawns the next token. afterSwapReturnDelta lets the hook claim the fee out of the swap's output or input amount.
Security & trust assessment
Risk level: high (verified source, high confidence).
Who controls it: The Spawner owner can whitelist or de-whitelist routers, tune parentDepth and the minimum distribution, kill the system, and withdraw ETH held by the Spawner contract, and receives 25% of every distributed fee. It cannot directly withdraw pool liquidity through this hook.
Risk to user funds: The hook does not custody user deposits, but it takes a percentage of each swap as a fee through return deltas and holds the fee temporarily. Swaps from non-whitelisted routers revert, so trades through unlisted routers are blocked. A reverting external call or a parentDepth of 0 can block swaps. Spawn LP positions are held by the Spawner contract, not by users.
Security findings
- [high] Very high swap tax up to 99%: Each generation's tax rises 1% per level and is capped at 99% (getTaxInBps). The hook takes it through afterSwapReturnDelta, so deep-generation tokens can lose almost all swap value to fees.
- [medium] Owner can change the router whitelist and parentDepth: The Spawner owner controls whitelistRouters, setParentDepth and setMinimumFeeDistribution. Removing routers reverts swaps from them (unless the Spawner is killed). Setting parentDepth to 0 makes the distribution divide by zero, so swaps that reach distribution would revert.
- [medium] Swaps depend on many external calls: afterSwap calls the Spawner, creates new tokens and pools via the position manager, runs nested swaps in the same pool and deposits to btc/acc. A failure in any of these reverts the user's swap, and the hook has no try/catch.
- [low] Fees held and routed through the hook: The hook takes fees into its own balance and keeps spawnerFeesBalance below the threshold. Distribution sends 25% to the owner and the rest to the creator and btc/acc. The hook has no withdraw function, but ETH and tokens can sit in the hook until distribution.
- [info] Kill switch and unusual design: The Spawner owner can call kill(), which disables the fee and spawning. Spawn creation is permissionless for any whitelisted-router swapper, and the token naming and the pyramid-style structure are part of the design.
Contract details
- Verified source
- Yes (SpawnerHook)
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Bytecode size
- 11,433 bytes
- Upgradeable proxy
- No
- Detected patterns
- access-control, return-delta
Pools using SpawnerHook
- ETH / SPAWN15076 (0.00% fee) — 24h volume $0, TVL $1.91, 0 swaps today
- ETH / SPAWN15207 (0.00% fee) — 24h volume $0, TVL $0.14, 0 swaps today
- ETH / SPAWN15227 (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- ETH / SPAWN15226 (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- ETH / SPAWN15221 (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- ETH / SPAWN15223 (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- ETH / SPAWN15220 (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- ETH / SPAWN15224 (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- ETH / SPAWN15225 (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- ETH / SPAWN15222 (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- ETH / SPAWN15219 (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- ETH / SPAWN15218 (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- ETH / SPAWN15217 (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- ETH / SPAWN15216 (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- ETH / SPAWN15215 (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- ETH / SPAWN15214 (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- ETH / SPAWN15213 (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- ETH / SPAWN15212 (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- ETH / SPAWN15211 (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- ETH / SPAWN15210 (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today