V4LaunchHook
BaseV4LaunchHook is a Uniswap v4 hook on Base. Live for 1 day. No trades in the last month, but 8 new pools this week.
- Contract name
- V4LaunchHook
How this hook works
Trading taxA trading tax hook. It takes a cut of every trade, charges more right after launch and limits trading to stop bots.
Takes a cut of every trade
On top of the normal pool fee, it keeps a share of each trade.
The code that does this (beforeSwap):function beforeSwap(address sender, PoolKey calldata key, SwapParams calldata params, bytes calldata hookData) external onlyPoolManager returns (bytes4, BeforeSwapDelta, uint24) { PoolId id = key.toId(); LaunchTypes.Launch storage L = _launch[id]; if (!L.exists) return (IHooks.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, 0); Currency quote = _quote[id]; Currency inputCurrency = params.zeroForOne ? key.currency0 : key.currency1; bool exactInput = params.amountSpecified < 0; bool quoteIn = Currency.unwrap(inputCurrency) == Currency.unwrap(quote); if (!exactInput) { // Exact-output sell (token -> exactly `amountSpecified` quote): taxed here, on the quote // out. Exact-output buys are taxed in afterSwap, once the quote input is known. if (quoteIn) return (IHooks.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, 0); return _exactOutputSell(id, L, quote, uint256(params.amountSpecified), hookData); } // Exact-input sells are taxed in afterSwap, on the quote proceeds. if (!quoteIn) return (IHooks.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, 0); uint256 amountIn = uint256(-params.amountSpecified); uint16 totalBps; if (launchBuyOpen[id] && sender == factory) { // The router's own launch buy: base fee, no anti-snipe surplus. One use, then closed. // `sender` is whoever called PoolManager.swap, so no other router or contract can use it. launchBuyOpen[id] = false; totalBps = L.fees.creatorBps + L.fees.protocolBps + L.fees.referrerBps; // …Higher at launch
The fee starts higher right after launch and comes down over time, which makes it costly for bots to buy first.
The code that does this (currentTotalFeeBps):function _currentTotalFeeBps(LaunchTypes.Launch storage L) internal view returns (uint16) { if (!L.exists) revert UnknownLaunch(); uint16 end = L.fees.creatorBps + L.fees.protocolBps + L.fees.referrerBps; uint256 elapsed = block.timestamp - L.launchedAt; if (elapsed >= L.antiSnipeSeconds) return end; uint256 start = L.antiSnipeStartBps; return uint16(start - ((start - end) * elapsed) / L.antiSnipeSeconds); }Limits on trading
It limits trading, for example a max buy or wallet size or a wait between trades, to stop bots grabbing the supply before real traders.
The code that does this (currentTotalFeeBps):function _currentTotalFeeBps(LaunchTypes.Launch storage L) internal view returns (uint16) { if (!L.exists) revert UnknownLaunch(); uint16 end = L.fees.creatorBps + L.fees.protocolBps + L.fees.referrerBps; uint256 elapsed = block.timestamp - L.launchedAt; if (elapsed >= L.antiSnipeSeconds) return end; uint256 start = L.antiSnipeStartBps; return uint16(start - ((start - end) * elapsed) / L.antiSnipeSeconds); }Liquidity is locked
Nobody can take liquidity out of its pools, so they can’t be drained (a rug pull).
Rules for adding liquidity
It decides who can add liquidity, or when.
The code that does this (beforeAddLiquidity):function beforeAddLiquidity(address sender, PoolKey calldata key, ModifyLiquidityParams calldata, bytes calldata) external view onlyPoolManager returns (bytes4) { PoolId id = key.toId(); if (!_launch[id].exists) revert UnknownLaunch(); if (seeded[id]) revert ExtraLiquidityForbidden(); if (sender != seeder[id]) revert ExtraLiquidityForbidden(); return IHooks.beforeAddLiquidity.selector; }Only approved callers create pools
New pools with this hook can only be created by approved callers, for example its own factory or launcher.
The code that does this (beforeInitialize):function beforeInitialize(address sender, PoolKey calldata, uint160) external view onlyPoolManager returns (bytes4) { if (sender != factory) revert NotFactory(); return IHooks.beforeInitialize.selector; }
Who controls it: The pool creator can call: transfer creator, accept creator, cancel transfer. The code cannot be changed.
Based on the hook’s published code.What do these labels mean?
Safety report
Before you build on it. Automated checks, not an auditV4FeeEscrow: nothing there can change how trades go.What it can do
Its code executes inside each trade in pools that use it.
It can take or add tokens during a swap. Fees, burns and custom curves work this way, and so do scams.
It runs before liquidity is removed, so it can delay or refuse LP exits.
It checks every deposit before it goes in.
It runs when a pool is created, often to lock in that pool’s settings.
Hook history
- Added starting liquidity 8 times
Latest transactions
- 0xb168b30d…74e0c0 block 61,545,462
- 0x34e90822…bd1893 block 61,544,869
- 0xbea2e75a…7a673c block 61,516,316
- 0x8a926a77…80c97f block 61,509,410
- 0xbe900bdc…62a703 block 61,482,808
- 0xe8e65704…3ce1c0 block 61,106,285
- 0xb0fbfcf6…693787 block 61,104,937
- 0xf9ed68cd…49ae73 block 61,001,257
- Registered a launch 8 times
Latest transactions
- 0xb168b30d…74e0c0 block 61,545,462
- 0x34e90822…bd1893 block 61,544,869
- 0xbea2e75a…7a673c block 61,516,316
- 0x8a926a77…80c97f block 61,509,410
- 0xbe900bdc…62a703 block 61,482,808
- 0xe8e65704…3ce1c0 block 61,106,285
- 0xb0fbfcf6…693787 block 61,104,937
- 0xf9ed68cd…49ae73 block 61,001,257
- Accepted the creator 3 times
Latest transactions
- 0xe49f9561…9d8b33 block 61,516,585
- 0x3dcba304…30f9f6 block 61,511,425
- 0x8e09f2be…1233a1 block 61,003,021
Settings changes: proposed a new controlling wallet (3 times).
Counted from what the hook recorded on-chain across all its pools, for every action in its published code, plus token transfers in and out of it.