Skip to content

[Contract] Automated Payout Batch Count Cap #375

@gabito1451

Description

@gabito1451

Independence Note: Execute solely using Rust native u32 comparison logic.

Context:
When processing buffered payouts in a batch, we must limit the count per call to stay within the Soroban gas bounds.

Objective:
Restrict the maximum size of a single payout batch call.

Acceptance Criteria:

  • Define a constant MAX_BATCH_SIZE = 25.
  • In process_payout_batch(count), assert that count <= MAX_BATCH_SIZE.
  • If the user tries to process more, simply process the MAX_BATCH_SIZE amount and log the remainder.
  • Ensure the contract doesn't panic on large input, just clamps it.

Technical Pointers:

  • Clamping input is safer than outright panicking if the user accidentally submits a huge number.

Metadata

Metadata

Assignees

No one assigned

    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