Skip to content

Add arbiter assignment to escrow contracts #316

@mikewheeleer

Description

@mikewheeleer

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

Metadata

Metadata

Assignees

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions