🏠 Home
Beginner
01 — Introduction to Solidity 02 — Setting Up Your Environment 03 — Your First Smart Contract 04 — Data Types & Variables 05 — Functions & Visibility 06 — Control Flow 07 — Arrays & Mappings 08 — Structs & Enums
Intermediate
09 — Events & Logging 10 — Modifiers 11 — Inheritance 12 — Interfaces & Abstract Contracts 13 — Error Handling 14 — Ether & Wei 15 — Payable Functions 16 — msg.sender & msg.value 17 — Storage vs Memory vs Stack
Advanced
18 — Gas Optimization 19 — ERC-20 Tokens 20 — ERC-721 NFT Standard 21 — Contract Security 22 — Reentrancy Attacks 23 — Oracles & Chainlink 24 — Upgradeable Contracts 25 — Deploying to Mainnet
SolidityMaster / Lesson 01
Lesson 01 of 25

Introduction to Solidity

What is Solidity and how does the Ethereum Virtual Machine work?

Beginner

What is Solidity?

Solidity is a statically-typed, contract-oriented programming language designed for developing smart contracts that run on the Ethereum Virtual Machine (EVM). Created by Gavin Wood and first proposed in 2014, Solidity borrows syntax from JavaScript, Python, and C++, making it approachable for developers from many backgrounds. Smart contracts are self-executing programs stored on the blockchain. Once deployed, they run exactly as programmed — without downtime, censorship, fraud, or third-party interference.

The Ethereum Virtual Machine (EVM)

The EVM is the runtime environment for smart contracts on Ethereum. It is a sandboxed, isolated virtual machine that:
  • Executes bytecode deterministically across all nodes
  • Charges gas for every operation to prevent abuse
  • Maintains a global state — accounts, balances, and storage
  • Is Turing-complete (with gas as a limiting factor)
When you write Solidity code, the compiler translates it to EVM bytecode that every Ethereum node can execute identically.

Your First Look at Solidity

Every Solidity file starts with a pragma directive specifying the compiler version, followed by a contract declaration — similar to a class in object-oriented languages.
Solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract HelloWorld {
    string public message = "Hello, Ethereum!";

    function setMessage(string memory _msg) public {
        message = _msg;
    }
}

Key Concepts to Remember

  • Immutability — deployed contract code cannot be changed
  • Gas — every computation costs ETH to execute
  • Determinism — the same inputs always produce the same outputs
  • Transparency — all contract code is visible on the blockchain
  • Trustlessness — no intermediary is needed to execute the logic