PactHook
RobinhoodPactHook is a Uniswap v4 hook on Robinhood Chain. Brand new: its first pool went live today. Still in use: 29 trades in the last week, and 3 new pools this week.
- Contract name
- PactHook
How this hook works
Trading taxA trading tax hook. It takes a cut of every trade, manages its own liquidity and burns tokens.
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 key, SwapParams calldata params, bytes calldata) internal view override returns (bytes4, BeforeSwapDelta, uint24) { Coin storage c = coins[key.toId()]; if (c.token == address(0)) revert UnknownCoin(); if (c.closedAt != 0) revert CoinClosed(); // A pause stops buys (quote going in) and only buys. Sells always go through. if (params.zeroForOne != c.tokenIs0 && block.timestamp < pausedUntil) revert PausedForNow(); if (c.openedAt == 0) { // During the Opening only the Opening contract trades: its one buy, at one price for everyone, with no fee. if (sender != opening) revert NotOpenYet(); return (IHooks.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, 0); } if (_quoteIsSpecified(c.tokenIs0, params)) { // The trader named an amount of quote: the fee comes out of that amount, here. uint256 fee = params.amountSpecified < 0 ? uint256(-params.amountSpecified) / FEE_DIVISOR : uint256(params.amountSpecified) / (FEE_DIVISOR - 1); return (IHooks.beforeSwap.selector, toBeforeSwapDelta(fee.toInt128(), 0), 0); } // The trader named an amount of coins: the fee is taken on the quote side after the swap. return (IHooks.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, 0); }Manages its own liquidity
It adds and removes liquidity itself, so it can own part or all of the pool.
The code that does this (unlockCallback):function unlockCallback(bytes calldata data) external onlyPoolManager returns (bytes memory) { (uint8 action, bytes memory args) = abi.decode(data, (uint8, bytes)); if (action == DO_ADD) { PoolId id = abi.decode(args, (PoolId)); Coin storage c = coins[id]; (BalanceDelta d,) = poolManager.modifyLiquidity( _key(c.token, c.quote, c.tokenIs0), ModifyLiquidityParams(c.tickLower, c.tickUpper, int256(uint256(c.liquidity)), bytes32(0)), "" ); (int128 coinDelta, int128 quoteDelta) = c.tokenIs0 ? (d.amount0(), d.amount1()) : (d.amount1(), d.amount0()); if (quoteDelta != 0 || coinDelta > 0) revert NotOneSided(); poolManager.sync(Currency.wrap(c.token)); IPactCoin(c.token).transfer(address(poolManager), uint256(uint128(-coinDelta))); poolManager.settle(); return ""; } if (action == DO_REMOVE) { (PoolId id, bool cancelling) = abi.decode(args, (PoolId, bool)); Coin storage c = coins[id]; (BalanceDelta d,) = poolManager.modifyLiquidity( _key(c.token, c.quote, c.tokenIs0), ModifyLiquidityParams(c.tickLower, c.tickUpper, -int256(uint256(c.liquidity)), bytes32(0)), "" ); c.liquidity = 0; (int128 coinDelta, int128 quoteDelta) = c.tokenIs0 ? (d.amount0(), d.amount1()) : (d.amount1(), d.amount0()); uint256 coinOut = uint256(uint128(coinDelta)); // …Burns tokens
It destroys some tokens (or sends them to an address nobody controls), so there are fewer of them.
The code that does this (createPool):function createPool(address token, Currency quote, address creator, int24 startTick, int24 capTick, uint128 quietVolume) external returns (PoolId id) { if (msg.sender != factory) revert NotFactory(); if (block.timestamp < pausedUntil) revert PausedForNow(); int24 minTick = TickMath.minUsableTick(TICK_SPACING); int24 maxTick = TickMath.maxUsableTick(TICK_SPACING); if ( startTick % TICK_SPACING != 0 || capTick % TICK_SPACING != 0 || capTick >= startTick || capTick < minTick || startTick >= maxTick ) revert BadTicks(); bool tokenIs0 = token < Currency.unwrap(quote); PoolKey memory key = _key(token, quote, tokenIs0); id = key.toId(); Coin storage c = coins[id]; if (c.token != address(0) || PoolId.unwrap(poolOf[token]) != bytes32(0)) revert AlreadyCreated(); uint256 amount = IPactCoin(token).balanceOf(address(this)); if (amount == 0) revert NoCoins(); uint160 sqrtStart; uint128 liquidity; if (tokenIs0) { // price = quote per coin, it rises as people buy: the coins sit from the start price upwards c.tickLower = -startTick; c.tickUpper = maxTick; sqrtStart = TickMath.getSqrtPriceAtTick(-startTick); liquidity = LiquidityAmounts.getLiquidityForAmount0(sqrtStart, TickMath.getSqrtPriceAtTick(maxTick), amount); // …Rewards to claim
It keeps track of what people have earned, and they claim it themselves.
The code that does this (claim):function claim(address token, uint256 amount) external returns (uint256) { return claimTo(token, amount, msg.sender); }Liquidity can’t be added or removed directly
Nobody can add or remove liquidity through Uniswap directly. Liquidity only moves 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.
Anyone can trigger payouts
Anyone can send the collected fees on to where they go, so nobody has to wait on the hook developer.
The code that does this (sweep):function sweep(Currency currency) external guarded { uint256 amount = protocolOwed[currency]; uint256 forStakers = stakersOwed[currency]; if (amount + forStakers == 0) revert NothingToClaim(); protocolOwed[currency] = 0; stakersOwed[currency] = 0; uint256 toTreasury = amount - amount / 2; uint256 toStakers = amount / 2 + forStakers; poolManager.unlock(abi.encode(DO_PAY, abi.encode(currency, treasury, toTreasury, stakers, toStakers))); emit Swept(currency, toTreasury, toStakers); }
Who controls it: The hook developer can change the trading limits. The pool creator can call: claim pay to. 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 auditcancelcancelWhat 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 before liquidity is removed, so it can delay or refuse LP exits.
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
- Burned tokens 5 times
Latest transactions
- 0xd7f5c02d…deae45 block 118,383,678 · 6.28e-15 GLORY
- 0x91379fb3…fcc949 block 118,349,648 · 975.00M GLORY
- 0xea4bb2b9…eb0d7f block 118,343,609 · 6.28e-15 GLORY
- 0xd0a94f10…b04aa9 block 118,184,833 · 975.00M SHITCOIN
- 0xed7a36e8…c26084 block 118,172,339 · 3.00e-18 SHITCOIN
- Created a coin 3 times
Latest transactions
- 0xd7f5c02d…deae45 block 118,383,678
- 0xea4bb2b9…eb0d7f block 118,343,609
- 0xed7a36e8…c26084 block 118,172,339
- Handled trade money (this hook holds the pool’s funds) 2 times
Latest transactions
- 0x91379fb3…fcc949 block 118,349,648 · 975.00M GLORY
- 0xd0a94f10…b04aa9 block 118,184,833 · 975.00M SHITCOIN
- Opened a pool 1 time
Settings changes: cancelled (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.