WooPPV2Aggregator
BaseWooPPV2Aggregator is a Uniswap v4 hook on Base. Brand new: its first pool went live today.
- Contract name
- WooPPV2Aggregator
How this hook works
Trading taxA trading tax hook. It takes a cut of every trade, limits some actions to approved addresses and stops liquidity being added directly.
Takes a cut of every trade
On top of the normal pool fee, it keeps a share of each trade. It can never be above 0.05%. The fee is paid out in the same trade.
The code that does this (conductSwap):function _conductSwap(Currency settleCurrency, Currency takeCurrency, SwapParams calldata params, PoolId poolId) internal override returns (uint256 amountSettle, uint256 amountTake, bool hasSettled) { if (params.amountSpecified >= 0) revert ExactOutputNotSupported(); if (params.amountSpecified < -int256(uint256(uint128(type(int128).max)))) revert AmountOutOfBounds(); amountTake = uint256(-params.amountSpecified); (address tokenIn, address tokenOut) = _validateSwapInputs(poolId, params, takeCurrency, settleCurrency, amountTake); // Push model: sync(out) -> take(in, wooPP) -> wooPP.swap(..., poolManager, 0) -> settle() poolManager.sync(settleCurrency); poolManager.take(takeCurrency, address(wooPP), amountTake); uint256 wooOut = wooPP.swap(tokenIn, tokenOut, amountTake, 1, address(poolManager), address(0)); uint256 settled = poolManager.settle(); if (settled < wooOut || settled == 0 || settled > uint256(uint128(type(int128).max))) { revert OutputSettlementMismatch(); } hasSettled = true; uint256 authorFee = feeOnOutput(settled); amountSettle = settled - authorFee; if (amountSettle == 0) revert AmountOutZero(); if (authorFee != 0) { poolManager.mint(feeRecipient, settleCurrency.toId(), authorFee); emit HookFeeCollected(PoolId.unwrap(poolId), tokenOut, feeRecipient, authorFee); } }Approved addresses only
Some actions are limited to addresses on an approved list.
The code that does this (beforeInitialize):function _beforeInitialize(address, PoolKey calldata key, uint160 sqrtPriceX96) internal override returns (bytes4) { if (key.currency0.isAddressZero() || key.currency1.isAddressZero()) revert NativeCurrencyNotSupported(); if (key.fee != LPFeeLibrary.DYNAMIC_FEE_FLAG || key.tickSpacing != CANONICAL_TICK_SPACING) { revert InvalidPoolKey(); } if (sqrtPriceX96 != CANONICAL_SQRT_PRICE_X96) revert InvalidSqrtPrice(); address t0 = Currency.unwrap(key.currency0); address t1 = Currency.unwrap(key.currency1); if (!isAllowedPair[t0][t1]) revert PairNotAllowed(); PoolId poolId = key.toId(); if (poolTokens[poolId].token0 != address(0)) revert PairAlreadyInitialized(); poolTokens[poolId] = PairConfig(t0, t1); _initializedPools.push(key); emit AggregatorPoolRegistered(poolId); pollTokenJar(); return IHooks.beforeInitialize.selector; }Liquidity can’t be added directly
Nobody can add liquidity to its pools through Uniswap directly. Liquidity only comes in through the hook’s own code.
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, PoolKey calldata key, uint160 sqrtPriceX96) internal override returns (bytes4) { if (key.currency0.isAddressZero() || key.currency1.isAddressZero()) revert NativeCurrencyNotSupported(); if (key.fee != LPFeeLibrary.DYNAMIC_FEE_FLAG || key.tickSpacing != CANONICAL_TICK_SPACING) { revert InvalidPoolKey(); } if (sqrtPriceX96 != CANONICAL_SQRT_PRICE_X96) revert InvalidSqrtPrice(); address t0 = Currency.unwrap(key.currency0); address t1 = Currency.unwrap(key.currency1); if (!isAllowedPair[t0][t1]) revert PairNotAllowed(); PoolId poolId = key.toId(); if (poolTokens[poolId].token0 != address(0)) revert PairAlreadyInitialized(); poolTokens[poolId] = PairConfig(t0, t1); _initializedPools.push(key); emit AggregatorPoolRegistered(poolId); pollTokenJar(); return IHooks.beforeInitialize.selector; }Trading can be paused
The hook can stop all trading in its pools until it is switched back on.
The code that does this (sourceQuote):function sourceQuote(PoolId poolId, bool zeroForOne, uint256 amountIn) public view returns (uint256 grossOut) { if (amountIn == 0) revert AmountInZero(); if (amountIn > uint256(uint128(type(int128).max))) revert AmountOutOfBounds(); PairConfig memory pair = _activePair(poolId); if (wooPP.paused()) revert WooPPPaused(); (address tokenIn, address tokenOut) = zeroForOne ? (pair.token0, pair.token1) : (pair.token1, pair.token0); (uint192 reserveIn, uint16 feeRateIn,,, uint192 capBalIn) = wooPP.tokenInfos(tokenIn); _checkCapBal(tokenIn, amountIn, reserveIn, capBalIn); grossOut = wooPP.query(tokenIn, tokenOut, amountIn); if (grossOut == 0) revert AmountOutZero(); if (grossOut > uint256(uint128(type(int128).max))) revert AmountOutOfBounds(); (uint192 reserveOut,,,,) = wooPP.tokenInfos(tokenOut); uint256 balOut = wooPP.balance(tokenOut); uint256 minOutAvail = uint256(reserveOut) < balOut ? uint256(reserveOut) : balOut; if (grossOut > minOutAvail) { revert InsufficientOutputReserve(); } // Fail-closed if WooPPV2 ever enables non-zero base->quote feeRate: _sellBase debits reserve by rawQuote // where netQuote = rawQuote - floor(rawQuote * feeRate / 1e5), so max possible rawQuote = floor(netQuote * 1e5 / (1e5 - feeRate)). if (feeRateIn != 0 && tokenOut == wooPP.quoteToken()) { if (feeRateIn >= WOO_FEE_DENOM) revert QuoteFailed(); uint256 maxRawQuote = (grossOut * WOO_FEE_DENOM) / (WOO_FEE_DENOM - uint256(feeRateIn)); if (maxRawQuote > minOutAvail) revert InsufficientOutputReserve(); } }Simple trades only
Trades must state the amount going in, not the amount coming out.
The code that does this (rawQuote):function _rawQuote(bool zeroToOne, int256 amountSpecified, PoolId poolId) internal view override returns (uint256 amountUnspecified) { if (amountSpecified >= 0) revert ExactOutputNotSupported(); if (amountSpecified < -int256(uint256(uint128(type(int128).max)))) revert AmountOutOfBounds(); uint256 grossOut = sourceQuote(poolId, zeroToOne, uint256(-amountSpecified)); amountUnspecified = grossOut - feeOnOutput(grossOut); if (amountUnspecified == 0) revert AmountOutZero(); }
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.
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 an aggregator pool 3 times
Latest transactions
- 0x944cbc0b…a7e857 block 61,832,197
- 0x1fea4c07…39d1a0 block 61,832,178
- 0xc0733401…323bf2 block 61,832,160
Settings changes: changed the token jar (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.