Everything a practical hands out lives here, as a zip archive built from
this site’s own repository, so that a practical started in the room can be
finished at home from the same files. Unzip, npm install, and read the
README inside.
| Practical | Session | Starter | Reference solution |
|---|---|---|---|
| A, wallet, node, first transactions | Day 1 | None needed | None needed |
B, Guestbook | Day 1 | None: the prerequisites project | Published here after Day 2 |
C, SimpleEscrow | Day 2 | None: a fresh npx hardhat --init | In day-3-reentrancy.zip, as contracts/SimpleEscrow.sol and test/SimpleEscrow.ts |
D, a frontend for SimpleEscrow | Day 2 | escrow-frontend.zip: Vite, React, wagmi, both networks configured, a wallet button, an empty page | Published here after Day 2 |
| E, deploy and verify | Day 2 | None: your Practical C and D projects | None needed |
| Breaking an escrow, then fixing it | Day 3 | day-3-reentrancy.zip: the vulnerable escrow, the fixed one, the attacker, and the tests that show the difference | It is its own solution |
day-3-reentrancy.zip
A Hardhat 3 project. npm install, then npx hardhat test: seventeen
tests, of which two are the demonstration. VulnerableEscrow is
SimpleEscrow with the guard removed and the balance zeroed after the
transfer; Attacker is a freelancer whose receive calls withdraw
again; Rejecter is a freelancer that cannot receive ETH at all, which is
what pull payments are for. The escrow is also the reference solution to
Practical C, so read it after you have written yours, not before.
escrow-frontend.zip
npm install, copy .env.example to .env.local with your chain and
your contract’s address, then npm run abi -- <path to your SimpleEscrow artifact> to give the page your ABI, and npm run dev. The wallet button
works; the page is yours to fill in, following Practical D. Switching it
to Base Sepolia for Practical E is two lines in .env.local.