Skip to content

[PeerX Backlog # 44] Add fuzz harness for swap with proptest #44

Description

@ameeribro4-sudo

Problem Statement
Existing fuzz tests live in fuzz_tests.rs but cover only a handful of
inputs. The interesting adversarial inputs (dust amounts, exact-1.0
ratios, max u32 swap counts) are unprobed.

Expected Outcome
A proptest harness runs 30 random sequences per fuzz target (swap,
add_liquidity, …) and asserts invariants + return value bounds.

Acceptance Criteria

  • New src/fuzz.rs with proptest! strategy module.
  • 5 strategy variables: amount, fee_bps, oracle_staleness, slippage,
    user_balance.
  • cargo test fuzz_ --workspace runs in < 90 s.

Files Affected

  • peerx-contracts/counter/src/fuzz.rs, Cargo.toml.

Dependencies Issue #10.
Difficulty / Effort 🥑 / M
Labels testing, fuzz, priority/medium

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26fuzzPeerX Backlog label fuzz (bulk-imported)priority/mediumPeerX Backlog label priority/medium (bulk-imported)testingPeerX Backlog label testing (bulk-imported)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions