@@ -62,9 +62,8 @@ abstract contract DisputeKitClassicBase is IDisputeKit, Initializable, UUPSProxi
62
62
mapping (uint256 => uint256 ) public coreDisputeIDToLocal; // Maps the dispute ID in Kleros Core to the local dispute ID.
63
63
bool public singleDrawPerJuror; // Whether each juror can only draw once per dispute, false by default.
64
64
mapping (uint256 localDisputeID = > mapping (uint256 localRoundID = > mapping (address drawnAddress = > bool )))
65
- public alreadyDrawn; // 'true' if the address has already been drawn, false by default. To be added to the Round struct when fully redeploying rather than upgrading.
66
-
67
- mapping (uint256 => uint256 ) public coreDisputeIDToDisputeLength; // Maps core dispute ID with the current length of disputes array to avoid falling back to 0 index and make sure core dispute is indeed connected to this DK.
65
+ public alreadyDrawn; // True if the address has already been drawn, false by default. To be added to the Round struct when fully redeploying rather than upgrading.
66
+ mapping (uint256 coreDisputeID = > bool ) public coreDisputeIDToActive; // True if this dispute kit is active for this core dispute ID.
68
67
69
68
// ************************************* //
70
69
// * Events * //
@@ -197,6 +196,7 @@ abstract contract DisputeKitClassicBase is IDisputeKit, Initializable, UUPSProxi
197
196
Dispute storage dispute = disputes.push ();
198
197
dispute.numberOfChoices = _numberOfChoices;
199
198
dispute.extraData = _extraData;
199
+ dispute.jumped = false ; // Possibly true if this DK has jumped in a previous round.
200
200
201
201
// New round in the Core should be created before the dispute creation in DK.
202
202
dispute.coreRoundIDToLocal[core.getNumberOfRounds (_coreDisputeID) - 1 ] = dispute.rounds.length ;
@@ -206,7 +206,7 @@ abstract contract DisputeKitClassicBase is IDisputeKit, Initializable, UUPSProxi
206
206
round.tied = true ;
207
207
208
208
coreDisputeIDToLocal[_coreDisputeID] = localDisputeID;
209
- coreDisputeIDToDisputeLength [_coreDisputeID] = localDisputeID + 1 ;
209
+ coreDisputeIDToActive [_coreDisputeID] = true ;
210
210
emit DisputeCreation (_coreDisputeID, _numberOfChoices, _extraData);
211
211
}
212
212
@@ -253,7 +253,7 @@ abstract contract DisputeKitClassicBase is IDisputeKit, Initializable, UUPSProxi
253
253
(, , KlerosCore.Period period , , ) = core.disputes (_coreDisputeID);
254
254
require (period == KlerosCoreBase.Period.commit, "The dispute should be in Commit period. " );
255
255
require (_commit != bytes32 (0 ), "Empty commit. " );
256
- require (coreDisputeIDToDisputeLength [_coreDisputeID] != 0 , "No local dispute for core ID " );
256
+ require (coreDisputeIDToActive [_coreDisputeID], "Not active for core dispute ID " );
257
257
258
258
Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];
259
259
Round storage round = dispute.rounds[dispute.rounds.length - 1 ];
@@ -283,7 +283,7 @@ abstract contract DisputeKitClassicBase is IDisputeKit, Initializable, UUPSProxi
283
283
(, , KlerosCore.Period period , , ) = core.disputes (_coreDisputeID);
284
284
require (period == KlerosCoreBase.Period.vote, "The dispute should be in Vote period. " );
285
285
require (_voteIDs.length > 0 , "No voteID provided " );
286
- require (coreDisputeIDToDisputeLength [_coreDisputeID] != 0 , "No local dispute for core ID " );
286
+ require (coreDisputeIDToActive [_coreDisputeID], "Not active for core dispute ID " );
287
287
288
288
Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];
289
289
require (_choice <= dispute.numberOfChoices, "Choice out of bounds " );
@@ -330,7 +330,7 @@ abstract contract DisputeKitClassicBase is IDisputeKit, Initializable, UUPSProxi
330
330
function fundAppeal (uint256 _coreDisputeID , uint256 _choice ) external payable notJumped (_coreDisputeID) {
331
331
Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];
332
332
require (_choice <= dispute.numberOfChoices, "There is no such ruling to fund. " );
333
- require (coreDisputeIDToDisputeLength [_coreDisputeID] != 0 , "No local dispute for core ID " );
333
+ require (coreDisputeIDToActive [_coreDisputeID], "Not active for core dispute ID " );
334
334
335
335
(uint256 appealPeriodStart , uint256 appealPeriodEnd ) = core.appealPeriod (_coreDisputeID);
336
336
require (block .timestamp >= appealPeriodStart && block .timestamp < appealPeriodEnd, "Appeal period is over. " );
@@ -410,7 +410,7 @@ abstract contract DisputeKitClassicBase is IDisputeKit, Initializable, UUPSProxi
410
410
(, , , bool isRuled , ) = core.disputes (_coreDisputeID);
411
411
require (isRuled, "Dispute should be resolved. " );
412
412
require (! core.paused (), "Core is paused " );
413
- require (coreDisputeIDToDisputeLength [_coreDisputeID] != 0 , "No local dispute for core ID " );
413
+ require (coreDisputeIDToActive [_coreDisputeID], "Not active for core dispute ID " );
414
414
415
415
Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];
416
416
Round storage round = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]];
0 commit comments