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.25",
  settings: {
    evmVersion: "cancun"
  },
  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:

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:

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:

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