Skip to main content

Overview

This example demonstrates how to build an escrow contract that uses Kleros Court V1 as an external arbitrator, following the ERC-792 arbitration standard and ERC-1497 evidence standard. The contract holds funds in escrow until the payer releases them, or a dispute is raised and resolved by Kleros jurors. It is based on the SimpleEscrow tutorial on docs.kleros.io and illustrates the core V1 integration pattern.

Contract


Key Integration Points

createDispute(): Sends the arbitration fee to the V1 arbitrator (KlerosLiquid) and receives a disputeID. The _extraData argument (empty string here) can encode the subcourt ID and juror count. rule(): The arbitrator calls this when the dispute is resolved. The ruling is enforced immediately by transferring the escrowed funds. ERC-1497 events: MetaEvidence announces the agreement at deployment, Dispute links the dispute to that metaEvidence and an evidence group, and Evidence records each submission. These are the V1 evidence standard events consumed by the Court V1 and Dispute Resolver interfaces.

Agreement (MetaEvidence)

In V1, the agreement is described with an ERC-1497 MetaEvidence JSON document, uploaded to IPFS and passed to the constructor:

Next Steps

  • Add appeal support so a losing party can fund additional rounds
  • Add ERC20 token support alongside native ETH (see the token compatibility notes for Escrow V1)
  • Review the ERC-792 and ERC-1497 standards in full