Skip to content

Replace magic number 10_000 with BASIS_POINTS_TOTAL constant in calc.rs #632

Description

@Kingsman-99

Description

distribute_with_remainder in contracts/split/src/calc.rs does not use BASIS_POINTS_TOTAL from types.rs. Any inline use of the literal 10_000 in calc.rs should be replaced with BASIS_POINTS_TOTAL (or BASIS_POINTS_TOTAL as i128) for consistency and to keep the constant as the single source of truth.

Acceptance Criteria

  • Import BASIS_POINTS_TOTAL from crate::types in contracts/split/src/calc.rs
  • Replace any literal 10_000 in calc.rs with BASIS_POINTS_TOTAL as i128 (or u32 as appropriate)
  • Add a note in the distribute_with_remainder doc comment mentioning typical denom values
  • cargo test passes

Context

  • Target file: contracts/split/src/calc.rs
  • BASIS_POINTS_TOTAL is declared in contracts/split/src/types.rs

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexity: highComplex feature requiring deep knowledge - 200 ptsrefactorCode quality and restructuring

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions