Skip to content

test(contract): add fuzz coverage for conversion, fee, and overflow invariants #74

Description

@arisu6804

Problem

Example-based tests do not cover the large input space where rounding, overflow, and reserve edge cases can break financial invariants.

Objective

Deliver a production-quality improvement to math and state-transition test suite that creates measurable value for correctness, security, reliability, performance, or maintainability.

Implementation scope

  • Generate valid and invalid asset, share, fee, and rate combinations.
  • Assert conservation, monotonicity, bounded fees, and safe rejection of overflow inputs.
  • Keep seeds and minimized counterexamples reproducible in CI.

Acceptance criteria

  • Fuzz runs cover all core conversion and fee paths.
  • Any counterexample is reported with a reproducible seed and input.
  • No invariant is weakened to make the suite pass.

Required validation

  • Deterministic fuzz/property tests and regression fixtures for every discovered boundary.
  • Existing tests and CI remain passing.
  • Add regression coverage for the original failure mode.
  • Do not weaken, delete, or skip unrelated tests to obtain a green build.

PR quality bar

  • Keep the PR focused on this issue and explain design tradeoffs.
  • Include test evidence, compatibility impact, and migration or rollout notes where relevant.
  • Avoid typo-only, documentation-only, cosmetic-only, or unrelated refactor submissions.

Out of scope

  • Broad rewrites not required by the acceptance criteria.
  • Changes to unrelated services, contracts, or user flows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GRANTFOX OSSOpen-source issue tracked by GrantFoxMAYBE REWARDEDThis issue may carry a rewardThird CampaignThird Campaign contributionenhancementNew feature or requestpriority:mediumMedium implementation priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions