Skip to content

Add module-level doc-comment to math.rs explaining the normalization flow #699

Description

@Kingsman-99

Description

math.rs has a module-level comment but it does not describe the full normalization flow: when normalization is applied, what happens to fractional stroop remainders, and how callers should use normalize_amount paired with denormalize_amount. This context is critical for contributors extending the payment logic.

Acceptance Criteria

  • Module-level //! comment added or expanded with a clear explanation
  • Comment covers: why 7-decimal canonical scale was chosen, what truncation occurs for tokens with fewer than 7 decimals, and how callers should pair normalize/denormalize
  • CANONICAL_DECIMALS constant has a doc-comment explaining its value
  • cargo doc --no-deps completes without warnings

Context

  • Target file: contracts/split/src/math.rs

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programcomplexity: highComplex feature requiring deep knowledge - 200 ptsdocumentationImprovements or additions to documentation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions