SwapAndSprayHook
BaseRegisteredSwapAndSprayHook is a Uniswap v4 hook on Base by 0xe0daa969c50ed9353bcdb9fd6a3b3ea510f567e3. Swap-settled payouts: afterSwap return-delta hook that delivers a swap's output to up to 200 recipients in one transaction via Spraay batch settlement on Base. Brand new: its first pool went live today. Still in use: 3 trades in the last week, and 1 new pool this week.
- Made by
- 0xe0daa969c50ed9353bcdb9fd6a3b3ea510f567e3
- Contract name
- SwapAndSprayHook
How this hook works
Trading taxA trading tax hook. It takes a cut of every trade and only takes simple trades.
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 (afterSwap):function _afterSwap( address, PoolKey calldata key, SwapParams calldata params, BalanceDelta delta, bytes calldata hookData ) internal override returns (bytes4, int128) { if (hookData.length == 0) return (IHooks.afterSwap.selector, 0); if (params.amountSpecified > 0) revert ExactOutputNotSupported(); PayoutSpec memory spec = abi.decode(hookData, (PayoutSpec)); spec.validate(address(spray)); (Currency currencyOut, int128 deltaOut) = params.zeroForOne ? (key.currency1, delta.amount1()) : (key.currency0, delta.amount0()); if (deltaOut <= 0) revert NoOutput(); uint256 output = uint256(uint128(deltaOut)); poolManager.take(currencyOut, address(this), output); SpraySettlement.settle(spray, key.toId(), currencyOut, output, spec); // Positive means the hook took this much of the swapper's output (IHooks.afterSwap). return (IHooks.afterSwap.selector, deltaOut); }Simple trades only
Trades must state the amount going in, not the amount coming out.
The code that does this (afterSwap):function _afterSwap( address, PoolKey calldata key, SwapParams calldata params, BalanceDelta delta, bytes calldata hookData ) internal override returns (bytes4, int128) { if (hookData.length == 0) return (IHooks.afterSwap.selector, 0); if (params.amountSpecified > 0) revert ExactOutputNotSupported(); PayoutSpec memory spec = abi.decode(hookData, (PayoutSpec)); spec.validate(address(spray)); (Currency currencyOut, int128 deltaOut) = params.zeroForOne ? (key.currency1, delta.amount1()) : (key.currency0, delta.amount0()); if (deltaOut <= 0) revert NoOutput(); uint256 output = uint256(uint128(deltaOut)); poolManager.take(currencyOut, address(this), output); SpraySettlement.settle(spray, key.toId(), currencyOut, output, spec); // Positive means the hook took this much of the swapper's output (IHooks.afterSwap). return (IHooks.afterSwap.selector, deltaOut); }
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.
Hook history
Settings changes: settled a swap (1 time).
Reading its history: 0% done. It fills in here when it is finished.
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. Dollar values count the amounts paid in ETH, stablecoins, BNB and BTC, at today’s prices. Still reading older history, so totals will grow.