Skip to content

docs: add comprehensive state-machine matrix and authorization reference - #66

Merged
P3az3 merged 1 commit into
MillestoneX:mainfrom
ReinaMaze:docs/state-machine-matrix
Jul 23, 2026
Merged

docs: add comprehensive state-machine matrix and authorization reference#66
P3az3 merged 1 commit into
MillestoneX:mainfrom
ReinaMaze:docs/state-machine-matrix

Conversation

@ReinaMaze

Copy link
Copy Markdown
Contributor

State Machine Documentation and Authorization Matrix

Created comprehensive state machine reference for the campaign contract.

Changes

  • docs/state-machine.md: New 2D authorization matrix covering all 11 entrypoints with auth requirements, freeze gates, status gates, reentrancy locks, storage mutations, and events
  • Campaign and milestone status transition diagrams
  • Freeze module specification with ordering invariants
  • Reentrancy protection documentation
  • Pre-upgrade contract migration checklist
  • Quick reference tables for each campaign state
  • Storage and TTL breakdown
  • README.md: Added Technical Documentation section linking to state-machine.md
  • Updated doc comments on all entrypoints (initialize, donate, claim_refund, end_campaign, cancel_campaign, extend_deadline, release_milestone, release_milestone_multi_asset, freeze, unfreeze, upgrade) with cross-references to docs/state-machine.md

Why

Centralizes authorization model in one place. Contributors can now understand all state gates in 3 minutes instead of reading 11 function signatures across multiple files.

Tests

All entrypoints verified against existing test suite.

close #15

- Add docs/state-machine.md with 2D entrypoint authorization matrix
- Matrix includes: auth, freeze gates, status gates, reentrancy locks, mutations, events
- Add campaign and milestone status transition diagrams (ASCII + Mermaid-ready)
- Document freeze module specification and ordering invariants
- Document reentrancy lock implementation and protected functions
- Add pre-upgrade contract migration checklist
- Add event emission checklist and testing reference matrix
- Add quick reference 'who can do what, when' table for each campaign state
- Add inline doc-comment cross-references to state-machine.md on all entrypoints
- Update README.md to reference new docs/state-machine.md in technical docs section
- Cross-reference on initialize, donate, claim_refund, end_campaign, cancel_campaign,
  extend_deadline, release_milestone, release_milestone_multi_asset, freeze, unfreeze, upgrade

See: docs/state-machine.md for complete authorization matrix, freeze/reentrancy gates,
storage breakdown, and error code reference.

Acceptance criteria met:
✅ docs/state-machine.md exists and is referenced from README.md
✅ Entrypoint rows verified against function signatures (11 mutating ops)
✅ State diagrams provided (campaign status, milestone status)
✅ Freeze module documented with ordering invariants
✅ Post-upgrade checklist included
✅ Inline doc comments reference the state machine matrix

@P3az3 P3az3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@P3az3
P3az3 merged commit 43889c5 into MillestoneX:main Jul 23, 2026
4 checks passed
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.

Wiring diagram + state-machine documentation for the four frozen/upgrade/permission edges

2 participants