2. How to use Polygon IDE?
To create a new smart contract we need to click on New File button at the top of the file system, currently supported file types in ChainIDE are txt', 'sol' , 'md' , 'compiled', 'deployed', 'json', 'txt', 'js', 'css', 'html', 'go', 'sum', and 'mod'. The contract shown in the figure below is a very simple storage contract prepared by ChainIDE for its users. Users can make changes in the built-in template according to their requirements.
.png?alt=media&token=ad7205f6-8a69-4cad-9844-e4f028c350bf)
Then click the Compile button on the right menu bar to open the compilation module, then select the Compiler compilation tool, and then click the Compile Storage.sol button to compile the solidity file. After the compilation is successful, the following ABI and bytecode contents will appear, and the console will show Compile contract success is output.
.png?alt=media&token=2753694f-c87b-42f3-b259-67b0551352e2)
Click the Deploy&Interaction button on the right, and the compilation page , and the interaction page will appear. Set the gas limit(1000000) and gas fee(20), then click Deploy and confirm on the Metamask. You can also click the Import Deployed Contract button to fill in the contract correlation information and click Import to import the deployed contract. The successful deployment will display contract-related information on the console and contract-related information on the interactive page.
.png?alt=media&token=d9ddab1f-900b-4a5f-b8b6-02fe826efcb4)
After the contract is successfully deployed, we need to interact with the contract deployed on the chain to obtain our own wallet address. Enter the interactive information under the store and click the Submit button to pay the interactive handling fee. If the interaction is successful, the log information will be printed on the console. Click the Get button to return the result interaction information. (Query, copy, and delete buttons can perform corresponding operations on the contract)
.png?alt=media&token=b57d623d-41f9-4a8e-9790-2560ae740aad)
Click the Transaction button on the right to display the transaction details page, where you can view the specific information of each transaction. Select one of the contracts and click the more button to view specific information.