Repository navigation
Add libfuzzer targets for markets and fees contracts - #328
Merged
dultimateade merged 1 commit intoOct 22, 2026
Merged
Conversation
Add comprehensive fuzz targets for high-risk contract surfaces: Markets Contract: - place_bet.rs: Exercises bet placement with arbitrary stakes, market states, outcome validation, and pool accumulation. Detects overflow and state transition violations. - claim_winnings.rs: Tests payout claims with CEI pattern protection, double-claim prevention, and payout calculation correctness. Fees Contract: - collect_fees.rs: Fuzzes fee collection with admin enforcement, cooldown periods, collection thresholds, and pause/unpause state transitions. Implementation Details: - All targets follow established fuzz patterns from existing targets (disputes, oracles, resolution, predictify-hybrid) - Fixed-byte-consumption model for deterministic action sequencing - Error codes frozen against auth_boundary tests to prevent regression - CEI pattern validation ensures reentrant call safety - Pre-allocated resource pools (4 markets, 5 users) for efficient coverage Risk Coverage: - Markets handles highest funds volume (now covered) - Fees collects platform revenue (now covered) - Reduces uncovered high-risk surface from 3 to 1 contract Running: cargo +nightly fuzz run --fuzz-dir contracts/markets/fuzz place_bet cargo +nightly fuzz run --fuzz-dir contracts/markets/fuzz claim_winnings cargo +nightly fuzz run --fuzz-dir contracts/fees/fuzz collect_fees
|
@MrWestWiz Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
closes #230
closes #231
closes #232
closes #233
Add comprehensive fuzz targets for high-risk contract surfaces:
Markets Contract:
Fees Contract:
Implementation Details:
Risk Coverage:
Running:
cargo +nightly fuzz run --fuzz-dir contracts/markets/fuzz place_bet cargo +nightly fuzz run --fuzz-dir contracts/markets/fuzz claim_winnings cargo +nightly fuzz run --fuzz-dir contracts/fees/fuzz collect_fees