What is solidity in blockchain?

What is solidity in blockchain?

Solidity is an object-oriented high-level programming language. Its syntax is similar to that of ECMAScript, the standard script for JavaScript. This makes it easier to understand and implement for programmers. Codes written in Solidity are designed keeping in mind the rules of the Ethereum Virtual Machine or EVM. It is a compiler for the “Ethereum World Computer”.

Compared to the other languages which compile on the EVM, Solidity contains a number of important advantages:

  1. Complex member variables for contracts are supported. For example, hierarchical mappings and structures.
  2. Contracts support inheritance, including multiple inheritances.
  3. An Application Binary Interface (ABI) facilitating multiple type-safe functions within a single contract is supported in Solidity. Type safety means that the compiler will validate datatypes while compiling, and throw an error if you try to assign the wrong datatype to a variable. This feature is now supported by Serpent as well.

An Application Binary Interface (ABI) is the interface between two program modules, one of which is often at the level of machine code. The interface is the de facto method for encoding/decoding data into/out of the machine code.

For a small instance of how to use solidity, read Interacting with Smart Contracts using Solidity & Web3.

To view or add a comment, sign in

Insights from the community

Others also viewed

Explore topics