DEV Community

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

Posted on

2 1

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 ❤.

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay