Skip to content

Validate that split amounts sum to exactly 100% before execution in splitExecutor #778

Description

@Kingsman-99

Description

splitExecutor processes split payment instructions without verifying that recipient percentages sum to 100. Floating-point rounding errors or user input mistakes silently produce splits that over- or underpay the total.

Acceptance Criteria

  • Before building any transaction, the executor checks that the sum of all recipient ratios equals 1.0 within a tolerance of 1e-9
  • A SplitRatioSumError is thrown with the actual sum when the check fails
  • Valid splits (sum within tolerance) proceed unchanged
  • Unit tests pass

Context

  • Target file: src/payments/splitExecutor.ts
  • The tolerance 1e-9 should be exported as SPLIT_RATIO_TOLERANCE

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions