Skip to content

docs(contracts): detailed pages for Chamber, Reserve, registrar and verifier - #15

Merged
shramee merged 17 commits into
mainfrom
feat/contracts-docs
Nov 28, 2026
Merged

shramee merged 17 commits into
mainfrom
feat/contracts-docs

Conversation

@shramee

@shramee shramee commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #13 (feat/landing-design).

What

Eight detailed pages under Contracts, linked from the section overview with RuledIndex, ordered by sidebar.order:

Page Covers
How the contracts fit A diagram of the four contracts, every call between them with its guard, and step-by-step deposit, spend/withdrawal, registration and removal flows
Chamber Constants and the (owner, verifier, guardian) constructor; both deposit overloads, the checks in order, return values, the asset list and minimum; screening, rejection, reclaim (pending to the depositor only, rejected to refundTo) and setDepositRefundTo; handleZkp checks and effects in order; registerReserve and the four Reserve setters; views
Trees and roots Tx-tree rollover, fetching a note's index, leaves and proof, merging notes across trees; the zkState tree; the 10-minute grace window and the history cutoff on messaging switch-on
Reserve Chamber-only deposit/withdraw; the admin and two-step handover; the four roles with their bytes32 values, silent no-op grants and revokes, and the per-role permission epoch; addUser/removeUser and the leaf nonce; the removal freeze; the auditor key; screener and asset list
ManagerSigRegistrar Setup grants; the EIP-712 domain (version 3) and struct with typehash; a viem signTypedData sample; registerUser checks; what voids a signature (leaf nonce, per-leaf revocation count, signer epoch, deadline); ECDSA vs ERC-1271; revoke(reserve, leaf)
Roles and security A roles and permissions table, the verifier and ownership timelocks, the guardian pauses, and plain worst-case notes for each privileged holder
Events and errors Every event with exact parameters and when it fires, what to monitor, and every revert string and custom error an integrator meets
Verifier and deployment ChamberVerifier's interface and how it is replaced; core's exit-spend deploy blocker; Deploy.s.sol env vars, the development-chain check and production validation (Safe owner with threshold ≥ 2, guardian required), constructor-time ownership and broadcast order, dev fixtures; post-deployment steps; toolchain

One CSS addition to diagram.css: two modifiers on .mist-arch__proof (a closing row under the Reserves, and chip-over-label stacking at phone width), used by the new diagram only.

Sources

Every signature, parameter, event, revert string and constant was checked against the Solidity at core fa7b92d (contracts/src/{Chamber,Reserve,IChamber,ManagerSigRegistrar,ChamberVerifier}.sol, lib/Merkle4.sol, lib/Poseidon.sol, script/Deploy.s.sol, foundry.toml, contracts/README.md) and the inherited OpenZeppelin code. fa7b92d re-lands core #192 as #194 on top of cf1413d; this PR follows it. Rationale follows spec/decisions.md (DEC-10, DEC-14 to DEC-17). Spec PR mistcash/mist#115 describes cf1413d, so it does not yet cover #194; the pages follow the code. Role hashes and the EIP-712 typehash were computed with cast keccak.

No deployed addresses are listed and no audit is claimed. A maximum transaction amount and exit spends are marked Planned.

How it was checked

  • npm ci && npm run check && npm run copyrules && npm run build && npm run linkcheck: all green, after the rebase onto feat(docs): landing design and EVM information architecture #13. In-page anchors checked against the built HTML.
  • Playwright at 1440 and 390 px, dark and light, every page: no horizontal overflow outside table and code frames. The diagram's wide-chip rows broke mid-word at 390 px, fixed with the stacking modifier.
  • Independent accuracy reviews against the core source, at cf1413d and again for the fa7b92d update; findings fixed before pushing.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Nov 27, 2026 3:54am UTC

shramee and others added 17 commits November 27, 2026 09:21
Adds a closing-row modifier to the architecture diagram grammar so the registrar can sit under the Reserves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replacing the guardian does not end an inflow pause; the exit-window claim is scoped to users who can spend; duplicate deposits queue at a screened Reserve; tree capacity and slot reuse are stated; and the event, error, registrar and deploy notes are made exact.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Core fa7b92d binds each signature to its signer, the signer's USERS epoch, the leaf nonce and a per-leaf revocation count, under domain version 3. revoke(reserve, leaf) cancels every outstanding signature for the leaf. The typehash is recomputed with cast keccak.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…emoval freeze

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
refundTo is paid only after rejection and can be changed while pending, the constructor takes the guardian, a users root cannot return to zero, and notes in different trees are merged through a spend with a dummy input.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ocker

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The registrar entry no longer names the removed registration count, the owner can unpause inflows directly, the deploy transfer condition and permission epoch are stated exactly, and a rejected deposit is said to go to refundTo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shramee
shramee force-pushed the feat/contracts-docs branch from a68588b to 0c95fe2 Compare November 27, 2026 03:54
Base automatically changed from feat/landing-design to main November 28, 2026 23:03
@shramee
shramee merged commit bc685df into main Nov 28, 2026
3 checks passed
@shramee
shramee deleted the feat/contracts-docs branch November 28, 2026 23:04

This branch was successfully deployed

1 active deployment
Preview — 0c95fe29 Deployed Nov 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant