Skip to content

Refactor balance and supply math to use checked arithmetic helpers #83

@Ibinola

Description

@Ibinola

Description

Balance and supply updates use direct + and - operations today. Even with overflow checks enabled in release, the code should centralize arithmetic through checked helpers so failure modes are explicit and reusable across modules.

Acceptance Criteria

  • Balance and supply math uses shared checked helpers rather than raw arithmetic
  • Overflow/underflow failure behavior is deterministic and tested
  • Escrow/splitter/recurring logic reuses the same checked math primitives where relevant

Technical Scope

  • Files likely affected: src/balance.rs, src/contract.rs, src/escrow.rs, src/splitter.rs
  • Modules/contracts involved: balance, VeritixToken, escrow, splitter

Dependencies

  • Enforce positive amount validation across all balance-moving entrypoints

Notes

If the team prefers panic-based failures over custom error enums, keep the helper surface small and consistent.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions