HookToken
RobinhoodHookToken is a Uniswap v4 hook on Robinhood Chain. Runs code on every swap. Can take tokens from swaps. Runs at pool creation.
- Contract name
- HookToken
How this hook works
Trading taxA trading tax hook. It takes a tax on trades, charges more right after launch 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. The tax is paid out in the same trade.
The code that does this (beforeSwap):function beforeSwap(address, PoolKey calldata key, SwapParams calldata params, bytes calldata) external onlyPM returns (bytes4, BeforeSwapDelta, uint24) { if (!_isHomePool(key)) revert WrongPool(); // ETH sisi yang ditentukan: beli exact-in (zeroForOne, amount<0) atau jual exact-out (!zeroForOne, amount>0) bool ethSpecified = (params.zeroForOne == (params.amountSpecified < 0)); if (!ethSpecified) return (IHooks.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, 0); uint256 amt = params.amountSpecified < 0 ? uint256(-params.amountSpecified) : uint256(params.amountSpecified); uint256 tax = _takeTithe(amt); return (IHooks.beforeSwap.selector, toBeforeSwapDelta(int128(int256(tax)), 0), 0); }Higher at launch
The tax starts higher right after launch and comes down over time, which makes it costly for bots to buy first.
The code that does this (currentTitheBps):function currentTitheBps() public view returns (uint256) { if (launchedAt == 0) return TITHE_MAX_BPS; uint256 dt = block.timestamp - launchedAt; if (dt >= TITHE_DECAY) return TITHE_MIN_BPS; return TITHE_MAX_BPS - ((TITHE_MAX_BPS - TITHE_MIN_BPS) * dt) / TITHE_DECAY; }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) external onlyPM returns (bytes4) { if (strung || !_isHomePool(key)) revert WrongPool(); // hanya satu pool resmi strung = true; launchedAt = block.timestamp; return IHooks.beforeInitialize.selector; }
Who controls it: Nobody. The hook has no admin functions, and the code cannot be changed.
What do these labels mean? Based on the hook’s published code.
What 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
Nothing recorded yet.
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.