mint.fast docs

MintFastHook

Uniswap v4 hook that charges 2% of the ETH side and banks fees for harvest.

Attached to every launchpad pool. Pool LP fee is 0. This hook is the fee. Address must carry v4 permission bits (HOOK_FLAGS). Deployed by the launchpad constructor via CREATE2 with a mined salt. Constructor reverts HookAddressMismatch if flags are wrong.

Constants

NameValue
FEE_BPS200 (2%)
BPS10_000
FLAGS / HOOK_FLAGSbeforeInitialize, beforeSwap, afterSwap, and both return-delta bits

Immutables

  • poolManager
  • launchpad (only address allowed to collect)

Storage

mapping(address token => uint256) public pendingFees;

Backed 1:1 by native-ETH ERC-6909 claims on the PoolManager (id 0).

Callbacks (PoolManager only)

beforeInitialize

function beforeInitialize(address sender, PoolKey calldata, uint160)
    external returns (bytes4);

Reverts unless sender == launchpad. Blocks grief pre-initialization of launchpad PoolKeys.

beforeSwap

Charges when ETH is the specified currency. Accrues fee = amt * 200 / 10000 against currency1 (the token). Returns a before-swap delta that takes the fee.

afterSwap

Charges when ETH is the unspecified currency, sized on ETH actually moved in the delta.

Harvest pull

collect

function collect(address token) external returns (uint256 amount);

Launchpad only. Burns claims and sends ETH to the launchpad. Returns 0 without error if nothing pending. Emits Collected.

unlockCallback

PoolManager only. Internal settle path for collect.

Events

  • HookFee(token, ethFee)
  • Collected(token, amount)

Errors

NotPoolManager, NotLaunchpad, HookAddressMismatch, FeeOverflow