A Python script to parse and analyze token creation transactions on the four.meme launchpad on Binance Smart Chain (BSC).
- 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
- Install required dependencies:
pip install -r requirements.txtRun the script and enter a transaction hash when prompted:
python tx_parser.pyYou 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)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
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.)
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):
...
- 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