freecoding.school100% FREE · NO SIGNUP
Ledger LandISSUE #29 of 90

solidity · the contract language

BlockyVSDouble-Spend Dan
Blocky saysSolidity is the main smart-contract language — C/JS-like, compiled to EVM bytecode.

Solidity is statically-typed and curly-braced, purpose-built for the EVM. A contract declares state variables, functions, events, and modifiers. It's deceptively familiar but unforgiving: code is immutable once deployed, bugs can lose real money, and gas costs shape how you write. You write small, audited, well-tested contracts — not sprawling apps.

Power-ups you unlock

Double-Spend Dan attacks — common mistakes

Boss battleWrite a minimal contract with one state variable and a setter.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>contract Counter {
  uint public count;
  function inc() public { count += 1; }
}</pre></body></html>
▶ Open the interactive comic issue
‹ Evm · Opcodes · Stack · Memory · StorageSolidity · Types · Functions · Modifiers ›