Learn Solidity with White Matrix: Chapter 1: Getting started with Solidity

Ali
Coinmonks
Published in
4 min readDec 21, 2020

--

Solidity is an object-oriented, high-level programming language for implementing smart contracts. It was introduced in 2014. Smart contracts are programs that govern the behavior of accounts within the Ethereum state. Solidity was influenced by C++, Python, and JavaScript and is designed to target the Ethereum Virtual Machine (EVM).

Solidity is statically typed, supports inheritance, libraries, and complex user-defined types among other features. With Solidity, you can create contracts for uses such as voting, crowdfunding, blind auctions, and multi-signature wallets.

Learn Solidity with White Matrix (World’s First Cloud-based Blockchain IDE provider)

There are different tools available for implementing the solidity language but ChainIDE is the most useful and commonly used tool for Ethereum based application development. It supports other blockchain platforms also (i.e. Fiscobcos, Libra, Ant, and etc). For more details, you can visit here ChainIDE.

Environment Setup :

Head over to ChainIDE. This will serve as the development platform for writing your first smart contract. Your screen should look like this or something similar:

ChainIDE:

ChianIDE for the Blockchain Applications development using Solidity and Ethereum

ChainIDE is a Cross-platform smart contract cloud-based IDE, it is very easy to use. It is developed for the ease of researchers and practitioners in the field of blockchain. on the most left side, you can select to create the new smart contract as shown in the image below and start to write down your first program.

The first thing you need to do before writing any solidity program is to declare its compiler version that will be used to compile your solidity program. pragma is used to declare compiler version for solidity. We can select an exact version of the compiler by pragma solidity by using pragma solidity 0.4.25; or we can let the program select an appropriate version for us by using pragma solidity >=0.4.0 <0.7.0;

Here we write down a very simple program for basic tasks (i.e. addition, multiplication, etc), test it, compile it, and deploy it.

once you have successfully compiled your contract, it's time to deploy it on the Ethereum blockchain using MetaMask. After successful deployment, you can do transactions on the Ethereum blockchain.

MetaMask

MetaMask acts as both an Ethereum browser and a wallet. It allows you to interact with smart contracts and dApps on the web without downloading the blockchain or installing any software. You only need to add MetaMask as a Chrome Extension, create a wallet, and submit Ether. You must have some amount of Ethers in your Ethereum wallet to deploy an Ethereum smart contract on the network.

For installing the MetaMask, we will go to the chrome store. or you can click here to install the MetaMask. Once it is installed, It will ask for the account if you already have a MetaMask account, can log in to an already existing account otherwise you can create a new account.

Once you have set up your account, you will select Ropsten Test Network. Because you are just going to test your contract. For successful deployment of your contract to Ethereum blockchain, you need to have dummy ether in your account. These ethers will be used as the transaction fee for storing and computing on the Ethereum blockchain.

Here is how will we add dummy ether to MetaMask. Once you have ethers in your wallet, you can simply go to ChainIDE and deploy it successfully.

Once you have ether in your wallet, select the higher fee to accelerate the processing of your transaction. Accelerating transaction by using higher fee increases their chances of getting processed by the network faster, but it is always not guaranteed. The estimated processing fee will be totally dependent on your contract. The more complex the transaction is, the more gas is required to run the smart contract.

After the successful deployment, you will get a notification “Deployment succeeded” as shown in the figure above. Now, you can make secure transactions using Ethereum blockchain resources by paying dummy ethers.

Thanks for your time. Hope this post helps you learn about Blockchain dapp development.

--

--

Ali
Coinmonks

Ali Arshad, student of computer science, interested in blockchain.