Skip to content

feat: implement campaign status check in donate#204

Open
YaronZaki wants to merge 1 commit into
Dfunder:mainfrom
YaronZaki:feature/issue-194-campaign-status-check
Open

feat: implement campaign status check in donate#204
YaronZaki wants to merge 1 commit into
Dfunder:mainfrom
YaronZaki:feature/issue-194-campaign-status-check

Conversation

@YaronZaki
Copy link
Copy Markdown
Contributor

Summary

Rejects donations to cancelled or ended campaigns by checking status atomically before transfer.

Changes

  • Added donate() function to CampaignContract
  • Accepts donations only when campaign.status is CampaignStatus::Active or CampaignStatus::GoalReached
  • Panics with Error::CampaignNotActive for Ended or Cancelled campaigns
  • Status check is atomic with the raised_amount update

Closes #194

- Add donate() function to CampaignContract
- Accept donations only when status is CampaignStatus::Active or CampaignStatus::GoalReached
- Panic with Error::CampaignNotActive for Ended or Cancelled campaigns
- Status check is atomic with state update

Closes Dfunder#194
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@YaronZaki 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement campaign status check in donate

1 participant