3

Introduction to Solidity...

 2 years ago
source link: https://dev.to/suhakim/introduction-to-solidity-1j7k
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

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.

and to deploy click

now use should see variables value.

Thanks ❤.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK