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

@microhoffman/sourcify-to-etherscan

v2.0.0

Published

CLI for importing Sourcify verified contracts to Etherscan

Readme

sourcify-to-etherscan

Note: This is an actively maintained rewrite of the original sourcify-to-etherscan. Uses the current Sourcify v2 and Etherscan v2 APIs.

CLI for importing Sourcify verified contracts to Etherscan in the simplest and fastest way.

Uses the Sourcify v2 API to fetch standard JSON input and submits it to Etherscan's unified v2 API. Works with any chain supported by both services — no hardcoded network list.

Install

npm install -g sourcify-to-etherscan

Requires Node.js >= 18.

Usage

sourcify-to-etherscan <contract-address> -c <chain> -k <etherscan-api-key>

Options

| Option | Description | |--------|-------------| | -c, --chain <chain> | Chain ID or network name (required). Examples: 1, mainnet, sepolia | | -k, --api-key <key> | Etherscan API key (or set ETHERSCAN_API_KEY env var) | | -a, --constructor-args <args> | ABI-encoded constructor arguments (auto-detected from Sourcify if available) | | --exact-only | Reject partial Sourcify matches (only accept exact matches) | | -V, --version | Output the version number | | -h, --help | Display help |

Supported chain aliases

mainnet, sepolia, holesky, bsc, polygon, gnosis, arbitrum, optimism, base, avalanche, linea, scroll

Any numeric chain ID is also accepted.

Examples

# Verify a contract on mainnet
sourcify-to-etherscan 0x1234...abcd -c mainnet -k YOUR_API_KEY

# Verify on Arbitrum using chain ID
sourcify-to-etherscan 0x1234...abcd -c 42161 -k YOUR_API_KEY

# Using environment variable for API key
export ETHERSCAN_API_KEY=YOUR_API_KEY
sourcify-to-etherscan 0x1234...abcd -c sepolia

# With explicit constructor arguments
sourcify-to-etherscan 0x1234...abcd -c 1 -k YOUR_API_KEY -a 000000000000000000000000...

# Only accept exact Sourcify matches
sourcify-to-etherscan 0x1234...abcd -c mainnet -k YOUR_API_KEY --exact-only

Docker

docker run microhoffman/sourcify-to-etherscan:latest \
  0x1234...abcd -c mainnet -k YOUR_API_KEY

How it works

  1. Fetches the contract's standard JSON input, compiler info, and constructor arguments from Sourcify's v2 API in a single request
  2. Submits the verification to Etherscan's unified v2 API endpoint
  3. Polls for the verification result

Acknowledgments

Inspired by the original sourcify-to-etherscan by @k1rill-fedoseev. This is a ground-up rewrite using the Sourcify v2 and Etherscan v2 APIs.

License

MIT