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
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;
As solidity is a contract
oriented language.We need to create contract
contract FirstPrograme{
}
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;
}
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.
and to deploy click
now use should see variables value.
Thanks ❤.
Top comments (0)