SweepHook
EthereumSweepHook is a Uniswap v4 hook on Ethereum. Live for 3 days. Still in use: 66 trades in the last week, and 1 new pool this week.
- Contract name
- SweepHook
How this hook works
Trading taxSweep lets anyone launch a token paired with ETH that helps buy an NFT collection. This hook takes a fee in ETH on every trade: half goes to the token's vault, which uses it to buy NFTs, and half goes to the Sweep treasury.
Fee goes to the NFT vault
Every trade pays a fee in ETH, between 1% and 5%, to the token's own vault. The vault spends that ETH on the NFT collection paired with the token.
The code that does this (_credit):function _credit(PoolId id, PoolInfo storage info, uint256 side) internal { pending[info.vault] += side; pending[treasury] += side; totalPending += side * 2; emit FeesCollected(id, side, side); }Same fee to the treasury
The same amount again goes to the Sweep treasury. A 1% token pays 1% plus 1%, a 5% token pays 5% plus 5%.
The code that does this (_credit):function _credit(PoolId id, PoolInfo storage info, uint256 side) internal { pending[info.vault] += side; pending[treasury] += side; totalPending += side * 2; emit FeesCollected(id, side, side); }Fees only in ETH
Fees are never taken in the token itself, so the token looks like a normal token with no tax. The rate is set at launch and can never be changed.
The code that does this (beforeSwap):function beforeSwap(address, PoolKey calldata key, SwapParams calldata params, bytes calldata) external onlyPoolManager returns (bytes4, BeforeSwapDelta, uint24) { PoolId id = key.toId(); PoolInfo storage info = pools[id]; if (!info.registered) revert PoolNotRegistered(); bool specifiedIsZero = (params.amountSpecified < 0) == params.zeroForOne; if (!specifiedIsZero) return (IHooks.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, 0); uint256 base = params.amountSpecified < 0 ? uint256(-params.amountSpecified) : uint256(params.amountSpecified); uint256 side = (base * info.feeBps) / BPS; if (side == 0) return (IHooks.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, 0); uint256 total = side * 2; // exact-in: the swap proceeds with (input - fee); exact-out: the swap produces (output + fee) and we keep the fee poolManager.take(key.currency0, address(this), total); _credit(id, info, side); return (IHooks.beforeSwap.selector, toBeforeSwapDelta(int128(uint128(total)), 0), 0); }Only the Sweep factory opens pools
A pool using this hook can only be created by the Sweep factory, and only after it has been registered.
The code that does this (beforeInitialize):function beforeInitialize(address sender, PoolKey calldata key, uint160) external view onlyPoolManager returns (bytes4) { if (sender != factory) revert NotFactory(); if (!pools[key.toId()].registered) revert PoolNotRegistered(); return IHooks.beforeInitialize.selector; }
Who controls it: The hook developer (Sweep) can change the factory and where the treasury half goes for future fees, and can take back tokens sent to the hook by mistake, but never fees that are owed. Fee rates cannot be changed, and the code cannot be upgraded.
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
- Took the fee from a trade 66 times
Latest transactions
- 0xcc027e63…5ca429 block 26,457,492
- 0xac141733…589ef4 block 26,457,490
- 0x68fd97b1…844454 block 26,457,489
- 0x5dcbbdda…8890f8 block 26,457,488
- 0x7a41e162…32306c block 26,457,485
- 0x03c2425d…3304da block 26,457,485
- 0x1ba8c626…be828b block 26,457,485
- 0xe44a8986…24ba6a block 26,457,484
- 0x01768c9c…bbad7d block 26,457,484
- 0x8051acd3…c469e5 block 26,457,482
- Paid out collected fees 9 times
Latest transactions
- 0xeafb5066…62e610 block 26,457,556
- 0x4a62f235…2ed8ef block 26,457,505
- 0x3b07e8d3…2a9538 block 26,457,489
- 0xb0962518…02656c block 26,457,483
- 0x9d4bd0b9…483b54 block 26,457,477
- 0x1500d4ec…5a673f block 26,457,471
- 0x35a95f09…3d7aa6 block 26,457,465
- 0xe1df0b64…102887 block 26,457,459
- 0xb978c98d…30355a block 26,457,453
Settings changes: set up the fee for a new token (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.