Contract verification

Verify your deployed contract's source code on TRONSCAN so users can read it, audit it, and call its methods through TRONSCAN's interactive UI.

📘

Prerequisites

Contract verification on TRONSCAN compares your contract's source code with the bytecode deployed on-chain and, if they match, makes the source publicly available. Verified contracts show their source on the TRONSCAN contract page so users can read, audit, and call their methods directly.

Why verify

Verifying a contract earns several practical advantages:

  • Transparency — users can read the contract's source and confirm it does what it claims to do.
  • Auditability — community members and security researchers can review the source for vulnerabilities.
  • Interactive UI on TRONSCAN — TRONSCAN exposes a click-to-call interface for verified contracts; users can invoke public methods without writing any code.
  • Ecosystem compatibility — many wallets, analytics services, and explorers only display contracts whose source is verified.

Step-by-step verification

Use the TRONSCAN Contract Verification tool.

Step 1 — Fill in the basic contract information

The verification page asks for several fields. Each must exactly match the value used at deployment time — even a one-character mismatch causes verification to fail.

FieldWhat to enter
Contract Addressthe address from your deployment transaction
Main Contractthe contract name (after the contract keyword in Solidity)
Solidity Compiler Versionthe exact version used to compile (for example, 0.8.6)
Licensethe open-source license type. Use None if unsure
Optimizationwhether optimization was enabled during compile
Runsthe number of optimization runs (often 200 if optimization was enabled)
TRONSCAN verification form with the basic contract information fields

After filling these in, click Upload Contract File(s) to continue.

Step 2 — Submit the source code

  1. Upload all source files. The uploaded code must exactly match the deployed version, including every dependency.
  2. Complete the reCAPTCHA check.
  3. Click Verify and Publish.
Source upload step with Verify and Publish button

TRONSCAN compiles your source with the parameters you provided and compares the resulting bytecode to the on-chain bytecode. If they match, you'll see "Contract Verified" — your source is now visible on the contract's TRONSCAN page.

TRONSCAN showing verified contract

Common issues

Verifying contracts with subdirectory structures

TRONSCAN does not currently accept verification of multi-file contracts with subdirectory layouts (contracts/, libs/, etc.). Flatten the contract into a single .sol file before submitting. See the TRONSCAN guide on flattening contracts.

reCAPTCHA fails to load

The verification form uses Google reCAPTCHA. If reCAPTCHA cannot load, your network may be blocking Google services. Check your connection or try a different network.

reCAPTCHA component in the verification form

"Contract has not been deployed on the network"

The address you submitted could not be found on the currently selected network. Check:

  • Is the contract address correct?
  • Is the network selector (top-right of the TRONSCAN page) set to the network you actually deployed to (Mainnet, Shasta, or Nile)?

"Please confirm the correct parameters and try again"

This is the most common verification error. The cause is one of two things:

Mismatched parameters — the values entered on the verification form differ from those used at compile time. Verify each of the following:

  • Solidity compiler version (TRON and Ethereum use distinct compiler distributions; the version you used when compiling for TRON must match exactly)
  • License type
  • Optimization enabled / disabled
  • Number of optimization runs

Source code mismatch — the uploaded code is different from what was actually deployed. Possible causes:

  • The source was edited after deployment
  • Dependency files are missing from the upload
  • The contract was not flattened before submission

To resolve:

  • Upload the exact source used at deployment (use a git tag or pinned commit if you have one)
  • Include every dependency
  • Flatten the contract using a tool like truffle-flattener or solidity-flattener before uploading — see the TRONSCAN flattening guide

Related resources