Description
EscrowContractData.arbiter is always set to None in create_contract and there is no entrypoint to set it, making dispute resolution impossible. Add a mechanism for the client and freelancer to agree on an arbiter so resolve_dispute has an authorized settler.
Requirements and context
- Scoped to TalentTrust
escrow Soroban contract (contracts/escrow).
- Implement
assign_arbiter(contract_id, caller, arbiter) requiring caller.require_auth() and that caller is client or freelancer; persist into EscrowContractData.arbiter.
- Reject if an arbiter is already set, if
arbiter equals client or freelancer, or if status is past Funded.
- Invariant: arbiter is set at most once and is distinct from both parties; assignment blocked while paused.
- Must be secure, tested, and documented.
Suggested execution
- Fork the repo and create a branch:
git checkout -b feature/arbiter-assignment
- Implement changes:
contracts/escrow/src/dispute.rs
- Tests:
contracts/escrow/src/test/dispute.rs
- Docs:
docs/escrow/dispute-workflow.md
- Include rustdoc/NatSpec-style doc comments on public functions
- Validate security assumptions (auth, overflow, fail-closed state machine, storage TTL, fee accounting)
Test and commit
- Run tests:
cargo test
- Cover edge cases (unauthorized callers, double release/refund, expired approvals, fee rounding, paused state)
- Include test output and security notes in the PR
Example commit message
feat(escrow): add arbiter assignment entrypoint
Guidelines
- Minimum 95% test coverage on new/changed code
- Clear documentation
- Timeframe: 96 hours from assignment
Description
EscrowContractData.arbiteris always set toNoneincreate_contractand there is no entrypoint to set it, making dispute resolution impossible. Add a mechanism for the client and freelancer to agree on an arbiter soresolve_disputehas an authorized settler.Requirements and context
escrowSoroban contract (contracts/escrow).assign_arbiter(contract_id, caller, arbiter)requiringcaller.require_auth()and thatcalleris client or freelancer; persist intoEscrowContractData.arbiter.arbiterequals client or freelancer, or if status is pastFunded.Suggested execution
git checkout -b feature/arbiter-assignmentcontracts/escrow/src/dispute.rscontracts/escrow/src/test/dispute.rsdocs/escrow/dispute-workflow.mdTest and commit
cargo testExample commit message
Guidelines