ReserveHookUniswapV4
EthereumReserveHookUniswapV4 is a Uniswap v4 hook on Ethereum. Live for 3 days. Still in use: 1 trade in the last week, and 1 new pool this week.
- Contract name
- ReserveHookUniswapV4
How this hook works
Trading taxA trading tax hook. It takes a cut of every trade, stops liquidity being added directly and creates its pools itself.
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, SwapParams calldata params, bytes calldata ) external returns (bytes4, int256, uint24) { if (msg.sender != address(POOL_MANAGER)) revert Errors.NotPoolManager(); // A buy is `oneForZero` (`ASSET` in) and exact-input (negative `amountSpecified`). if (params.zeroForOne || params.amountSpecified >= 0) revert Errors.SwapNotSupported(); // Bounded so the negation below cannot overflow and the amount fits v4's `int128` deltas. if (params.amountSpecified < -int256(type(int128).max)) revert Errors.AmountOverflow(); uint256 amountIn = uint256(-params.amountSpecified); // Baselines BEFORE the take, so a donated balance is never counted. uint256 assetBefore = ASSET.balanceOf(address(this)); uint256 wspctrBefore = WSPCTR.balanceOf(address(this)); POOL_MANAGER.take(address(ASSET), address(this), amountIn); ASSET.forceApprove(address(DESK), amountIn); DESK.deposit(address(ASSET), amountIn, address(this)); // Zeroed on the success path too, so no standing claim on this contract can survive. ASSET.forceApprove(address(DESK), 0); // Every unit taken must have gone into the desk. One check covers a short take, a short pull // and a donation spent in place of the taken `ASSET`. Selector reused from the zaps. if (ASSET.balanceOf(address(this)) != assetBefore) revert Errors.BalanceTooLow(); uint256 issued = WSPCTR.balanceOf(address(this)) - wspctrBefore; if (issued == 0) revert Errors.ZeroAmount(); if (issued > uint256(uint128(type(int128).max))) revert Errors.AmountOverflow(); // …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 the hook creates its pools
Nobody can create a pool with this hook directly. Pools are only created through the hook’s own code.
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 checks every deposit before it goes in.
It runs when a pool is created, often to lock in that pool’s settings.
Hook history
- Handled a trade 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.