Minimal TypeScript script to buy tokens from Four.meme launchpad on BSC.
- ✅ TypeScript with type safety
- ✅ Uses actual Four.meme contract ABI
- ✅ buyTokenAMAP function for precise BNB spending
- ✅ Detailed step-by-step logging for every transaction
- ✅ Real-time progress tracking
- ✅ Comprehensive error reporting
-
Install dependencies:
npm install
-
Create .env file:
BSC_RPC_URL=https://bsc-dataseed.binance.org/ PRIVATE_KEY=your_private_key_here_without_0x_prefix FOUR_MEME_LAUNCHPAD_CONTRACT=0x... # Launchpad contract address TOKEN_ADDRESS=0x... # Token you want to buy BUY_AMOUNT=0.1 # Amount in BNB
npm run find
# or
npx ts-node findTokens.ts# Check default token
npm run check
# Check specific token
npx ts-node buyToken.ts check 0xTokenAddress# Buy token with default amount
npm start
# Buy specific token
npx ts-node buyToken.ts 0xTokenAddress
# Buy with custom amount
npx ts-node buyToken.ts 0xTokenAddress 0.5# Sell token with default percentage (100%)
npm run sell
# Sell specific token (100%)
npx ts-node sellToken.ts 0xTokenAddress
# Sell specific percentage
npx ts-node sellToken.ts 0xTokenAddress 50Find the Four.meme launchpad contract on BSCScan and update FOUR_MEME_LAUNCHPAD_CONTRACT in .env.
The script now includes the actual Four.meme contract ABI with all buyToken and buyTokenAMAP functions.
- Uses buyTokenAMAP for precise BNB amount spending
- Make sure you have enough BNB for gas fees
- Test with small amounts first