CruxV4Hook
BaseCruxV4Hook is a Uniswap v4 hook on Base. Brand new: its first pool went live today. Still in use: 5 trades in the last week, and 3 new pools this week.
- Contract name
- CruxV4Hook
How this hook works
Trading taxA trading tax hook. It takes a cut of every trade, charges more right after launch and keeps rewards to claim.
Takes a cut of every trade
On top of the normal pool fee, it keeps a share of each trade. The fee builds up in the hook until it is collected.
The code that does this (beforeSwap):function beforeSwap(address sender, PoolKey calldata key, SwapParams calldata params, bytes calldata) external onlyManager returns (bytes4, BeforeSwapDelta, uint24) { { address c = Currency.unwrap(key.currency1); if (_ref[c].blockNumber != block.number) { (, int24 t,,) = manager.getSlot0(key.toId()); _ref[c] = RefTick(uint64(block.number), t); } } if (params.zeroForOne && params.amountSpecified < 0 && sender != factory) { address coin = Currency.unwrap(key.currency1); uint256 rate = earlyFeeBps(coin); if (rate != 0) { uint256 fee = uint256(-params.amountSpecified) * rate / BPS; if (fee != 0) { _collect(coin, sender, fee); return (IHooks.beforeSwap.selector, toBeforeSwapDelta(fee.toInt128(), 0), 0); } } } return (IHooks.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, 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 (earlyFeeBps):function earlyFeeBps(address coin) public view returns (uint256) { Config storage c = _config[coin]; uint256 window = c.window; if (window == 0) return 0; uint256 elapsed = block.timestamp - c.launchedAt; if (elapsed >= window) return 0; return uint256(c.startBps) * (window - elapsed) / window; }Rewards to claim
It keeps track of what people have earned, and they claim it themselves.
The code that does this (claimCreator):function claimCreator(address coin) external returns (uint256 amount) { amount = creatorOwed[coin]; if (amount == 0) return 0; address to = ICruxV4Locker(ICruxV4Factory(factory).locker()).creatorOf(coin); if (to == address(0)) revert ZeroAddress(); creatorOwed[coin] = 0; _send(to, amount); emit CreatorClaimed(coin, to, amount); }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 onlyManager returns (bytes4) { address coin = Currency.unwrap(key.currency1); if ( sender != factory || _config[coin].coin == address(0) || PoolId.unwrap(_poolId[coin]) != PoolId.unwrap(key.toId()) ) revert OnlyFactory(); return IHooks.beforeInitialize.selector; }
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 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 when a pool is created, often to lock in that pool’s settings.
Hook history
- Early fee 1 time
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.
Pools
3 totalOnly pools with trades in the last 7 days are listed here: 2 of 3. See all, newest first.