Gig Contract
Core logic for Standard Gigs.
Created: 1/9/2026
Gig Contract (gig_contract)
The gig_contract module defines the core business logic for Standard Gigs. It orchestrates the entire lifecycle from creation to completion, integrating with the escrow_module for payments and rating_module for reputation.
Flows
1. Gig Creation
- Actor: Poster (Client)
- Action: Calls
create_gig. - Process:
- Initializes a
Gigresource under the poster's account. - Deposits the budget into the
escrow_module. - Sets state to
Open. - Stores the IPFS hash of the off-chain requirements.
- Initializes a
2. Application
- Actor: Applicant (Worker)
- Action: Calls
apply_by_signing. - Process:
- Worker signs the contract hash to signal intent and agreement to terms.
- Worker's address is added to the
signed_applicantslist.
3. Assignment
- Actor: Poster
- Action: Calls
assign_applicant. - Process:
- Poster selects a worker from the
signed_applicantslist. - State moves to
Assigned. - Work can officially begin.
- Poster selects a worker from the
4. Completion & Payout
- Actor: Worker (Applicant)
- Action: Calls
submit_completionwith evidence hash. - Actor: Poster
- Action: Calls
complete_gig. - Process:
- State moves to
Completed. - Funds are released from
escrow_moduleto the worker.
- State moves to
5. Disputes
At any point before completion, either party can initiate a dispute via the dispute_module. The gig_contract allows the dispute module to modify the gig state to Disputed and eventually resolve it.
