Skip to content

A Realitio arbitrator implementation that also implements IDisputeResolver

License

Notifications You must be signed in to change notification settings

kleros/realitio-arbitrator-with-appeals

Repository files navigation

Realitio Arbitrator With Appeals

A Realitio arbitrator that implements appeals via IDisputeResolver. Implementing this interface ensures compatibility with https://resolve.kleros.io user interface.

The Flow

             Kleros                         RealitioArbitratorWithAppeals                         Realitio
          <IArbitrator>                          <IArbitrator>
                                                 <IArbitrable>
                                                 <IRealitioArbitrator>
                                                 <IDisputeResolver>


 ┌──────────────────────────────┐        ┌─────────────────────────────────┐       ┌──────────────────────────────────────┐
 │                              │        │                                 │       │                                      │
 │                              │        │                                 │       │                                      │
 │                              │        │                                 │       │                                      │
 │   createDispute() ◄──────────┼──1─────┼───────  requestArbitration──────┼───1───┼─────►  notifyOfArbitrationRequest()  │
 │                              │        │                                 │       │                                      │
 │                              │        │                                 │       │                                      │
 │                              │        │                                 │       │                                      │
 │                              │        │                                 │       │                                      │
 │                              │        │                                 │       │                                      │
 │                              │        │                                 │       │                                      │
 │                              │        │                                 │       │                                      │
 │   executeRuling() ───────────┼───4────┼───────►  rule() ────────────────┼───────┼──►   assignWinnerAnd                 │
 │                              │        │                                 │       │      submitAnswerByArbitrator()      │
 │                              │        │                                 │       │                                      │
 │                              │        │                                 │       │                                      │
 │                              │        │                                 │       │                                      │
 │                              │        │                                 │       │                                      │
 │                              │        │                                 │       │                                      │
 │                              │        │                                 │       │                                      │
 │    appeal()  ◄───────────────┼───3────┼────────  fundAppeal()           │       │                                      │
 │                              │        │                                 │       │                                      │
 │                              │        │                                 │       │                                      │
 │                              │        │                                 │       │                                      │
 │                              │        │                                 │       │                                      │
 │                              │        │                                 │       │                                      │
 │                              │        │                                 │       │                                      │
 │                              │        │                                 │       │                                      │
 └──────────────────────────────┘        └─────────────────────────────────┘       └──────────────────────────────────────┘


1 User calls requestArbitration(). Internal calls to createDispute() and notifyOfArbitrationRequest().
2 Kleros jury decides. Ruling open for appeal.
3 If any user wants to appeal, can do so by calling fundAppeal(). When total amount raised by both parties, appeal round starts.
4 When ruling becomes finalized, user calls executeRuling(), causing internal calls to rule() and assignWinnerAndSubmitAnswerByArbitrator().

Compile

yarn compile

Deploy

Here is an example deployment command:

ETHERSCAN=W1VIXXXXXXHTHTIS INFURA_PROJECT_ID=b0XXXXXX6802 PRIVATE_KEY=1XXXX0b80 npx hardhat deploy --network kovan --reset --gasprice 70000000000

Deployment script will automatically verify the source code.

Live instances:

General Purpose Arbitrator (Subcourt 0, 31 votes, Primary Document)

DAO Governance Arbitrator (Subcourt 4, 5 votes, Primary Document)

DAO Governance Arbitrator (Subcourt 2, 1 vote, Primary Document)