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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@starboardventures/hardhat-verify

v1.0.1

Published

Hardhat plugin for solidity contract verification on Starboard block explorer

Downloads

180

Readme

@starboardventures/hardhat-verify

The @starboardventures/hardhat-verify is a Hardhat plugin designed and developed for the source code verification of Solidity contracts on the Filecoin Virtual Machine (FVM) with the Starboard FVM Explorer. This plugin supports both the Mainnet and the Calibration Testnet.

Starboard FVM Explorer:

Mainnet: https://fvm.starboard.ventures/explorer

Calibration Testnet: https://fvm.starboard.ventures/calibration/explorer

Installation

In an existing project:

You can add the plugin to your existing project by running:

yarn add @starboardventures/hardhat-verify

In a new project:

If you're setting up a new project, the fevm-hardhat-kit provides better support for the FEVM chain. Here's how to set it up:

git clone https://github.com/filecoin-project/fevm-hardhat-kit

cd fevm-hardhat-kit

yarn install

yarn add @starboardventures/hardhat-verify

Configuration

The plugin can be imported into your hardhat.config.js file: Import the plugin in your hardhat.config.js:

require("@starboardventures/hardhat-verify");

Or if you are using TypeScript, in your hardhat.config.ts:

import "@starboardventures/hardhat-verify";

This plugin depends on the starboardConfig field in your Hardhat config to distinguish between different network environments. To use the CLI tools, this config needs to be set up first.

Here's an example for both the Mainnet and Calibration Testnet:

Mainnet:

module.exports = {
  solidity: {},
  starboardConfig: {
    baseURL: 'https://fvm-api.starboard.ventures',
    network: 'Mainnet' // if there's no baseURL, url will depend on the network.  Mainnet || Calibration
  },
};

Calibration Testnet:

module.exports = {
  solidity: {
    version: "0.8.17",
  },
  starboardConfig: {
      baseURL: 'https://fvm-calibration-api.starboard.ventures',
      network: 'Calibration' // if there's no baseURL, url will depend on the network.  Mainnet || Calibration
  },
};

Usage

Compile

Before you verify a contract, you need to compile it first:

npx hardhat compile

Cli

This plugin adds the starboard-verify task to Hardhat :

npx hardhat starboard-verify <CONTRACT_NAME> <CONTRACT_ADDRESS>

Additionally, you can generate a metadata.json file for a contract. This will save the metadata in a file named <CONTRACT_NAME>_Metadata.json in your root directory:

npx hardhat starboard-verify <CONTRACT_NAME> metadata

Script

You can also write a script to use this plugin. Make sure to compile your contracts and have the artifacts available before running the script:

Mainnet:

const { StarboardVerify, generateMetadata } = require('@starboardventures/hardhat-verify/dist/src/utils')

async function verify() {
  const verify = new StarboardVerify({
    network: 'Mainnet',
    contractName: 'BigDataAuctionImpl',
    contractAddress: '0x5588c33dFF7e3A1831D41B0E3aBdD4D67E897a02',
  })
  await generateMetadata('BigDataAuctionImpl') // optional
  await verify.verify()
}
verify();

Calibration Testnet:

const { StarboardVerify, generateMetadata } = require('@starboardventures/hardhat-verify/dist/src/utils')

async function verify() {
  const verify = new StarboardVerify({
    network: 'Calibration',
    contractName: 'BigDataAuctionImpl',
    contractAddress: '0x5588c33dFF7e3A1831D41B0E3aBdD4D67E897a02',
  })
  await generateMetadata('BigDataAuctionImpl') // optional
  await verify.verify()
}
verify();

Note: For contracts that are newly deployed, the Starboard FVM Explorer will require some time to index them. The indexing time is approximately 30 seconds on Calibration, and around 1-2 minutes on Mainnet. Please ensure that they are indexed by the Starboard FVM Explorer before proceeding with verification, otherwise an error stating resource not found will be returned.