Skip to content

Add per-holder accrual snapshot query returning currently-owed but unclaimed balance #529

Description

@greatest0fallt1me

Description

Integrators need a single-call read that returns each holder's currently-owed dividend balance across all periods. This query walks the accrual ledger and returns a consolidated amount.

Requirements and context

  • Must be secure, tested, and documented
  • Should be efficient and easy to review
  • Relevant code: src/test_accrual_ledger.rs, src/lib.rs
  • Query must be pure and bounded per-holder to avoid unbounded gas

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b feat/accrual-snapshot-query
  • Implement changes
    • Add get_holder_accrued_unclaimed(offering_id, holder) returning i128
    • Sum entries from AccrualLedger since last claim checkpoint
    • Emit read-only tracing when a debug flag is set
  • Validate security and correctness assumptions

Test and commit

  • Run tests
    • cargo test --all
  • Cover edge cases
    • Holder with zero shares and holder never having claimed
  • Include test output and security notes

Example commit message

feat: add per-holder accrual snapshot query

Guidelines

  • Minimum 95 percent test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Labels

Stellar WaveStellar Wave issue batch

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions