FulcrumLaunchHook
RobinhoodFulcrumLaunchHook is a Uniswap v4 hook on Robinhood Chain. Runs code on every swap. Can take tokens from swaps. Runs at pool creation.
- Contract name
- FulcrumLaunchHook
How this hook works
Trading taxA trading tax hook. It takes a tax on trades, keeps a price record 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 code that does this (beforeSwap):function beforeSwap(address sender, PoolKey calldata key, IPoolManager.SwapParams calldata params, bytes calldata data) external onlyPoolManager returns (bytes4, BeforeSwapDelta, uint24) { _requirePool(key); if (!initialized) revert UninitializedPool(); if (swapActive) revert ReentrantSwap(); if (params.amountSpecified == 0) revert NoTrade(); if (module.codehash != moduleCodeHash) revert ModuleCodeChanged(); _accumulate(); swapActive = true; activeSwap = keccak256(abi.encode(sender, key, params, data)); if (params.zeroForOne && block.timestamp < FulcrumToken(token).startedAt() + 300) { activeBuyer = LaunchProtectionModule(module).protectedBuyer(sender); } activeOpeningTaxPpm = params.zeroForOne ? LaunchProtectionModule(module).openingTaxPpmForSender(sender) : 0; bool nativeIsSpecified = params.zeroForOne == (params.amountSpecified < 0); if (!nativeIsSpecified) return (IHooks.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, 0); uint256 nativeAmount = _absolute(params.amountSpecified); (uint256 gross, uint256 platformFee, uint256 creatorFee, uint256 openingTax) = _quoteTradeFees( nativeAmount, params.amountSpecified > 0, params.zeroForOne, activeOpeningTaxPpm, sender == buyback ); uint256 total = platformFee + creatorFee + openingTax; if (params.amountSpecified < 0 && total >= nativeAmount) revert NoTrade(); expectedNativePoolAmount = params.amountSpecified > 0 ? gross : nativeAmount - total; if (expectedNativePoolAmount == 0) revert NoTrade(); _accrue(sender, key, params.zeroForOne, gross, platformFee, creatorFee, openingTax); return (IHooks.beforeSwap.selector, toBeforeSwapDelta(total.toInt256().toInt128(), 0), 0); }Keeps a price record
It records the pool’s price over time, so other apps can read a fair average price.
The code that does this (beforeInitialize):function beforeInitialize(address sender, PoolKey calldata key, uint160 price) external onlyPoolManager returns (bytes4) { _requirePool(key); if (initialized || sender != initializer || price != initialSqrtPriceX96) revert UnauthorizedInitializer(); initialized = true; uint32 t = uint32(block.timestamp); lastTick = TickMath.getTickAtSqrtPrice(price); lastTime = t; observations[0] = Observation(t, 0); obsCount = 1; return IHooks.beforeInitialize.selector; }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 sender, PoolKey calldata key, uint160 price) external onlyPoolManager returns (bytes4) { _requirePool(key); if (initialized || sender != initializer || price != initialSqrtPriceX96) revert UnauthorizedInitializer(); initialized = true; uint32 t = uint32(block.timestamp); lastTick = TickMath.getTickAtSqrtPrice(price); lastTime = t; observations[0] = Observation(t, 0); obsCount = 1; return IHooks.beforeInitialize.selector; }
Who controls it: Nobody. The hook has no admin functions, and the code cannot be changed.
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
- Took its fee from 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.