Description
DataKey defines 20+ variants spanning instance and persistent storage with subtle defaults (unwrap_or) and the ADR-007 additive-key policy. Produce an authoritative data-model reference describing each key, its storage tier (instance vs persistent), value type, default-on-absence behavior, and which SCHEMA_VERSION introduced it.
Requirements and context
- Scoped to the LiquiFact
escrow Soroban contract.
- Table every
DataKey variant with: storage tier, value type, default when absent, schema version added (cross-ref the changelog in lib.rs).
- Explicitly note which keys are per-address (e.g.
InvestorContribution, InvestorAllowlisted) and which use persistent().
- Document the additive-vs-breaking rules from ADR-007 and the
migrate redeploy policy.
- Invariant: documentation must match the
DataKey enum and its rustdoc in lib.rs.
- Must be accurate, reviewed, and aligned with code.
Suggested execution
- Fork the repo and create a branch:
git checkout -b docs/data-model-keys
- Implement changes:
escrow/src/lib.rs
- Tests:
escrow/src/tests/init.rs
- Docs:
docs/escrow-data-model.md
- Include rustdoc/NatSpec-style doc comments on public functions
- Validate security assumptions (auth, overflow, storage TTL, double-spend)
Test and commit
- Run tests:
cargo test
- Cover edge cases (zero amounts, overflow, unauthorized callers, double-spend, state-machine misuse)
- Include test output and security notes in the PR
Example commit message
docs(escrow): authoritative DataKey storage reference
Guidelines
- Minimum 95% test coverage on new/changed code
- Clear documentation
- Timeframe: 96 hours from assignment
Description
DataKeydefines 20+ variants spanning instance and persistent storage with subtle defaults (unwrap_or) and the ADR-007 additive-key policy. Produce an authoritative data-model reference describing each key, its storage tier (instance vs persistent), value type, default-on-absence behavior, and whichSCHEMA_VERSIONintroduced it.Requirements and context
escrowSoroban contract.DataKeyvariant with: storage tier, value type, default when absent, schema version added (cross-ref the changelog inlib.rs).InvestorContribution,InvestorAllowlisted) and which usepersistent().migrateredeploy policy.DataKeyenum and its rustdoc inlib.rs.Suggested execution
git checkout -b docs/data-model-keysescrow/src/lib.rsescrow/src/tests/init.rsdocs/escrow-data-model.mdTest and commit
cargo testExample commit message
Guidelines