This guide provides examples for using Doppler V4 with Custom Fees and various optional govenance
Note on startTimeOffset: The startTimeOffset parameter is included in the type definitions but is not currently used by the SDK implementation. All pools will start 30 seconds after the transaction is confirmed. This will be addressed in a future update.
Prerequisites
import{ReadWriteFactory,BeneficiaryData,V4MigratorData,DEAD_ADDRESS,DOPPLER_V4_ADDRESSES}from'doppler-v4-sdk';import{createPublicClient,createWalletClient,http,parseEther}from'viem';import{base}from'viem/chains';import{Drift}from'@delvtech/drift';import{viemAdapter}from'@delvtech/drift-viem';// Setup clientsconstpublicClient=createPublicClient({chain:base,transport:http()});constwalletClient=createWalletClient({chain:base,transport:http(),account:privateKeyToAccount('0x...') // Your private key});// Setup Driftimport{createDrift}from'@delvtech/drift';constdrift=createDrift({adapter:viemAdapter({publicClient,walletClient}) });// Get addresses for your chainconstaddresses=DOPPLER_V4_ADDRESSES[base.id];// Initialize factoryconstfactory=newReadWriteFactory(addresses.airlock,drift);
Example 1: Standard Token Launch with Governance
This example launches a token with standard governance, where 90% of liquidity goes to the timelock and 10% to the StreamableFeesLocker.
Example 2: No-Op Governance Launch (100% Locked Liquidity)
This example launches a token with no-op governance, where 100% of liquidity is permanently locked in the StreamableFeesLocker.
Example 3: Custom Quote Token Launch
This example shows launching with a custom quote token (not ETH).