Solidity is the programming language used for developing a smart contract over Ethereum blockchain. Here, in this article, we will learn the basics of Solidity and we’ll also write our first smart contract of "Hello World".
Solidity is a contract-oriented programing language; bear in mind, it’s not object-oriented. Each smart contract has its own state. By using a state, you can store the data to the blockchain. However, storing data is not free; it costs some Gas. Thus, whenever you write the code on the public blockchain, keep in mind, each block of your code should consume a minimum amount of Gas. If it’s not clear at this point, don’t worry, we will take a look at it later with examples.
Initially, there is no setup required to start with Solidity. Ethereum provides an online IDE called Remix, on which you can develop and deploy your smart contract. For learning purpose, we will use the same throughout this series.
Remix Introduction
When you open the Remix in your browser, you will see the screen as below.

Click here to see the image in full width
There are four different sections.
1. File explore
Using file explorer, we can manage our contract files. Note that by default, all the files are stored in your browser, hence, clearing the browser storage will permanently delete all the Solidity files that you added. Explorer has other options, such as exporting all the contract files to GitHub and copying all files to another instance.
2. Code Editor
Code Editor is your main section where we’ll write the Solidity code. The Editor re-compiles the code each time the current file is changed. It also provides syntax highlighting and font-size option.
3. Terminal
It displays the log/debugging information while you interact with Remix. You can trace the information of transaction you made or see the event info there.
4. Deploy And Test
The fourth section contains various options for analysis, compilation, deployment, and testing of your smart contract. Here, we have an option of auto-compile. If you enable that option, it will compile the smart contract every 5 seconds. We’ll see the usage of options while developing a smart contract.
Write Your Contract
First, we will remove the existing default contract files (i.e. ballot.sol and ballot_test.sol) and add a new file with the name myContract.sol with the following code.
pragma solidity ^0.5.0;
contract helloWorld {
function printHelloWorld() public pure returns (string memory) {
return 'helloWorld';
}
}
Here, we have created one smart contract named helloWorld. Let’s understand the contract structure in brief.



Денис ДюкPosted Jul 22, 2019, 2:50 AM
Thanks for the rather extensive guide. I read here an equally interesting article on this topic https://writeabout.tech/programming/facts-about-web-design-2/
Vishal PrajapatiPosted Jan 2, 2019, 2:58 AM
Nice article DIvyang..Thanks for sharing
Mahesh ChandPosted Jan 1, 2019, 10:45 PM
Well done, Divyang.
Sarathlal SaseendranPosted Dec 31, 2018, 9:14 AM
Very good information Divyang on Solidity language. Thanks for sharing.