A production-ready, secure web application for automated token purchasing on the Base network. This bot creates multiple wallets, distributes ETH, swaps for tokens using Bungee.exchange, and consolidates funds - all from your browser.
- π Secure & Encrypted: All private keys are encrypted using AES-GCM with password protection
- πΎ Local Storage: Uses IndexedDB for persistent, local-only data storage (no server required)
- π GitHub Pages Compatible: Runs entirely in the browser - perfect for static hosting
- π Real-time Tracking: Monitor all transactions with detailed logs and status updates
- π Bungee Integration: Utilizes Bungee.exchange API for optimal token swaps
- π Batch Operations: Create and manage up to 1000 wallets simultaneously
- π¨ Modern UI: Clean, responsive interface with dark theme
- β‘ TypeScript: Type-safe, production-level code
mass-token-buy-web/
βββ src/
β βββ app.ts # Main application logic
β βββ types.ts # TypeScript type definitions
β βββ database.ts # IndexedDB wrapper
β βββ crypto.ts # Encryption utilities (Web Crypto API)
β βββ wallet.ts # Wallet management (ethers.js)
β βββ bungee.ts # Bungee.exchange API integration
β βββ transactions.ts # Transaction orchestration
β βββ ui.ts # UI management
βββ index.html # Main HTML file
βββ styles.css # Styling
βββ package.json # Dependencies
βββ tsconfig.json # TypeScript configuration
βββ webpack.config.js # Build configuration
βββ README.md # This file
- TypeScript: Type-safe development
- Ethers.js v6: Ethereum wallet and transaction handling
- Axios: HTTP client for Bungee API
- IndexedDB: Browser-based local database
- Web Crypto API: Secure encryption/decryption
- Webpack: Module bundling for browser
- Base Network: Layer 2 Ethereum blockchain
- Node.js v18 or higher
- npm or yarn
- Modern web browser (Chrome, Firefox, Edge, Safari)
- Master wallet with sufficient ETH on Base network
-
Clone or download the repository
cd mass-token-buy-web -
Install dependencies
npm install
-
Build the project
npm run build
-
Run development server (optional)
npm run serve
-
Deploy to GitHub Pages
- Build the project
- Upload the
distfolder to GitHub Pages - Or use GitHub Actions for automated deployment
-
Build the project:
npm run build
-
Push the
distfolder to thegh-pagesbranch:git add dist -f git commit -m "Deploy to GitHub Pages" git subtree push --prefix dist origin gh-pages
Create .github/workflows/deploy.yml:
name: Deploy to GitHub Pages
on:
push:
branches: [ main ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./distThen enable GitHub Pages in your repository settings to serve from the gh-pages branch.
- Open the application in your browser
- Set a master password (minimum 8 characters)
- This password encrypts all wallet private keys
- IMPORTANT: Remember this password - it cannot be recovered!
- Click "Unlock Application"
Fill in the following required fields:
- Token Address: The ERC-20 token contract address on Base (e.g.,
0x9e12735d77c72c5C3670636D428f2F3815d8A4cB) - Number of Wallets: How many wallets to create (1-1000)
- Master Wallet Private Key: Private key of the wallet funding the operation
- Must have sufficient ETH to fund all wallets
- Target Wallet Address: Where remaining funds will be sent after swaps
- Gas Fee Amount (ETH): Amount reserved for gas per wallet (e.g.,
0.0001) - Purchase Amount (ETH): Amount to swap for tokens per wallet (e.g.,
0.001) - Minimum Kept Tokens: Minimum tokens to keep in each wallet after transfer
- Base RPC URL: Base network RPC endpoint (default:
https://mainnet.base.org)
- Wallet Creation: Creates N new wallets with encrypted private keys
- Fund Distribution: Transfers ETH from master wallet to each new wallet
- Token Swaps: Swaps ETH for target token using Bungee.exchange in each wallet
- Fund Consolidation: Transfers tokens and remaining ETH to target address
- Keeps minimum specified tokens in each wallet
- Transfers all remaining ETH
- Status Panel: Real-time operation progress
- Activity Logs: Detailed logs of all actions
- Transaction History: Complete record with BaseScan links
- Wallets Table: List of all created wallets with balances
- Save Config: All parameters are automatically saved to local storage
- Load Config: Restore previously saved configuration
- Export Logs: Download activity logs as text file
- Export Transactions: Download transaction history as CSV
- Export Wallets: Download wallet list with encrypted keys (CSV)
- AES-GCM 256-bit encryption for all private keys
- PBKDF2 key derivation with 100,000 iterations
- Random salt and IV for each encryption operation
- Password hashing using SHA-256
- All data stored locally in IndexedDB
- No data sent to external servers (except blockchain RPCs)
- Private keys never leave your browser unencrypted
- Password is never stored (only hash for verification)
- Use a strong master password (12+ characters, mixed case, numbers, symbols)
- Backup your data regularly (export wallets and transactions)
- Test with small amounts first
- Keep your master wallet secure
- Use secure RPC endpoints (avoid public nodes for production)
- Clear browser data only if you have backups
Token Address: 0x9e12735d77c72c5C3670636D428f2F3815d8A4cB
Number of Wallets: 5
Gas Amount: 0.0001 ETH
Purchase Amount: 0.001 ETH
Min Kept Tokens: 100
Total ETH needed: 0.0055 ETH (plus extra for master wallet gas)
Token Address: 0x9e12735d77c72c5C3670636D428f2F3815d8A4cB
Number of Wallets: 500
Gas Amount: 0.0002 ETH
Purchase Amount: 0.005 ETH
Min Kept Tokens: 1000
Total ETH needed: 2.6 ETH (plus extra for master wallet gas)
# Development mode with watch
npm run dev
# Production build
npm run build
# Run development server
npm run serve
# Type checking only
npm run type-check- src/types.ts: Shared TypeScript interfaces
- src/database.ts: IndexedDB operations
- src/crypto.ts: Encryption/decryption using Web Crypto API
- src/wallet.ts: Wallet creation and transactions
- src/bungee.ts: Bungee.exchange API integration
- src/transactions.ts: Main operation orchestration
- src/ui.ts: UI updates and event handling
- src/app.ts: Application initialization and coordination
This bot uses the Bungee.exchange API for token swaps:
- Endpoint:
https://api.bungee.exchange/v1/quote - Chain ID: 8453 (Base Mainnet)
- Native ETH Address:
0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE - Slippage: Default 0.5%
The API returns optimal routing across multiple DEXs on Base for the best swap rates.
The bot uses the exact gas and token amounts you specify. Ensure you provide:
- Sufficient gas amount for transactions on Base
- Appropriate slippage for token swaps
- Extra ETH in master wallet for gas fees
- Bungee API may have rate limits
- Add delays between operations to avoid issues
- Current delays: 100ms (wallet creation), 500ms (transfers), 1000ms (swaps)
- All operations have try-catch error handling
- Failed transactions are logged with details
- Operation can be stopped at any time
- Failed wallets remain in "created" or "funded" state for retry
- Base network uses EIP-1559 (priority fees)
- Gas prices are fetched dynamically
- Transactions wait for 1 confirmation by default
- Failed transactions don't halt the entire operation
- Clear browser cache/storage
- Try a different browser
- Check browser's IndexedDB support
- Ensure master wallet has enough ETH
- Account for gas costs in calculations
- Check Base network balance, not mainnet
- Check gas amount is sufficient
- Verify token address is correct
- Ensure sufficient liquidity for swap
- Try increasing slippage tolerance
- Check internet connection
- Verify Base RPC is accessible
- Wait and retry (may be rate limited)
- Check Bungee service status
- Wrong master password
- Clear data and start fresh
- Check for browser updates
- Wallet Creation: ~100ms per wallet
- ETH Transfer: ~500ms per transaction
- Token Swap: ~1-3 seconds per swap (network dependent)
- Token Transfer: ~500ms per transaction
For 100 wallets, expect total runtime of approximately 10-15 minutes.
This is a production tool. If you'd like to contribute:
- Test thoroughly on testnet first
- Maintain security standards
- Add proper error handling
- Update documentation
- Follow TypeScript best practices
MIT License - Use at your own risk
For issues and questions:
- Check this README thoroughly
- Review browser console for errors
- Test with small amounts first
- Verify all configuration parameters
Potential future enhancements:
- Multi-chain support
- Custom DEX selection
- Advanced slippage controls
- Batch retry for failed operations
- Import/export encrypted config
- Transaction cost estimation
- Mobile-responsive improvements
- Multi-language support
π SECURITY WARNING: Never share your private keys or master password. Always verify smart contract addresses before interacting. This tool handles sensitive cryptographic material - use responsibly.