You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: contracts/src/arbitration/CentralizedArbitrator.sol
+41-39Lines changed: 41 additions & 39 deletions
Original file line number
Diff line number
Diff line change
@@ -5,10 +5,10 @@ pragma solidity ^0.8;
5
5
import"./IArbitrator.sol";
6
6
7
7
/** @title Centralized Arbitrator
8
-
* @dev This is a centralized arbitrator deciding alone on the result of disputes. It allows to appeal the rulings by crowdfunding a desired choice.
8
+
* @dev This is a centralized arbitrator deciding alone on the result of disputes. It illustrates how the appeals can be handled on the arbitrator level.
9
+
* In this particular contract the rulings can be appealed by crowdfunding a desired choice.
9
10
* Note that normally the arbitrator should use a Dispute Kit contract which will define the algorithm for appeals/withdrawals.
10
11
* However to avoid complexity the code of the Dispute Kit is inlined within this contract.
11
-
* Also note that to avoid complexity funding the subset of choices is not possible in this contract.
12
12
*/
13
13
contractCentralizedArbitratorisIArbitrator {
14
14
/* Constants */
@@ -52,6 +52,20 @@ contract CentralizedArbitrator is IArbitrator {
52
52
53
53
/* Events */
54
54
55
+
/**
56
+
* @dev To be emitted when a dispute can be appealed.
57
+
* @param _disputeID ID of the dispute.
58
+
* @param _arbitrable The contract which created the dispute.
/** @dev Raised when a contribution is made, inside fundAppeal function.
56
70
* @param _disputeID ID of the dispute.
57
71
* @param _round The round the contribution was made to.
@@ -168,24 +182,20 @@ contract CentralizedArbitrator is IArbitrator {
168
182
/** @dev TRUSTED. Manages contributions, and appeals a dispute if at least two choices are fully funded. This function allows the appeals to be crowdfunded.
169
183
* Note that the surplus deposit will be reimbursed.
170
184
* @param _disputeID Index of the dispute to appeal.
171
-
* @param _choices Subset of choices that can be funded. Note that this contract only allows to fund one choice at a time.
185
+
* @param _choice A choice that receives funding.
172
186
*/
173
-
function fundAppeal(uint256_disputeID, uint256[] calldata_choices) externalpayableoverride {
174
-
require(_choices.length==1, "Can only fund 1 ruling.");
175
-
187
+
function fundAppeal(uint256_disputeID, uint256_choice) externalpayable {
Copy file name to clipboardExpand all lines: contracts/src/arbitration/IArbitrator.sol
+2-45Lines changed: 2 additions & 45 deletions
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,10 @@ import "./IArbitrable.sol";
7
7
/**
8
8
* @title Arbitrator
9
9
* Arbitrator interface for CourtV2.
10
-
* This interface follows the ERC-792 standard but also allows the appeal crowdfunding on arbitrator's side.
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.
11
11
* When developing arbitrator contracts we need to:
12
12
* - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).
13
-
* - Define the function for appeal crowdfunding (fundAppeal) in order to appeal the ruling.
14
-
* - Define the functions for cost display (arbitrationCost and fundingStatus).
13
+
* - Define the functions for cost display (arbitrationCost).
15
14
* - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).
0 commit comments