Skip to main content

Smart Contract Verification

Updated over a month ago

Verifying your smart contract is essential for building trust and transparency. It allows developers and users to confirm that a contract's deployed bytecode is a match for its published source code. An ‘Exact Match’ provides the highest assurance that the code and its onchain behavior are identical. While a ‘Partial Match’ may occur due to subtle differences in compiler settings or metadata, even if the core functionality is identical. A successful contract verification is required to allow users to directly audit the code and interact with the contract's read/write functions through the Routescan UI interface. Learn more about it at Exploring Contract Page.

How Contract Verification Works

Routescan takes the source code you provide and matches it against the bytecode of your contract already on the blockchain. This step is vital because it confirms the public code is accurate and readable, making your contract transparent and open for public review. The following article outlines available verification methods on our platform.

Manual Verification

You have the option to verify your contract directly through our user interface (UI). This method simplifies the entire verification process, allowing you to easily submit your contract's source code and deployment details without needing to use command-line tools or complex scripts.

Recipes Verification

Alternatively, you can use Recipes and automate the contract verification process using the available methods. Each method is designed to support different contract structures and workflows, so be sure to choose the one that best fits your needs from the options below.

Programmatic Verification

You can also verify contracts using ‘Verify Source Code’ API endpoint. More on that can be found in our official documentation.

Troubleshooting and Best Practices

  • Missing Libraries. You'll need to include any linked libraries in your source code or simply provide their deployed addresses.

  • Multi-file Contracts. If your contract is spread across several files, you'll need to flatten it using a tool like Hardhat or Foundry. Alternatively, ensure all required files are included with the appropriate imports.

  • Optimization Settings. Ensure your optimizer settings (like whether it’s enabled or the run count) precisely match your original compilation setup.

  • Compiler Mismatch. Always double-check that you’re using the exact same compiler version that was used when your contract was deployed.

  • Verify on Testnet. Before deploying to Mainnet, it’s always best to try verifying your contract on a Testnet first. This helps you catch any issues early.

Contract Verification Support

We offer flexible support to fit your needs. Get instant, AI-driven solutions right from the chat. Our Support Team is also there should you require further assistance.

Contract Verification Support chat bubble on Routescan
Contract Verification Support chat window on Routescan
Did this answer your question?