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
- feat: dispute kit in progress ([95b8ada](https://github.com/kleros/kleros-v2/commit/95b8ada))
6
+
- feat: modern toolchain setup and simple RNG smart contracts ([17f6a76](https://github.com/kleros/kleros-v2/commit/17f6a76))
7
+
- feat(Arbitration): standard update ([ed930de](https://github.com/kleros/kleros-v2/commit/ed930de))
8
+
- feat(DisputeKitPlurality): split the responsibility of drawing jurors between Core and Dispute Kit ([f339e2b](https://github.com/kleros/kleros-v2/commit/f339e2b))
3
9
- refactor: add arbitrator data index getter ([47a1623](https://github.com/kleros/kleros-v2/commit/47a1623))
- chore: .gitignore and removal of unnecessary yarn cache as we are using "zero installs" ([a6cfdd0](https://github.com/kleros/kleros-v2/commit/a6cfdd0))
bytes32 commit; // The commit of the juror. For courts with hidden votes.
37
+
uint choice; // The choice of the juror.
38
+
bool voted; // True if the vote has been cast or revealed, false otherwise.
39
+
}
40
+
struct VoteCounter {
41
+
// The choice with the most votes. Note that in the case of a tie, it is the choice that reached the tied number of votes first.
42
+
uint winningChoice;
43
+
mapping(uint=>uint) counts; // The sum of votes for each choice in the form `counts[choice]`.
44
+
bool tied; // True if there is a tie, false otherwise.
45
+
}
46
+
struct Dispute {
47
+
//NOTE: arbitrated needed?? But it needs the chainId too, not just an address.
48
+
//IArbitrable arbitrated; // The address of the arbitrable contract.
49
+
bytes arbitratorExtraData; // Extra data for the arbitrator.
50
+
uint256 choices; // The number of choices the arbitrator can choose from.
51
+
uint256 appealPeriodStart; // Time when the appeal funding becomes possible.
52
+
Vote[][] votes; // The votes in the form `votes[appeal][voteID]`. On each round, a new list is pushed and packed with as many empty votes as there are draws. We use `dispute.votes.length` to get the number of appeals plus 1 for the first round.
53
+
VoteCounter[] voteCounters; // The vote counters in the form `voteCounters[appeal]`.
54
+
uint[] tokensAtStakePerJurorForRound; // The amount of tokens at stake for each juror in the form `tokensAtStakePerJuror[appeal]`.
55
+
uint[] arbitrationFeeForRound; // Fee paid by the arbitrable for the arbitration for each round. Must be equal or higher than arbitration cost.
56
+
uint drawsInCurrentRound; // A counter of draws made in the current round.
57
+
uint commitsInCurrentRound; // A counter of commits made in the current round.
58
+
uint[] votesForRound; // A counter of votes made in each round in the form `votesInEachRound[appeal]`.
59
+
uint[] repartitionsForRound; // A counter of vote reward repartitions made in each round in the form `repartitionsInEachRound[appeal]`.
60
+
uint[] penaltiesForRound; // The amount of tokens collected from penalties in each round in the form `penaltiesInEachRound[appeal]`.
61
+
bool ruled; // True if the ruling has been executed, false otherwise.
62
+
uint256 ruling; // Ruling given by the arbitrator.
63
+
}
64
+
65
+
struct Round {
66
+
mapping(uint256=>uint256) paidFees; // Tracks the fees paid for each choice in this round.
67
+
mapping(uint256=>bool) hasPaid; // True if this choice was fully funded, false otherwise.
68
+
mapping(address=>mapping(uint256=>uint256)) contributions; // Maps contributors to their contributions for each choice.
69
+
uint256 feeRewards; // Sum of reimbursable appeal fees available to the parties that made contributions to the ruling that ultimately wins a dispute.
70
+
uint256[] fundedChoices; // Stores the choices that are fully funded.
71
+
}
72
+
73
+
// ************************ //
74
+
// * STORAGE * //
75
+
// ************************ //
76
+
77
+
uintpublic constant ALPHA_DIVISOR =1e4; // The number to divide `Court.alpha` by.
78
+
31
79
// TODO: extract the necessary interfaces
32
80
MockKlerosCore publicimmutable core;
33
81
34
82
RNG publicimmutable rng;
35
83
84
+
Dispute[] public disputes; // Stores the dispute info. disputes[disputeID].
85
+
mapping(uint256=> Round[]) public disputeIDtoRounds; // Maps dispute IDs to Round array that contains the info about crowdfunding.
86
+
87
+
36
88
constructor(MockKlerosCore _core, RNG _rng) {
37
89
core = _core;
38
90
rng = _rng;
39
91
}
40
92
93
+
// ************************ //
94
+
// * MODIFIERS * //
95
+
// ************************ //
96
+
41
97
/**
42
-
* Note: disputeID is maintained by Kleros Core, not the dispute kit
43
-
* Note: the dispute kit does not receive any payment, Kleros Core does
98
+
* Note: disputeID is maintained by KlerosCore, not the dispute kit
99
+
* Note: the dispute kit does not receive nor validate any payment, KlerosCore does
44
100
* Note: Permissioned
45
101
*/
46
102
function createDispute(
47
103
uint256_disputeID,
48
-
uint256_minJuror,
104
+
uint256_arbitrationFee,
105
+
uint256_subcourtFeeForJuror,
106
+
uint256_subcourtMinStake,
107
+
uint256_subcourtAlpha,
49
108
uint256_choices,
50
109
bytescalldata_extraData
51
-
) external {
110
+
) externaloverride{
52
111
require(msg.sender==address(core), "Not allowed: sender is not core");
0 commit comments