Hardhat

Once your contract is deployed to the Neura Testnet, you can verify its source code on the block explorer.

Verifying a contract means uploading its source code, compiler configuration, and metadata to the explorer so others can review and reproduce the bytecode. Neura uses a Blockscout-based system compatible with Hardhat’s verify task.

Network Details

  • Chain ID: 267

  • RPC URL: https://testnet.rpc.neuraprotocol.io

  • Blockscout Verifier URL: https://testnet-blockscout.infra.neuraprotocol.io/api/

  • Explorer URL: https://testnet-blockscout.infra.neuraprotocol.io/

  • Verification Standard: blockscout

Hardhat Configuration Example

import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
import * as dotenv from "dotenv";

dotenv.config();

const config: HardhatUserConfig = {
  solidity: "0.8.28",
  networks: {
    neura_testnet: {
      url: "https://testnet.rpc.neuraprotocol.io",
      accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
    },
  },
  sourcify: {
    enabled: false,
  },
  etherscan: {
    apiKey: {
      "neura-testnet": "empty", // Required placeholder
    },
    customChains: [
      {
        network: "neura-testnet",
        chainId: 267,
        urls: {
          apiURL: "https://testnet-blockscout.infra.neuraprotocol.io/api",
          browserURL: "https://testnet-blockscout.infra.neuraprotocol.io",
        },
      },
    ],
  },
};

export default config;

Note: Be sure to keep your .env file private and never commit it to version control.

Verify a Deployed Contract

  • Basic verification:

npx hardhat verify --network neura_testnet 0x335F0BCE3980813517f5cc30ae779236fcaeD3AA
  • Example output:

[[email protected]] injecting env (1) from .env – [tip] encrypt with dotenvx: https://dotenvx.com

Successfully submitted source code for contract
contracts/SimpleStorage.sol:SimpleStorage at 0x335F0BCE3980813517f5cc30ae779236fcaeD3AA
for verification on the block explorer. Waiting for verification result...

Successfully verified contract SimpleStorage on the block explorer.
https://testnet-blockscout.infra.neuraprotocol.io/address/0x335F0BCE3980813517f5cc30ae779236fcaeD3AA#code

Check the verified contract on Neura Blockscout Explorer.

Additional Info

Item
Status / Notes

@nomicfoundation/hardhat-verify plugin

✅ Required

Supported Solidity versions

✅ Recommended: ^0.8.28


Last updated