User Experience

These diagrams reflect the experience of an end user. These are the “high level” of how the platform works.

<aside> 💡 Gas fees are not notated. Supplier and engineer will pay gas fees on top of the transaction they are performing.

</aside>

Happy Path (Explicit Approval)

sequenceDiagram
	Supplier->>App: Creates & Funds Contract (postJob)
	App-->>App: Lists contract
	Engineer->>App: Accepts Contract & Pays Buy-In (startJob)
	Note right of App: Within set timeframe
  Engineer->>App: Completes Contract (completeJob)
  Supplier->>App: Accepts Work & Completes Contract (approveJob)
  App->>Engineer: Pays out Bounty + Buy-In 

Happy Path (Timeout Approval)

sequenceDiagram
	Supplier->>App: Creates & Funds Contract (postJob)
	App-->>App: Lists contract
	Engineer->>App: Accepts Contract & Pays Buy-In (acceptJob)
	Note right of App: Within set timeframe
  Engineer->>App: Completes Contract (completeJob)
	Supplier-->>Supplier: Does nothing
	Note right of App: Acceptance time period expires
  Engineer->>App: Requests Non-interactive Payout (completeTimedOutJob)
  App->>Engineer: Pays out Bounty + Buy-In

Supplier Close (before engineer accepts)

sequenceDiagram
	Supplier->>App: Creates & Funds Contract (postJob)
	App-->>App: Lists contract
	Supplier->>App: Request Close Contract (cancelJob)
	App->>Supplier: Pays out Bounty

Supplier Close (after engineer accepts; engineer approval)


sequenceDiagram
	Supplier->>App: Creates & Funds Contract (postJob)
	App-->>App: Lists contract
	Engineer->>App: Accepts Contract & Pays Buy-In (acceptJob)
	Supplier->>App: Request Close Contract (closeJob)
  App-->>Engineer: Notify of "Request Close"
	Engineer->>App: Approve Close (closeJob)
	App->>Engineer: Pay out Buy-In
  App->>Supplier: Pay out Bounty

Supplier Close (after engineer accepts; engineer denial)

sequenceDiagram
	Supplier->>App: Creates & Funds Contract (postJob)
	App-->>App: Lists contract
	Engineer->>App: Accepts Contract & Pays Buy-In (acceptJob)
	Supplier->>App: Request Close Contract (closeJob)
  App->>Engineer: Notify of "Request Close"
	Engineer-->>App: Deny Close 
	Note right of App: Supplier is no longer able to Request Close, but can Dispute.

Supplier Dispute

sequenceDiagram
	Supplier->>App: Creates & Funds Contract (postJob)
	App-->>App: Lists contract
	Engineer->>App: Accepts Contract & Pays Buy-In (acceptJob)
	Note right of App: Before timeout
	Supplier->>App: Dispute (disputeJob)
	App-->>App: Trigger Dispute Resolution workflow
	alt Supplier Wins
			DR Service->>App: Resolve Dispute for Supplier (resolveDisputeForSupplier)
	    App->>Supplier: Pay out Bounty + Buy-In
	else Engineer Wins
			DR Service->>App: Resolve Dispute for Engineer (resolveDisputeForEngineer)
	    App->>Engineer: Pay out Bounty + Buy-In
	else Mixed Decision
			DR Service->>App: Resolve Dispute with Split (resolveDisputeWithCustomSplit)
			Note right of App: Other splits are possible
	    App->>Engineer: Pay out n% of (Bounty + Buy-In)
	    App->>Supplier: Refund remaining Bounty and Buy-In
	end

Dispute Resolution Workflow

sequenceDiagram
	Supplier-->>Supplier: Prepare public materials (attachments, activity feed, etc.)
	Supplier->>App: Trigger Dispute Resolution Workflow
	App-->>DR Service: 6% of total contract value
	Note right of DR Service: 6% goes to main wallet. Manual distribution for MVP.
	DR Service-->>DR Service: Randomly choose 3 resolvers from DAO
	Note right of DR Service: Resolvers review public materials
	Resolvers-->>DR Service: Decision
	DR Service-->>App: Deliver Decision
	App-->>App: Execute decision (see above)