The DevBuy extension lets the deployer atomically buy tokens in the same transaction as deployment — frontrun-proof since no one can insert a transaction between pool creation and the buy.
How it works
- Deployer sends ETH with the
deployToken()call - Factory creates the pool and the LP locker adds initial liquidity
- DevBuy extension immediately swaps the sent ETH for the new token
- Purchased tokens are sent to the deployer's address
Since pool creation and the buy happen in the same transaction, no MEV bot can sandwich or frontrun 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
);