You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement the dividend claim function that lets token holders withdraw their share inside contracts/contrib/.
Location
All work must be inside contracts/contrib/src/dividends.rs.
Acceptance Criteria
claim_dividends(env, asset_id, holder) — requires auth from holder; reads unclaimed_dividends from OwnershipRecord; panics if amount is 0; resets unclaimed_dividends to 0; emits claim event with amount
get_total_distributed(env, asset_id) -> i128 — returns total dividends distributed to date
Unit tests: claim with zero balance panics, successful claim resets balance
Overview
Implement the dividend claim function that lets token holders withdraw their share inside
contracts/contrib/.Location
All work must be inside
contracts/contrib/src/dividends.rs.Acceptance Criteria
claim_dividends(env, asset_id, holder)— requires auth from holder; readsunclaimed_dividendsfromOwnershipRecord; panics if amount is 0; resetsunclaimed_dividendsto 0; emits claim event with amountget_total_distributed(env, asset_id) -> i128— returns total dividends distributed to date