Skip to main content

aelf-Studio

1. Introduction

aelf Studio is a VS code IDE extension to minimise the efforts required in developing and deploying aelf blockchain's smart contract. aelf-Studio helps developers in buiding, testing and deploying smart contracts on the aelf blockchain. It also has other features like Ai audit, check transaction status, get testnet tokens, etc. This guide will help you in understanding the usage of the aelf-Studio.

2. aelf-Studio Features

Feature NameDescriptionCommand Option
Build Smart ContractsCompile aelf smart contracts within VS Code.Build aelf smart contract
Test Smart ContractsRun tests to validate contract functionality before deployment.Test aelf smart contract
Get Testnet TokensClaim testnet ELF tokens for testing directly in the development environment.Get testnet tokens from faucet
Deploy Smart ContractsDeploy smart contracts to the aelf testnet.Deploy aelf smart contract
Check Transaction StatusTrack deployment and blockchain transaction statuses directly from the extension.Check status of transaction
AI AuditsUse AI tools to audit smart contracts for vulnerabilities and potential issues.Audit aelf smart contract
Deploy from LocalDeploy locally built smart contracts to the aelf blockchain.Deploy aelf smart contract from a local dll

3. Setting Up aelf-Studio

  • VS Code: Make sure you have VS Code installed. You can download it from here.
  • .NET SDK: You also need the .NET SDK to write smart contracts. Download it from here.

Steps to install aelf-Studio:

  • Open VS Code:

    • Start the visual studio code program.

    vs-code-aelf-studio

  • Install the aelf-Studio Extension:

    • On the left side of VS Code, click the Extensions icon.

    click-extention-aelf-studio

    • In the search box, type “aelf-studio”.

    search-extention-aelf-studio

    • Find the extension and click Install.

    click-install-aelf-studio

    • If VS code asks to reload, click reload.
  • Check if it’s installed:

    • aelf icon will be visible at the bottom right corner of the screen after successful installation.

    bottom-icon-aelf-studio

4. How to Use aelf Studio

Create a new project:

  • Make a new folder:

    • Open the terminal in VS Code (Click Terminal at the top and choose New Terminal).

    • Type mkdir hello-world and press enter. This makes a new folder called "hello-world".

      mk-dir-aelf-studio

    • Type cd hello-world and press enter. This will change the directory to "hello-world" folder.

      cd-aelf-studio

  • Create a new smart contract:

    • In the terminal, type dotnet new aelf -n HelloWorld and press enter. This will create a HelloWorld smart contract template project.

      create-hello-world-aelf-studio

Build the contract:

  • Go to the "src" folder by typing cd src.

  • Click the aelf icon in the bottom right corner.

  • Select Build Smart Contract from the menu to build (compile) the smart contract

    create-build-aelf-studio

  • Notification will appear with preferance question. Click on "No" option.

    create-build-ask-notification-aelf-studio

  • You will again get one more select menu option. Please select respective file for Build the project.

    select-file-create-build-aelf-studio

  • You will see the success message below after the build is created successfully.

    build-success-aelf-studio

Test Smart Contract:

  • Click the aelf icon in the bottom right corner.

  • Select Test Smart Contract from the menu.

    test-build-aelf-studio

  • You will again get one more select menu option. Please select respective test file for Testing the contract.

    text-build-select-file-aelf-studio

  • Once test is completed, you will get below result in output tab.

    test-build-success-report-aelf-studio

Get testnet tokens:

  • Click the aelf icon in the bottom right corner.

  • Select Get Testnet Tokens from the menu.

    get-token-menu-aelf-studio

  • Follow the steps on the screen to get some ELF tokens for testing.

Generate AI Audit Report:

  • Click the aelf icon in the bottom right corner.

  • Select AI Audit from the menu.

    select-ai-audit-aelf-studio

  • Please select respective file to generate the audit report. Testnet token might be required to perform the audit. Claim the testnet tokens by selecting Get Testnet Tokens menu option if the tokens are not claimed already.

    select-file-ai-audit-aelf-studio

  • When the audit report is ready, a notification will appear on the bottom right of the screen with option to click Check Audit Report button.

    check-ai-audit-report-aelf-studio

  • It's advised to wait for sometime and click on Check Audit Report button to see the audit report.

Deploy the smart contract:

  • Click the aelf icon again in the bottom right corner.

  • Select Deploy from Local or Deploy Smart Contract from the menu.

    deploy-from-local-aelf-studio

  • Follow the instructions to deploy the smart contract. Blockchains take sometime to deploy the smart contract.

Check Transaction Status:

  • After deploying the smart contract, wait for sometime and click the aelf icon in the bottom right corner.

  • Select Check Transaction Status from the menu.

    select-check-transaction-aelf-studio

  • Click on Check proposal status button from the notification in the bottom right of the screen.

    check-proposal-status-aelf-studio

  • Then click on View on aelf Scan button from the notification.

    view-aelf-scan-aelf-studio

  • It will redirect you to aelf blockchain explorer for the deployment transaction. The explorer page will reflect the details of the deployment transaction.

    aelf-sacn-result-aelf-studio

Conclusion

aelf-Studio simplifies the process of developing, testing, and deploying smart contracts on the aelf blockchain, offering an intuitive in-IDE experience. With features like AI audits, transaction tracking, and testnet token retrieval, it ensures developers can efficiently manage the entire smart contract lifecycle without leaving VS Code.