Your First 90 DaysAcademy
The Grammar · Contracts Talking to Contracts · Week 6 · Checkpoint 13

What Are You

A contract holds an address and needs to know what is there before it calls. Read both halves of ERC-165, fifty lines in total, and find the single comparison that the whole famous mechanism rests on.

13 steps~25 min3 nodes for your map
01 · Two files, twenty five lines each

You are holding an address. Something is deployed there, you did not write it, and from inside your own code you cannot open it and look. Before you call it you would like to settle one thing: does the contract at that address speak the interface you are about to speak to it.

Two OpenZeppelin files settle it, twenty five lines each. One asks the question and one gives the plainest answer anybody has written down. The famous part of all this turns out to be a single comparison, and finding it is the checkpoint.

02 · An opening you can read at a glance now

A licence comment, a release stamp naming the folder this lives in, and a version floor with no ceiling above it. The last time you saw a pragma written that way it was on a file with almost nothing underneath it, and the same is true here.

Line 15 opens an interface, so you already know what the rest of the file is allowed to contain: declarations, and nothing else. No state, no constructor, no body anywhere. Which means the whole of the code in this file is one line.

03 · A question you can hand to a contract

Function first. This line lets anyone hand a contract a short identifier and get back a yes or a no: do you implement the thing this identifier names. The identifier is four bytes wide and never any other width, and the type that says so is `bytes4`.

You have read `uint256`, `address` and `bool`, so a new type is worth a moment. Ana reads `bytes4` and assumes it is a small number. Decide whether she is right before the file tells you.

Line 24 takes a `bytes4`. What does that type fix?
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?
bytes4interface idsoverride

Three new nodes on your map

bytes4 · interface ids · override · +10 Lynx