B20MaxBuyHook on Base
Uniswap v4 Hook Contract 0x0b8fcd9e55754bddfe47714095836821fe0bc0c0 on Base · Access control · Verified contract
- Volume (24h)
- $0
- Value locked (TVL)
- $577
- All-time volume
- $2.19M
- Pools using this hook
- 1
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 32,976
What it does
A Base B20 launch hook that caps how much B20 any single transaction, wallet or block can buy during the first 60 blocks after launch, to limit early sniping, and otherwise leaves swaps unchanged.
How it works step by step
- Deployed by the B20 launcher with the pool manager, owner, B20 token and cold-start supply as immutable constructor arguments
- Requires the hook address to encode beforeSwap and afterSwap flags, which the launcher satisfies via CREATE2 salt search
- beforeSwap returns the selector with zero delta and zero fee override, so it does not alter pricing
- afterSwap detects B20 buys and, only during the first 60 blocks, checks amountOut against tx, wallet and block limits that grow linearly over the window
- Tracks boughtDuringColdStart per tx.origin and boughtPerBlock per block, emitting ColdStartBuy on successful buys
- After the cold-start window ends, all limit checks stop applying and the hook becomes a pass-through
- Swap behaviour
- beforeSwap is a no-op returning zero delta and zero fee. afterSwap, for B20 buys only during the first 60 blocks, enforces a per-transaction limit (starting at 0.05% of cold-start supply, rising linearly to full supply), a per-wallet cumulative limit (starting at 0.1%), and a per-block limit (starting at 0.5%), reverting the swap if exceeded and recording purchases otherwise.
- Liquidity behaviour
- No liquidity callbacks.
- Fee behaviour
- Uses the pool's static fee; beforeSwap returns a zero fee override and zero delta.
- Owner & admin controls
- Owner (set to the launch recipient via transferOwnership in the launcher) can only transfer ownership to another non-zero address; no pause, upgrade, or parameter-change functions exist. Limit parameters are immutable constants and coldStartSupply/startBlock are immutable.
Enabled Uniswap v4 callbacks
beforeSwap, afterSwap
beforeSwap is enabled but only returns the selector with zero delta and zero fee override. afterSwap is enabled to inspect B20 buys and enforce cold-start per-transaction, per-wallet and per-block buy caps during the first 60 blocks after deployment.
Security & trust assessment
Risk level: low (verified source, high confidence).
Who controls it: The owner can only reassign ownership; it cannot change limits, fees, or block swaps. Ownership is handed to the launch recipient at deployment, so that recipient has no meaningful power over pool funds beyond the ownership transfer right.
Risk to user funds: The hook does not hold tokens or ETH, takes no return deltas, and does not move pool funds. Its only effect on users is reverting over-limit buys during the first 60 blocks, which can temporarily block purchases but cannot trap funds.
Security findings
- [info] Cold-start buy caps can revert swaps: afterSwap reverts for any B20 buy exceeding the cold-start tx, wallet, or block limits during the first 60 blocks, so those buys fail.
- [low] Wallet cap enforced on tx.origin can be bypassed with multiple wallets: Per-wallet tracking keys on tx.origin and the limit check uses sender for the event only, so a buyer can split purchases across wallets to exceed the intended per-wallet cap while staying within the per-block and per-tx limits.
- [info] No pause or fund-moving admin functions: The hook has no pause or emergency function, and its only privileged action is ownership transfer, so the owner cannot freeze or redirect pool liquidity.
Contract details
- Verified source
- Yes (B20MaxBuyHook)
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Bytecode size
- 6,035 bytes
- Upgradeable proxy
- No
- Detected patterns
- ownable
Pools using B20MaxBuyHook
- ETH / B20 (1.00% fee) — 24h volume $0, TVL $577, 0 swaps today