Skip to content

Verifying contracts

Verifying publishes a contract's source alongside its bytecode, so anyone can read what the contract does and call it from the explorer.

Why verify

  • Users can read the code rather than trusting a description of it.
  • The explorer decodes transaction input and event logs into readable names.
  • A read and write interface appears on the contract's page.
  • Integrators get the ABI without asking you for it.

Every platform contract — the AMM factory and router, the governance contracts, the launchpad — is verified.

What you need

Contract addressWhere it is deployed
SourceThe exact source that produced the deployed bytecode
Compiler versionExactly the one used
OptimisationEnabled or not, and the runs count
Constructor argumentsABI-encoded, if the constructor took any

The source must match exactly

Verification compiles your source and compares the result against the deployed bytecode. A whitespace change is fine; a different compiler version, a different optimiser setting or a changed import is not. Keep the exact source that was deployed.

Verifying through the explorer

  1. Open the contract address in the explorer.
  2. Choose to verify, and select how you will supply the source — flattened source, standard JSON input, or multi-part files.
  3. Supply the compiler version and optimisation settings used at deployment.
  4. Add the ABI-encoded constructor arguments if the constructor took any.
  5. Submit. On success the source appears immediately.

Standard JSON input is the most reliable route, because it captures the compiler settings and every import exactly as the compiler saw them. Hardhat and Foundry both emit it as a build artefact.

After verification

bash
curl -s https://api.testnet.kriptonyx.com/api/v2/smart-contracts/0xYourContract

returns the source and ABI, which you can feed straight into ethers.js.

If verification fails

SymptomLikely cause
Bytecode mismatchWrong compiler version, or optimisation settings differ from deployment
Missing importsUse standard JSON input, or flatten the source first
Constructor mismatchArguments not ABI-encoded, or in the wrong order
Metadata hash differsSource differs in a way the compiler records — confirm you have the deployed source, not a later edit

KriptoNyx testnet — chain ID 3009 (kriptonyx_3009-1)