Skip to content

Comments

feat: enforce escrow funding on mission creation#34

Merged
Kaylahray merged 2 commits intoQuid-proquo:mainfrom
lishmanTech:EsTransfer
Jan 31, 2026
Merged

feat: enforce escrow funding on mission creation#34
Kaylahray merged 2 commits intoQuid-proquo:mainfrom
lishmanTech:EsTransfer

Conversation

@lishmanTech
Copy link
Contributor

@lishmanTech lishmanTech commented Jan 31, 2026

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

@Kaylahray
Copy link
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"

Copy link
Contributor

@Kaylahray Kaylahray left a comment

Choose a reason for hiding this comment

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

image

Fixed @lishmanTech . Thanks

@Kaylahray Kaylahray merged commit ccf9ebe into Quid-proquo:main Jan 31, 2026
2 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.

Implement Escrow Transfer in create mission

2 participants