LaunchFeeHook
BaseLaunchFeeHook is a Uniswap v4 hook on Base. Live for 3 days. Still in use: 4 trades in the last week, and 3 new pools this week.
- Contract name
- LaunchFeeHook
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 fee can be changed. The fee builds up in the hook until it is collected.
The code that does this (afterSwap):function afterSwap(address, PoolKey calldata key, SwapParams calldata params, int256 delta, bytes calldata) external returns (bytes4, int128) { require(msg.sender == address(poolManager), "only poolmanager"); // PoolManager's own mapping (Hooks.sol): unspecified delta lands // in amount1 when (amountSpecified<0)==zeroForOne, else amount0. bool unspecIs1 = (params.amountSpecified < 0) == params.zeroForOne; int128 u = unspecIs1 ? int128(delta) // amount1 = low 128 bits : int128(delta >> 128); // amount0 = high 128 bits if (u == 0) return (this.afterSwap.selector, 0); uint128 base = uint128(u < 0 ? -u : u); uint16 bps = _bpsFor(key, params.zeroForOne); uint128 fee = uint128(uint256(base) * bps / 10000); if (fee == 0) return (this.afterSwap.selector, 0); address c = unspecIs1 ? key.currency1 : key.currency0; poolManager.take(c, address(this), uint256(fee)); return (this.afterSwap.selector, int128(int256(uint256(fee)))); }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 (bpsFor):function _bpsFor(PoolKey calldata key, bool zeroForOne) internal returns (uint16) { uint16 normal = zeroForOne ? buyBps : sellBps; if (sniperBps <= normal || sniperDecayS == 0) return normal; bytes32 pid = keccak256(abi.encode( key.currency0, key.currency1, key.fee, key.tickSpacing, key.hooks)); uint64 t0 = firstSwapTs[pid]; if (t0 == 0) { t0 = uint64(block.timestamp); firstSwapTs[pid] = t0; } uint256 el = block.timestamp - t0; if (el >= sniperDecayS) return normal; return uint16(uint256(sniperBps) - (uint256(sniperBps - normal) * el / sniperDecayS)); }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 (bpsFor):function _bpsFor(PoolKey calldata key, bool zeroForOne) internal returns (uint16) { uint16 normal = zeroForOne ? buyBps : sellBps; if (sniperBps <= normal || sniperDecayS == 0) return normal; bytes32 pid = keccak256(abi.encode( key.currency0, key.currency1, key.fee, key.tickSpacing, key.hooks)); uint64 t0 = firstSwapTs[pid]; if (t0 == 0) { t0 = uint64(block.timestamp); firstSwapTs[pid] = t0; } uint256 el = block.timestamp - t0; if (el >= sniperDecayS) return normal; return uint16(uint256(sniperBps) - (uint256(sniperBps - normal) * el / sniperDecayS)); }Anyone can trigger payouts
Anyone can collect the fees it has built up, so nobody has to wait on the hook developer.
The code that does this (collectFees):function collectFees(address currency) external { if (currency == address(0)) { uint256 b = address(this).balance; if (b > 0) { (bool ok, ) = feeWallet.call{value: b}(""); require(ok, "eth send"); } } else { uint256 b = IERC20Min(currency).balanceOf(address(this)); if (b > 0) IERC20Min(currency).transfer(feeWallet, b); } }
Who controls it: The hook developer can change the trading limits and the wallets that receive its fees. The hook developer can also change: bps, owner. 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 auditsetBps setSniperWhat 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.
Hook history
Nothing recorded yet.
Counted from token transfers in and out of the hook. Its published code records no actions of its own.