Skip to content

Add batch dividend claim so holders can collect earnings from multiple creators in one transaction #521

Description

@Chucks1093

Summary

A fan who holds keys for several creators has to call claim_dividend separately for each one. Each call is a separate Soroban transaction with its own fee. A batch claim function lets a holder collect dividends from multiple creators in a single transaction, reducing fees and making the claim flow practical when holding a diversified portfolio.

Scope

  • Add batch_claim_dividend(claims: Vec<CreatorId>) -> Vec<ClaimResult> function
    • claims is a list of creator IDs to claim from in one call
    • For each creator ID: if the caller has a claimable balance, transfer it and zero the balance; if zero, skip silently (no revert)
    • Returns a result per creator: { creator_id, amount_claimed } — zero for creators with nothing to claim
    • Maximum 20 creator IDs per call to bound execution cost
    • Each claim within the batch is independent — a failure on one creator does not revert the others

Acceptance Criteria

  • Dividends claimed from all specified creators in one call
  • Creators with zero claimable balance return amount_claimed: 0 and do not revert
  • Each claimed balance zeroed after the batch completes
  • More than 20 creator IDs reverts with a clear error
  • Caller XLM balance increases by the sum of all claims
  • Individual claim failures are isolated and do not revert the whole batch

ETA: 24 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official Campaign

Type

No type

Fields

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