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/KlerosCore.sol
+83-44Lines changed: 83 additions & 44 deletions
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ import {SortitionSumTreeFactory} from "../data-structures/SortitionSumTreeFactor
18
18
/**
19
19
* @title KlerosCore
20
20
* Core arbitrator contract for Kleros v2.
21
+
* Note that this contract trusts the token and the dispute kit contracts.
21
22
*/
22
23
contractKlerosCoreisIArbitrator {
23
24
using SortitionSumTreeFactoryfor SortitionSumTreeFactory.SortitionSumTrees; // Use library functions for sortition sum trees.
@@ -71,7 +72,7 @@ contract KlerosCore is IArbitrator {
71
72
}
72
73
73
74
struct Juror {
74
-
uint96[] subcourtIDs; // The IDs of subcourts where the juror's stake path ends. A stake path is a path from the forking court to a court the juror directly staked in using `_setStake`.
75
+
uint96[] subcourtIDs; // The IDs of subcourts where the juror's stake path ends. A stake path is a path from the general court to a court the juror directly staked in using `_setStake`.
75
76
mapping(uint96=>uint256) stakedTokens; // The number of tokens the juror has staked in the subcourt in the form `stakedTokens[subcourtID]`.
76
77
mapping(uint96=>uint256) lockedTokens; // The number of tokens the juror has locked in the subcourt in the form `lockedTokens[subcourtID]`.
77
78
}
@@ -95,7 +96,8 @@ contract KlerosCore is IArbitrator {
95
96
// * Storage * //
96
97
// ************************************* //
97
98
98
-
uint256public constant FORKING_COURT =0; // Index of the default court.
99
+
uint256public constant FORKING_COURT =0; // Index of the forking court.
100
+
uint256public constant GENERAL_COURT =1; // Index of the default (general) court.
99
101
uint256public constant NULL_DISPUTE_KIT =0; // Null pattern to indicate a top-level DK which has no parent.
100
102
uint256public constant DISPUTE_KIT_CLASSIC_INDEX =1; // Index of the default DK. 0 index is skipped.
101
103
uint256public constant MAX_STAKE_PATHS =4; // The maximum number of stake paths a juror can have.
@@ -168,10 +170,10 @@ contract KlerosCore is IArbitrator {
168
170
* @param _jurorProsecutionModule The address of the juror prosecution module.
169
171
* @param _disputeKit The address of the default dispute kit.
170
172
* @param _phaseTimeouts minStakingTime and maxFreezingTime respectively
171
-
* @param _hiddenVotes The `hiddenVotes` property value of the forking court.
172
-
* @param _courtParameters Numeric parameters of Forking court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).
173
-
* @param _timesPerPeriod The `timesPerPeriod` property value of the forking court.
174
-
* @param _sortitionSumTreeK The number of children per node of the forking court's sortition sum tree.
173
+
* @param _hiddenVotes The `hiddenVotes` property value of the general court.
174
+
* @param _courtParameters Numeric parameters of General court (minStake, alpha, feeForJuror and jurorsForCourtJump respectively).
175
+
* @param _timesPerPeriod The `timesPerPeriod` property value of the general court.
176
+
* @param _sortitionSumTreeK The number of children per node of the general court's sortition sum tree.
175
177
*/
176
178
constructor(
177
179
address_governor,
@@ -204,8 +206,12 @@ contract KlerosCore is IArbitrator {
204
206
lastPhaseChange =block.timestamp;
205
207
206
208
// Create the Forking court.
209
+
courts.push();
210
+
// TODO: fill the properties for Forking court.
211
+
212
+
// Create the General court.
207
213
Court storage court = courts.push();
208
-
court.parent =0;
214
+
court.parent =1; // TODO: Should the parent for General court be 0 or 1? In the former case the Forking court will become the top court after jumping.
209
215
court.children =newuint256[](0);
210
216
court.hiddenVotes = _hiddenVotes;
211
217
court.minStake = _courtParameters[0];
@@ -215,7 +221,9 @@ contract KlerosCore is IArbitrator {
0 commit comments