Skip to content

feat(contracts): add auto-refund logic to donation-escrow (#634)#720

Merged
Idrhas merged 4 commits into
Farm-credit:mainfrom
kingbitnation:feat/donation-escrow-auto-refund-634
Jun 30, 2026
Merged

feat(contracts): add auto-refund logic to donation-escrow (#634)#720
Idrhas merged 4 commits into
Farm-credit:mainfrom
kingbitnation:feat/donation-escrow-auto-refund-634

Conversation

@kingbitnation

Copy link
Copy Markdown
Contributor

Summary

  • Track per-donation milestone deadlines (milestone_deadline, location_verified) when donors lock USDC/XLM into escrow
  • Add verify_location(seq) for admin to confirm location verification proofs were submitted
  • Add claim_refund(donor, seq) so donors can reclaim locked funds after the deadline if verification never occurred
  • Restore full harvesta-errors enum and add MilestoneDeadlineNotPassed (Build Analytics Dashboard Widget #82) and LocationAlreadyVerified (Create Webhook Event Logs Viewer (Admin) #83)

Test plan

  • cargo test --package donation-escrow
  • Verify donate() sets milestone_deadline to now + configured window (default 90 days)
  • Verify claim_refund succeeds only after deadline with location_verified == false
  • Verify claim_refund panics before deadline (Build Analytics Dashboard Widget #82) and after verify_location (Create Webhook Event Logs Viewer (Admin) #83)
  • Update deploy scripts: initialize() now accepts milestone_deadline_secs (pass 0 for default)

Closes #634

…t#634)

Track per-donation milestone deadlines and let donors claim refunds when
location verification is not submitted before the deadline expires.
@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

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

…m-credit#634)

Reconcile HarvestaError codes after merging origin/main: keep shortened
names, carbon marketplace (100-113), farmer/species slots (67-70), and
add auto-refund codes MilestoneDeadlineNotPassed (82) and
LocationAlreadyVerified (83).
@Idrhas

Idrhas commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Fix merge conflict and dont forget to Offramp your USDC on https://fundable.finance when you receive your rewards

…ith main

Merge latest main conflict in contracts/harvesta-errors/src/lib.rs and
align species/zk contract test panic codes to the updated enum values.
@kingbitnation

Copy link
Copy Markdown
Contributor Author

@Idrhas conflicts resolved kindly take a look

@Idrhas Idrhas merged commit f7f78d9 into Farm-credit:main Jun 30, 2026
4 of 6 checks passed
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.

[Contract] Add Auto-Refund Logic to donation-escrow

2 participants