Reference

Documentation

Technical reference for the Glasspad token factory.

DevBuy Extension

The DevBuy extension lets the deployer buy tokens atomically in the same transaction as deployment. The buy cannot be front-run, because no transaction can be inserted between pool creation and the buy.

How it works

  1. Deployer sends ETH with the deployToken() call
  2. Factory creates the pool and the LP locker adds initial liquidity
  3. DevBuy extension immediately swaps the sent ETH for the new token
  4. Purchased tokens are sent to the deployer's address

Because pool creation and the buy occur in the same transaction, MEV bots cannot sandwich or front-run the purchase.

Configuration

The extension data encodes the buy parameters:

// extensionData for DevBuy
bytes extensionData = abi.encode(
    pairedTokenPoolKey,           // PoolKey for WETH->paired swap (zeroed for WETH pairs)
    pairedTokenAmountOutMinimum,  // Min paired-token out (slippage protection)
    recipient                     // Address to receive purchased tokens
);