HookPot
RobinhoodRegisteredHookPot is a Uniswap v4 hook on Robinhood Chain. Fee hook for ETH/token pools that takes a tax in ETH on top of each swap (capped at 10% by an immutable; the owner can only lower it) and pays it into a pot. The swap itself runs through the v4 pool. Swaps are blocked until the owner opens trading, which is one-way and cannot be closed again. Live for 1 day. Still in use: 3 trades in the last week, and 1 new pool this week.
- Contract name
- HookPot
How this hook works
Trading taxA trading tax hook. It takes a tax on trades, uses an outside price feed and only lets approved callers create pools.
Takes a tax on trades
On top of the normal pool fee, it keeps part of each trade as a tax. Buys and sells can be charged differently. The tax can be changed, but never above 10%. The tax builds up in the hook until it is collected.
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(); Pool storage p = pools[id]; if (!p.tradingOpen) revert TradingNotOpen(); bool isBuy = params.zeroForOne; // ETH is currency0, so ETH -> coin is zeroForOne bool exactIn = params.amountSpecified < 0; uint256 tax; if (isBuy && exactIn) { tax = uint256(-params.amountSpecified) * p.buyTaxBps / BPS; } else if (!isBuy && !exactIn) { // trader wants exactly this much ETH out, so the pool pays out that plus the tax tax = FullMath.mulDivRoundingUp(uint256(params.amountSpecified), p.sellTaxBps, BPS - p.sellTaxBps); } if (tax == 0) return (IHooks.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, 0); poolManager.take(Currency.wrap(address(0)), address(this), tax); _onTax(id, p, tax, isBuy); return (IHooks.beforeSwap.selector, toBeforeSwapDelta(tax.toInt128(), 0), 0); }Uses an outside price feed
It reads a price from an outside source (an oracle) and uses it in its rules.
The code that does this (isHit):function isHit(uint256 id, uint80 roundId) external view returns (bool) { Lock storage l = _locks[id]; if (l.status != Status.Open) return false; try AggregatorV3Interface(l.feed).getRoundData(roundId) returns ( uint80, int256 answer, uint256, uint256 updatedAt, uint80 ) { return _roundQualifies(l, answer, updatedAt); } catch { return false; } }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) external onlyPoolManager returns (bytes4) { Pool storage p = pools[key.toId()]; if (p.initialized) revert PoolAlreadyInitialized(); if (p.sqrtPriceX96 == 0 || sqrtPriceX96 != p.sqrtPriceX96) revert PoolNotAllowed(); p.initialized = true; return IHooks.beforeInitialize.selector; }No trading before the start
Trades are refused until trading has been opened.
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(); Pool storage p = pools[id]; if (!p.tradingOpen) revert TradingNotOpen(); bool isBuy = params.zeroForOne; // ETH is currency0, so ETH -> coin is zeroForOne bool exactIn = params.amountSpecified < 0; uint256 tax; if (isBuy && exactIn) { tax = uint256(-params.amountSpecified) * p.buyTaxBps / BPS; } else if (!isBuy && !exactIn) { // trader wants exactly this much ETH out, so the pool pays out that plus the tax tax = FullMath.mulDivRoundingUp(uint256(params.amountSpecified), p.sellTaxBps, BPS - p.sellTaxBps); } if (tax == 0) return (IHooks.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, 0); poolManager.take(Currency.wrap(address(0)), address(this), tax); _onTax(id, p, tax, isBuy); return (IHooks.beforeSwap.selector, toBeforeSwapDelta(tax.toInt128(), 0), 0); }Trading can be paused
The hook can stop all trading in its pools until it is switched back on.
The code that does this (newLock):function _newLock( PoolId id, Pool storage p, LockRequest memory r, uint256 ethSpent, uint256 coins, uint256 moduleUsd, bool fromModule ) internal returns (uint256 lockId) { if (p.locksPaused) revert LocksArePaused(); if (r.version != HOOKDATA_VERSION || r.beneficiary == address(0)) revert BadHookData(); if (coins == 0 || (!fromModule && coins < r.minCoinsOut)) revert TooFewCoins(coins, r.minCoinsOut); Rules storage ru = rules[id]; if (r.lockDays < ru.minLockDays || r.lockDays > ru.maxLockDays) revert BadLockLength(); _checkSequencer(); // target must sit far enough from the feed's current, fresh price, on the side asked for FeedConfig memory fc = feeds[r.feed]; if (!fc.enabled) revert FeedNotAllowed(); uint256 price = _freshPrice(r.feed, fc.maxAge); { (uint256 lowestAbove, uint256 highestBelow) = _targetLimits(price, ru.minTargetBps); if (r.below) { if (r.target == 0) revert BadHookData(); if (r.target > highestBelow) revert TargetTooClose(r.target, highestBelow); } else if (r.target < lowestAbove) { revert TargetTooClose(r.target, lowestAbove); } } // …
Who controls it: The hook developer can change when trading opens, the tax, how the fees are shared, the wallets that receive its fees, the contracts it works with and the fee. The hook developer can also change: reach rule, prize rules, min target bps, lock days. The hook developer can also call: allow pool. The code never lets the fee go above 10%. The hook developer can withdraw funds held by the hook. The hook developer can pause trading. 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 auditsetFeed setEthUsdFeedsetPotSharessetLocksPausedsetReachRulesetPrizeRulessetMinTargetBpssetLockDayssetFeedsetEthUsdFeed setSequencerFeedsetEthUsdFeedWhat 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
- Tax 3 times
Latest transactions
- 0x4f943625…2a39df block 122,191,649
- 0x76be2154…8a8c12 block 122,191,541
- 0x4da702a0…60b833 block 122,191,447
- Paid out a withdrawal 2 times
Latest transactions
- 0x7e7cf864…e79391 block 122,321,596
- 0x8c9be941…9650ac block 122,191,813
- Closed the lock 2 times
Latest transactions
- 0x5c8e5555…0b57db block 122,321,540
- 0x8602597c…0ff1aa block 122,191,732
- Created a lock 2 times
Latest transactions
- 0xa4a747d4…a223cc block 122,321,474
- 0x76be2154…8a8c12 block 122,191,541
- Opened trading 1 time
- Handled trade money (this hook holds the pool’s funds) 1 time
Latest transactions
- 0x76be2154…8a8c12 block 122,191,541 · 147.4k HPTEST
Settings changes: set the feed (8 times), changed the pool settings (2 times).
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.