Writing / Blockchain & Solidity · · 3 min read
Introduction to solidity

Solidity is nothing new, just the use case of it is something that came to existence a few years ago. Solidity is just a high level object oriented language that someone who is familiar with other object oriented language like C++, Java etc. will find very similar.
It would be a series of blogs and at the end, we will be deploying our ERC20, ERC721 and ERC1155 token on testnet.
The learning curve of solidity depends on two factors:
-
Prior knowledge of object oriented language like C++, Java, PHP etc. -> For those having prior knowledge, the curve is almost linear, there’s nothing new other than the syntax that is also very easy to learn and everything related to syntax can be found online.
-
No Prior knowledge -> Those having no knowledge of other OOPS language, I would suggest them to first learn any of the above mentioned language and then jump to solidity to experience a linear curve otherwise if you would directly jump on learning solidity, the curve would be very steep.
Use Cases
It is important to know the use cases of the thing you are planning to learn and if that doesn’t excite you, then you are not gonna enjoy your learning journey.
- It’s one and only most popular use case is to write smart contracts and smart contracts in simple language are the code that runs on blockchain. If you don’t know about smart contract, please get a basic idea of it because in later tutorial we will be writing smart contracts throughout.
Setup
There’s nothing much to setup, you just need a browser and boom you can write your first smart contract now.
We will be using remix for writing smart contracts.
Data Types
-
uint
-
int
-
string
-
bool
-
array
-
struct
-
address
-
bytes
-
contract
-
enums
These are some majorly used data structure used in solidity
uint and int are similar just the difference is that in int, you can have negative values but in uint, you can’t.
NOTE: uint and int can be also written as uint256 and int256. We can also use uint8 uint16 uint24 ….. to save some gas.
Address is a new type and it holds a 20 bytes value as ethereum address.
Contract is just like a class.
Let’s write our first contract on remix.
Hello World

Line 1: We have to mention the license, don’t focus on it just write the line as it is.
Line 3: Mention the solidity version.
Line 5: Contract name just like class declaration in other languages
Line 6: Declaring a string variable named hello and assigning value to it. The modifier of it is kept as public so that the compiler attaches a getter with it and we don’t have to manually create it.
After writing this code, just press Ctr + s or go to the third icon from left bar and **compile **the code, if there is no error go to the fourth option and deploy your code. You will see something like this:

You will see the value as specified in the smart contract.
Boom, you have successfully written your first smart contract and deployed it on blockchain.
That’s it for this blog, If you have any doubt please put it in the comment section and if you liked it, don’t forget to give a thumbs up to it. In next blog, we will be writing some basic level smart contracts.
Stay safe and keep learning.
Written by Dikshant Rajput, AI and full-stack engineer. Also published on Medium. Questions? Ask my AI version or get in touch.