Introduction
Matrix IDE is an integrated development environment for Matrix mainchain smart contracts. It allows users to develop,compile, deploy and interact with smart contracts online using our website.
Address
Mainnet: http://ide.matrix.io
Testnet: http://testnet.matrix.io:8088
Interface layout
- Icon Panel: Click icons in the Icon Panel to decide which plug-ins to show in the Side Panel
- Side Panel: A graphical user interface to show the functions of each icon
- Main Panel: Users can edit files in the Main Panel
- Terminal: The result of interactions is shown in the Terminal.
Icon Panel
The Icon Panel contains File Explorer, Solidity Compiler, Deploy and Run Transactions and Tool.
File Explorer
The File Explorer shows files saved in the local storage. It contains two contract files and one Matrix address conversion library tool.
Click the plus sign on the top left to create a new Solidity contract file. Name the file test.sol in the dialogue box that pops up.
Click OK. A file named hello.sol should appear in the browser directory inside the File Explorer of the panel on the left hand side, and a new empty space should pop up in the middle where you can edit the new file. We will learn some simple Solidity codes as we go on.
Add local files
Select files from your local storage and add them to your IDE Explorer storage.
Editor
The Editor is a panel for editing codes.
Select the new hello.sol file and enter a simple contract code.
Above is an example of the most basic form of a contract. It contains only one echo( ) method, which can be used to convert a string to its original form.
Terminal
The Terminal shows the result of executing a contract or running a static analysis.
Compiler
In the Compiler, click the drop-down box to select the correct version of Solidity Compiler.
Click Begin Compiling to convert selected code file (or files) in the Matrix IDE Compiler, like the hello.sol file shown here.
If compiling is completed without any errors, you will see the contract file name Hello in the drop-down box of the Compiler.
Deploy and Run Transactions
You can deploy a compiled contract or run a deployed contract using the options boxes in the Deploy and Run Transactions panel.
There are three Environment options: JavaScript VM, Plugin or aiman Provider.
- JavaScript VM is a virtual machine supporting JavaScript that functions within your explorer, so that you don’t have to worry about Masternode configuration or the possibility of losing your ERC-20 tokens when learning or test-running your prototype.
- If you already have mango plug-in inserted in your explorer, use the injected aiman object.
- If you have your own Masternode, you may select aiman Provider to connect the IDE to your Masternode. However, please note that if your Masternode is connected to the mainnet, every transaction you make will incur costs.
Launching a demo contract
Select Hello in the options box as shown in the screenshot above. You will find compiled contract lists contained in this option.
Click Deploy to launch the selected contract transaction. After mining, the newly created demo contract will be added, which may take a few seconds’ time. Please note that if specific parametres are requested in the constructor, you need to set the parametres first.
Use At Address to visit deployed contracts, in this case, the selected demo contract. Currently there is no safety check function available, so please take extra care to make sure the address is a trusted one.
The contract we have deployed will appear in the Deployed Contracts list. Click the demo contract.
Now we have the echo method we just wrote for the Hello contract. If the return value is the same as the input value, we have accomplished our goal.
Address Conversion Library
address_conversion.sol is a library file developed by Matrix for the smooth transplanting of Ethereum contracts to Matrix mainnet.
toMan will convert an Ethereum address to a Matrix mainnet address.
toAddress will convert a Matrix address to an Ethereum address.
Tool
Tool contains the basic functions of Matrix mainchain.
Settings
Choose a theme for Tool.