Pangea Fee Hook V2
BSCRegisteredPangea Fee Hook V2 is a Uniswap v4 hook on BSC by 0x7794de82aa21ce22863102fb07e319daf85dd1c5, also known as PangeaFeeHookV2M. Pangea launch-pool fee hook with a changeable fee. Takes the trading fee (0.3%-5%) in the quote asset on every swap via beforeSwap/afterSwap return deltas and credits it as ERC-6909 claims to the pool's fee splitter. The pool's payee or the platform admin can change the fee within 0.3%-5% (one change per pool per block; fees earned at the old rate are settled first). Liquidity adds are locker-only, swaps past the launch range edge revert, and Pangea's launch buyers pay no fee. Live for 3 days. No trades in the last month, but 1 new pool this week.
- Made by
- 0x7794de82aa21ce22863102fb07e319daf85dd1c5
- Contract name
- PangeaFeeHookV2M
How this hook works
Token launcherPangea lets anyone launch a token. Every trade in a Pangea pool pays a fee of 0.3% to 5% in ETH or BNB, shared between the token creator and Pangea.
A fee on every trade
The pool’s own fee is zero. Instead the hook takes its fee, between 0.3% and 5%, from the ETH or BNB side of each trade. The launch’s own first buys are 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 fee can be changed
The token creator or Pangea can move a pool’s fee at any time, but never below 0.3% or above 5%.
The code that does this (setFee):function setFee(PoolKey calldata key, uint16 feeBps) external nonReentrant notInSwap { PoolId id = key.toId(); Config memory c = configs[id]; if (!c.registered) revert NotRegistered(); if (feeBps < MIN_FEE_BPS || feeBps > MAX_FEE_BPS) revert FeeOutOfRange(feeBps); // Read live: a payee the platform has moved (the splitter's two-step) moves this right too. if (msg.sender != IFeeSplitterV3(c.splitter).creator() && msg.sender != factoryAdmin) { revert NotPayeeOrAdmin(msg.sender); } // The splitter takes `setFeeBps` from its own hook only. Checked here so a pool whose // splitter is not ours fails at the change rather than, in delay mode, at a later redeem. if (IFeeSplitterV3(c.splitter).hook() != address(this)) revert SplitterNotOurs(c.splitter); if (feeDelayBlocks == 0) { // The rate in force: nothing to do (hookv2-ready I-2). It neither uses the block's one // change nor redeems, and it leaves `feeChanged` as it was (xa-dvn-hooks I-4). if (feeBps == c.feeBps) return; if (lastChangeBlock[id] == block.number) revert OneChangePerBlock(); lastChangeBlock[id] = block.number; if (!feeChanged[id]) feeChanged[id] = true; _switch(key, id, c, feeBps, msg.sender); return; } if (_due(pendingFee[id])) (c,) = _applyDue(key, id, c); if (feeBps == c.feeBps) { // The rate in force: nothing to schedule, and a pending change is cancelled. PendingFee memory p = pendingFee[id]; if (p.fromBlock != 0) { delete pendingFee[id]; // …Fees are paid out
Fees build up for each pool, and anyone can trigger the payout. It goes to a contract that splits it between the token creator and Pangea.
The code that does this (redeem):function _redeem(PoolKey calldata key, PoolId id, address splitter) internal returns (uint256 amount0, uint256 amount1) { amount0 = owed[id][key.currency0]; amount1 = owed[id][key.currency1]; if (amount0 == 0 && amount1 == 0) return (0, 0); // Cleared before the unlock, so a currency that re-enters cannot be redeemed twice. if (amount0 > 0) owed[id][key.currency0] = 0; if (amount1 > 0) owed[id][key.currency1] = 0; poolManager.unlock(abi.encode(key, splitter, amount0, amount1)); if (amount0 > 0) emit Redeemed(id, key.currency0, amount0, splitter); if (amount1 > 0) emit Redeemed(id, key.currency1, amount1, splitter); }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 token creator and the hook developer (Pangea) can each change a pool’s fee, between 0.3% and 5%. Pangea can also approve who adds liquidity and add new launchers. Nobody can change where a pool’s fees go. The code itself can’t 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 auditsetFeesetFeeWhat 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).
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.