Skip to content

BSCsmartdev/BSC-transaction-parser

Repository files navigation

BSC Transaction Parser for four.meme

A Python script to parse and analyze token creation transactions on the four.meme launchpad on Binance Smart Chain (BSC).

Features

  • Fetches detailed transaction information from BSC
  • Parses transaction logs and events
  • Identifies common token events (Transfer, Approval, PairCreated)
  • Displays formatted transaction details
  • Exports data to JSON format

Installation

  1. Install required dependencies:
pip install -r requirements.txt

Usage

Interactive Mode

Run the script and enter a transaction hash when prompted:

python tx_parser.py

Programmatic Usage

You can also import and use the functions in your own code:

from tx_parser import parse_token_creation_tx, print_tx_info

tx_hash = "0x..."
tx_info = parse_token_creation_tx(tx_hash)
print_tx_info(tx_info)

Output Information

The script provides:

  • Transaction hash and status
  • Block number and timestamp
  • Sender and receiver addresses
  • Value transferred and gas fees
  • Method signature
  • Decoded event logs including:
    • Transfer events
    • Approval events
    • PairCreated events (for DEX pairs)
    • Contract addresses involved

RPC Endpoint

The script uses the public BSC RPC endpoint by default: https://bsc-dataseed1.binance.org/

For better performance and reliability, you can modify the BSC_RPC variable in the script to use:

  • Your own node
  • Paid RPC services (QuickNode, Alchemy, etc.)

Example

Enter transaction hash: 0xabcd1234...

✅ Connected to BSC network
⏳ Parsing transaction...

================================================================================
TRANSACTION DETAILS
================================================================================

📋 Basic Information:
  Transaction Hash: 0xabcd1234...
  Status: Success
  Block Number: 12345678
  Timestamp: 1702656000

👤 Addresses:
  From: 0x...
  To: 0x...

💰 Value & Fees:
  Value: 0.1 BNB
  Gas Used: 150,000
  Gas Price: 3.00 Gwei
  Transaction Fee: 0.000450 BNB

📝 Logs (5 events):
  ...

Notes

  • The script automatically identifies common ERC-20/BEP-20 events
  • Unknown events are also captured with their raw data
  • JSON export includes all raw transaction data for further analysis

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published