Description
This issue aims to address the implementation of Cross-Contract Settlement Router with Auth-Chained Escrow → Reputation → Loyalty Atomicity.
The core objective is to: Introduce a settlement router contract that atomically drives escrow release, reputation attestation, and loyalty emission in a single authorized invocation, so a completed appointment settles as one indivisible on-chain unit instead of three racing calls.
By completing this feature, we will ensure that the GuildWorkman protocol maintains its high standards for security, usability, and decentralized logic. This issue requires careful attention to the Smart Contract architecture and adherence to the existing project conventions.
When picking up this issue, please ensure you document any new dependencies or architectural decisions made during development.
Component
Smart Contracts (Soroban)
Difficulty
⚫ Very Hard
Current state
The three contracts in soroban-contracts/contracts/ are today completely disconnected from one another:
escrow::confirm_completion moves funds and sets Status::Completed — and stops there.
reputation::submit_review accepts any appointment_id with no proof that the appointment exists, was funded, or was completed.
loyalty-token::mint is gated only on a single Minter address (the backend service account), so reward points are minted on the backend's word rather than on settled on-chain state.
That means a client can review a worker for an appointment that never happened, and loyalty points are only as trustworthy as the backend's private key. A router that owns the settlement sequence closes both holes.
Tasks
Acceptance Criteria
Estimated Time
4-6 days
Description
This issue aims to address the implementation of Cross-Contract Settlement Router with Auth-Chained Escrow → Reputation → Loyalty Atomicity.
The core objective is to: Introduce a settlement router contract that atomically drives escrow release, reputation attestation, and loyalty emission in a single authorized invocation, so a completed appointment settles as one indivisible on-chain unit instead of three racing calls.
By completing this feature, we will ensure that the GuildWorkman protocol maintains its high standards for security, usability, and decentralized logic. This issue requires careful attention to the Smart Contract architecture and adherence to the existing project conventions.
When picking up this issue, please ensure you document any new dependencies or architectural decisions made during development.
Component
Smart Contracts (Soroban)
Difficulty
⚫ Very Hard
Current state
The three contracts in
soroban-contracts/contracts/are today completely disconnected from one another:escrow::confirm_completionmoves funds and setsStatus::Completed— and stops there.reputation::submit_reviewaccepts anyappointment_idwith no proof that the appointment exists, was funded, or was completed.loyalty-token::mintis gated only on a singleMinteraddress (the backend service account), so reward points are minted on the backend's word rather than on settled on-chain state.That means a client can review a worker for an appointment that never happened, and loyalty points are only as trustworthy as the backend's private key. A router that owns the settlement sequence closes both holes.
Tasks
soroban-contracts/contracts/settlement-routercrate to the workspace members insoroban-contracts/Cargo.tomlrequire_auth/ sub-invocation auth chaining so the router — not the backend — is the authority that lets reputation and loyalty accept a settlementappointment_id: a replayed settle call must be a no-op, never a double mint or double releasereputation::submit_reviewandloyalty-token::mintto settlement paths the router authorizes, and migrate the existing minter model accordinglycargo fmt --checkandcargo clippy -- -D warningscargo testandsoroban contract buildto verify the optimized WASM buildAcceptance Criteria
appointment_idleaves balances and reputation unchanged after the first callEstimated Time
4-6 days