MELD Dev Docs
  • Welcome to MELD
  • OVERVIEW
    • Core Concepts
      • EVM Compatible
      • Staking/Block Rewards
      • L1-Subnet
    • Bug Bounties
    • Careers
    • Security & Audits
      • Double Spend Prevention
  • DEVELOP
    • Developing on MELD
    • Basics
      • Kanazawa Testnet
      • Test Tokens & Faucet
      • MELD Mainnet
      • RPC connections
        • RPC Methods
      • Explorers
    • Tools
    • Oracles
      • Integrating Supra Oracles
    • Deploy a Smart Contract
      • Smart Contract Languages
      • Smart Contract Testing
      • Using Remix IDE
      • Using Hardhat
      • Verify Your Smart Contract
    • Token Standards
      • MLD-20: Fungible Tokens
        • Interacting With MLD-20 Tokens
      • MLD-721: NFTs
      • MLD-1155: Multi-token standard
      • MLD-404: Semi-fungible tokens
      • MDL-6551: Token Bound Accounts
    • Deploy NFTs
      • Using Remix
    • dApp
      • Develop a Full Stack dApp on MELD
      • Secure your dApp
    • Decentralized Storage
    • Cross Chain Bridging
      • Integrating Chainport
        • Bridging Between MELD and EVM Chains
          • Main Chain -> Side Chain
          • Side Chain -> Main Chain
          • Side Chain -> Side Chain
      • Akamon Bridge
      • Yield Boost
  • VALIDATORS
    • Overview
    • Consensus
    • Run a Validator node
    • MELD Staking
  • Tutorials
    • Using MELD with your metamask
    • Create a Token
    • Add a Token to Asomi DEX
    • Lock/Burn Liquidity
  • FAQ
    • General FAQ
    • Borrowing & Lending FAQ
    • MELD ISPO FAQ
Powered by GitBook
On this page
  • Verify the deployed contract on the MELD block explorer
  • Flatten the Smart Contract Code
  • Using Flattened Code to Verify
  1. DEVELOP
  2. Deploy a Smart Contract

Verify Your Smart Contract

PreviousUsing HardhatNextToken Standards

Last updated 1 year ago

Verify the deployed contract on the MELD block explorer

The first and foremost step is to flatten the solidity contract into a single file to be able to get it verified on MELD block explorer.

Flatten the Smart Contract Code

  • Copy and Paste your smart contract into a local file on your system named as HelloWorld.sol.

  • Use a package installer to install (or your desired tool to perform the flattening)

    • For NMP run the command npm install truffle-flattener on your terminal or command prompt.

    • For Homebrew run the command brew install truffle

  • Flatten the contract by running the command in the npx truffle-flattener HelloWorld.sol > FlatHelloWorld.sol contracts directory

  • Clean up the licensing information.

    • The flattened contract will have the same licensing note imported from each of the files.

    • Multiple licensing notes in one file break the verification process, so you have to leave one licensing note for the entirety of the flattened contract.

    • The easiest way to clean up is to search for the SPDX mentions in the file and remove all of them except for the very first one.

Using Flattened Code to Verify

At this point, you have your flattened and cleaned-up contract ready for the MELD block explorer verification.

  • Go to .

  • Enter the address of the smart contract you want to verify

  • In Compiler Type, select Solidity Flattened.

  • In Compiler Version, select v0.8.15. This is the version this tutorial used to compile the contract.

  • In Open Source License Type, select MIT License (MIT).

  • Click Continue.

  • Keep the Optimization option set to No as Remix does not use optimization by default.

    • Important: if you used a different optimization configuration, adapt as needed

  • Paste the entirety of your flattened .sol contract in the Enter the Solidity Contract Code below field.

  • Click Verify and Publish.

  • MELD block explorer will take a few seconds to compile your contract, verify, and publish it.

Truffle Flattener
MELD block explorer for Testnet