feat: implement escrow and job registry smart contracts#44
Merged
soomtochukwu merged 1 commit intoMar 26, 2026
Merged
Conversation
Escrow Contract (DXmakers#1): - initialize with admin guard against double-init - deposit transfers USDC from client to contract, stores EscrowJob - release_milestone with proportional release per milestone - open_dispute verifies client/freelancer, sets Disputed - resolve_dispute splits remaining by BPS (admin only) - refund returns remaining to client (Active status only) - 5 tests: lifecycle, double-init, unauthorized, 50/50 split, refund Job Registry Contract (DXmakers#3): - post_job with client auth, duplicate guard, stores JobRecord - submit_bid verifies Open status, appends BidRecord - accept_bid sets freelancer + InProgress - submit_deliverable verifies InProgress + correct freelancer - mark_disputed (cross-contract, no auth) only from valid states - 6 tests: full lifecycle, bid on non-Open, mark_disputed states Both pass cargo clippy -D warnings. Closes DXmakers#1 Closes DXmakers#3
|
@ogazboiz 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! 🚀 |
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.
Summary
Escrow Contract (#1)
initialize— persist admin, guard double-initdeposit— transfer USDC from client→contract, store EscrowJobrelease_milestone— proportional release per milestone, handles rounding remainderopen_dispute— verify client/freelancer, set Disputedresolve_dispute— admin auth, split remaining by BPS to both partiesrefund— client auth + Active status, return remaining fundsJob Registry Contract (#3)
post_job— client auth, duplicate job_id guard, store JobRecord + empty bidssubmit_bid— freelancer auth, verify Open statusaccept_bid— client auth, set freelancer + InProgresssubmit_deliverable— freelancer auth, verify InProgress + correct freelancermark_disputed— no auth (cross-contract), only from InProgress/DeliverableSubmittedCloses #1
Closes #3
Test plan
cargo clippy -p escrow -p job_registry -- -D warnings— cleancargo test -p escrow— 5/5 passcargo test -p job_registry— 6/6 pass