Skip to content
Lattice

Architecture decision records

These records explain why Lattice is built the way it is. Each one states a decision, the options it was weighed against, what follows from it, and the check that enforces it. The full comparison stays in the linked issue or pull request; a record is the outcome, not a spec.

ADRDecisionStatus
0001Modules are an interface, a library and a stateless facetAccepted
0002ERC-7201 storage at hard-coded lattice.storage.<Module> slotsAccepted
0003ERC-165 registration writes a precomputed map slotAccepted
0004Releases use raw-salt CREATE2: versioned facet salts, versionless registry and factory saltsAccepted; deployer under review in #193
0005Bare-ETH acceptance is an opt-in facet under the zero selectorAccepted
0006Diamonds are created and initialized atomically through LatticeFactoryAccepted
0007LatticeRegistry is a standalone two-tier registryProposed until #176 settles
0008A live module's namespace and interfaceId are frozenAccepted
0009Token extensions replace base selectors; base libraries run no hooksAccepted
0010Zero-knowledge modules standardize on Groth16 over BN254Accepted
0011No new copies of stateless Solady or OpenZeppelin utilitiesAccepted
0012The storage-layout checker stays in Bash and jqAccepted
0013A timelock in the Governor's diamond enforces the proposal grace periodAccepted

When to write one

Write an ADR when a change settles a material architecture decision, the kind AGENTS.md asks to compare with credible alternatives. Record the outcome here and keep the comparison itself in the issue or pull request.

A record is never rewritten to reverse its decision. A new ADR replaces it, and the old record's status becomes Superseded by NNNN. Corrections that keep the decision, such as a fixed link or a status that follows a linked issue, are edited in place.

Template

Copy this into NNNN-short-title.md, using the next free number, then add the record to the table above and to the Design decisions sidebar group in docs/site/vocs.config.ts.

# NNNN. Decision as a short sentence
 
- **Status:** Proposed | Accepted | Superseded by NNNN
- **Date:** when it was decided (and the PR or issue that decided it); when it was recorded
 
## Context
 
The problem and the constraints, with links to the code.
 
## Options considered
 
1. **The chosen option.** One line.
2. **An alternative.** One line on why it lost.
 
## Decision
 
What Lattice does, stated so a reviewer can check a change against it.
 
## Consequences
 
What follows, good and bad, including what it costs and what it rules out.
 
## Confirmation
 
The test, gate or review step that enforces the decision, or "none" with the reason.
 
## References
 
Issues, pull requests and files.