Skip to main content

What is Solidity?

Solidity is an object-oriented high-level programming language used to implement smart contracts, which allow programs to be written to manage the behavior of accounts in a blockchain network. The Solidity language supports contract inheritance and has many built-in contract libraries. Solidity is similar to programming languages like C++, Python, and JavaScript.

Solidity consists of components below,

  • Variable
  • Operator
  • Loop
  • Conditional
  • Modifier
  • Function
  • Object and Type
  • Event
  • API

Before coding in Solidity, it is important to be familiar with the blockchain mental model, because the blockchain application architecture is very different from the ordinary web application architecture. Servers and databases in a blockchain network are as decentralized as clients. In other words, the client can also act as a server and database. So you must always keep the following points in mind when coding in Solidity.

  • Memory is limited - each memory element requires all nodes on the blockchain to confirm and store that element.
  • Computational complexity is limited.
  • Reading data is free.
  • Every write operation has an associated cost - paid in ETH. This cost is measured in gas.

Solidity Tools

  • Truffle: DApp Framework
  • Remix: online IDE
  • Web3
  • MetaMask

📜Resources

📚 Solidity Docs