Smart Contract Verification

Plume's native block explorer is our own hosted deployment of Blockscout, an open-source block explorer that implements an Etherscan-compatible API. Unlike Etherscan, the Plume block explorer does not require any API key to verify contracts. Like Etherscan, we offer a variety of methods to verify your smart contracts. Verification is available for both Solidity and Vyper smart contracts.

Verify with Hardhat Plugin

You can verify your smart contract on the Plume block explorer using the hardhat-verify plugin developed by the Nomic Foundation. Please see the "Deploy with Hardhat" section for a step-by-step guide of deploying and verifying a simple NFT contract. The steps are straightforward:

  1. Install the hardhat-verify plugin.

$ npm install --save-dev @nomicfoundation/hardhat-verify
  1. Add the following changes to your hardhat.config.js file:

    • Import the hardhat-verify plugin into the Hardhat Runtime Environment.

    • Unlike Etherscan, Blockscout does not require an API key, but the hardhat-verify plugin requires that you put in any non-empty string, so we can just use "test" as a placeholder.

    • Add the Plume testnet block explorer URLs. Make sure to add the extra \? to the end of the API URL, otherwise the verification will fail.

require("@nomicfoundation/hardhat-ethers");
require("@nomicfoundation/hardhat-verify");

/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
  solidity: "0.8.23",
  settings: {
    evmVersion: "paris"
  },
  networks: {
    hardhat: {},
    "plume-testnet": {
      url: "https://testnet-rpc.plumenetwork.xyz/http",
      chainId: 161221135,
      accounts: [process.env.PRIVATE_KEY]
    }
  },
  etherscan: {
    apiKey: {
      "plume-testnet": "test"
    },
    customChains: [
      {
        network: "plume-testnet",
        chainId: 161221135,
        urls: {
          apiURL: "https://testnet-explorer.plumenetwork.xyz/api\?",
          browserURL: "https://testnet-explorer.plumenetwork.xyz"
        }
      }
    ]
  }
};
  1. Run the npx hardhat verify task on an existing contract. For example:

$ export DEPLOYER_ADDRESS=0x96774F9f5693dFb95c973b676DFE6EaFc6f95E6d                                
$ npx hardhat verify --network plume-testnet \
  0x24fD012C1fd6c496609018e19264D30D580d2385 $DEPLOYER_ADDRESS
Successfully submitted source code for contract
contracts/RolexYachtMaster40.sol:RolexYachtMaster40 at 0x24fD012C1fd6c496609018e19264D30D580d2385
for verification on the block explorer. Waiting for verification result...

Successfully verified contract RolexYachtMaster40 on the block explorer.
https://testnet-explorer.plumenetwork.xyz/address/0x24fD012C1fd6c496609018e19264D30D580d2385#code

You can see the resulting verified smart contract code on the Plume block explorer.

Verify with Web Interface

You can manually verify your smart contract on the Plume block explorer's web interface. Simply enter the contract address into the search bar, click on the contract details, then navigate to the "Contract" tab and click on "Verify & publish":

The Plume block explorer supports three different contract verification methods for each smart contract programming language. You can submit the flattened source code, multi-part files, or standard JSON input.

Flattened Source Code

There are seven input fields to verify a smort contract using its flattened source code:

Field NameDescription

Is Yul contract

Check this if you wrote any part of your contract or whole contracts in Yul.

Include nightly builds

Check this to show nightly builds.

Compiler version

Select the compiler version specified in your contract's pragma solidity directive.

EVM version

Select the EVM version you compiled the contract against, or default if you did not choose a particular version.

Optimization enabled

200 is the default optimization level for the Solidity compiler. Edit this number if you compiled your contract with a different optimization level.

Contract code

Paste your flattened contract code here. You can flattened your contract code using Foundry, Hardhat, and other open-source flattener packages available online.

Add contract libraries

Add up to 10 contract libraries called in your smart contract. You have to specify the name of the library (e.g. ERC721.sol) and its currently deployed address on the Plume testnet.

Once you've finished entering your data, press "Verify & publish" on the bottom and your contract will be verified on the Plume block explorer!

Standard JSON Input

There are three input fields to verify a smart contract using standard JSON input:

Field NameDescription

Include nightly builds

Check this to show nightly builds.

Compiler version

Select the compiler version specified in your contract's pragma solidity directive.

Contract code

Upload your standard input JSON file. It should match the official format of the Solidity compiler input API.

Once you've finished entering your data, press "Verify & publish" on the bottom and your contract will be verified on the Plume block explorer!

Multi-Part Files

There are four input fields to verify a smart contract using standard JSON input:

Field NameDescription

Include nightly builds

Check this to show nightly builds.

Compiler version

Select the compiler version specified in your contract's pragma solidity directive.

EVM version

Select the EVM version you compiled the contract against, or default if you did not choose a particular version.

Optimization enabled

200 is the default optimization level for the Solidity compiler. Edit this number if you compiled your contract with a different optimization level.

Sources

Upload all Solidity and Yul source files for your entire contract.

Once you've finished entering your data, press "Verify & publish" on the bottom and your contract will be verified on the Plume block explorer!

Last updated