Skip to content

Commit 807c57c

Browse files
committed
feat: interfaces wip
1 parent efc3b61 commit 807c57c

16 files changed

+103
-44
lines changed

contracts/src/arbitration/IArbitrableV2.sol

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,32 @@ import "./IArbitratorV2.sol";
1212
* - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);
1313
*/
1414
interface IArbitrableV2 {
15+
/**
16+
* @dev To be emitted when a new dispute template is created.
17+
* @param _templateId The ID of the dispute template.
18+
* @param _templateTag An optional tag for the dispute template, such as "registration" or "removal".
19+
* @param data The template data.
20+
*/
21+
event NewDisputeTemplate(
22+
uint256 indexed _templateId,
23+
string indexed _templateTag,
24+
string data
25+
);
26+
1527
/**
1628
* @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.
1729
* @param _arbitrator The arbitrator of the contract.
18-
* @param _disputeID ID of the dispute in the Arbitrator contract.
19-
* @param _externalDisputeID Unique identifier from the dispute creator that is linked to this dispute.
20-
* @param _disputeContextUri IPFS path to dispute context, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/disputecontext.json'
30+
* @param _arbitrableDisputeID The ID of the dispute in the Arbitrable contract.
31+
* @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.
32+
* @param _templateId The ID of the dispute template. Should not be used with _templateUri.
33+
* @param _templateUri IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId.
2134
*/
22-
event Dispute(
35+
event NewDisputeRequest(
2336
IArbitrableV2 indexed _arbitrator,
24-
uint256 indexed _disputeID,
37+
uint256 indexed _arbitrableDisputeID,
2538
uint256 _externalDisputeID,
26-
string _disputeContextUri
39+
uint256 _templateId,
40+
string _templateUri
2741
);
2842

2943
/**

contracts/src/arbitration/IArbitratorV2.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import "./IArbitrableV2.sol";
77
/**
88
* @title Arbitrator
99
* Arbitrator interface that implements the new arbitration standard.
10-
* Unlike the ERC-792 this standard doesn't have anything related to appeals, so each arbitrator can implement an appeal system that suits it the most.
10+
* Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.
1111
* When developing arbitrator contracts we need to:
1212
* - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).
1313
* - Define the functions for cost display (arbitrationCost).

contracts/src/arbitration/dispute-kits/DisputeKitClassic.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,11 +375,11 @@ contract DisputeKitClassic is BaseDisputeKit, IEvidence {
375375
}
376376
}
377377

378-
/// @dev Submits evidence.
379-
/// @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to. It's the submitter responsability to submit the right evidence group ID.
378+
/// @dev Submits evidence for a dispute.
379+
/// @param _externalDisputeID Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right evidence group ID.
380380
/// @param _evidence IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'.
381-
function submitEvidence(uint256 _evidenceGroupID, string calldata _evidence) external {
382-
emit Evidence(_evidenceGroupID, msg.sender, _evidence);
381+
function submitEvidence(uint256 _externalDisputeID, string calldata _evidence) external {
382+
emit Evidence(_externalDisputeID, msg.sender, _evidence);
383383
}
384384

385385
// ************************************* //

contracts/src/arbitration/dispute-kits/DisputeKitSybilResistant.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,11 +395,11 @@ contract DisputeKitSybilResistant is BaseDisputeKit, IEvidence {
395395
}
396396
}
397397

398-
/// @dev Submits evidence.
399-
/// @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to. It's the submitter responsability to submit the right evidence group ID.
398+
/// @dev Submits evidence for a dispute.
399+
/// @param _externalDisputeID Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right evidence group ID.
400400
/// @param _evidence IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'.
401-
function submitEvidence(uint256 _evidenceGroupID, string calldata _evidence) external {
402-
emit Evidence(_evidenceGroupID, msg.sender, _evidence);
401+
function submitEvidence(uint256 _externalDisputeID, string calldata _evidence) external {
402+
emit Evidence(_externalDisputeID, msg.sender, _evidence);
403403
}
404404

405405
// ************************************* //

contracts/src/evidence/IEvidence.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import "../arbitration/IArbitrator.sol";
77
/// @title IEvidence
88
interface IEvidence {
99
/// @dev To be raised when evidence is submitted. Should point to the resource (evidences are not to be stored on chain due to gas considerations).
10-
/// @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to.
10+
/// @param _externalDisputeID Unique identifier for this dispute outside Kleros. It's the submitter responsability to submit the right evidence group ID.
1111
/// @param _party The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party.
1212
/// @param _evidence IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'
13-
event Evidence(uint256 indexed _evidenceGroupID, address indexed _party, string _evidence);
13+
event Evidence(uint256 indexed _externalDisputeID, address indexed _party, string _evidence);
1414
}

contracts/src/evidence/IEvidenceV2.sol

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# V2 BREAKING CHANGES
2+
3+
## Onchain changes
4+
5+
### IArbitrator
6+
7+
#### The appeal events and functions have been removed
8+
9+
The appeal concerns are deemed implementation-specific so they have been removed from the Arbitrator interface.
10+
11+
The following have been removed from the Arbitrator interface but are available directly on KlerosCore:
12+
13+
```solidity
14+
function appealCost(uint256 _disputeID) external view returns (uint256 cost);
15+
16+
function appealPeriod(uint256 _disputeID) external view returns (uint256 start, uint256 end);
17+
```
18+
19+
The following have been removed entirely:
20+
21+
```solidity
22+
event AppealPossible(uint256 indexed _disputeID, IArbitrableV1 indexed _arbitrable);
23+
event AppealDecision(uint256 indexed _disputeID, IArbitrableV1 indexed _arbitrable);
24+
function appeal(uint256 _disputeID, bytes calldata _extraData) external payable;
25+
```
26+
27+
The appeal requests are now the responsibility of the DisputeKit implementation. For example in the DisputeKitClassic there is now:
28+
29+
```solidity
30+
// DisputeKitClassic.sol
31+
function fundAppeal(uint256 _coreDisputeID, uint256 _choice) payable;
32+
33+
function getFundedChoices(uint256 _coreDisputeID) view returns (uint256[] memory fundedChoices);
34+
```
35+
36+
#### `DisputeStatus` has been removed
37+
38+
It was deemed redundant. An equivalent behavior can be emulated as follow:
39+
40+
```solidity
41+
// for a particular disputeID
42+
(,,IArbitrator.Period period,,) = arbitrator.disputes(disputeID);
43+
44+
if (period < IArbitratorV2.Period.appeal)
45+
// Do DisputeStatus.Waiting stuffs
46+
else if (_period < IArbitratorV2.Period.execution)
47+
// Do DisputeStatus.Appealable stuffs
48+
else
49+
// Do DisputeStatus.Solved stuffs
50+
}
51+
```

kleros-sdk/config/v2-disputetemplate/linguo/DisputeDetails.linguo.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"linguoRequester": "0xabc996a233895be74a66f451f1019ca97342aaaa",
5252
"linguoTranslator": "0xbcd996a233895be74a66f451f1019ca97342bbbb",
5353
"linguoChallenger": "0xcde996a233895be74a66f451f1019ca97342cccc",
54-
"linguoFrontendUrl": "https://linguo.kleros.io/translation/0x0B928165A67df8254412483ae8C3b8cc7F2b4D36/35",
54+
"linguoFrontendUrl": "https://linguo.kleros.io/translation/0x0B928165A67df8254412483ae8C3b8cc7F2b4D36/35"
5555
},
5656
"externalDisputeID": "13", // taskID
5757
"arbitrableDisputeID": "7",

kleros-sdk/config/v2-disputetemplate/linguo/NewDisputeTemplate.linguo.jsonc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
"answers": [
77
{
88
"title": "Yes, the translation should be accepted",
9-
"description": "Select this if you think the translation complies with the required criteria.",
9+
"description": "Select this if you think the translation complies with the required criteria."
1010
},
1111
{
1212
"title": "No, the translation should not be accepted",
13-
"description": "Select this if you think the translation does not comply with the required criteria.",
13+
"description": "Select this if you think the translation does not comply with the required criteria."
1414
}
1515
],
1616
"policyURI": "/ipfs/QmVabp1VjJNYzXDxbcWFdeK17RvvA9eQy6eJVf1T1AzS1a/linguo-translation-quality-policy.pdf",
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Dispute Standard for Reality.eth
2+
3+
[Specs](./kip-99.md)
4+
[New dispute template](./NewDisputeTemplate.reality.jsonc)
5+
[Dispute details schema](./DisputeDetails.reality.schema.json) (optional)
6+
SDK implementation (TODO)
7+
8+
## Example 1: Kleros Moderate Question
9+
10+
[New dispute parameters](./example1/NewDispute.reality1.jsonc)
11+
[Inputs for the dispute template](./example1/DisputeTemplateInputs.reality1.txt)
12+
[Dispute details output](./example1/DisputeDetails.reality1.jsonc)
13+
14+
## Example 2: Formula1 Question
15+
16+
[New dispute parameters](./example2/NewDispute.reality2.jsonc)
17+
[Inputs for the dispute template](./example2/DisputeTemplateInputs.reality2.txt)
18+
[Dispute details output](./example2/DisputeDetails.reality2.jsonc)

0 commit comments

Comments
 (0)