Skip to content

This project implements a Four.Meme new token detector using real-time block polling and transaction log parsing to identify newly deployed token contract creations.

Notifications You must be signed in to change notification settings

BSCsmartdev/Fourmeme-Token-Detector

Repository files navigation

Four Meme Token Detector

A real-time monitoring tool for detecting new token creations on the four.meme platform on BNB Smart Chain.

Features

  • 🕒 Real-time Monitoring: Continuously monitors new token creations
  • 📊 Historical Catch-up: Scans historical blocks to catch up on past events
  • 🎯 Event Filtering: Specifically targets four.meme token creation events
  • 📋 Detailed Logging: Provides comprehensive information about each token creation
  • 🔧 Configurable: Easy to modify RPC endpoints, block ranges, and monitoring intervals

Prerequisites

  • Node.js 18.0.0 or higher
  • npm or yarn

Installation

  1. Clone or download this project
  2. Install dependencies:
npm install

Configuration

Before running the detector, you need to update the configuration in fourmeme-token-detector.ts:

Required Configuration Updates

  1. Factory Address: Replace the placeholder factory address with the actual four.meme factory contract address
  2. Event Signature: Replace the placeholder event signature with the actual TokenCreated event signature
const CONFIG = {
  // BSC RPC endpoint (you can use public endpoints or your own)
  RPC_URL: 'https://bsc-dataseed.binance.org/',

  // Factory contract address for four.meme
  FACTORY_ADDRESS: '0x0000000000000000000000000000000000000000', // TODO: Replace with actual factory address

  // Token creation event signature
  TOKEN_CREATED_EVENT: '0x0000000000000000000000000000000000000000000000000000000000000000', // TODO: Replace with actual event signature

  // Monitoring configuration
  START_BLOCK: 30000000, // Approximate recent block number
  BLOCKS_PER_BATCH: 1000, // Number of blocks to scan per batch
  POLLING_INTERVAL: 10000, // Check for new blocks every 10 seconds
};

Finding Contract Addresses and Event Signatures

You can find the required information by:

  1. Factory Address: Check four.meme's official documentation or smart contracts
  2. Event Signature: Use tools like BSCScan to examine the factory contract events

Usage

Development Mode (with auto-restart)

npm run dev

Production Mode

npm start

Build for Production

npm run build
node dist/fourmeme-token-detector.js

Output Example

When a new token is created, you'll see output like:

🎉 New Token Created!
📋 Details:
   Token Address: 0x1234567890123456789012345678901234567890
   Creator: 0x0987654321098765432109876543210987654321
   Block: 31234567
   Transaction: 0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890
   Timestamp: 2024-12-02T10:30:45.000Z
   Create Fee: 0.001 BNB
   Sell Fee: 0.002 BNB
   Gas Settings:
     Buy Gas Price: 5000000000
     Buy Gas Limit: 300000
     Sell Gas Price: 5000000000
     Sell Gas Limit: 300000
   ──────────────────────────────────

Project Structure

four-meme-token-detector/
├── fourmeme-token-detector.ts    # Main executable file
├── package.json                  # Dependencies and scripts
├── tsconfig.json                 # TypeScript configuration
└── README.md                     # This file

Technical Details

Event Monitoring

The detector monitors the BNB Smart Chain for TokenCreated events emitted by the four.meme factory contract. Each event contains:

  • Token Address: The address of the newly created token
  • Creator Address: The address of the token creator
  • Transaction Details: Gas price and limit used in creation
  • Token Parameters: Trading fees and gas settings configured by four.meme

Block Scanning Strategy

  1. Historical Catch-up: Scans past blocks in batches to process historical events
  2. Real-time Monitoring: Polls for new blocks at regular intervals
  3. Error Handling: Continues monitoring even if individual blocks fail to process

Troubleshooting

Common Issues

  1. "Cannot find module 'viem'": Run npm install to install dependencies
  2. No events detected: Check that the factory address and event signature are correct
  3. RPC errors: Try using a different BSC RPC endpoint
  4. Rate limiting: Increase the polling interval or use your own RPC node

RPC Endpoints

You can use these public BSC RPC endpoints:

  • https://bsc-dataseed.binance.org/
  • https://bsc-dataseed1.binance.org/
  • https://bsc-dataseed2.binance.org/
  • https://bsc-dataseed3.binance.org/

License

MIT License - feel free to use and modify as needed.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

Disclaimer

This tool is for educational and monitoring purposes only. Always verify token contracts and conduct your own research before interacting with any tokens on the blockchain.

About

This project implements a Four.Meme new token detector using real-time block polling and transaction log parsing to identify newly deployed token contract creations.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published