DEV Community

Cover image for Introduction to Solidity...
sadiul hakim
sadiul hakim

Posted on

Introduction to Solidity...

Hey there,Today i am going to talk a little bit about Solidity.What is solidity?Solidity is an object-oriented, high-level language for implementing smart contracts. Smart contracts are programs which govern the behaviour of accounts within the Ethereum state.Interesting,right?Let's write some solidity code.

To write solidity code you would like to use a online IDE called remix.visit IDE

remix ide

First we need to say license and which solidity version you are going to use.In my case it looks like below..

//SPDX-License-Identifier:GPL-3.0

pragma solidity ^0.8.4;
Enter fullscreen mode Exit fullscreen mode

As solidity is a contract oriented language.We need to create contract

contract FirstPrograme{

}
Enter fullscreen mode Exit fullscreen mode

If you know OOP.you can imagine contract as a Class.Now let's create two variables and deploy our contract.

contract FirstPrograme{
   string public name="Hakim";
   uint public age=18;
}
Enter fullscreen mode Exit fullscreen mode

Here the public keyword is variables visibility.Now if we compile and deploy our contract we will see two buttons.To compile contract click this button.

compile

and to deploy click

deploy

now use should see variables value.

value

Thanks ❤.

Top comments (0)