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
  • 1. Choose a Template
  • 2. Write a contract
  • 3. Compile a contract
  • 4. Connect to Astar WASM
  • 4.1 Connect to Swanky Node
  • 5. Deploy a contract
  • 6. Contract interaction
  • 7. Transaction Query
  • 8. Contract verification
  • 9. View WASM Developer dashboard
  • 10. Astar WASM Sandbox

Was this helpful?

  1. ChainIDE
  2. 12. Astar IDE

3. How to Use Astar WASM IDE

The process of writing, compiling, deploying, interacting, and querying with Astar WASM smart contracts

Previous2. How to Use Astar EVM IDENext13. IRISnet IDE

Last updated 1 year ago

Was this helpful?

1. Choose a Template

Astar WASM IDE offers developers a variety of basic or complex templates, such as Flipper, PSP22, PSP34, Magink-dApp, and more. Click to access a template.

2. Write a contract

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.

3. Compile a contract

Once the contract code is written, click the "Compiler" button on the right-hand menu to open the compilation module. Choose whether to enable "release" and "nightly" (usually not required), and then click "Build ***.rs" to initiate the compilation.

Compiling WASM contracts takes a few minutes, so in the meantime, we can proceed with the next step.

After a successful compilation, the left-hand Explorer panel will display the "target/ink" folder, and within that folder, you will find the "***.contract" file (used for deploying the contract).

4. Connect to Astar WASM

Before deploying a contract, you need to click on "Connect Wallet" in the upper right corner, choose your wallet, and use it to connect to the Astar blockchain.

By default, it's connected to the Shibuya testnet. If you need to switch to another network, you can click on "Shibuya Testnet" in the bottom right corner to change the network.

ChainIDE supports switching between four networks: Astar Mainnet, Shibuya Testnet, Shiden Mainnet, and Custom Network.

4.1 Connect to Swanky Node

Swanky Node is a Substrate-based blockchain designed to facilitate local development of Wasm smart contracts. If you require a substantial amount of tokens for testing and have high-speed interaction requirements, this section is worth exploring.

ChainIDE has integrated a graphical Swanky Node. Click on "Astar Swanky Node" on the right-hand side and then click "Start."

Wait for a few seconds until the Sandbox displays the following two lines.

Click on the "Jump" link in the Faucet URL to obtain test tokens on the Swanky Node's local network.

Choose an account with tokens and transfer some tokens to your own wallet.

Return to the ChainIDE for Astar page and copy the WebSocket URL.

Congratulations, you have successfully switched to the Swanky Node local network.

5. Deploy a contract

Click the "Deploy & Interaction" button on the right-hand side, which will bring up the deployment and interaction pages. Select the compiled contract, click "Deploy" to initiate the deployment (then confirm in your wallet). After successful contract deployment, the console will display the contract deployment result and relevant information.

In addition, you can click on "Import Deployed Contract" to import contracts that have already been deployed, or you can use "On-Chain Contract Code" to deploy contracts using a CodeHash.

6. Contract interaction

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.

7. Transaction Query

Click on the transaction hash in the Output section to view the specific details of each transaction.

8. Contract verification

Contracts compiled using ChainIDE can be submitted to Polkaholic for contract verification.

Click the "Scan Verifier" button on the right-hand side, select the network, code hash, and public mode, then click "Publish Verified Code" to initiate the contract verification process.

9. View WASM Developer dashboard

ChainIDE and Polkaholic have collaborated to develop the WASM Developer Dashboard.

Click the "WASM Developer Dashboard" button on the right-hand side to view information such as "Recent Code Stored," "Recent Contracts Instantiated," and "Recent Calls."

10. Astar WASM Sandbox

Refer to , select "Custom Mode," and enter the WebSocket URL you copied in the previous step. Then, click "Switch."

If you prefer command-line development, you can open the Astar WASM Sandbox, which comes pre-loaded with , and .

ChainIDE facilicates full-stack development. For example, if you use Magink-dApp template, you can not only compile and deploy your smart contracts, but also serve your dApp's frontend via ChainIDE's port forwarding feature. Please refer to .

Swanky Suite
Git
Node.js V16
ChainIDE - Port Forwarding
step 3, "Connect to Astar WASM"