Description
The contracts/job_registry/src/lib.rs stubs out on-chain job lifecycle management. Job metadata (IPFS CIDs) and state transitions are stored on-chain for auditability.
Requirements
post_job(env, job_id, client, metadata_hash, budget) — require client auth; guard duplicate job_id; store JobRecord and empty bids vec
submit_bid(env, job_id, freelancer, proposal_hash) — require freelancer auth; verify job status is Open; append BidRecord
accept_bid(env, job_id, client, freelancer) — require client auth; set freelancer and status to InProgress
submit_deliverable(env, job_id, freelancer, hash) — require freelancer auth; verify status InProgress and correct freelancer; set status to DeliverableSubmitted; persist hash
mark_disputed(env, job_id) — no auth guard (called cross-contract from escrow); set status to Disputed
Acceptance Criteria
- Contract compiles to WASM
- Full lifecycle (post → bid → accept → deliverable) passes as a single Soroban test
- Submitting a bid on a non-Open job panics with a clear message
mark_disputed can only transition from InProgress or DeliverableSubmitted
Description
The
contracts/job_registry/src/lib.rsstubs out on-chain job lifecycle management. Job metadata (IPFS CIDs) and state transitions are stored on-chain for auditability.Requirements
post_job(env, job_id, client, metadata_hash, budget)— require client auth; guard duplicatejob_id; storeJobRecordand empty bids vecsubmit_bid(env, job_id, freelancer, proposal_hash)— require freelancer auth; verify job status isOpen; appendBidRecordaccept_bid(env, job_id, client, freelancer)— require client auth; set freelancer and status toInProgresssubmit_deliverable(env, job_id, freelancer, hash)— require freelancer auth; verify statusInProgressand correct freelancer; set status toDeliverableSubmitted; persist hashmark_disputed(env, job_id)— no auth guard (called cross-contract from escrow); set status toDisputedAcceptance Criteria
mark_disputedcan only transition fromInProgressorDeliverableSubmitted