Solidity: Environment setup + Hello World !!

Solidity: Environment setup + Hello World !!

Uncovering and Understanding Playground and basics of Solidity Programming

In the previous Session, we learned about Evm and SmartContract where EVM is Ethereum Virtual Machine that is a run time Environment for smart-contract in Ethereum. and smart contract is a specialized programs to perform certain tasks written in solidity.

let's know something more

Remix IDE - Remix is a web platform that enables us to build, run and test smart contracts locally without any mess.

Link to Remix: https://remix.ethereum.org/

after loading, you would be able to see the workspace here!!

don't worry if it looks complex to you it will be easy as the time-passes by

we can see some folders

  • Contracts

    we will be developing contracts in the Contracts folder.

  • Scripts

    Scripts are the javascript files used to deploy contracts on the network, we will be seeing those tests in later sessions

  • Test

    Scripts are the javascript files used to test contracts on the network.

  • .deps

    it is the same as node_modules. simply storing dependencies in a folder.

Finally - Hello World !!

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

contract HelloWorld{
      string public greet = "Hello World !!";
}

so this is a very simple and basic program of solidity

program structure

  • License

    it necessary to mention the license or otherwise the compiler will give you a warning.

  • Compiler version

    declaring which compiler version we need to use.

  • Contract

    so here Contract is very much similar to Class in OOPs below the contract we are simply declaring a variable named greet.

      // see how similar solidity and javascript is
      class HelloWorld{
          let greet = "Hello World !!"
      }
    

    Done GIF by Quizizz - Find & Share on GIPHY

Hey!!! you have completed you very basic lessons on solidity now we will be diving in to programming stuff in next lessons.

Keep Learning Keep Building...

Did you find this article valuable?

Support Nishchit Malasana by becoming a sponsor. Any amount is appreciated!