Skip to content

[bulk_payment] Missing overflow check when summing batch total in execute_batch_partial #868

Description

@Wilfred007

Description

The total-amount accumulation in execute_batch_partial uses plain addition over the batch's amounts without a checked/saturating operation. A sufficiently large or adversarial batch could overflow i128 accumulation, leading to incorrect settlement totals.

Where

contracts/bulk_payment/src/lib.rs (~line 687-701)

Acceptance Criteria

  • Replace the running total with checked_add, returning a contract error on overflow
  • Add a test that constructs a batch designed to overflow and asserts a clean error instead of a panic or wraparound

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programcontractSmart Contract developmenthardComplex tasks

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions