@@ -62,9 +62,8 @@ abstract contract DisputeKitClassicBase is IDisputeKit, Initializable, UUPSProxi
6262 mapping (uint256 => uint256 ) public coreDisputeIDToLocal; // Maps the dispute ID in Kleros Core to the local dispute ID.
6363 bool public singleDrawPerJuror; // Whether each juror can only draw once per dispute, false by default.
6464 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.
6867
6968 // ************************************* //
7069 // * Events * //
@@ -197,6 +196,7 @@ abstract contract DisputeKitClassicBase is IDisputeKit, Initializable, UUPSProxi
197196 Dispute storage dispute = disputes.push ();
198197 dispute.numberOfChoices = _numberOfChoices;
199198 dispute.extraData = _extraData;
199+ dispute.jumped = false ; // Possibly true if this DK has jumped in a previous round.
200200
201201 // New round in the Core should be created before the dispute creation in DK.
202202 dispute.coreRoundIDToLocal[core.getNumberOfRounds (_coreDisputeID) - 1 ] = dispute.rounds.length ;
@@ -206,7 +206,7 @@ abstract contract DisputeKitClassicBase is IDisputeKit, Initializable, UUPSProxi
206206 round.tied = true ;
207207
208208 coreDisputeIDToLocal[_coreDisputeID] = localDisputeID;
209- coreDisputeIDToDisputeLength [_coreDisputeID] = localDisputeID + 1 ;
209+ coreDisputeIDToActive [_coreDisputeID] = true ;
210210 emit DisputeCreation (_coreDisputeID, _numberOfChoices, _extraData);
211211 }
212212
@@ -253,7 +253,7 @@ abstract contract DisputeKitClassicBase is IDisputeKit, Initializable, UUPSProxi
253253 (, , KlerosCore.Period period , , ) = core.disputes (_coreDisputeID);
254254 require (period == KlerosCoreBase.Period.commit, "The dispute should be in Commit period. " );
255255 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 " );
257257
258258 Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];
259259 Round storage round = dispute.rounds[dispute.rounds.length - 1 ];
@@ -283,7 +283,7 @@ abstract contract DisputeKitClassicBase is IDisputeKit, Initializable, UUPSProxi
283283 (, , KlerosCore.Period period , , ) = core.disputes (_coreDisputeID);
284284 require (period == KlerosCoreBase.Period.vote, "The dispute should be in Vote period. " );
285285 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 " );
287287
288288 Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];
289289 require (_choice <= dispute.numberOfChoices, "Choice out of bounds " );
@@ -330,7 +330,7 @@ abstract contract DisputeKitClassicBase is IDisputeKit, Initializable, UUPSProxi
330330 function fundAppeal (uint256 _coreDisputeID , uint256 _choice ) external payable notJumped (_coreDisputeID) {
331331 Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];
332332 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 " );
334334
335335 (uint256 appealPeriodStart , uint256 appealPeriodEnd ) = core.appealPeriod (_coreDisputeID);
336336 require (block .timestamp >= appealPeriodStart && block .timestamp < appealPeriodEnd, "Appeal period is over. " );
@@ -410,7 +410,7 @@ abstract contract DisputeKitClassicBase is IDisputeKit, Initializable, UUPSProxi
410410 (, , , bool isRuled , ) = core.disputes (_coreDisputeID);
411411 require (isRuled, "Dispute should be resolved. " );
412412 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 " );
414414
415415 Dispute storage dispute = disputes[coreDisputeIDToLocal[_coreDisputeID]];
416416 Round storage round = dispute.rounds[dispute.coreRoundIDToLocal[_coreRoundID]];
0 commit comments