Day 1: contracts, schema, and the city layer
ETHGlobal Tokyo started today. By the evening we had:
- Residency.sol — and **ResidencyFactory.sol** — the core contracts. One factory deploys one Residency per stay. Funds never mix.
- 22 unit tests + fuzz + invariant suite + mainnet fork test — — all passing against real USDC on a mainnet fork.
- Database schema — — users, profiles, cities, core team, residency series, proposals, residencies, applications, receipts. Every onchain event has its corresponding table row.
- SIWE auth — — Sign-In with Ethereum, session cookies signed with jose.
- World IDKit 4.x — — Proof of Human widget, server-side RP signing, developer API verification, one nullifier per wallet.
The big design decision: cities are offchain containers (Postgres), and residencies are onchain contracts. This means launching a city is free (no gas), and each residency's money is isolated in its own contract.
The city layer was a late addition — the original design had cities as metadata-only. The offchain city with a core team that approves proposals turned out to be the right abstraction: it decouples city governance from onchain risk.