SX Network
  • Quick Links
    • 💻SX Bet
    • ⛓️Explorer
    • 📰Newsletter
    • 🦈Community Discord
    • 🪙Buy $SX
  • SX Overview
    • 🏟️SX Vision
    • 🏆Why SX
    • 🎖️SX Product Strategy
    • 🚢SX Business Strategy
    • 💻How SX Works
    • 💰SX Tokenomics
    • ⚾SX Roadmap
    • 🏦Protocol Revenue
    • 🦈SX Executive Team
    • 🤝Key Backers
  • Developers
    • 🏗️Mainnet details
      • 🧊Block Explorer
        • Verifying a Smart Contract
    • ⚙️Testnet details
  • Validators, staking, and delegating
    • ⛓️SX Rollup
    • 💾Become a Validator
      • Setting validator commission
      • Validator Maintenance
      • Earning Rewards
      • Market Reporting
    • 📜How to Delegate SX
    • 🌉Native Bridging
    • 🧰Governance Voting
    • ❔Glossary
Powered by GitBook
On this page
  • I. Prepare your Smart Contracts for verification
  • II. Verifying via Standard Input JSON

Was this helpful?

  1. Developers
  2. Mainnet details
  3. Block Explorer

Verifying a Smart Contract

PreviousBlock ExplorerNextTestnet details

Last updated 7 months ago

Was this helpful?

Our block explorer includes the ability for developers to verify any previously-deployed contracts.

Developers can reference this page which describes the verification process within two parts - the first being the preliminary steps required to pre-verify their contract and the final piece consisting of how developers can use our explorer's contract verification form to verify their contracts.

We expect to provide a more seamless contract verification process in the coming months once Polygon-Edge supports the traceTransaction JSON-RPC endpoint needed for instant contract pre-verification. Until that time comes, developers will need to complete the pre-verification process manually (see below).

I. Prepare your Smart Contracts for verification

Follow the simple steps below to prepare your Smart Contracts for verification:

  1. Once your contracts have been deployed (we suggest flattening first, see for our reasoning why), please reach out to our dev team, providing them with any addresses that require verification.

  2. Our team will then get back to you once we've pre-configured your addresses to be verifiable.

  3. On BlockScout, you'll now see a new Code tab appear within the address pages of your contracts.

  4. You can then proceed to verify these contracts yourself via 'Standard Input JSON' (see below).

II. Verifying via Standard Input JSON

Proxy/upgradeable contract verification isn't currently available on our explorer however this functionality will be supported in the near future.

Please fill out all fields according to the official BlockScout docs - note that the uploaded JSON file should only consist of the following 3 keys taken from the input key:

  • language

  • sources

    • Within this section, we suggest you remove all entries that are unrelated to the contract you are verifying as any entries within this section will be included within the Code tab

      • It is highly recommended to first flatten your Smart Contract prior to deploying - this will make it easier to distinguish required imports from other .sol files within your repository.

  • settings

For your convenience, we've included an example .json file which can be referenced below:

{
  "language": "Solidity",
  "sources": {
    "@openzeppelin/contracts/token/ERC20/IERC20.sol": {
      "content": "// SPDX-License-Identifier: MIT ..."
    },

    ...

    "contracts/tokens/TestToken.sol": {
      "content": "// SPDX-License-Identifier: MIT ..."
    },
  },
  "settings": {
    "optimizer": {
      "enabled": true,
      "runs": 200
    },
    "outputSelection": {
      "*": {
        "*": [
          "abi",
          "evm.bytecode",
          "evm.deployedBytecode",
          "evm.methodIdentifiers",
          "metadata",
          "storageLayout",
          "devdoc",
          "userdoc",
          "evm.gasEstimates"
        ],
        "": [
          "ast"
        ]
      }
    },
    "metadata": {
      "useLiteralContent": true
    }
  }
}

After filling the form click the Verify & publish button and wait for the response.

In a few moments you'll see a green check mark appear within the Code tab indicating that your contract has been verified successfully.

Additionally, you'll see a Read Contract and Write Contract tab which will allow users to interact with all read and write functions of your Smart Contract.

🏗️
🧊
https://explorerl2.sx.technology/
here
Part I
Part II
Part II