Skip to content
BENIBIX Learn

Solidity

Development⛓️ Blockchain & Web3Smart Contracts

Also known as Solidity Language, Solidity Programming

The main code language for smart contracts. It runs on Ethereum.

Think of it like

It is the words you use to tell a snack machine what to do.

Example

Lucy writes a counter contract in Solidity. She compiles it and puts it on the chain. Now anyone can press add.

Why it matters

Most smart contracts are written in it, so it is the first thing to learn if you want to read one.

Definition

Solidity is the main language for writing smart contracts on Ethereum. Its code looks a bit like JavaScript, with curly brackets. Each value has a type that is set before the code runs. You write the code in a .sol file and then compile it. The result runs on the Ethereum Virtual Machine (EVM). That is the engine each Ethereum computer runs.

Example code

solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract Counter {
    uint256 public count;

    function add() public {
        count += 1;
    }
}
A tiny contract that keeps one number. Anyone who calls add makes it go up by one.
Solidity is the language of the code in the contract box.

Common mistake

Treating it like JavaScript. Every step costs gas, and a bug cannot simply be fixed once it is live.

Key takeaways

  1. 1
    Typed. Each value has a set type.
  2. 2
    Compiled. It turns into bytecode.
  3. 3
    Runs on the EVM. Every Ethereum computer runs it.