MuseLinuHook
BaseMuseLinuHook is a Uniswap v4 hook on Base. Runs code on every swap. Can take tokens from swaps.
- Contract name
- MuseLinuHook
How this hook works
Fee on tradesA fee on trades hook. It takes a cut of every trade.
Takes a cut of every trade
On top of the normal pool fee, it can keep a share of each trade for itself.
The code that does this (beforeSwap):function beforeSwap( address, PoolKey calldata key, IPoolManager.SwapParams calldata params, bytes calldata ) external override returns (bytes4, BeforeSwapDelta, uint24) { if (PoolId.unwrap(key.toId()) != poolId) revert WrongPool(); if (params.amountSpecified >= 0) { return (IHooks.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, 0); } // Input currency: zeroForOne ? currency0 : currency1. Currency inputCurrency = params.zeroForOne ? key.currency0 : key.currency1; uint256 inputAmount = uint256(-params.amountSpecified); if (Currency.unwrap(inputCurrency) == quote) { // Buy: 2% of the quote input to the collector. uint256 fee = (inputAmount * FEE_BPS) / 10000; if (fee == 0) return (IHooks.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, 0); poolManager.take(Currency.wrap(quote), collector, fee); emit FeeTaken(collector, Currency.wrap(quote), fee); return (IHooks.beforeSwap.selector, toBeforeSwapDelta(int128(int256(fee)), 0), 0); } else { // Sell: 1% of the MUSN input burned, capped at the floor. uint256 burn = _cappedBurn((inputAmount * BURN_BPS) / 10000); if (burn == 0) return (IHooks.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, 0); poolManager.take(Currency.wrap(token), DEAD, burn); emit Burned(DEAD, burn, _circulatingAfter()); return (IHooks.beforeSwap.selector, toBeforeSwapDelta(int128(int256(burn)), 0), 0); } // …
Who controls it: No admin functions: nobody can change its rules after deployment.
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.
Hook history
Across all its pools, the hook took fee: $0.000400.
- Took fee 1 time, worth $0.000400
- Burned 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. Dollar values count the amounts paid in ETH, stablecoins, BNB and BTC, at today’s prices.