Smart Contract Verification

Publish your contract’s source code and metadata so users can audit, decode, and interact with it.

Verification matches your deployed bytecode against compiled source. Once verified, a contract gets a green checkmark across the explorer: human-readable method names in transactions, decoded event logs, a browsable source view, and read/write interaction tabs.


Why verify

  • Trust — users can read exactly what your contract does before interacting.
  • Decoding — the explorer decodes method calls, logs, and errors using your ABI.
  • Interaction — the Contract tab’s read/write interface works out of the box.
  • API consumers/api/v2/smart-contracts/{hash} returns your source and ABI to integrators.

Verification methods

MethodBest for
Explorer UIOne-off verification; paste source into the form
Standard JSONAny toolchain; submit the compiler’s JSON input
Flattened sourceSimple single-file contracts
Multi-part filesProjects with imports, without a build tool
Hardhat pluginProjects using Hardhat — verify on deploy
Foundry (forge)Projects using Foundry — forge verify-contract

All methods are covered in the Examples Library and the Verification API Reference.

Match types

  • Exact (full) match — source compiles to bytecode identical to what’s on-chain, including metadata hash. The strongest form of verification.
  • Partial match — the compiled bytecode matches except for the metadata hash. Still fully usable in the explorer; marked as partially verified.

What you need

  • The exact compiler version used at deployment (e.g. v0.8.24+commit.e11b9ed9)
  • Optimization settings (enabled? runs?) and EVM version
  • The source code exactly as compiled — flattened, multi-part, or standard JSON input
  • Constructor arguments (ABI-encoded) if the constructor takes any
  • Library addresses if the contract links external libraries

Getting any of these wrong is the top cause of failed verification — see Best Practices for how to get them right, and Advanced Features for proxies, Vyper, and similar-match lookup.

Verify from the UI

  1. Open your contract’s page on xdcscan.io.
  2. Go to Contract → Verify & publish.
  3. Choose a method, paste your source and settings, and submit.

Verification completes in seconds; the contract page updates immediately and the API begins serving the ABI.

Verify via API

CI pipelines and deploy scripts should verify programmatically — see the Verification API Reference.