PadHook
BasePadHook is a Uniswap v4 hook on Base. Brand new: its first pool went live today. Still in use: 31 trades in the last week, and 1 new pool this week.
- Contract name
- PadHook
How this hook works
Trading taxA trading tax hook. It takes a cut of every trade, charges more right after launch and only lets approved callers create pools.
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, but never above 20%.
The code that does this (beforeSwap):function beforeSwap(address sender, PoolKey calldata key, SwapParams calldata p, bytes calldata) external onlyPM returns (bytes4, BeforeSwapDelta, uint24) { PoolId id = PoolIdLibrary.toId(key); Cfg memory c = pools[id]; // the price at the first swap of a block has held since the block before: only that counts as a peak Info storage n = info[c.token]; if (n.seenBlock != block.number) { n.seenBlock = uint48(block.number); (uint160 sp, , , ) = StateLibrary.getSlot0(poolManager, id); if (n.peak == 0 || (c.quoteIs0 ? sp < n.peak : sp > n.peak)) n.peak = sp; } bool specifiedIs0 = (p.amountSpecified < 0) == p.zeroForOne; if (sender == launchpad || specifiedIs0 != c.quoteIs0) { return (IHooks.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, 0); } // the pair asset is the specified side: exact-in buy or exact-out sell (uint16 bps, ) = feeNow(c.token, p.zeroForOne == c.quoteIs0, tx.origin); if (bps == 0) return (IHooks.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, 0); uint256 a = _abs(p.amountSpecified); uint256 fee = (a * bps) / 10000; _collect(c.token, c.quoteIs0 ? key.currency0 : key.currency1, fee); return (IHooks.beforeSwap.selector, toBeforeSwapDelta(int128(int256(fee)), 0), 0); }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 (feeNow):function feeNow(address token, bool isBuy, address origin) public view returns (uint16 total, uint16 extra) { uint16 base = feeOf(token); total = base; if (isBuy) { uint256 t = block.timestamp - info[token].launched; if (t < SNIPE_WINDOW) total = base + uint16((uint256(MAX_FEE_BPS - base) * (SNIPE_WINDOW - t)) / SNIPE_WINDOW); } else if (lastBuyBlock[token][origin] == block.number) { total = base + SANDWICH_BPS > MAX_FEE_BPS ? MAX_FEE_BPS : base + SANDWICH_BPS; } extra = total - base; }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 onlyPM returns (bytes4) { require(sender == launchpad, "launchpad only"); return IHooks.beforeInitialize.selector; }
Who controls it: The pad can change the fee. The pad can also call: register. The code never lets the fee go above 20%. 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 auditsetGlobalFee setFeebeamTarget, launchpad on every trade.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 when a pool is created, often to lock in that pool’s settings.
Hook history
- Handled a trade 31 times
Latest transactions
- 0x0678456b…de27b7 block 62,112,357 · 0.0369 IF
- 0x3a42aaff…694ccd block 62,112,357 · 0.0269 IF
- 0xfb7ae4c4…b775ba block 62,112,357 · 0.0374 IF
- 0x8da3518c…6bc2e0 block 62,112,357 · 0.0594 IF
- 0x6a3da8b8…67bec8 block 62,110,400 · 0.0775 IF
- 0xbfd01d2d…7b558f block 62,110,352 · 0.0401 IF
- 0x7dc09137…366203 block 62,110,261 · 0.0223 IF
- 0xc489709a…ab8c68 block 62,105,146 · 0.00594 IF
- 0xdd708eec…bf9453 block 62,105,080 · 0.00990 IF
- 0xbb39e870…b775da block 62,105,017 · 0.00990 IF
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.