Your First 90 DaysAcademy
First Contact · What a Contract Even Is · Week 1 · Checkpoint 2

The File and the Dialect

A real library file, read end to end: the licence, the version, the import, the documentation, and the forty lines of code wearing all of it. OpenZeppelin's Ownable, inherited by thousands of deployed contracts.

13 steps~26 min3 nodes for your map
01 · A file that is mostly words

A different kind of file. This is OpenZeppelin's Ownable, inherited by thousands of deployed contracts, and it is the plumbing behind almost every admin function you have ever seen. One hundred lines.

Count the code and you get about forty. The rest is paperwork: a licence, a version, an import, and a great deal of documentation. Last lesson's contract hid its paperwork outside the file. This one wears it on the inside, which is what real modern code looks like.

02 · Two lines for machines that are not the compiler

Both lines are comments, so the compiler ignores both. Line 1 names the licence in SPDX form, a standard list of identifiers, which is why tooling can read it even though the machine cannot. Your previous contract had no such line, only a wall of licence prose.

Line 2 is a convention rather than a language feature. OpenZeppelin stamps every file with the release it belongs to. When you meet an unfamiliar library file, that stamp tells you which version's documentation to trust.

03 · The dialect, again

The version line again, and this time it reads `^0.8.20`. The caret means this version or any later one in the same series, stopping before the next breaking one. So 0.8.20 through 0.8.anything is accepted, and 0.9 is not.

Hold it against the contract you read last time, which said `>=0.4.22 <0.6`. Same line, two eras. The 0.8 series is where arithmetic began reverting on overflow instead of wrapping silently, so this one line tells you something real about how the maths below behaves.

04 · A signpost to another file

Line 6 is new territory. Function first: a statement that pulls in another file so this one can use what it defines. The name: an import. The braces name exactly what is being taken, here a contract called Context.

This is the moment reading gets harder, and it is worth slowing down. Your last contract had everything inside it. This one does not. Before reading on, decide what that means for you as a reader.

The file imports Context from somewhere else. What does that mean for someone reading Ownable?
your balance2,400
BANK_DBowner: the bank
you2,400
what the app is actually showing you
BANK_DBowner: the bank
you2,400their pen
you hold a claim. they hold the pen.
your digital life
BANK · you2,400the bank ✍
INSTAGRAM · you2.1M followersMeta ✍
STEAM · you134 gamesValve ✍
AIRLINE · you58,200 milesthe airline ✍
four tables. zero pens that are yours.
BANK_DBowner: the bank
you2,400
DENIED
try both pens
PLATFORM_DBowner: the platform
her · 8 years2,000,000 followers
one automated decision away
BANK_DB · you · 2,400intentcompetencecontinuity
your row stands on all three
FTX_DBowner: FTX
you5 BTC
the backing vault●●●●●
the row stayed. the backing did not.
CARD_DBowner: your bank ✍
TV you never bought−1,100
fraud reversal+1,100
someone holds the pen, so someone can fix it
?_DBowner: nobody
youstill yours?
?
can a table exist that nobody owns?
?
?_DBowner: ̶n̶o̶b̶o̶d̶y̶
you100
no owner, no pen, no trust?
keeper 1
you100
keeper 2
you100
keeper 3
you100
keeper 4
you100
keeper 5
you100
no THE copy, only copies.
keeper 2
you100
keeper 3
you100
keeper 4
you100
keeper 5
you100
your copy
you100
five copies. one of them is yours.
one attacker
one attacker, ten thousand faces.
real machinesburned wattsnext page, sealed
writing costs watts. faking voters buys nothing.
cost paid OUTSIDE: hardware and power
proof of work, burn energy to vote.
page 1you · 100page 2you · 100page 3you · 100page 4you · 100
rewrite one line, break every lock after it.
office lunchtrusted keeperconsensusfive keepers, real cost
the price buys trustlessness. the office already has trust.
?
ownerless ledger
you?
a key, not a login?
nobody owns the table. so who owns your row?
importsinheritancemodifiers

Three new nodes on your map

imports · inheritance · modifiers · +10 Lynx