feat: enforce escrow funding on mission creation#34
Merged
Kaylahray merged 2 commits intoQuid-proquo:mainfrom Jan 31, 2026
Merged
feat: enforce escrow funding on mission creation#34Kaylahray merged 2 commits intoQuid-proquo:mainfrom
Kaylahray merged 2 commits intoQuid-proquo:mainfrom
Conversation
Contributor
|
Hi @lishmanTech 🙋♀️. Thank you for contributing. Please Kindly run this in quid-contract/ "cargo fmt --all -- --check" then to fix the error run "cargo fmt --all" . Then run "cargo clippy --all-targets --all-features -- -D warnings" |
Kaylahray
approved these changes
Jan 31, 2026
Contributor
Kaylahray
left a comment
There was a problem hiding this comment.
Fixed @lishmanTech . Thanks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces escrow funding enforcement for mission creation. closes #25
A mission can only be created if the creator fully funds the total reward upfront, ensuring participants are guaranteed payment before starting work.
Motivation
Participants need assurance that a mission is fully funded before contributing effort.
By locking rewards in escrow at creation time, we enforce a strong on-chain invariant:
If a mission exists, its rewards are already secured.
What’s Changed
Added escrow funding logic to create_mission
Full reward amount is calculated as:
reward_amount × max_participants
Tokens are transferred from the mission creator to the contract using soroban_sdk::token::Client
Mission creation fails atomically if:
Reward amount is zero or negative
Creator has insufficient token balance
Arithmetic overflow occurs
Updated tests to:
Deploy a real Stellar token contract
Mint balances for escrow testing
Validate failure when funds are insufficient
Verify escrow balance after mission creation