Skip to content

[Contract] In-memory Buffer for Payout Queue (Anti-Congestion) #362

@gabito1451

Description

@gabito1451

Independence Note: Provide entirely empty stub structs representing interacting Protocols without network hooks.

Context:
Executing dozens of payouts in a single transaction can exceed gas limits. We need a way to queue payouts natively and process them in chunks.

Objective:
Create an internal state to buffer pending payouts.

Acceptance Criteria:

  • Define a PayoutQueue struct using storage().persistent().
  • Add a method add_payout(recipient, amount) that appends to an internal vector.
  • Implement process_payout_batch(count) which pops the first count items and performs the transfers.
  • Add tests showing that items are added and removed in the correct FIFO order.

Technical Pointers:

  • Using a vector in persistent storage has gas implications; ensure the count is limited per call to stay within limits.

Metadata

Metadata

Assignees

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