KCC Documents
  • Quickstart
  • Overview
    • Introduction
    • Features
    • Our Goal
    • Consensus Engine
    • Marketing Guide
      • Requirements
      • KCC Official Website Resource
      • KCC Social Media Promotion
      • PR & Third-Party Marketing Support
  • Developers
    • Network Endpoints
    • Deploy Smart Contract
      • Using Hardhat
      • Using Remix
    • Verify Smart Contract
      • Using Hardhat
      • Using Foundry
      • Using Remix
    • Issue ERC20 Token
    • Deploy NFTs
      • Create A Foundry Project
      • Create Your ERC721 Contract
      • Add Metadata
    • Run a Node
      • Hardware & System Requirements
      • Install KCC
      • Run A Full Node
      • Run A Validator Node
        • Block Rewards
        • Apply For Running A Validator
        • Manager Account And Validator Account
        • Run A Validator
      • Troubleshooting
    • Explorer
    • Oracles
      • KCC Oracle
    • Bridge
    • Dev Toolkit
    • Data
      • Indexing and Querying
        • The Graph
        • Using KCC's hosted subgraph
    • Gas Revenue Program
      • Rules for Calculation of Gas Revenue
      • How to Join the KCC Gas Revenue Program
  • Individuals
    • Wallet
      • Supported Wallet
      • Tutorial on how to set up wallet
      • Mutisig Wallet
        • Create New Safe
        • Send KCS From Your Safe
        • Use A DApp With Your Safe
    • Network Configuration
      • Configure Value
      • Tutorial on how to config KCC network in Metamask
      • Tutorial on how to config KCC network in Chainlist
    • Bridge Assets
      • Bridge assets from others chains
      • KCC Bridge
      • Bridge assets form Exchange
    • Find a dApp
      • Add Your dAPP
    • KCS Token
      • Get KCS
      • Stake KCS
        • How to participate in KCS Staking
        • How to redeem staked KCS
        • How to check or claim staking rewards
  • FAQs
    • FAQs
      • General FAQs
      • KCS and Staking FAQs
      • Validator FAQs
  • Future Developments
    • Milestone
  • CONTACT US
    • Contact Us
  • Disclosure
    • Disclaimers
    • Risk Statement
    • Media Kit
Powered by GitBook
On this page
  • Deploy Smart Contract
  • Verify Smart Contract
  • Via flattened source code
  • Via Standard Input JSON
  1. Developers
  2. Verify Smart Contract

Using Remix

PreviousUsing FoundryNextIssue ERC20 Token

Last updated 2 years ago

Deploy Smart Contract

You can refer to this tutorial on using Remix to deploy contracts.

Verify Smart Contract

Via flattened source code

  • Our deployed HelloWorld contract address is 0x1267b1887f0a7333a47bb0a37e68c04a8ee80a44

  • Navigate to the HelloWorld smart contract address in the

  • Find the Code sub-tab and click on Verify & Publish

  • Choose the via flattened source code and continue to the Next

  • Naming the smart contract

  • Select the appropriate compiler version

  • Copy and paste the flattened source code

  • Click Verify & Publish.

  • KCC Testnet will take a few seconds to compile your contract, verify, and publish it.

Via Standard Input JSON

Standard input json is basically the raw file fed into the Solidity compiler on verification. There are some minor updates made regarding info the output compiler should return, but the main contract-related fields remain the same. This way, standard json allows you to specify the most subtle compiler settings, as well as to specify all source files.

It is quite cumbersome and tedious work, so it is preferable to use any of the above methods, however, we describe the process in more detail for those who want to use it.

For this tutorial, we will create standard json for the following contract:

// SPDX-License-Identifier: MIT
// Specifies that the source code is for a version
// of Solidity greater than 0.8.15
pragma solidity ^0.8.15;

contract HelloWorld {

    // A publicly accessible function that takes a string as a parameter
    // and echoes the `message`
    function echo(string memory message) public pure returns (string memory) {
        return message;
    }
}

1) We will use a COMPILERINPUT file generated by the compiler. You can find it in the “Compilation Details” tab (ensure that correct contract is chosen).

Create a JSON file locally and paste the copied content into the JSON file.

{
    "language":"Solidity",
    "sources":{
        "HelloWorld.sol":{
            "content":"// SPDX-License-Identifier: MIT\n// Specifies that the source code is for a version\n// of Solidity greater than 0.8.15\npragma solidity ^0.8.15;\n\ncontract HelloWorld {\n\n    // A publicly accessible function that takes a string as a parameter\n    // and echoes the `message`\n    function echo(string memory message) public pure returns (string memory) {\n        return message;\n    }\n}"
        }
    },
    "settings":{
        "optimizer":{
            "enabled":true,
            "runs":200
        },
        "outputSelection":{
            "*":{
                "":[
                    "ast"
                ],
                "*":[
                    "abi",
                    "metadata",
                    "devdoc",
                    "userdoc",
                    "storageLayout",
                    "evm.legacyAssembly",
                    "evm.bytecode",
                    "evm.deployedBytecode",
                    "evm.methodIdentifiers",
                    "evm.gasEstimates",
                    "evm.assembly"
                ]
            }
        }
    }
}

2) Submit composed standard json for verification “Via Standard Input JSON” and check results.

Import the local JSON file.

Using Remix
KCC Testnet explorer