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 Gig resource 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.

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_applicants list.

3. Assignment

  • Actor: Poster
  • Action: Calls assign_applicant.
  • Process:
    • Poster selects a worker from the signed_applicants list.
    • State moves to Assigned.
    • Work can officially begin.

4. Completion & Payout

  • Actor: Worker (Applicant)
  • Action: Calls submit_completion with evidence hash.
  • Actor: Poster
  • Action: Calls complete_gig.
  • Process:
    • State moves to Completed.
    • Funds are released from escrow_module to the worker.

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.