A high-performance static analysis tool designed to identify state conflicts in Solidity smart contracts under parallel execution environments (e.g., Monad, Sei).
- 🔍 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.
Ensure you have Rust installed.
git clone https://github.com/your-username/evm-parallel-conflict-analyzer
cd evm-parallel-conflict-analyzer
cargo build --releaseAnalyze a local file:
cargo run -- analyze --file samples/SimpleBank.solAnalyze a contract on Ethereum:
# Set your Etherscan API Key
export ETHERSCAN_API_KEY="your_api_key_here"
cargo run -- analyze --address 0xdAC17F958D2ee523a2206206994597C13D831ec7============================================================
Parallel Safety Score: 76.00%
(Score formula: 100 * (1 - Total_Conflicts / Total_Pairs))
Conflict Matrix:
┌────────────┬─────────┬────────────┐
│ Function ┆ deposit ┆ getBalance │
╞════════════╪═════════╪════════════╡
│ deposit ┆ WW ┆ RW │
├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
│ getBalance ┆ RW ┆ SAFE │
└────────────┴─────────┴────────────┘
============================================================
- Fetch: Acquires source code via local FS or Etherscan API.
- Parse: Uses
solang-parserto traverse the AST and build a map of storage variable accesses per function. - Compare: Analyzes function pairs to detect if one writes to a variable that another reads from or writes to.
- Report: Generates a conflict matrix and safety score based on the discovered access patterns.
MIT