{"id":15654037,"url":"https://github.com/aniket-engg/sol-verifier","last_synced_at":"2025-10-16T02:19:19.511Z","repository":{"id":33784338,"uuid":"161603389","full_name":"Aniket-Engg/sol-verifier","owner":"Aniket-Engg","description":"Verify Solidity smart contracts on Etherscan","archived":false,"fork":false,"pushed_at":"2023-03-03T11:28:36.000Z","size":731,"stargazers_count":30,"open_issues_count":6,"forks_count":15,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T22:38:16.793Z","etag":null,"topics":["etherscan","etherscan-api","sol-verifier","solidity","solidity-contracts","verification-code"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Aniket-Engg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-13T07:53:50.000Z","updated_at":"2025-04-09T13:28:55.000Z","dependencies_parsed_at":"2024-08-01T21:54:07.121Z","dependency_job_id":null,"html_url":"https://github.com/Aniket-Engg/sol-verifier","commit_stats":{"total_commits":84,"total_committers":6,"mean_commits":14.0,"dds":0.4285714285714286,"last_synced_commit":"68d7c940eb2384fc76182fcb2ba2a98d1b66ca69"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aniket-Engg%2Fsol-verifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aniket-Engg%2Fsol-verifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aniket-Engg%2Fsol-verifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aniket-Engg%2Fsol-verifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aniket-Engg","download_url":"https://codeload.github.com/Aniket-Engg/sol-verifier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251790639,"owners_count":21644254,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["etherscan","etherscan-api","sol-verifier","solidity","solidity-contracts","verification-code"],"created_at":"2024-10-03T12:49:12.189Z","updated_at":"2025-10-16T02:19:14.462Z","avatar_url":"https://github.com/Aniket-Engg.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm version](https://badge.fury.io/js/sol-verifier.svg)](https://www.npmjs.com/package/sol-verifier)\n[![Build status](https://travis-ci.com/Aniket-Engg/sol-verifier.svg?branch=master)](https://travis-ci.com/Aniket-Engg/sol-verifier)\n[![Coverage Status](https://coveralls.io/repos/github/Aniket-Engg/sol-verifier/badge.svg?branch=master)](https://coveralls.io/github/Aniket-Engg/sol-verifier?branch=master)\n[![npm](https://img.shields.io/npm/dw/sol-verifier.svg)](https://www.npmjs.com/package/sol-verifier)\n[![npm](https://img.shields.io/npm/dt/sol-verifier.svg?label=Total%20Downloads)](https://www.npmjs.com/package/sol-verifier)\n![NPM](https://img.shields.io/npm/l/sol-verifier.svg)\n[![Package Quality](https://npm.packagequality.com/shield/sol-verifier.svg)](https://packagequality.com/#?package=sol-verifier)\n\n# sol-verifier\nsol-verifier is an NPM package to verify the Solidity smart contracts on Etherscan. It works as a CLI tool and can be used inside the js file too. \n\n## Install\nAs a dependency, to use inside a file:\n```\nnpm install --save sol-verifier\n```\nAs a development dependency, to use it as `\u003cproject_root\u003e/node_modules/.bin/sol-verifier`:\n```\nnpm install --save-dev sol-verifier\n```\nAs a global npm module, to use `sol-verifier` as an executable:\n```\nnpm install -g sol-verifier\n```\n\n## How to use\n\n### As a CLI tool\nsol-verifier has multiple available options. some of them are required and some depends on the usecase. One can see all the available options by using `--help` option.\n```\n$ sol-verifier --help\nUsage: sol-verifier [options]\n\nOptions:\n  -v, --version                                    output the version number\n  -k, --key \u003cetherscan-api-key\u003e                    Etherscan API Key (recommended but optional)\n  -c, --contract \u003cpath-to-solidity-contract-file\u003e  Contract File Path (required)\n  -a, --address \u003ccontract-address\u003e                 Address of Deployed Contract (required)\n  -n, --network \u003cnetwork\u003e                          Ethereum Network on Which Contract is deployed (if applicable)\n  -N, --contractName \u003ccontract-name\u003e               Contract Name if Passed File Contains More Than One Contract (if applicable)\n  -p, --constructParams [param1, param2,...]       Constructor Parameter Values Same as in Deployment (if applicable)\n  -r, --runs \u003cruns\u003e                                Optimizer Runs (optional, default 200)\n  -e, --evmVersion \u003cevm-version\u003e                   See valid options: https://solidity.readthedocs.io/en/latest/using-the-compiler.html#target-options (optional, default compiler-default)\n  -l, --licenseType \u003clicense-type\u003e                 Valid codes 1-12, see https://etherscan.io/contract-license-types (optional, default 1=No License)\n  -o, --optimize                                   Add This Flag to Optimize The Contract (optional)\n  -h, --help                                       output usage information \n```\nKeeping the user-friendliness in mind, sol-verifier process certain information internally until it is explicitly required. For example, in a minimum case, if someone deploys a contract as below on some Ethereum network(which exists only on one network),\n```\npragma solidity ^0.5.7;\n\ncontract SimpleStorage {\n    uint storedData;\n\n    function set(uint x) public {\n        storedData = x;\n    }\n\n    function get() public view returns (uint) {\n        return storedData;\n    }\n}\n```\nby CLI, it can be verified with this command:\n```\n$ sol-verifier -c \u003ccontract-file-path\u003e -a \u003ccontract-address\u003e\n```\nThat's it.\n\nWhen you have a contract importing some other contracts and having constructor with parameters, it can be verified with this command:\n```\n$ sol-verifier -k \u003cetherscan-api-key\u003e -c \u003ccontract-file-path\u003e -a \u003ccontract-address\u003e -n \u003cnetwork i.e. mainnet, ropsten etc.\u003e -p \u003cconstructor-params-values as: [param1,param2]\u003e -N \u003ccontract-name\u003e\n```\nIf contract is compiled \u0026 deployed by enabling optimization, flag `-o` can be used to enable the optimization during verification. On successful verification, you will get response as :\n```\nInfo: Contract has been successfully verified.\n```\n\n### By requiring in file\nA request object will be passed to verify contract. See below: (Make sure keys of request object will be always same)\n```\n    const verifier = require('sol-verifier');\n    var data = {\n        key: 'etherscan-api-key',                       // Etherscan API key (required)\n        path : '/path/to/contract/contractName.sol',    // Contract file path(required)\n        contractAddress:  '0x123456789.......',         // Contract address (required)\n        network  : 'mainnet/ropsten/rinkeby/kovan',     // Ethereum network used (required)\n        contractName: 'contractName'                    // Contract name, only if contract file has more than one contracts\n        cvalues   : [constructor, values, in, array],   // constructor values in array, only if contract has constructor\n        evmVersion: 'istanbul',                         // See valid options: https://solidity.readthedocs.io/en/latest/using-the-compiler.html#target-options (optional, default compiler-default)\n        runs: 200,                                      // Optimizer Runs (optional, default 200)\n        licenseType: 1,                                 // Valid codes 1-12, see https://etherscan.io/contract-license-types (optional, default 1=No License)\n        optimizationFlag: false                         // Set `true` to enable optimization (default false)\n    };\n\n    await verifier.verifyContract(data);\n```\nParameters not applicable can be ignored. \n\n**Note:** In case of array as constructor parameters, pass values as: [[v1, v2], v3, v4] (This feature is available since version v2.1.0)\n\n## Points to remember\n* Add specific version with `^` in your contract pragma. Version should be same as the compiler version used while contract deployment.\n* This doesn't provide support for libraries.\n* Works for solidity version `\u003e 0.4.11`.\n* The Etherscan API that this module uses is in BETA state.\n* Maximum time for processing verification request is 30 seconds. If request timed out, check final result on Etherscan itself.\n\n## Contribution\n[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/Aniket-Engg/sol-verifier/issues)\n\nEach kind of contributions even a single suggestion or feedback makes project mature and reliable.\n\n## License\n[MIT](https://github.com/Aniket-Engg/sol-verifier/blob/master/LICENSE)\n\n### \u003ci\u003ePowered by Etherscan.io APIs\u003c/i\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faniket-engg%2Fsol-verifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faniket-engg%2Fsol-verifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faniket-engg%2Fsol-verifier/lists"}