2. How to Use Conflux IDE
The process of writing contracts, compiling contract files, deploying, interacting, querying and verifing, etc.
Last updated
The process of writing contracts, compiling contract files, deploying, interacting, querying and verifing, etc.
Last updated
Upon entering the project, the README.md file included in the folder will be automatically previewed.
In the Explorer panel, you can create new files (or folders), refresh the directory, and download files. You can also directly click on the files that come with the template.
Click on a contract file to edit the code.
Once your contract code is written, click on the "Compiler" button in the right-side menu to open the compilation module. Choose the compiler version and decide whether to enable optimization, then click "Compile ***.sol" to initiate the compilation.
After successful compilation, the ABI and BYTE CODE will be displayed below, and you'll see a message in the console stating "Compile contract success."
Before deploying a contract, you need to click on "Connect Wallet" in the upper right corner and select to connect to JavaScript VM (used for testing, implemented in JavaScript) or Metamask (for deployment on the Conflux eSpace Chain blockchain) or Fluent Wallet (deployable on the Conflux Core blockchain)..
After connecting Metamask or Fluent Wallet, a banner will appear in the bottom right corner guiding you to connect to Conflux.
Click the "Deploy & Interaction" button on the right-hand side, which will bring up the deployment and interaction pages. Select the compiled contract and click "Deploy" to initiate the deployment (then confirm in Metamask). After successful contract deployment, the console will display the contract deployment result and relevant information.
In addition, you can click "Import Deployed Contract" to import a contract that has already been deployed for contract interactions.
After a successful contract deployment, you can interact with the contract. Click on the deployed contract, choose the corresponding interface, and click "Submit" or "Get" to perform interactions.
Click on the transaction hash in the Output section to view the specific details of each transaction.
If you wish to open-source your smart contract on a blockchain explorer, please refer to ChainIDE Verifier or ChainIDE Flattener.
If you prefer using the command line for development, you can open the Conflux Chain EVM Sandbox, which comes pre-loaded with Hardhat, Truffle, Brownie, Ganache, Git and Node.js V16.
If you've started a process on a port in the Sandbox and wish to access that port, please refer to ChainIDE - Port Forwarding.