Skip to content

[SC-50] Property-based tests for multisig thresholds and share accounting #1214

Description

@yusuftomilola

Overview

Existing tests are example-based. Multisig threshold logic and fractional share accounting are invariant-heavy — exactly where property testing finds the edge cases humans miss.

Tasks

  • Add proptest as a dev-dependency for the relevant crates.
  • Multisig invariant: for any generated sequence of signer additions, removals, and approvals, a proposal executes only when distinct current signers meeting the threshold have approved.
  • Share accounting invariant: after any sequence of tokenize, transfer, and detokenize operations, the sum of all holder balances equals total supply and no balance is negative.
  • Escrow invariant: value in equals value out plus value held — never created or destroyed.
  • Constrain generators to realistic ranges and keep the case count CI-appropriate.
  • Commit any counterexample found as a permanent regression test.

Acceptance Criteria

  • Property tests exist for multisig thresholds, share conservation, and escrow balance.
  • They run in CI within a reasonable time budget.
  • Discovered counterexamples are fixed and pinned as regression tests.

Dependencies

Best after [SC-32] and [SC-40] establish baseline coverage.

Notes for Contributors

Requires Rust + Soroban. Workspace: contracts/ (soroban-sdk 22, members: assetsup, contrib, multisig-wallet, multisig_transfer, asset-maintenance). Run cargo test --all, cargo fmt --all -- --check, and cargo clippy --all-targets --all-features -- -D warnings before opening a PR — CI enforces all three. Comment below to be assigned.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programcontracttestingTests, QA, and quality assurance

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions