https://github.com/subscan-explorer/solidity-verification-tool
Subscan solidity contract verification tool
https://github.com/subscan-explorer/solidity-verification-tool
evm solidity subscan
Last synced: about 2 months ago
JSON representation
Subscan solidity contract verification tool
- Host: GitHub
- URL: https://github.com/subscan-explorer/solidity-verification-tool
- Owner: subscan-explorer
- License: mit
- Created: 2025-03-05T07:07:03.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-04-16T10:18:26.000Z (2 months ago)
- Last Synced: 2026-04-16T12:27:29.163Z (2 months ago)
- Topics: evm, solidity, subscan
- Language: Go
- Homepage:
- Size: 2.71 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Solidity Smart Contract Verification Tool
This tool allows you to verify Solidity smart contracts by comparing the bytecode on the blockchain with the recompiled
bytecode.
## Features
- Recompiles Solidity smart contracts using a specified compiler version.
- Compares the on-chain bytecode with the recompiled bytecode.
- Provides detailed error messages if verification fails.
- Preserves metadata settings such as `evmVersion` and `eofVersion` when recompiling.
- Polkadot revive(https://github.com/paritytech/revive) support.
- No dependency on external services or third-party libraries.
## Installation
1. Clone the repository:
```sh
git clone https://github.com/subscan-explorer/solidity-verification-tool.git
```
2. Navigate to the project directory:
```sh
cd solidity-verification-tool
```
3. Install dependencies:
```sh
go mod tidy
```
## Usage
1. Start the server:
```sh
go run main.go
```
2. Send a POST request to `/verify` with the contract metadata and compiler version.
If the contract was compiled for EOF, include `settings.eofVersion` in the metadata JSON.
```sh
curl -X POST -H "Content-Type: application/json" -d '{"metadata": {...}, "compilerVersion": "v0.8.26+commit.8a97fa7a","chain":46,"address":"xxxx"}' http://localhost:8081/verify
```
Example EOF metadata fragment:
```json
{
"settings": {
"evmVersion": "osaka",
"eofVersion": 1
}
}
```
## Revive support
Building Solidity contracts for PolkaVM requires installing extra dependencies. To install revive, run the following command:
```sh
go run . download # if will auto download latest resolc binary in static folder
```
## License
This project is licensed under the MIT License.