Skip to content

feat: implement donation enhancements (#195, #196, #197, #198)#206

Merged
ayshadogo merged 1 commit into
Dfunder:mainfrom
Mkalbani:feat/donation-status-milestones-views
May 30, 2026
Merged

feat: implement donation enhancements (#195, #196, #197, #198)#206
ayshadogo merged 1 commit into
Dfunder:mainfrom
Mkalbani:feat/donation-status-milestones-views

Conversation

@Mkalbani
Copy link
Copy Markdown
Contributor

#195 - raised_amount update and milestone unlock check:

  • After donation, raised_amount updated atomically
  • Loop over milestones: if raised_amount >= target_amount && Locked, set Unlocked
  • milestone_unlocked event emitted for each newly unlocked milestone
  • Multiple milestones can unlock in single donation
  • TotalRaised storage updated after each donation
  • DonorRecord updated/created with cumulative totals

#196 - get_donor_record view function:

  • fn get_donor_record(env, donor) -> Option
  • Returns None if address has never donated
  • Read-only, no auth required

#197 - get_total_raised view function:

  • fn get_total_raised(env) -> i128
  • Returns current raised_amount from TotalRaised storage
  • No auth required, returns 0 if no donations yet

#198 - goal reached status transition:

  • After donation, if raised_amount >= goal_amount, set status = GoalReached
  • campaign_goal_reached event emitted
  • Does not prevent additional donations (GoalReached still accepts)
  • Checked after every donation, only transitions from Active

closes #195
closes #196
closes #197
closes #198

…der#197, Dfunder#198)

Dfunder#195 - raised_amount update and milestone unlock check:
  - After donation, raised_amount updated atomically
  - Loop over milestones: if raised_amount >= target_amount && Locked, set Unlocked
  - milestone_unlocked event emitted for each newly unlocked milestone
  - Multiple milestones can unlock in single donation
  - TotalRaised storage updated after each donation
  - DonorRecord updated/created with cumulative totals

Dfunder#196 - get_donor_record view function:
  - fn get_donor_record(env, donor) -> Option<DonorRecord>
  - Returns None if address has never donated
  - Read-only, no auth required

Dfunder#197 - get_total_raised view function:
  - fn get_total_raised(env) -> i128
  - Returns current raised_amount from TotalRaised storage
  - No auth required, returns 0 if no donations yet

Dfunder#198 - goal reached status transition:
  - After donation, if raised_amount >= goal_amount, set status = GoalReached
  - campaign_goal_reached event emitted
  - Does not prevent additional donations (GoalReached still accepts)
  - Checked after every donation, only transitions from Active
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 30, 2026

@Mkalbani Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Copy link
Copy Markdown
Contributor

@ayshadogo ayshadogo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thank you for your contribution

@ayshadogo ayshadogo merged commit 5ae8805 into Dfunder:main May 30, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants