BullV2Hook
BSCBullV2Hook is a Uniswap v4 hook on BSC. Live for 4 days. Still in use: 57 trades in the last week, and 3 new pools this week.
- Contract name
- BullV2Hook
How this hook works
Trading taxA trading tax hook. It takes a tax on trades, manages its own liquidity and trades on its own.
Takes a tax on trades
On top of the normal pool fee, it keeps part of each trade as a tax. Buys and sells can be charged differently. The tax 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 onlyPoolManager returns (bytes4, int128) { address token = key.currency1; Info memory c = infoOf[token]; bool buy = params.zeroForOne; bool specifiedIsNative = (params.amountSpecified < 0) == buy; uint256 nativeTax = _pendingNative; uint256 tokenTax = _pendingToken; _pendingNative = 0; _pendingToken = 0; (uint256 nativeRate, uint256 tokenRate) = _rates(c, buy); uint256 unspecifiedTax; if (specifiedIsNative) { if (tokenRate > 0) { unspecifiedTax = int256(delta.amount1()).abs() * tokenRate / 1_000_000; tokenTax = unspecifiedTax; } } else if (nativeRate > 0) { unspecifiedTax = int256(delta.amount0()).abs() * nativeRate / 1_000_000; nativeTax = unspecifiedTax; } if (nativeTax > 0) _splitNative(token, c, nativeTax); if (tokenTax > 0) { poolManager.take(token, address(this), tokenTax); require(IERC20Min(token).transfer(DEAD, tokenTax), "BURN"); } if (nativeTax > 0 || tokenTax > 0) emit TaxTaken(token, buy, nativeTax, tokenTax); if (!buy) { try this.restoreLaunchPrice{gas: 400_000}(token) {} catch {} } if (pendingLiquidity[token] >= LIQUIDITY_MIN) { try this.addLiquidityFromTax{gas: 400_000}(token) {} catch {} } // …Manages its own liquidity
It adds and removes liquidity itself, so it can own part or all of the pool.
The code that does this (addLiquidityFromTax):function addLiquidityFromTax(address token) external onlySelf { uint256 amount = pendingLiquidity[token]; require(amount >= LIQUIDITY_MIN, "LOW"); int24 tick = _currentTick(token); int24 lower = V4Math.floorTick(tick) + TICK_SPACING; int24 upper = infoOf[token].launchTick; require(lower < upper, "AT_LAUNCH"); uint256 sa = V4Math.sqrtPriceAtTick(lower); uint256 sb = V4Math.sqrtPriceAtTick(upper); uint256 liq = V4Math.mulDiv(V4Math.mulDiv(amount - 2, sa, V4Math.Q96), sb, sb - sa); require(liq > 0 && liq <= type(uint128).max, "LIQ"); (int256 d, ) = poolManager.modifyLiquidity(poolKey(token), ModifyLiquidityParams(lower, upper, int256(liq), bytes32(0)), ""); require(d.amount1() == 0 && d.amount0() < 0, "ONE_SIDED"); uint256 used = uint256(int256(-d.amount0())); require(used <= amount, "OVER"); poolManager.burn(address(this), uint256(uint160(NATIVE)), used); pendingLiquidity[token] = amount - used; liquidityAdded[token] += used; emit LiquidityAdded(token, lower, upper, uint128(liq), used); }Trades on its own
It makes trades itself, for example to convert the fees it collected.
The code that does this (restoreLaunchPrice):function restoreLaunchPrice(address token) external onlySelf { uint160 launch = uint160(V4Math.sqrtPriceAtTick(infoOf[token].launchTick)); if (_currentSqrtPrice(token) <= launch) return; int256 d = poolManager.swap(poolKey(token), SwapParams(true, -1, launch), ""); require(d == 0, "NOT_EMPTY"); }Liquidity can’t be removed directly
Nobody can remove liquidity from its pools through Uniswap directly. It can only leave through the hook’s own code, if the hook allows it.
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) { require(sender == POSITION_MANAGER && _launching == key.currency1 && key.currency1 != address(0), "ONLY_LAUNCH"); return msg.sig; }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 key, uint160) external view onlyPoolManager returns (bytes4) { require(sender == factory, "ONLY_FACTORY"); require(key.currency0 == NATIVE && key.hooks == address(this) && key.fee == LP_FEE && key.tickSpacing == TICK_SPACING && infoOf[key.currency1].registered, "KEY"); return msg.sig; }
Who controls it: The hook developer can change which launcher it works with. 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 auditWhat 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
- Took its tax from a trade 57 times
Latest transactions
- 0xe9fe6e07…42433c block 135,616,569 · 0.000170 SHADE
- 0xea32751d…86e507 block 135,529,611 · 0.000259 SHADE
- 0x2c08749b…a36ee2 block 135,508,897 · 0.0000919 SHADE
- 0xefcbce19…9fd63b block 135,450,497 · 0.000209 SHADE
- 0xfed90b13…bd6679 block 135,448,392 · 0.000608 SHADE
- 0x4b52847f…b4c1bb block 135,439,783 · 0.000627 SHADE
- 0x082a7eb7…032fb3 block 135,439,418 · 0.000159 SHADE
- 0x5c0332a2…a85a35 block 135,439,091 · 0.0000559 SHADE
- 0x28f5c191…2f9e00 block 135,437,324 · 0.000416 SHADE
- 0x893cd7ea…ae8540 block 135,437,034 · 0.000759 SHADE
- Paid a tax bnb 57 times
Latest transactions
- 0xe9fe6e07…42433c block 135,616,569 · 0.000128 SHADE
- 0xea32751d…86e507 block 135,529,611 · 0.000194 SHADE
- 0x2c08749b…a36ee2 block 135,508,897 · 0.0000689 SHADE
- 0xefcbce19…9fd63b block 135,450,497 · 0.000157 SHADE
- 0xfed90b13…bd6679 block 135,448,392 · 0.000456 SHADE
- 0x4b52847f…b4c1bb block 135,439,783 · 0.000470 SHADE
- 0x082a7eb7…032fb3 block 135,439,418 · 0.000119 SHADE
- 0x5c0332a2…a85a35 block 135,439,091 · 0.0000419 SHADE
- 0x28f5c191…2f9e00 block 135,437,324 · 0.000312 SHADE
- 0x893cd7ea…ae8540 block 135,437,034 · 0.000570 SHADE
- Burned tokens 46 times
Latest transactions
- 0xe9fe6e07…42433c block 135,616,569 · 20.46 SHADE
- 0xea32751d…86e507 block 135,529,611 · 30.62 SHADE
- 0x2c08749b…a36ee2 block 135,508,897 · 11.47 SHADE
- 0xefcbce19…9fd63b block 135,450,497 · 26.39 SHADE
- 0xfed90b13…bd6679 block 135,448,392 · 67.63 SHADE
- 0x4b52847f…b4c1bb block 135,439,783 · 67.71 SHADE
- 0x082a7eb7…032fb3 block 135,439,418 · 18.89 SHADE
- 0x5c0332a2…a85a35 block 135,439,091 · 6.35 SHADE
- 0x28f5c191…2f9e00 block 135,437,324 · 46.13 SHADE
- 0x893cd7ea…ae8540 block 135,437,034 · 71.18 SHADE
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.