-
Notifications
You must be signed in to change notification settings - Fork 72
Open
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave programgood first issueGood for newcomersGood for newcomerssoroban-contract
Description
Enables asset owners to distribute revenue to token holders in proportion to their token ownership, with a claim-based payout model.
Requirements
distribute_dividends(env, asset_id, total_amount):
- Asset must have revenue sharing enabled
- Iterates over all token holders
- For each holder: computes their share as
(holder_balance / total_supply) * total_amount - Adds to that holder's unclaimed dividend balance (does not pay immediately)
- Emits a
dividendsevent
claim_dividends(env, asset_id, holder):
- Holder must authenticate
- Returns and clears the holder's unclaimed balance
- Returns
BigIntof claimed amount
get_unclaimed_dividends(env, asset_id, holder) — Read-only
Revenue sharing toggle: enable_revenue_sharing(env, asset_id), disable_revenue_sharing(env, asset_id)
Acceptance Criteria
- Dividend amounts accurately proportional to ownership
- Claiming zeroes the holder's unclaimed balance
- Distribution fails if revenue sharing disabled
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave programgood first issueGood for newcomersGood for newcomerssoroban-contract