Introduction
This guide shows how to verify a deployed smart contract on Quai Network’s official mainnet block explorer, Quai Explorer (explorer.qu.ai).
Verifying your smart contract publishes its source code and ABI on-chain so users and developers can audit the bytecode and interact with Read and Write contract tabs directly inside the explorer.
For Orchard Testnet deployments (
chainId: 15000), use the Orchard explorer at orchard.quaiscan.io.Supported Verification Methods on Quai Explorer
Quai Explorer supports three contract verification workflows:- Solidity (Standard JSON Input) (recommended) — Upload the compiler’s Standard JSON input (or the IPFS metadata file generated by
@quai/hardhat-deploy-metadata). - Solidity (Flattened Source Code) — Paste single-file flattened Solidity source code along with compiler version and optimization flags.
- Sourcify Import — Automatically import verified contract metadata and source files from Sourcify.
Prerequisites
To deploy contracts with IPFS metadata and verify them on Quai Explorer, you’ll need:Walkthrough
This walkthrough follows the Deploy with Solidity guide using the hardhat-example repository.1. Deploy a Smart Contract
Following the Deploy with Solidity guide, deploy a smart contract with IPFS metadata enabled:ipfs.qu.ai.
2. Download the Formatted IPFS Metadata
When using@quai/hardhat-deploy-metadata, download the formatted metadata JSON from ipfs.qu.ai using your deployment’s CID:
3. Verify & Publish on Quai Explorer
- Open Quai Explorer (
explorer.qu.ai) and navigate to the Contract Verification page (or search your deployed contract address and open its Contract → Verify & Publish tab). - Enter your deployed Contract Address and select the License matching the
SPDX-License-Identifierin your source file. - Choose Solidity (Standard JSON Input) as the verification method and select the exact Solidity Compiler version used to compile your contract (or choose Flattened Source / Sourcify if preferred).
- Upload
ipfsMeta.json(or your Standard JSON input file) and click Verify & Publish.
