Skip to content

Hyena0x/evm-parallel-conflict-analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EVM Parallel Conflict Analyzer 🚀

A high-performance static analysis tool designed to identify state conflicts in Solidity smart contracts under parallel execution environments (e.g., Monad, Sei).


Features

  • 🔍 Static Analysis: Pure Rust implementation using solang-parser (no Slither/Python dependency).
  • 🌐 Etherscan Integration: Fetch verified source code directly from Etherscan API.
  • 🔗 Proxy Resolution: Automatically detects and follows EIP-1967 and other proxy patterns.
  • 📊 Conflict Matrix: Visualizes Read-Write (RW) and Write-Write (WW) conflicts in a clear ASCII table.
  • Safety Scoring: Calculates a "Parallel Safety Score" to estimate the parallelizability of a contract.

Quick Start

Installation

Ensure you have Rust installed.

git clone https://github.com/your-username/evm-parallel-conflict-analyzer
cd evm-parallel-conflict-analyzer
cargo build --release

Usage

Analyze a local file:

cargo run -- analyze --file samples/SimpleBank.sol

Analyze a contract on Ethereum:

# Set your Etherscan API Key
export ETHERSCAN_API_KEY="your_api_key_here"

cargo run -- analyze --address 0xdAC17F958D2ee523a2206206994597C13D831ec7

Example Report

============================================================
Parallel Safety Score: 76.00%
(Score formula: 100 * (1 - Total_Conflicts / Total_Pairs))

Conflict Matrix:
┌────────────┬─────────┬────────────┐
│ Function   ┆ deposit ┆ getBalance │
╞════════════╪═════════╪════════════╡
│ deposit    ┆ WW      ┆ RW         │
├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
│ getBalance ┆ RW      ┆ SAFE       │
└────────────┴─────────┴────────────┘
============================================================

How It Works

  1. Fetch: Acquires source code via local FS or Etherscan API.
  2. Parse: Uses solang-parser to traverse the AST and build a map of storage variable accesses per function.
  3. Compare: Analyzes function pairs to detect if one writes to a variable that another reads from or writes to.
  4. Report: Generates a conflict matrix and safety score based on the discovered access patterns.

License

MIT

About

Analyze potential state conflicts in EVM smart contracts under parallel execution environments

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages