ChainIDE-English
  • 1. ChainIDE Introduction
  • 2. ChainIDE Modules
    • 2.1. File System
    • 2.2. Editor
    • 2.3. File Preview
    • 2.4. Logger
    • 2.5. Compile
    • 2.6. Deployment and Interaction
    • 2.7. Plug-in System Module
      • 2.7.1 ChainIDE Debugger
      • 2.7.2. ChainIDE Flattener Plugin
      • 2.7.3. ChainIDE Scan Verifier
    • 2.8. Functions at Bottom Part of ChainIDE
  • 3. ChainIDE - Loading Your Work
  • 4. ChainIDE - Saving Your Work
  • 5. ChainIDE - Port Forwarding
  • ChainIDE
    • 1. Ethereum IDE
      • 1. Ethereum IDE Environment Configuration
      • 2. How to Use Ethereum IDE?
      • 3. Using Hardhat
      • 4. Using Ganache v7
      • 5. Using Truffle
    • 2. BNB Chain IDE
      • 1. BNB Chain IDE Environment Configuration
      • 2. How to Use BNB Chain IDE
      • 3. Using Hardhat
      • 4. Using Ganache v7
      • 5. Using Truffle
    • 3. Conflux IDE
      • 1. Conflux IDE Environment Configuration
      • 2. How to Use Conflux IDE
      • 3. Using Hardhat
      • 4. Using Ganache v7
      • 5. Using Truffle
      • 5. Using Conflux-Truffle
    • 4. Internet Computer IDE
      • 1. How to Use Internet Computer IDE
    • 5. Nervos IDE
      • 1. Nervos IDE Environment Configuration
      • 2. How to use Nervos IDE
      • 3. Using Hardhat
      • 4. Using Ganache v7
    • 6. Polygon IDE
      • 1. Polygon IDE Environment Configuration
      • 2. How to use Polygon IDE
      • 3. Using Hardhat
      • 4. Using Ganache v7
      • 5. Using Truffle
    • 7. Flow IDE
      • Learn how to use Flow IDE to develop dApps
    • 8. FISCO BCOS IDE
      • 1. FISCO BCOS Environment Configuration
      • 2. How to use FISCO BCOS IDE
    • 9. Sui IDE
      • 1. Sui Environment Configuration
      • 2. How to use Sui IDE
    • 10. Aptos IDE
      • 1. Aptos IDE Usage Process
      • 2. How to use Aptos IDE
    • 11. XDC IDE
      • 1. XDC IDE Environment Configuration
      • 2. How to Use XDC IDE
      • 3. Using Hardhat
      • 4. Using Ganache v7
      • 5. Using Truffle
    • 12. Astar IDE
      • 1. Astar Environment Configuration
      • 2. How to Use Astar EVM IDE
      • 3. How to Use Astar WASM IDE
    • 13. IRISnet IDE
      • 1. IRISnet Environment Configuration
      • 2. How to Use IRISnet EVM IDE
      • 3. How to Use IRISnet Native IDE
    • 14. Arbitrum IDE
      • 1. Arbitrum IDE Environment Configuration
      • 2. How to Use Arbitrum IDE
      • 3. Using Hardhat
      • 4. Using Ganache v7
      • 5. Using Truffle
    • 15. Starknet IDE
      • 1. Starknet IDE Environment Configuration
      • 2. How to Use Starknet IDE
    • 16. Mina IDE
      • 1. Mina IDE Environment Configuration
      • 2. How to Use Mina IDE
Powered by GitBook
On this page

Was this helpful?

  1. 2. ChainIDE Modules
  2. 2.7. Plug-in System Module

2.7.2. ChainIDE Flattener Plugin

ChainIDE offers contract flattener plugin that combines all the imports from the original file into a single contract

Previous2.7.1 ChainIDE DebuggerNext2.7.3. ChainIDE Scan Verifier

Last updated 1 year ago

Was this helpful?

If you're new to smart contract development and are encountering issues with file organization when trying to get your code verified on platforms such as Etherscan.io, ChainIDE's Flattener plug-in can help you simplify the verification process and ensure that your smart contract is properly organized and ready for verification.

To use ChainIDE's Flattener plug-in, first, navigate to the "PLUGIN Manager" section of the ChainIDE platform. From there, select the Flattener plug-in and click "Install" to add it to your workspace. Once you have activated the Flattener plug-in, you can use it to create a flattened file for your smart contract. To do this, simply right-click on the smart contract file you wish to flatten and select "Flatten Contract" from the button. This will generate a flattened file under the "EXPLORER" panel and the flattened file combines all the imports from the original file into a single contract. The flattened file can then be used for verification on platforms such as Etherscan.io or for deployment to a blockchain network.

Following are the steps to create a flattened file for your smart contract:

  1. Activate the Flattener plugin

  1. Choose a contract file you want to flatten.

Before selecting the contract, you need to compile the contract.

  1. Save the flattened file to directory under Explorer panel

  1. View the flattened file and use it for verifying a smart contract.

Overall, using ChainIDE's Flattener plug-in can help streamline the development and verification process for your smart contracts, making it easier to ensure that your code is properly organized and ready for verification.

  1. Click on the verify and publish link shown under the contract section.

  1. Once you click on the verify and publish link, you will be asked for the following:

  • Contract Address: The address of a deployed smart contract that you want to verify

  • Compiler Type: Either you want to verify a single file or multiple files

  • Compiler Version: The compiler version that you used to compile the smart contract

  • License: Open-source license type that you used for your source code

  1. After that, you need to paste the flattened file you created in step 3, and make sure that Optimization is on or off during the compilation process, click OK, and your smart contract will be verified.

  1. If there are no issues with your smart contract, it would be verified, and you'll be able to see an image similar to the one that is shown below.

Your smart contract is verified.

To verify a smart contract, you need to access the corresponding blockchain explorer (such as ). After deploying the contract, click the button below to automatically navigate to the browser page for the corresponding contract.

EtherScan