BankrLaunchHook
BaseBankrLaunchHook is a Uniswap v4 hook on Base. Brand new: its first pool went live today. Still in use: 4 trades in the last week, and 3 new pools this week.
- Contract name
- BankrLaunchHook
How this hook works
Trading taxA trading tax hook. It sets the fee at creation, takes a tax on trades and charges more right after launch.
Sets the fee at creation
It sets the pool’s trading fee itself when the pool is created.
The code that does this (afterInitialize):function afterInitialize(address, PoolKey calldata key, uint160, int24 tick) external onlyPoolManager returns (bytes4) { PoolConfig storage c = _pools[PoolId.unwrap(key.toId())]; c.startTick = tick; // Slot 1, its ticks and clock still unset: refTick, refTs, openTick (NS-18 HOOK-2: the launch second opened // here), the fill floor and the liquidity's edge, all at the launch tick (the curve starts on it). assembly ("memory-safe") { let s := add(c.slot, 1) let t := and(tick, 0xffffff) sstore(s, or(sload(s), or(or(t, shl(24, timestamp())), or(shl(168, t), or(shl(192, t), shl(216, t)))))) } poolManager.updateDynamicLPFee(key, 0); // the hook takes the whole fee; the pool's own LP fee is 0 return IHooks.afterInitialize.selector; }Takes a tax on trades
On top of the normal pool fee, it keeps part of each trade as a tax.
The code that does this (beforeSwap):function _beforeSwap(bytes32 id, address sender, SwapParams calldata p, bytes calldata hookData) internal returns (uint256 feeSpecified) { bool nested = _lockCheck(id, sender); PoolConfig storage c = _pools[id]; // A nested swap (the fill's, an extension's own) runs behind an outer one that folded this second already, and // is no trader's start: it leaves the fill floor where that swap put it. if (!nested) _updateReference(id, c); uint24 f = _feePips(c, sender, p.zeroForOne != c.tokenIsCurrency0); bool exactOut = p.amountSpecified > 0; bool quoteIsSpecified = (p.zeroForOne != exactOut) != c.tokenIsCurrency0; // exactIn: input side; exactOut: output uint256 amt = exactOut ? uint256(p.amountSpecified) : uint256(-p.amountSpecified); uint256 w; // the low 24 bits of the word are the clamped pips if (c.hasExtension) { w = nested ? 0 : _extQuote(id, c, sender, p, hookData, f); // Q27-B: a nested swap is a plain Bankr swap _tstore(TS_EXT_PIPS, w); } if (quoteIsSpecified) { // Each on the whole gross the trader pays, the other fee included (H13 AMM-I2); sized on its own pips, never // folded into f (I1). The extension's whenever the quote ran, 0 pips included, as afterSwap sizes it, so an // exact-in sell estimated at fee 0 lands once it charges (r4 EXT-1, r5 ADM-1; other shapes: README). // forge-lint: disable-next-line(unsafe-typecast) feeSpecified = FeeMath.feeFor(amt, f, uint24(w), exactOut); // under 2^127, or beforeSwap's own return reverts: the pips sit clear of it _tstore(TS_FEE_SPECIFIED, feeSpecified | uint256(f) << 128); // forge-lint: disable-next-line(unsafe-typecast) if (w != 0) feeSpecified += _extFeeOf(amt, uint24(w), f, exactOut, feeSpecified); } else { _tstore(TS_FEE_SPECIFIED, uint256(f) << 128); // …Higher at launch
The tax starts higher right after launch and comes down over time, which makes it costly for bots to buy first.
The code that does this (buyFeeOf):function buyFeeOf(uint256 head, uint256 buy) internal view returns (uint24 f, bool hasExtension, bool decaying) { hasExtension = uint8(head >> 240) != 0; PoolSide memory s = _side(buy); f = FeeMath.sideFeeAt(s, _notAfterNow(uint40(head >> 16)), block.timestamp); decaying = f > s.steadyPips; }Buys back the token
It uses what it collects to buy the token back.
The code that does this (compoundSwap):function _compoundSwap( bytes32 id, PoolConfig storage c, PoolKey memory key, bool t0, int24 lower, int24 upper, uint256 amount ) internal returns (Slice memory s) { uint256 tokenHeld = c.heldToken; (uint160 sqrtP, int24 spot) = _slot0(id); uint256 x = _quoteToSwap( sqrtP, TickMath.getSqrtPriceAtTick(lower), TickMath.getSqrtPriceAtTick(upper), amount, tokenHeld, t0 ); uint160 limit = _swapLimit(c, spot, t0); if (x != 0 && (t0 ? limit > sqrtP : limit < sqrtP)) { // x <= amount, a uint128 quote balance (ERC-6909), so it fits int256 // forge-lint: disable-next-line(unsafe-typecast) BalanceDelta d = poolManager.swap(key, SwapParams(!t0, -int256(x), limit), ""); // quote in, TOKEN out s.got = uint256(uint128(t0 ? d.amount0() : d.amount1())); s.spent = uint256(uint128(-(t0 ? d.amount1() : d.amount0()))); } s.quote = amount - s.spent; s.token = tokenHeld + s.got; }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 (extQuote):function _extQuote( bytes32 id, PoolConfig storage c, address sender, SwapParams calldata p, bytes calldata hookData, uint24 f ) internal view returns (uint256 w) { if (sender == factory) return 0; // first: on a scheduled launch the dev buy runs before initTimestamp ExtBinding storage b = _ext[id]; { uint256 sunset = b.sunsetSecs; if (sunset != 0 && block.timestamp - c.initTimestamp >= sunset) return 0; } address e = b.ext; if ((b.ownerSwitch && _switchedOff[e]) || e.codehash != b.codehash) return 0; (uint160 px,) = _slot0(id); w = uint256(px) << 24; if (!b.quoteOnly) w |= EXT_CALL_DUE; if (f >= b.feeCeilingPips) w |= EXT_NO_ROOM; SwapCtx memory ctx = _ctx(id, c, sender, p, f, px); uint256 g = b.quoteGas; // the binding's budget, in ext's slot (uint256 q, uint256 spent) = _probeQuote(e, g, abi.encodeCall(IBankrHookExtension.quote, (ctx, HookData.extData(hookData)))); bool isBuy = p.zeroForOne != c.tokenIsCurrency0; // The post-swap check reserves the slack too, so a quote's gas cannot move its threshold (audit r2 EXT-1); at // 63/64, what afterSwap's frame receives of it (EIP-150: both callbacks are the PoolManager's calls, r4 EXT-1). if (spent < g) w |= (g - spent) * 63 / 64 << 184; // < 2^24 if (q == EXT_REFUSE) { if (isBuy) revert ExtensionRefusedBuy(); // Q31-B: buys only, holders can always sell // …Rules for adding liquidity
It decides who can add liquidity, or when.
The code that does this (beforeAddLiquidity):function beforeAddLiquidity(address sender, PoolKey calldata, ModifyLiquidityParams calldata, bytes calldata) external view onlyPoolManager returns (bytes4) { if (sender != _cfg.locker) revert LiquidityNotLocker(); return IHooks.beforeAddLiquidity.selector; }Anyone can trigger payouts
Anyone can reinvest what it has collected, so nobody has to wait on the hook developer.
The code that does this (compound):function _compound(bytes32 id) internal returns (uint128 L, int24 lower, int24 upper) { PoolConfig storage c = _pools[id]; PoolKey memory key = _keys[id]; bool t0 = c.tokenIsCurrency0; uint256 backlog = _pullBacklog(id, c) + c.heldQuote; uint256 amount = _compoundAmount(backlog, c); if (amount == 0) { c.heldQuote = backlog; emit CompoundSkipped(id, SkipReason.BELOW_THRESHOLD); return (0, 0, 0); } c.lastCompoundTs = uint40(block.timestamp); (lower, upper) = _straddleBand(id); // The band may reach under every earlier one: the liquidity's edge follows it (slot 1 bits 216..239). assembly ("memory-safe") { let s := add(c.slot, 1) let w := sload(s) let e := signextend(2, shr(216, w)) let x := signextend(2, lower) let under := slt(x, e) if iszero(t0) { x := signextend(2, upper) under := sgt(x, e) } if under { sstore(s, or(and(w, not(shl(216, 0xffffff))), shl(216, and(x, 0xffffff)))) } } Slice memory s = _compoundSwap(id, c, key, t0, lower, upper, amount); uint256 oT; uint256 oQ; (L, oT, oQ) = _compoundPlace(id, key, t0, lower, upper, s); // …
Who controls it: Nobody. The hook has no admin functions, and 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 auditlocker on every trade.Uniswap’s PoolManager, BankrGuardLens, BankrLaunchFactory: 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.
Pools using it let the hook choose the swap fee instead of a fixed tier.
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
- Registered a new pool 3 times
Latest transactions
- 0x60e9f737…0df818 block 57,981,005
- 0x168297eb…ac6668 block 57,979,752
- 0xf6549b6a…a47d80 block 57,979,449
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.