Skip to content

Document the storage DataKey map and additive-key policy in docs/escrow-data-model.md #273

@mikewheeleer

Description

@mikewheeleer

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

Metadata

Metadata

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions