Zircuit
  • Introduction
  • Frequently Asked Questions (FAQ)
  • Tokenomics
    • Zircuit Token (ZRC)
    • Bridging ZRC to Zircuit
  • Build on Zircuit
    • Quick Start
    • Deploy on Zircuit
    • Zircuit LST/LRT Liquidity Hub
  • Architecture and Concepts
    • Architecture
      • Modular Prover Design
      • Template Proofs
      • Versions and Updates
    • Concepts
    • Sequencer Level Security (SLS)
    • Gas Pricing and Transaction Fees
    • Transaction Statuses
    • Supported Transaction Types
  • Research
    • Research
    • Publications and Grants
    • Talks and Panels
  • Dev Tools
    • Block Explorer
    • RPC Endpoints
    • Bridge
    • Verifying Contracts
    • ERC20 Tokens with Zircuit Canonical Bridge
    • Development Frameworks
    • CREATE2 Deployments
    • Oracles
    • Indexing and Subgraph
    • Relayers
    • Unsupported Opcodes
    • Precompiles
    • L1 Data Fee Calculation
  • Smart Contracts
    • L1 Contracts
    • L2 Contracts
    • Contract Addresses
    • Bridged Token Addresses
  • Security
    • Security
    • Privileged Roles
    • Bug Bounty
    • Audit Reports
  • Garfield Testnet
    • Garfield Testnet Quick Start
    • Garfield Testnet Bridging Prerequisites
      • Adding the Sepolia Network To Metamask
      • Adding The Zircuit Garfield Testnet Network To Metamask
      • Connecting Metamask To Zircuit’s Bridge
    • Deploy on the Zircuit Garfield Testnet
    • RPC Endpoints
    • Block Explorer
    • Verifying Contracts
    • Bridge
    • Faucet
    • Differences & Limitations
    • Contract Addresses
  • Testnet Legacy
    • Legacy Testnet Quick Start
    • Legacy Testnet Bridging Prerequisites
      • Adding The Sepolia Network To Metamask
      • Adding The Zircuit Legacy Testnet Network To Metamask
      • Connecting Metamask To Zircuit’s Bridge
    • Deploy on the Legacy Zircuit Testnet
    • RPC Endpoints
    • Block Explorer
    • Verifying Contracts
    • Bridge
    • Faucet
    • Contract Addresses
  • Bridging Step-by-Step
    • Prequisites
      • Adding The Zircuit Network To Metamask
    • Bridging From Sepolia To Zircuit
    • Bridging From Zircuit To Sepolia
    • Completing Withdrawals From Zircuit
    • Bridging ERC20 Tokens Manually
    • Binance Web3 Wallet Task Tutorial
      • Binance Web3 Wallet Tutorial: Bridging back to Ethereum
Powered by GitBook
On this page
  • Automated Verification
  • Manual Verification
  1. Testnet Legacy

Verifying Contracts

PreviousBlock ExplorerNextBridge

Last updated 1 month ago

This page is for the Zircuit Legacy Testnet, which runs against the Sepolia testnet as a layer one. This is to be deprecated on 31 May 2025. Please use the Garfield testnet.

Verifying your smart contract's source code on the testnet allows others to see your contract's code and verify that it operates as intended. The Zircuit Legacy Testnet block explorer provides two ways of verifying source code:

  • automated verification using or

  • manual verification through direct upload of Solidity code from your .sol files or the compiler artifacts

Automated Verification

If you are using Hardhat or Foundry to develop your project, you can use a plug-in to verify the smart contracts.

Hardhat

Before you start, install if you haven't already, and deploy your smart contracts to Zircuit. Then:

  1. Install the Hardhat plug-in:

npm install --save-dev @nomicfoundation/hardhat-verify

  1. Configure Hardhat by adding the plug-in to your hardhat.config.js:

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

module.exports = {
  networks: {
    zircuit: {
      url: 'https://zircuit1-testnet.p2pify.com',
      // ... rest of the network config
    },
  },
  etherscan: {
    enabled: false,
  },
  sourcify: {
    enabled: true,
    apiUrl: 'https://sourcify.dev/server',
    browserUrl: 'https://repo.sourcify.dev',
  },
  
  // ... rest of the config
}
  1. Run the verification command from your terminal:

npx hardhat verify --network zircuit <deployed-contract-address> [constructor-arguments]

Replace <deployed-contract-address>, and [constructor-arguments] with your specific details.

If the command runs successfully, your contract's page will now display the source code and a Contract source code verified badge.

Foundry

Use the forge command to verify the contract:

forge verify-contract --verifier sourcify <deployed-contract-address> <source-file>:<contract-name> --root . --chain-id 48899

Replace <deployed-contract-address>, <source-file>:<contract-name> with your details.

Manual Verification

You will require the following:

  1. Deployed Smart Contract: The contract's Zircuit address

  2. Solidity Source Code: The solc artifacts in the standard JSON format, or the exact source code as it was at the time of contract deployment + their metadata.json file(s)

  3. Compiler Version: The Solidity compiler version used to compile the deployed contract

  4. Constructor Arguments: The contract’s constructor arguments during the deployment, if any

Follow these steps for verification:

  1. On the contract's page, click on the Contract tab. Click on the Verify and Publish link.

  2. On the next page, enter the constructor argument data types and values. Use the ABI encoded format or the form, and the system will convert them for you. if using the .sol files, you will also need to upload their respective metadata.json files. When finished, upload the source files and click Verify and Publish.

If successful, your contract's page will now display the source code and a Contract Source Code Verified badge. If the process fails, double-check the compiler version, constructor parameters, and exactness of the source code.

Install if not already installed, and deploy your smart contracts to Zircuit. Then:

If you need to specify the constructor arguments, use the --constructor-args option with the ABI-encoded argument string. You can refer to the verify-contract for more details.

If the command runs successfully, your contract's page on will now display the source code and a Contract source code verified badge.

Navigate to your smart contract on and use the search bar to find the smart contract for which you would like to verify the source code.

On the next screen, select the compiler version used to compile source code, and upload the source code files. Those can be the , or Solidity and metadata.json file(s). Click next.

block explorer
Hardhat
Foundry
Hardhat
Foundry
subcommand documentation
https://explorer.testnet.zircuit.com
https://explorer.testnet.zircuit.com
standard json input/output files for solc