Skip to content

feat: add quest escrow and fund management (#137)#146

Merged
RUKAYAT-CODER merged 2 commits intoEarnQuestOne:mainfrom
sublime247:feat/137-quest-escrow-fund-management
Feb 25, 2026
Merged

feat: add quest escrow and fund management (#137)#146
RUKAYAT-CODER merged 2 commits intoEarnQuestOne:mainfrom
sublime247:feat/137-quest-escrow-fund-management

Conversation

@sublime247
Copy link
Contributor

  • Implement deposit_escrow() function with token transfer from creator to contract
  • Track escrowed amounts per quest via EscrowInfo struct with audit fields (created_at timestamp, deposit_count for tracking top-ups)
  • Validate sufficient escrow before submission approval
  • Create withdraw_unclaimed() for quest creators on terminal quests
  • Handle refunds for cancelled quests via cancel_quest()
  • Add expire_quest() for quests past deadline with automatic refund
  • Add escrow balance and info query endpoints
  • Integrate escrow with payout system (transfer_reward_from_escrow)
  • Backward compatible: quests without escrow still work
  • Add delete_escrow() storage helper for cleanup
  • Fix duplicate import in submission.rs
  • Fix test_batch.rs SDK compatibility (RawVal → Val, Events trait)
  • Fix unused import warnings in test_security.rs
  • Comprehensive test suite with 44 escrow-specific tests covering: deposits, top-ups, payout deductions, insufficient escrow blocking, cancellation refunds, expiry refunds, withdrawal guards, backward compatibility, full lifecycle, audit fields, and edge cases

Close #137

- Implement deposit_escrow() function with token transfer from creator to contract
- Track escrowed amounts per quest via EscrowInfo struct with audit fields
  (created_at timestamp, deposit_count for tracking top-ups)
- Validate sufficient escrow before submission approval
- Create withdraw_unclaimed() for quest creators on terminal quests
- Handle refunds for cancelled quests via cancel_quest()
- Add expire_quest() for quests past deadline with automatic refund
- Add escrow balance and info query endpoints
- Integrate escrow with payout system (transfer_reward_from_escrow)
- Backward compatible: quests without escrow still work
- Add delete_escrow() storage helper for cleanup
- Fix duplicate import in submission.rs
- Fix test_batch.rs SDK compatibility (RawVal → Val, Events trait)
- Fix unused import warnings in test_security.rs
- Comprehensive test suite with 44 escrow-specific tests covering:
  deposits, top-ups, payout deductions, insufficient escrow blocking,
  cancellation refunds, expiry refunds, withdrawal guards, backward
  compatibility, full lifecycle, audit fields, and edge cases

Close EarnQuestOne#137
@sublime247
Copy link
Contributor Author

@RUKAYAT-CODER kindly review

Thanks!

@RUKAYAT-CODER
Copy link
Contributor

Please resolve conflict

@sublime247
Copy link
Contributor Author

Please resolve conflict

done

@RUKAYAT-CODER
Copy link
Contributor

Support our project by giving us a star

@RUKAYAT-CODER RUKAYAT-CODER merged commit 5d89322 into EarnQuestOne:main Feb 25, 2026
1 check passed
@sublime247
Copy link
Contributor Author

Support our project by giving us a star

Sure!

@sublime247 sublime247 deleted the feat/137-quest-escrow-fund-management branch February 25, 2026 17:09
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.

Add Quest Escrow and Fund Management

2 participants