Recording Addresses
How write-addresses.ts turns broadcast logs into the app's address source of truth.
Addresses are never hand-edited into the app. scripts/write-addresses.ts reads Foundry broadcast logs and regenerates app/src/lib/addresses.ts.
Flow
Usage
bash
make write-addresses- Reads the newest
run-latest.jsonper chain undercontracts/broadcast/. - Maps deployed contract names to the address table; unknown chains are skipped.
- Writes both
4663and46630sections; undeployed entries staynull.
Rules
- Commit the regenerated file. It is the single address source of truth for the app and this documentation.
- Never paste addresses by hand into
addresses.ts— regenerate from a broadcast log so every address is traceable to a transaction. - Never copy 4663 addresses onto 46630 (the registry's placeholder rows exist to prevent exactly this).
- If a deploy is partial, rerun the script after completing it —
nullentries are the honest state, not an error.
Verifying an address independently
bash
# the address must trace to a real deployment transaction
cast tx <deploy-tx-hash> --rpc-url $RPC
# and the code at the address must be non-empty
cast code <address> --rpc-url $RPC