Verifying your contract publishes its source code on the explorer, so anyone can read what it does and interact with it safely. On xdcscan.io, a verified contract gets a checkmark on its code tab, human-readable transaction names, and Read/Write Contract tabs for direct interaction. Here’s how to do it in a few minutes.
1. Get the contract address
You need the 0x… address the contract was deployed to — it’s in your deployment output, or find the deployment transaction on xdcscan.io/txs and look at the created contract address.
2. Open the verification page
Go to the verification form at xdcscan.io/contracts/verify (also reachable via Other → Verify contract in the explorer menu). Enter the contract address and pick a verification method:
- Solidity (Flattened source code) — best for a single-file contract with no imports.
- Solidity (Standard JSON input) — upload the standard JSON output from the Solidity compiler.
- Solidity (Multi-part files) — upload all your
.solfiles as-is; the right choice for Hardhat/Foundry projects. - Solidity (Sourcify) — verify via the Sourcify metadata files.
- Vyper — single contract, multi-part files, or standard JSON.
3. Match your build settings exactly
Verification recompiles your source and compares the bytecode to what’s on chain, so the settings must match your original build:
- Compiler version — taken from your
pragma solidity X.X.Xline. Every digit matters:0.5.1≠0.5.10. - Optimization — if you compiled with optimization enabled, say so and enter the runs value (200 is the Solidity default — leave it unless you changed it).
- EVM version — select it if you know it, otherwise use the default.
- Contract libraries — if your contract links external libraries, add each library name and its
0xaddress.
Paste or upload the source and hit Verify and publish.
4. Confirm it worked
Open the contract’s address page — https://xdcscan.io/address/<contract-address>. You should see a checkmark next to the code, plus Read Contract and Write Contract tabs that let anyone call the contract’s methods directly from the explorer.
If it fails
There was an error compiling your contract means the compiled bytecode doesn’t match the on-chain bytecode. The usual fixes:
- Double-check the compiler version — all digits.
- Remove any trailing whitespace added when pasting the source.
- Try the exact source in Remix to confirm it compiles as expected.
- If your project has multiple files, switch from flattened source to the multi-part or standard JSON method.
Automate it next time
Verifying from the UI is fine for one contract; for a project, verify from your dev environment instead. OpenScan.AI supports the Hardhat verification plugin, Foundry, Remix, and Sourcify. The full reference for every UI input method is in Verify Contracts Using the OpenScan.AI Explorer UI.