[codex] add contracts foundation#2
Merged
Merged
Conversation
5b00cc9 to
2c24282
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the first FlowMemory contracts foundation: a small commitment-oriented FlowPulse event schema, a minimal RootfieldRegistry, schema documentation, and Foundry tests.
This is intentionally a foundation PR, not a production protocol launch.
What Changed
contracts/FlowPulse.solwith the canonicalFlowPulseevent interface and initial pulse type constants.contracts/RootfieldRegistry.solfor registering Rootfield namespaces and submitting committed roots.contracts/FLOWPULSE_SCHEMA.mddocumenting the v0 event fields and receipt boundary.tests/RootfieldRegistry.t.solwith Foundry tests for registration, pulse emission, root submission, duplicate/zero-id rejection, and owner-only root submission.tests/README.mdwith the current test command.docs/SECURITY_MODEL.mdwith the contracts-foundation assumptions, especially that URI fields are advisory log data and do not enforce the off-chain-data boundary.Why
FlowMemory needs a small, reviewable protocol starting point before indexers, verifiers, dashboards, hardware, or future appchain work depend on any event or root semantics.
The main boundary preserved here: contracts emit roots, commitments, counters, actors, timestamps, and advisory URI strings. They do not know receipt-only metadata such as
txHashorlogIndex; indexers derive those after reading receipts and logs.Validation
git diff --checkforge test --root . --contracts . --match-path tests/RootfieldRegistry.t.sol --out E:\tmp\flowmemory-forge-out --cache-path E:\tmp\flowmemory-forge-cache -vvResult: 6 tests passed, 0 failed.
Risks And Assumptions
metadataURIandevidenceURIare arbitrary emitted strings. They are not length-limited, format-checked, resolvability-checked, or privacy-preserving by contract logic.Merge Notes
Keep this PR as draft until the bootstrap repository scaffolding PR is merged or this branch is rebased on the final bootstrap docs.
Depends on #1.