npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

solc-plugin-verify-proxy

v0.0.2

Published

Verify your deployed smart contracts (compiled with solc) on Etherscan from nodejs

Readme

solc-plugin-verify-proxy

NPM Version NPM Monthly Downloads

This plugin allows you to automatically verify your smart contracts' source code (compiled with solc) on Etherscan, straight from nodejs.

Note: This version of the plugin uses multi-file verification. If you want to use source code flattening instead for any reason, please use the legacy version (v0.4.x) of the plugin.

Installation / Preparation

  1. Install the plugin with npm or yarn

    npm install solc-plugin-verify-proxy
    yarn add solc-plugin-verify-proxy
  2. Generate an API Key on your Etherscan account (see the Etherscan website)

  3. Add your Etherscan API key and other configuration to your config (make sure to use something like dotenv so you don't commit the api key)

    let config = {
        api_keys: {
            etherscan: 'MY_API_KEY'
        }
    }

Usage

Before running verification, make sure that you have successfully deployed your contracts to a public network with Web3 and solc. The contract deployment must have completely finished without errors.

After deployment, connect the contract that you wish to verify and corresponding deployment address with @, and set the following config data:

let config = {
    api_keys: {
        etherscan: 'MY_API_KEY'
    },
    networks: {
        rinkeby: {
            provider: () => new Web3.providers.HttpProvider('END_POINT'),
            network_id: 4,
            skipDryRun: true
        },
        bsc: {
            provider: () => new Web3.providers.HttpProvider('END_POINT'),
            network_id: 56,
            skipDryRun: true
        }
    },
    network: 'rinkeby',
    working_directory: 'ABSOLUTE_PROJECT_ROOT_PATH',
    contracts_build_directory: 'ABSOLUTE_PROJECT_ROOT_PATH/build',
    contract_name_address_pairs: ['CONTRACT_NAME@DEPLOYMENT_ADDRESS'],
    debug: true
}

The network parameter should correspond to a network defined in the config data, with the correct network id set. The Ethereum mainnet and all main public testnets are supported.

For example, if we defined rinkeby as network in config data, and we wish to verify the SimpleStorage contract:

const verify_plugin = require('solc-plugin-verify-proxy/verify')

let config = {
    api_keys: {
        etherscan: 'MY_API_KEY'
    },
    networks: {
        rinkeby: {
            provider: () => new Web3.providers.HttpProvider('END_POINT'),
            network_id: 4,
            skipDryRun: true
        }
    },
    network: 'rinkeby',
    working_directory: 'ABSOLUTE_PROJECT_ROOT_PATH',
    contracts_build_directory: 'ABSOLUTE_PROJECT_ROOT_PATH/build',
    contract_name_address_pairs: ['SimpleStorage@DEPLOYMENT_ADDRESS']
}

await verify_plugin(config)

This can take some time, and will eventually either return Pass - Verified or Fail - Unable to verify for each contract. Since the information we get from the Etherscan API is quite limited, it is currently impossible to retrieve any more information on verification failure. There should be no reason though why the verification should fail if the usage is followed correctly.

If you do receive a Fail - Unable to verify and you are sure that you followed the instructions correctly, please open an issue and I will look into it. Optionally, a --debug flag can also be passed into the CLI to output additional debug messages. It is helpful if you run this once before opening an issue and provide the output in your bug report.

Proxy Contracts

This plugin supports EIP1967 proxies out of the box. If you try to verify a proxy contract (e.g. contracts deployed with OpenZeppelin's deployProxy), it will correctly verify the proxy contract and call Etherscan's "proxy verification" so that the proxy contract gets marked as a proxy on Etherscan (enabling Read/Write as Proxy). Note that EIP1967 Beacon contracts are not yet supported, and other types of non-standard proxies are also not supported.

Usage with supported chains

These instructions were written for verification on Etherscan for Ethereum mainnet and testnets, but it also works for verification on other platforms for other chains. To verify your contracts on these chains make sure that your truffle-config.js file contains a network config for your preferred network. Also make sure that you request an API key from the platform that you're using and add it to your truffle-config.js file. If you want to verify your contracts on multiple chains, please provide separate API keys.

module.exports = {
  /* ... rest of truffle-config */

  api_keys: {
    etherscan: 'MY_API_KEY',
    optimistic_etherscan: 'MY_API_KEY',
    arbiscan: 'MY_API_KEY',
    bscscan: 'MY_API_KEY',
    snowtrace: 'MY_API_KEY',
    polygonscan: 'MY_API_KEY',
    ftmscan: 'MY_API_KEY',
    hecoinfo: 'MY_API_KEY',
    moonscan: 'MY_API_KEY',
    bttcscan: 'MY_API_KEY',
    aurorascan: 'MY_API_KEY',
    cronoscan: 'MY_API_KEY'
  }
}

All supported platforms & networks