Description
Perform formal verification of the vault's share accounting math using a proof assistant or model checker to mathematically prove correctness properties.
Use Case
Share accounting is the core economic mechanism. Bugs here could lead to fund loss. Formal verification provides the highest level of assurance.
Properties to Verify
- TotalShares never exceeds sum of all user shares
- No user share balance can go negative
- Exchange rate is monotonically non-decreasing (with yield)
- Deposit/withdrawal round-trip preserves value within rounding tolerance
- Rounding always favors the vault (never the user)
Acceptance Criteria
- Property specification document
- Kani model checker proofs for key properties
- Automated proof runs in CI
- All properties pass on current codebase
- Proof maintenance process for code changes
- Document properties and proofs in docs/FORMAL_VERIFICATION.md
Technical Notes
- Kani is well-suited for Rust formal verification
- Build on existing property tests as specification
Description
Perform formal verification of the vault's share accounting math using a proof assistant or model checker to mathematically prove correctness properties.
Use Case
Share accounting is the core economic mechanism. Bugs here could lead to fund loss. Formal verification provides the highest level of assurance.
Properties to Verify
Acceptance Criteria
Technical Notes