Skip to content

Issue 6: Escrow Contract - Agent Judge Verdict Execution #17

Description

@soomtochukwu

Description:
The crown jewel of the Lance platform is its AI Agent Judge, which requires special administrative privileges within the escrow contract to execute verdicts and distribute disputed funds. This issue focuses on the integration point where the backend agent interacts with the blockchain. We must implement a resolve_dispute function that is strictly gated to the Agent Judge's predefined public key (or a designated multi-sig admin group). When the OpenClaw agent reaches a verdict, it will dictate a specific fund split (e.g., 100% to Client, 50/50 split, or 100% to Freelancer). The contract must securely interpret these split parameters, execute the respective token transfers, and firmly close the escrow state for that specific milestone as Resolved. This ensures the AI has teeth and its decisions are mathematically and financially binding.
Requirements:

  • Implement the resolve_dispute function that accepts a payout structure (Payee Amount, Payer Amount).
  • Strictly enforce authorization so that only the designated Agent Judge public key can call this function.
  • Verify that the sum of the payloads equals or is less than the total funds locked in the disputed milestone.
  • Execute the split transfers via the Soroban token::Client and finalize the state.
    Acceptance Criteria:
  • Only the authenticated Agent Judge key can finalize a dispute.
  • The contract accurately routes the split percentage to both parties based on the verdict payload.
  • Post-resolution, the escrow status is correctly updated and cannot be re-disputed.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions