Gauss Docs
  • 🌐Getting Started
    • Welcome to Gauss
    • Whitepaper
      • Blockchain Providers Need to Do Better
        • Solving a Lack of Token Adoption
          • An Evolving Space With Untapped Potential
        • Security & Reliability
          • Curation & Vetting
            • Important Note For Brands
        • Token Creation
      • WHY BUILD WITH GAUSS?
      • Use Cases
        • Use Cases (Chart)
      • Roadmap
      • Technical Background and Blockchain Development
        • Why Another Blockchain?
        • Gauss 1.0: Built With Efficiency and a Strong Infrastructure to Launch Rapidly
        • Gauss 2.0: Added Functionality For a Better User Experiance
          • Noble Swap 2.0
          • NFTs in Gauss 2.0
          • Token Development Kit (TDK)
          • Gaming DAO
          • Omnipool
      • Token Economics
        • Gang Token Economics: Designed to Ensure Trust and Transparency
        • Token Locking Schedule
        • Reflections: Rewarding the Gauss Community
        • Charitable Allocations: Grants, Scholarships, & Financial Assistance
      • The Gauss Team
      • Important Definitions
      • DISCLAIMER
        • PURCHASER WARNING
        • PROMINENT STATEMENTS
        • FUTURE STATEMENTS
        • VALUE RISKS
        • NOT A SECURITY
    • How To Connect
      • Create Metamask Wallet
    • Links
  • ⚡Launching with Gauss
    • Benefits of Building with Gauss
      • Fostering an Environment for Success
      • Gauss Growth Grant Program
      • Gauss Liquidity Program
      • Ecosystem Integrity Fund
      • Client Referral Program
    • A Guide to Curation
      • Core Principles and Curation Guidelines
      • Curation Stages and Processing Fees
    • Building on Gauss
  • 🖥️Gauss Ecosystem
    • Gauss Chain
      • Polygon-Edge Overview
      • Architecture
      • Consensus
      • Client Modules
        • Blockchain
        • Minimal
        • Networking
        • State
        • TxPool
        • JSON RPC
        • Consensus
        • Storage
        • Types
        • Syncer
        • Sealer
        • Other Modules
      • Polygon-Edge Performance Reports
      • For Developers
        • Operate a Node
          • Local Install
          • Genesis Contract
          • Server Config
          • CLI Commands
          • Key Management
        • Run a Validator
          • Validator FAQ
        • Smart Contract Deployment Permissioning
        • Deploying Contracts
          • Remix
          • Truffle
          • Hardhat
          • Replit
    • Gauss Explorer
      • Features
      • Navigating the Explorer
        • Menus
        • Blocks
        • Transactions
      • Verifying a Smart Contract
        • Hardhat Plugin
        • Sourcify Plugin
        • OpenZeppelin Plugin
      • Interacting With Smart Contracts
      • Exporting Transactions
      • FAQ
      • For Developers
        • Gauss Explorer Dependencies
        • Deployment Guide
          • Smart Contract Verification
          • Cleaning an instance from the previous deployment
          • ENV Variables
          • Testing
        • APIs
          • Requests & Limits
          • GraphQL
          • ETH RPC
    • Noble Swap
      • Liquidity Boost Program
    • Tokens
    • Gauss NFTs
      • Ferro Cards
      • F.E.R.R.E.T. NFTs
    • Contests & Giveaways
    • Gauss Faucet
      • For Developers
    • Address List
  • 💡Additional Resources
    • Partnerships & Affiliates
    • Discord Channel
    • Contact Us
    • Learning Materials
      • Web3 Glossary
    • Media Kit
Powered by GitBook
On this page
  • Sourcify Plugin for Hardhat
  • Contract Verification via Sourcify
  • Usage Example
  1. Gauss Ecosystem
  2. Gauss Explorer
  3. Verifying a Smart Contract

Sourcify Plugin

PreviousHardhat PluginNextOpenZeppelin Plugin

Last updated 2 years ago

Sourcify Plugin for Hardhat

Similar to the hardhat verification plugin, this plugin submits the contract source and other info of all deployed contracts to Sourcify.

1) Tune Hardhat environment. For seamless usage, you should setup your environment (note, it will take an hour or so to run through). In this example we setup to use the Sokol test network. See the Hardhat Verification Tutorial for more information on the config file setup.

2) Deploy contract. . Note that we run from node_modules.bin\hardhat to circumvent package.json warning and use --network sokol to specify the network.

D:\test>yarn hardhat --network sokol deploy
yarn run v1.22.17 
warning package.json: No license field 
$ D:\test\node_modules.bin\hardhat --network sokol deploy 
Nothing to compile deploying "Greeter" (tx: 0x32d11b11a547c126a4763be963f6acd0bb4f87ee7d7627e36f7d9009c57c6182)...: deployed at 0xBEA47De7132cF44D6b16617154CAA247b6568eaD with 528275 gas 
Done in 18.81s.

3) Verify contract.

D:\test>yarn hardhat --network sokol sourcify
yarn run v1.22.17
warning package.json: No license field
$ D:\test\node_modules\.bin\hardhat --network sokol sourcify
verifying Greeter (0xBEA47De7132cF44D6b16617154CAA247b6568eaD on chain 77) ...
 => contract Greeter is now verified
Done in 5.74s.

4) Confirm verification in BlockScout. Go to your BlockScout instance and paste the contract address into the search bar. If verified, the code tab will display a green checkmark.

Selecting the Code tab will show additional information about your contract.

Contract Verification via Sourcify

ENABLE_SOURCIFY_INTEGRATION=true
CHAIN_ID={chain_id_number}

Usage Example

Verify your contract using Sourcify:

  1. Open the address page for the contract you want to verify, switch to Code tab, and click Verify & Publish button.

  1. Choose Sources and metadata JSON file option and click the Next button.

  1. On the next screen, you will see a drop field where you will add files.

  1. Drag and drop (or click the button to add files from your computer) all .sol files used by the target contract you want to verify and the .json file containing the contract's metadata. For example, this .json is created by Truffle in ./build/contracts folder after truffle compile. If your contract has linked libraries you should also drag & drop .json files _for those libraries. Once all files are added, start verification by clicking the _Verify & Publish button.

Example Contract:

​

Along with contract verification through a flattened source file (the default option in Blockscout), a API verification option is also available. The Verification with Sourcify feature is enabled in the and available in . Projects who want to use this feature need to set the following ENV variables.

After several seconds your contract should be verified through Sourcify's API (If verification fails, you will see the reason in the dropzone). Verification metadata will be saved in the Blockscout DB and you will see the verified contract page with the link to the same metadata in the (chain ID is 100 for the xDai chain).

Contract .

The same contract in the .

🖥️
following this tutorial
More deployment details here
Sourcify
xDai instance of Blockscout
version 3.7.0+
Sourcify contract repository
verified via Sourcify contract in Blockscout
Sourcify contract repository