Please visit Tronscan Contract Verification Tool to start the verification process.
1. Fill in Basic Contract Information
In the verification page, you need to accurately fill in the basic information of your contract. It is crucial to note that the following information must be exactly consistent with the settings used during contract deployment; otherwise, verification will fail.
- Contract Address: The address generated after deploying the contract.
-
Main Contract: The name of your main contract (i.e., the name after the
contractkeyword). - Solidity Compiler Version: The Solidity compiler version used during deployment.
-
License: The type of open-source license used. If there are no special requirements,
Nonecan usually be selected. - Optimization: Whether compiler optimization was enabled during contract deployment. Please select based on your actual choice during deployment.
- Runs: If optimization was enabled, please enter the number of optimization runs set during deployment.
After filling in the information, click "Upload Contract File(s)" to continue the verification process.
2.Submit Contract Source Code
- Click the "Upload Contract File(s)" button, select your contract source code files, and upload them. Please ensure that the uploaded code is exactly consistent with the version deployed on the chain, including all dependent files.
- Check "I am not a robot" box to complete the CAPTCHA check.
- Click the "Verify and Publish" button.
Tronscan will automatically compare your submitted source code with the bytecode deployed on the chain. If verification is successful, the system will display a message saying "Contract Verified". Afterwards, you can go to the contract page to view the publicly available contract source code information.
3.FAQ
1. How to verify contract files with subdirectory structures?
Note: Tronscan currently does not support direct verification of contract files with subdirectory structures. If your contract file structure includes subdirectories (e.g., contracts/, libs/, etc.), you need to "flatten" the contract before verification, which means merging all dependencies into a single .sol file. For specific instructions, please refer to the Tronscan Official Guide.
2. Unable to perform reCAPTCHA verification
Before clicking "Verify and Publish" to submit contract verification information, Tronscan will pop up a Google reCAPTCHA component for human identity verification (as shown in the figure below). If this component fails to load normally, it may be due to network restrictions preventing access to Google services. It is recommended to check your network connection.
3. Verification failed with message: "T… verification failed. Contract has not been deployed on the network"
This error indicates that the contract address you submitted could not be found on the currently selected network (Mainnet/Nile Testnet/Shasta testnet). Please check:
- Is the contract address correct?
- Is the selected network in the upper right corner of the Tronscan page correct (Mainnet/Nile Testnet/Shasta Testnet)?
4. Verification failed with message: "T… verification failed. Please confirm the correct parameters and try again"
This is the most common error, typically caused by one of the following:
-
Reason One: Mismatched verification parameters
Please ensure that the following parameters are exactly consistent with those used when deploying the contract:- Solidity compiler version (note: the distinction between Tron and Ethereum compilers)
- License type
- Whether optimization was enabled
- Number of optimization runs
-
Reason Two: Source code mismatch
- The uploaded contract source code is different from the code actually deployed (e.g., edited after deployment, missing files);
- Dependencies were not included
- The contracts were not flattened before submission
Solutions:
- Ensure the uploaded source code is exactly the same as the one used for deployment;
- Include all dependencies;
- Complete contract flattening;