Skip to content

feat: Batch Claiming for Multi-Schedule Beneficiaries#254

Merged
JerryIdoko merged 2 commits into
mainfrom
feat/batch-claim-beneficiaries
Apr 23, 2026
Merged

feat: Batch Claiming for Multi-Schedule Beneficiaries#254
JerryIdoko merged 2 commits into
mainfrom
feat/batch-claim-beneficiaries

Conversation

@BarryArinze

Copy link
Copy Markdown
Collaborator

🧩 Overview

This PR adds a batch_claim function that allows beneficiaries with multiple vesting schedules (e.g. Seed, Private, Advisory) to claim all currently unlocked tokens in a single transaction.

Previously, users needed to submit separate claims for each schedule, resulting in unnecessary gas costs and friction. This update consolidates claims into one efficient transaction.

⚙️ Key Features

  • Added batch_claim() for addresses with multiple schedules
  • Aggregates claimable balances across all linked schedules
  • Executes a single token transfer
  • Updates each schedule’s claimed amount atomically
  • Skips inactive or fully claimed schedules
  • Prevents duplicate claiming

🏗️ Implementation Details

  • Fetch all schedules mapped to caller address
  • Compute vested but unclaimed tokens per schedule
  • Sum all available claimable amounts
  • Persist claimed state before transfer
  • Transfer total amount once to beneficiary

⛽ Gas & UX Benefits

  • One transaction instead of many
  • Lower cumulative gas spend
  • Reduced wallet interaction friction
  • Better experience for advisors and investors with multiple allocations

🔐 Security Considerations

  • Checks-effects-interactions flow maintained
  • Reverts when total claimable amount is zero
  • Accurate per-schedule accounting preserved
  • Compatible with existing vesting logic

🧪 Testing

Added coverage for:

  • Beneficiary with multiple active schedules
  • Mixed vested/unvested schedules
  • Fully claimed schedules skipped
  • Zero claimable balance revert
  • Correct aggregate payout amount
  • Claimed balances updated after batch execution

🚀 Impact

  • Significant UX improvement for multi-tranche beneficiaries
  • Lower operational claim costs
  • Cleaner vesting claim workflow
  • Improved contract efficiency

🔗 Related Issue

Closes #201

🏷️ Labels

ux, optimization, gas

@drips-wave

drips-wave Bot commented Apr 22, 2026

Copy link
Copy Markdown

@BarryArinze Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@JerryIdoko JerryIdoko merged commit 7d5b8c7 into main Apr 23, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Batch Claiming for Multi-Schedule Beneficiaries

2 participants