Skip to content

docs: restructure B20 guides and rewrite execution architecture - #213

Draft
rayyan224 wants to merge 19 commits into
mainfrom
docs/restructure-b20-guides
Draft

docs: restructure B20 guides and rewrite execution architecture#213
rayyan224 wants to merge 19 commits into
mainfrom
docs/restructure-b20-guides

Conversation

@rayyan224

Copy link
Copy Markdown
Collaborator

Summary

  • Replace the old per-primitive docs (docs/B20, PolicyRegistry, ActivationRegistry) with an audience-layered structure: overview, architecture, guides, concepts, and reference.
  • Rewrite the architecture page so readers can follow native precompile dispatch, self-managed gas and EVM-like errors, and writes that go straight into shared EVM account storage.
  • Fill in the overview (why B20, compliance, roles, pause) and the constants, errors, and events reference tables.

Test plan

  • Read docs/overview.md end to end and confirm it still matches current B20 behavior
  • Read docs/architecture.md §§1–3 and confirm the precompile vs contract story, routing, and token-creation flow are accurate
  • Confirm mermaid diagrams render (especially the Rust-precompile vs EVM-state transfer chart)
  • Click through links from docs/README.md and the root README.md into the new structure; no stale docs/B20 / PolicyRegistry / ActivationRegistry paths
  • Spot-check docs/reference/{constants,errors,events}.md against the interfaces

Made with Cursor

rayyan224 and others added 13 commits August 28, 2026 11:03
…/reference

Replaces the old docs/B20, docs/PolicyRegistry, and docs/ActivationRegistry
pages with an audience-layered structure: a short overview, a canonical
architecture doc, per-audience guides (integrator/indexer/implementer),
evergreen concept pages, and a reference section. Root README now points
into the new docs/ entry point instead of the removed paths.

Co-Authored-By: Claude <noreply@anthropic.com>
Walk grant-then-call and attach-then-gate in the overview, including
revert paths, and move the role and policy-scope tables to the concept pages.

Co-authored-by: Cursor <cursoragent@cursor.com>
Give roles, pause, and policy a why-then-how flow. Drop the stack section
that duplicated What is B20.

Co-authored-by: Cursor <cursoragent@cursor.com>
…rchitecture

Fills in the constants, errors, and events reference tables with the
actual role/policy hashes, error selectors, and event catalogue, and
rewrites architecture.md around the precompile execution model and
protocol-evolution guarantees.

Co-Authored-By: Claude <noreply@anthropic.com>
The changelog/README.md ordinal table is already the source of truth for
hardfork<->version mapping, so a separate reference/versions.md duplicated
it. Repoint the three referring TODOs at the changelog index instead.

Co-Authored-By: Claude <noreply@anthropic.com>
Rewrite the contracts-vs-precompiles section into a continuous narrative so readers can follow native execution, self-managed state and gas, registry routing, and the shared EVM flow.

Co-authored-by: Cursor <cursoragent@cursor.com>
Spell out that recognized precompiles run registered native code, meter
gas and EVM-like errors themselves, and write straight into account
storage — the same slots a contract would use.

Co-authored-by: Cursor <cursoragent@cursor.com>
Remove the unfinished implementer page and its nav links, and add a
compliance-guide template for the remaining how-to pages.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown

Interface Coverage

✅ All interface functions have test coverage.

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown

❌ Fork tests did not run

The build or setup step failed before any tests could execute. Check the workflow logs for details.

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown

📊 Forge Coverage (src/lib/)

🟡 ≥95% across all metrics — some metrics below 99%.

File Lines Stmts Branches Funcs
🟡 B20FactoryLib.sol 97.70% 98.00% 100.00% 95.00%
🔴 test/lib/ForceFeeder.sol 0.00% 0.00% 100.00% 0.00%
🔴 test/lib/PrecompileProbe.sol 0.00% 0.00% 0.00% 0.00%
🟢 MockActivationRegistry.sol 100.00% 100.00% 100.00% 100.00%
🟢 MockActivationRegistryStorage.sol 100.00% 100.00% 100.00% 100.00%
🟢 MockB20.sol 100.00% 100.00% 100.00% 100.00%
🟢 MockB20Asset.sol 100.00% 100.00% 100.00% 100.00%
🟡 MockB20Factory.sol 98.96% 99.10% 100.00% 100.00%
🟢 MockB20Stablecoin.sol 100.00% 100.00% 100.00% 100.00%
🟢 MockB20Storage.sol 100.00% 100.00% 100.00% 100.00%
🟡 MockPolicyRegistry.sol 100.00% 99.54% 97.67% 100.00%
🟢 MockPolicyRegistryStorage.sol 100.00% 100.00% 100.00% 100.00%
Total 97.07% 97.52% 98.16% 97.00%

Full report: download artifact. To browse locally: make coverage (runs forge coverage + genhtml + opens the HTML report).

rayyan224 and others added 6 commits August 31, 2026 11:27
Replace the roles stub with a full roles-and-pause concept, write Asset
and Stablecoin as token types, and move execution and versioning into
architecture so callers have one place for each mental model.

Co-authored-by: Cursor <cursoragent@cursor.com>
Replace the stub with a progressive-discovery guide covering registry types, admin lifecycle, scopes, and composite examples.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Give issuers a step-by-step path from SEIZE_ROLE and inverted holder policy through seizeWithMemo, confirmed by the Seized event.

Co-authored-by: Cursor <cursoragent@cursor.com>
Walk operators through scheduling a UI multiplier for corporate actions,
plus cancel, optional transfer pause, and emergency instant override.

Co-authored-by: Cursor <cursoragent@cursor.com>
Replace their nav links with the seize and schedule-multiplier how-tos.

Co-authored-by: Cursor <cursoragent@cursor.com>
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