Web3
Smartcontracts
Hello World

Hello World

Create your account at dashboard.bywise.org (opens in a new tab) and search for the IDE to start coding.

Type the code:

import BywiseUtils from 'bywise-utils.js';
 
class HelloWorldContract {
    getHelloWorld() { // @view
        return "Hello World 🎉";
    }
}
 
BywiseUtils.exportContract(new HelloWorldContract());

Let's understand this code. Every Bywise contract runs in an isolated environment, so the developer chooses what to export. The BywiseUtils.exportContract function will export a new HelloWorldContract contract.

Inside the contract we have only one method that returns Hello World. Note that there is a comment // @view that indicates to the compiler that this method does not save anything on the blockchain, it only queries information.

To execute, go to the Environment tab. Here you have a simulated environment to test your contracts. A brief description of the items:

  1. Selected simulated portfolio
  2. Value of BWS sent in the transaction
  3. Deploy the contract
  4. Contract methods
  5. List of contracts already sent
  6. List of your simulated portfolios and their respective balances

When you click the READ getHelloWorld button, you will get the string Hello World 🎉