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

smart contracts · code as law

BlockyVSDouble-Spend Dan
Blocky saysA smart contract is code that runs on-chain exactly as written — "code is law".

A smart contract is a program deployed to the blockchain that executes automatically when called, with no operator who can intervene. It holds funds and enforces rules deterministically: an escrow that releases on conditions, a token that tracks balances. Its power and danger are the same — it does precisely what the code says, bugs included, and usually can't be stopped or edited.

Power-ups you unlock

Double-Spend Dan attacks — common mistakes

Boss battleGive one upside and one risk of "code is law" enforcement.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>escrow contract: releases funds when condition met
no operator to call → runs as written
bug in the code = bug in the "law"</pre></body></html>
▶ Open the interactive comic issue
‹ Vyper · The Python-Flavored AlternativeSmart Contracts · Upgradeability Patterns ›