Skip to content

BartKupc/ChainExplorer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ CronoExplorer

A powerful blockchain explorer for Ethereum-compatible chains with intelligent transaction and contract classification.

CronoExplorer provides real-time blockchain analysis with advanced transaction classification, contract detection, and user-friendly web interface. It automatically identifies ERC-20, ERC-721, ERC-1155, and T-REX (ERC-3643) contracts and transactions.

✨ Features

  • πŸ” Smart Transaction Classification: Automatically identifies token transfers, contract interactions, and deployments
  • πŸ¦– T-REX Protocol Support: Full detection of ERC-3643 compliant contracts and transactions
  • πŸͺ™ Multi-Token Support: ERC-20, ERC-721, ERC-1155 detection and analysis
  • 🌐 Multi-Chain Support: Works with any Ethereum-compatible blockchain
  • πŸ“Š Real-time Block Analysis: Live block monitoring with transaction breakdowns
  • 🎯 Event Log Decoding: Intelligent parsing of blockchain events and logs
  • πŸš€ High Performance: Optimized RPC calls with smart caching strategies
  • πŸ’» Modern Web Interface: Clean, responsive Flask-based web application

πŸ› οΈ Installation

Prerequisites

  • Python 3.8 or higher
  • Access to Ethereum-compatible RPC endpoint
  • Git

Quick Start

  1. Clone the repository

    git clone https://github.com/yourusername/CronoExplorer.git
    cd CronoExplorer
  2. Create virtual environment

    python -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  3. Install dependencies

    pip install -r requirements.txt
  4. Configure your chains

    # Edit chains.yaml with your RPC endpoints
    nano chains.yaml
  5. Run the application

    python app.py
  6. Open your browser

    http://localhost:5001
    

βš™οΈ Configuration

Chains Configuration (chains.yaml)

chains:
  Cronos:
    rpc_url: "https://evm.cronos.org"
    chain_id: 25
    name: "Cronos Mainnet"
    enabled: true
  
  Ethereum:
    rpc_url: "https://mainnet.infura.io/v3/YOUR_API_KEY"
    chain_id: 1
    name: "Ethereum Mainnet"
    enabled: true
  
  Polygon:
    rpc_url: "https://polygon-rpc.com"
    chain_id: 137
    name: "Polygon Mainnet"
    enabled: true

Environment Variables

Create a .env file for sensitive configuration:

# Database configuration
DATABASE_URL=sqlite:///instance/cronoexplorer.db

# Flask secret key
SECRET_KEY=your-secret-key-here

# RPC rate limiting
RPC_TIMEOUT=30
MAX_RPC_RETRIES=3

🎯 Usage

Web Interface

  1. Home Page: View latest blocks with transaction summaries
  2. Block Details: Click on any block to see detailed transaction analysis
  3. All Blocks: Browse blocks with pagination and search
  4. Chain Management: Switch between different blockchain networks

Transaction Classification

CronoExplorer automatically classifies transactions into:

  • Token Transfers: ERC-20, ERC-721, ERC-1155 transfers
  • Contract Deployments: New contract creations
  • T-REX Interactions: ERC-3643 protocol transactions
  • Generic Contracts: Other smart contract interactions
  • ETH Transfers: Native cryptocurrency transfers

Block Analysis

Each block shows:

  • Primary activity type
  • Gas efficiency metrics
  • Transaction classification breakdown
  • Contract creation counts
  • Token interaction summaries

πŸ”§ Development

Project Structure

CronoExplorer/
β”œβ”€β”€ app.py                 # Main Flask application
β”œβ”€β”€ config.py             # Configuration management
β”œβ”€β”€ core/                 # Core classification logic
β”‚   β”œβ”€β”€ contract.py       # Contract and transaction classifiers
β”‚   └── queries.py        # Blockchain RPC queries
β”œβ”€β”€ models/               # Database models
β”œβ”€β”€ services/             # Business logic services
β”œβ”€β”€ templates/            # HTML templates
β”œβ”€β”€ static/               # CSS, JS, and static assets
β”œβ”€β”€ tests.py              # Test suite
└── requirements.txt      # Python dependencies

Running Tests

python tests.py

Adding New Chain Support

  1. Add chain configuration to chains.yaml
  2. Test RPC connectivity
  3. Verify transaction format compatibility

🌟 Advanced Features

Smart Caching

  • Transaction classification results are cached for performance
  • Block summaries reuse detailed transaction analysis
  • Minimizes redundant RPC calls

Event Fingerprinting

  • Fast contract type detection using event signatures
  • Topic0 matching against known event patterns
  • ERC-165 interface detection for standard compliance

Performance Optimization

  • Parallel RPC calls where possible
  • Lazy classification for non-critical data
  • Efficient log parsing and event decoding

🀝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Setup

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Submit a pull request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published