🎓 A1Learner
🔍
0 of 50 lessons completed

Home / Solidity

Solidity

Solidity taught as working smart contracts: state and functions, arrays, mappings, structs and enums, require guards, callers and ether, events and modifiers, inheritance and safety habits. Every example is compiled and test-proven.

Solidity is the language that smart contracts are written in. A smart contract is a small program that lives on the Ethereum blockchain, holds data and ether, and follows its rules exactly because nobody can quietly change them afterwards. This course starts with a contract that does almost nothing and builds, lesson by lesson, to contracts that take deposits, keep score, and pay ether back out.

Start learning ❯❯50 lessons · 12 topics · 0/50 completed

Course contents

Work top to bottom — the sidebar is the course. Topics later in the list assume the ones before them.

Solidity Introduction

Beginner · ⏱ 3 min · standalone lesson

Getting Started

Start: Solidity Get Started ❯

Numbers and Types

Start: Solidity Integers ❯

Functions

Start: Solidity Functions ❯

Collections

Start: Solidity Arrays ❯

Control Flow

Start: Solidity If Else ❯

Messages and Money

Start: Solidity Msg Sender ❯

Growing Contracts

Start: Solidity Inheritance ❯

Staying Safe

Start: Solidity Access Control ❯

Solidity Project: Simple Storage

Beginner · ⏱ 6 min · standalone lesson

Solidity Project: Counter

Beginner · ⏱ 6 min · standalone lesson

Solidity Project: Piggy Bank

Beginner · ⏱ 6 min · standalone lesson

Learn Solidity

A Solidity file holds contracts. A contract is a bundle of stored values and the functions that may change them, and once it is deployed — placed on the blockchain — it stays there with its own address, ready for anyone to call. Wallets and other contracts call its functions; the answers and the changes are recorded in the open.

People write Solidity when the rules of a deal must enforce themselves. The same code that counts votes in a community poll can hold a savings balance, track who owns a digital item, or release a payment when a condition is met. Contracts run on Ethereum and on chains that work the same way, so the language learned here travels.

The fifty lessons below teach the whole beginner toolkit in the order a working contract needs it. State comes first, then the functions that guard it, then the parts that deal with callers and ether. Three projects close the course: a storage contract, a counter, and a piggy bank that handles real deposits in the practice chain.

What you will learn

Each topic below is a working skill, practised on contracts small enough to hold in your head:

  • Keep values inside a contract as state variables, and read them back through the getter a public variable grows on its own.
  • Work with Solidity numbers and types: whole-number arithmetic that drops fractions, explicit conversions between sizes, addresses, and text stored as strings.
  • Write functions with parameters and return values, and control who may call them with public, private, internal and external visibility.
  • Use view and pure to mark functions that only read, or that touch nothing but their inputs.
  • Organise contract data with arrays, mappings that answer by key, structs that group fields, and enums that name a fixed set of states.
  • Choose paths with if and else, repeat work with loops, and stop bad calls early with require guards whose messages explain the refusal.
  • Tell who is calling through msg.sender, price amounts in wei, gwei and ether, and accept ether through payable functions.
  • Send ether out again with transfer, announce what happened with events, and wrap repeated checks into modifiers.
  • Build bigger contracts from smaller ones with inheritance, interfaces, and calls between contracts.
  • Apply the safety habits real contracts need: owner-only controls, arithmetic that refuses to overflow, and receive and fallback functions that catch plain ether sends.

Who this Solidity course is for

The course assumes no programming background. Words like blockchain, wallet and deploy are explained in plain language at the moment they first matter, and every new idea is shown in a contract before it is asked of you in an exercise.

It also suits a programmer arriving from another language who wants the chain-specific parts without ceremony. The early lessons will move quickly for you; the guards, ether handling and safety topics are where Solidity stops resembling the languages you know.

Time estimates printed on the fifty lessons total 176 minutes. Most readers spread that over a week of short sessions, because a lesson sticks better after its exercise has been attempted honestly.

How this course works

Work from the first lesson downward. The contents list is a path, not a menu: a mapping is only used after the lesson that introduces it, and the projects at the end lean on nearly everything above them.

No example on these pages is a sketch. Each contract was compiled with the real Solidity compiler before publication, and a set of tests then called its functions and checked the answers. The output shown under a contract is the report of those tests passing, so the behaviour described in the text is behaviour that was measured.

Running Solidity for real needs a chain, so the Try-it box does not pretend to be one. It shows the verified test report for the lesson contract, and the Remix editor linked on every lesson opens in your browser when you want to deploy and poke a contract yourself.

Your place is kept on this device. Finished lessons are marked in the contents list, and returning to the course home offers to resume where you stopped.

Frequently asked questions

Is this Solidity course free?

Yes. The whole course is open to read without payment, and you begin simply by opening the first lesson — no sign-up step stands between you and the contract code.

Can I learn Solidity without installing anything?

Yes. Lessons, examples and exercises all live on the page. When you want to run a contract yourself, the linked Remix editor works entirely in a browser tab.

What is Solidity used for?

Solidity writes the smart contracts that run on Ethereum and compatible chains. People use it for tokens, savings and lending pools, voting systems, game items with provable owners, and records that many parties must trust.

Is Solidity a good first programming language?

Yes, provided the ideas arrive in a sensible order. The language adds a few notions other languages lack — accounts, ether, and the cost of running on a chain — and this course introduces each one at the moment a contract first needs it.

How long does it take to finish this Solidity course?

The lesson estimates add up to 176 minutes of reading and practice. Working through the three projects carefully usually adds an evening, and exercises are worth attempting before checking the given answers.

What should I learn after Solidity?

Most contract writers next learn the web side, because people reach contracts through pages. JavaScript is the language those pages use to talk to a chain, and it is the natural companion course.

Next steps

  • JavaScript Beginner ❯ — The language of web pages, and the usual bridge between a visitor and a contract: buttons, forms and wallet prompts all speak JavaScript.
  • Python Beginner ❯ — A gentle second language for scripting and automation. Its scripts are handy for testing contract ideas quickly and for working with data off the chain.
  • System Design Beginner ❯ — How larger systems are planned: storage, scale and trade-offs. Useful when a contract grows into a product with servers and many readers behind it.