Your First 90 DaysAcademy
The Vocabulary · Every Word, Inside Real Code · Week 3 · Checkpoint 7

The and the Arithmetic Clock

A contract's only clock is a number of seconds, and its maths has no decimal point. Read OpenZeppelin's VestingWallet end to end and you can compute any release it will ever make, by hand, from two lines.

14 steps~27 min3 nodes for your map
01 · A contract that is mostly one calculation

Your first contract from OpenZeppelin, and the first one whose whole job is arithmetic. A vesting wallet holds assets for one person and hands them over gradually, a little more with every second that passes. One hundred and sixty lines, and well over half of them comment.

Almost everything here you have already met: state, a constructor, events, a mapping, inheritance, `view` functions. What is new is one word for the time and one line of maths. By the end of this checkpoint you will be able to compute any release in it by hand.

02 · Four things it remembers

Straight to the state block, the habit you now have. Line 40 counts the ether already handed over. Line 41 does the same for each token, a mapping you can read at a glance. Both of those change over the life of the contract.

Lines 42 and 43 do not. `immutable` you met last week: a value written once while the contract is being deployed and never touched afterwards. The second the schedule starts and the number of seconds it runs are decided once, and after that they are facts.

03 · Where those two get their values

Line 49 takes three things: who the assets are for, the second the schedule starts, and how long it runs. Lines 50 and 51 copy the last two straight into the immutable pair, and that is the entire body. The first is passed upward to `Ownable`.

Look at the types. Both are `uint64`, a whole number and nothing else, and the third parameter is called `durationSeconds` rather than `durationDays`. The unit lives in the name, because the type cannot carry it. A number is all the compiler sees.

Lines 42 and 43 carry immutable and line 40 does not. What decides which of them could have the marker?
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?
block.timestampinteger divisiontruncation

Three new nodes on your map

block.timestamp · integer division · truncation · +10 Lynx