Skip to content

[SC-16] Implement distribute_dividends function #656

@yusuftomilola

Description

@yusuftomilola

Overview

Implement the dividend distribution system for tokenized assets inside contracts/contrib/.

Location

All work must be inside contracts/contrib/src/dividends.rs.

Acceptance Criteria

  • distribute_dividends(env, asset_id, total_amount) — callable by asset tokenizer; iterates all holders; adds (holder_balance / total_supply) * total_amount to each holder's unclaimed_dividends in their OwnershipRecord; emits distribution event
  • Panics if revenue_sharing_enabled is false
  • get_unclaimed_dividends(env, asset_id, holder) -> i128 — returns holder's unclaimed amount
  • Unit test verifying proportional distribution across multiple holders

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions