Solidity Basics I

Learn about licenses, pragmas, imports, comments, smart contracts, and state variables in Solidity.

Solidity is a programming language that is used to write smart contracts for the Ethereum blockchain. It’s a high-level programming language that was designed by Gavin Wood and several co-founders of Ethereum. Solidity’s main characteristics are:

  • A procedural programming language: Specifies a series of steps to be followed in order to solve a problem. So, the program is designed as a sequence of commands or statements that must be executed one after another, in a specific order. 

  • A Turing complete language: Meaning that the program can be used to solve any problem that can be solved by algorithms. 

Its syntax is similar to that of JavaScript, making it easy for developers with a background in JavaScript to learn. It’s designed to target the Ethereum Virtual Machine (EVM), allowing developers to write secure and reliable decentralized applications (dapps) that implement self-enforcing business logic embodied in smart contracts.

The Solidity compiler takes the Solidity code and generates the bytecode that can be executed on the Ethereum Virtual Machine (EVM). It has become the most popular language for writing smart contracts on the Ethereum platform and has strong community support and a growing number of tools and frameworks for developing dapps.

The license

Smart contracts usually start with a Software Package Data Exchange (SPDX) comment. This is a special comment followed by a license identifier. For example:

Get hands-on with 1200+ tech skills courses.