Saltar al contenido principal

Verifying Smart Contracts

Once a smart contract is deployed to zKatana testnet, it can be verified in various ways depending on the framework of deployment as well as the complexity of the contract. The aim here is to use examples to illustrate how you can manually verify a deployed smart contract.

Ensure that your wallet is connected while following this guide. We will use Metamask wallet throughout this tutorial. For detailed explanation on how to verify smart contracts, please refer to the Blockscout documentation.

Manual Verification

After successfully compiling a smart contract, follow the next steps to verify your smart contract.

  1. Copy the Address to which the smart contract is deployed.

  2. Navigate to the block Explorer and paste the contract address into the Search box. This opens a window with a box labelled Contract Details.

  3. Scroll down to the box with tabs labelled - Transactions, Token transfers Internal txns, Coin Balance History, and Contract.

  4. Select the Contract tab and click the Verify and Publish button.

  5. There are 3 options to provide the Contract's code. We will be diving into the following two options:

    • Solidity, Flattened Source Code
    • Solidity, Standard Input JSON

Solidity, Flattened Source Code

  1. Click Next after selecting the via Flattened Source Code option.

  2. In order to update the Compiler based on your contract's compiler version,

    • Click the ↓ for a list of compiler versions.

    • Select the corresponding version. For example, select v0.8.9+commit.e5eed63a if your code has pragma solidity ^0.8.9;.

  3. Select the Optimization option based on your contract's optimization settings.

  4. Various frameworks have specific ways to flatten the source code. Our examples are Hardhat, Remix and Foundry. If you are using one file contract and it has no imports, you do not need to flatten the file.

In order to flatten the contract code with Hardhat, one needs to only run the following command:

npx hardhat flatten

The result will be printed to stdout. You can create a file with the flattened sources using the > redirection operator:

npx hardhat flatten > flattened.sol

Copy the contents of the new flattened.sol file and paste into the Contract code field in the explorer.

Solidity, Standard JSON Input

Click Next after selecting the via Standard JSON Input option.

  1. In order to update the Compiler based on your contract's compiler version,

    • Click the ↓ for a list of compiler versions.

    • Select the corresponding version. For example, select v0.8.9+commit.e5eed63a if your code has pragma solidity ^0.8.9;.

  2. Paste the Standard Input JSON file into the Drop the standard input JSON file or Click here field. You can find it in your local project folder.

Finding the Standard Input JSON file
  1. For Hardhat project go to the src/build-info folder and open the .json file.


  1. Find the input JSON object. Format the json file to make it more readable.

  2. Copy the only input JSON object value into a new file



  1. Drag and drop this new file into Drop file or Click here field.
  1. Click on Verify & Publish button to verify your deployed smart contract.