PangeaFeeHookV2M
BasePangeaFeeHookV2M is a Uniswap v4 hook on Base. Runs code on every swap. Can take tokens from swaps. Gates who can add liquidity. Runs at pool creation.
- Contract name
- PangeaFeeHookV2M
How this hook works
Token launcherPangea lets anyone launch a token. Every trade in a Pangea pool pays an extra fixed fee in ETH or BNB, which goes to the token creator.
Extra fee on every trade
On top of the normal pool fee, each trade pays a fixed fee in ETH or BNB. The token creator’s own first buy is free.
The code that does this (beforeSwap):function beforeSwap(address sender, PoolKey calldata key, SwapParams calldata params, bytes calldata) external onlyPoolManager returns (bytes4, BeforeSwapDelta, uint24) { // See "NO SWAP RUNS WHILE A FEE IS MOVING": the guard is held by setFee, applyFee, redeem // and cancelPendingFee, and by nothing on the swap path. if (_reentrancyGuardEntered()) revert SwapDuringFeeChange(); // Open until this swap's afterSwap (every swap on this hook reaches it: both flags are mined). _swapsOpen += 1; PoolId id = key.toId(); Config memory c = configs[id]; if (!c.registered) revert NotRegistered(); // The price before this swap, for the token's record in afterSwap (transient: this swap only). { (uint160 pre,,,) = poolManager.getSlot0(id); bytes32 slot = _preSlot(id); assembly ("memory-safe") { tstore(slot, pre) } } bool exactIn = params.amountSpecified < 0; Currency specified = exactIn ? (params.zeroForOne ? key.currency0 : key.currency1) : (params.zeroForOne ? key.currency1 : key.currency0); Currency quote = c.quoteIsCurrency0 ? key.currency0 : key.currency1; if (Currency.unwrap(specified) != Currency.unwrap(quote)) { return (IHooks.beforeSwap.selector, toBeforeSwapDelta(0, 0), 0); // …The token creator gets paid
Fees build up for each pool, and anyone can trigger the payout to the token creator’s wallet.
Locked-down liquidity
Only approved addresses can add liquidity, so nobody can mess with the launch.
The code that does this (beforeAddLiquidity):function beforeAddLiquidity(address sender, PoolKey calldata, ModifyLiquidityParams calldata, bytes calldata) external view returns (bytes4) { if (sender != locker && !isLiquidityAdder[sender]) revert OnlyLocker(sender); return IHooks.beforeAddLiquidity.selector; }
Who controls it: The hook developer (Pangea) can approve who adds liquidity and add new launchers. It can’t change the fee or the receiver of a pool that already exists. The code itself can’t be changed.
What do these labels mean? This hook’s code works like PangeaFeeHook (same design, possibly different settings or names), so this is that contract’s description.
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 checks every deposit before it goes in.
It runs when a pool is created, often to lock in that pool’s settings.
Hook history
Settings changes: set up a new launch (1 time).
Only recent activity is shown: this hook’s past history hasn’t been read 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. Still reading older history, so totals will grow.