test(contract): deterministic fuzz for conversion, fee, overflow (#74) - #84
Open
woahwhattheheck wants to merge 1 commit into
Open
woahwhattheheck wants to merge 1 commit into
woahwhattheheck wants to merge 1 commit into
Conversation
…ldVault-Org#74) Add a fixed-seed LCG fuzz/property suite covering mul_div floor-or-reject, share↔asset round-trip conservation and monotonicity, BPS (fee/rate) bounds, price-per-share monotonicity, empty-vault bootstrap, pinned overflow fixtures, and a small Env deposit/yield/withdraw conservation loop. Failures report seed and minimized inputs for CI-reproducible counterexamples. No production invariants weakened.
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
Closes #74.
Adds a deterministic fuzz / property suite for share↔asset conversion, BPS (fee/rate) bounds, overflow rejection, and deposit/withdraw conservation — without weakening any existing invariant.
Harness
FUZZ_SEED = 0x0059_5646_3734_2026(LCG); same seed ⇒ same inputs in CI.Coverage
fuzz_mul_div_floor_or_safe_rejecta*b/d, orDivisionByZero/MathOverflowfuzz_convert_round_trip_conserves_valuefuzz_convert_shares_round_trip_conservesfuzz_convert_to_shares_monotonicfuzz_convert_to_assets_monotonicfuzz_share_fraction_bps_boundedbps(fee/rate bound)fuzz_price_per_share_monotonic_in_assetsfuzz_empty_vault_bootstrap_and_zero_totalsfuzz_regression_fixtures_overflow_and_boundsfuzz_vault_deposit_withdraw_conserves_under_yieldDesign tradeoff
Kept the fuzz lane thin and high-confidence: focused on
math.rsinvariants plus a small Env conservation loop, rather than a sprawling stateful fuzzer. Fee/rate coverage maps to the existing BPS and price-per-share paths (no deposit-fee module exists today).Tests
Compatibility
Test-only. No on-chain API or
version()change.