Skip to content

[Contract] Build Dividend Distribution and Claiming Module #470

@yusuftomilola

Description

@yusuftomilola

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 dividends event

claim_dividends(env, asset_id, holder):

  • Holder must authenticate
  • Returns and clears the holder's unclaimed balance
  • Returns BigInt of 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

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