Evaluate Ethereum Virtual Machine (EVM) blockchain smart contracts for similar bytecodes, identifying duplicates across contracts.
EVM Bytecodes Check is a specialized tool designed to analyze smart contracts on the EVM blockchain for duplicate bytecodes. By efficiently managing requests with rate limiting and leveraging a local SQLite database, it provides a robust solution for contract evaluation.
- Clone the repository or download the
sc_checker.js
file. - Install the required dependencies:
npm install sqlite3 [email protected] fs-extra bottleneck progress
- Create a file named
addresses.txt
in the same folder as the script. Add the contract addresses you want to analyze, one address per line. - Create a
secrets.json
file in the same folder with your Ethereum provider endpoint and Etherscan API key. Example format:{ "providerEndpoint": "YOUR_PROVIDER_ENDPOINT", "ethApiKey": "YOUR_ETHERSCAN_API_KEY" }
- (Optional) Modify the
transactionEvalCount
variable in the script to set a custom threshold for the minimum transaction count required for evaluation. Only contracts with a transaction count higher than this value will be checked. Default value is 10. - Run the script to start the evaluation:
node sc_checker.js
The script will read the contract addresses from the addresses.txt
file, utilize the configurations from secrets.json
, and evaluate the contracts based on the specified transaction count threshold, checking for duplicate bytecodes and providing progress updates.
- Database Management: Utilizes SQLite for efficient storage and retrieval of bytecodes.
- Rate Limiting: Manages request rates to adhere to Etherscan API limits.
- Etherscan Integration: Fetches transactions and bytecodes from the Ethereum network using Etherscan.
- Robust Error Handling: Implements comprehensive error handling and logging.
Contributions are welcome! Feel free to submit issues or pull requests.
Special thanks to the developers and maintainers of the libraries used in this project.
This project is licensed under the MIT License. See the LICENSE file for details.