@@ -113,7 +113,7 @@ abstract contract KlerosCoreBase is IArbitratorV2 {
113113 event AppealDecision (uint256 indexed _disputeID , IArbitrableV2 indexed _arbitrable );
114114 event Draw (address indexed _address , uint256 indexed _disputeID , uint256 _roundID , uint256 _voteID );
115115 event CourtCreated (
116- uint256 indexed _courtID ,
116+ uint96 indexed _courtID ,
117117 uint96 indexed _parent ,
118118 bool _hiddenVotes ,
119119 uint256 _minStake ,
@@ -237,16 +237,18 @@ abstract contract KlerosCoreBase is IArbitratorV2 {
237237
238238 sortitionModule.createTree (bytes32 (uint256 (GENERAL_COURT)), _sortitionExtraData);
239239
240+ uint256 [] memory supportedDisputeKits = new uint256 [](1 );
241+ supportedDisputeKits[0 ] = DISPUTE_KIT_CLASSIC;
240242 emit CourtCreated (
241- 1 ,
243+ GENERAL_COURT ,
242244 court.parent,
243245 _hiddenVotes,
244246 _courtParameters[0 ],
245247 _courtParameters[1 ],
246248 _courtParameters[2 ],
247249 _courtParameters[3 ],
248250 _timesPerPeriod,
249- new uint256 []( 0 )
251+ supportedDisputeKits
250252 );
251253 _enableDisputeKit (GENERAL_COURT, DISPUTE_KIT_CLASSIC, true );
252254 }
@@ -351,7 +353,7 @@ abstract contract KlerosCoreBase is IArbitratorV2 {
351353 if (_supportedDisputeKits[i] == 0 || _supportedDisputeKits[i] >= disputeKits.length ) {
352354 revert WrongDisputeKitIndex ();
353355 }
354- court.supportedDisputeKits[ _supportedDisputeKits[i]] = true ;
356+ _enableDisputeKit ( uint96 (courtID), _supportedDisputeKits[i], true ) ;
355357 }
356358 // Check that Classic DK support was added.
357359 if (! court.supportedDisputeKits[DISPUTE_KIT_CLASSIC]) revert MustSupportDisputeKitClassic ();
@@ -370,7 +372,7 @@ abstract contract KlerosCoreBase is IArbitratorV2 {
370372 // Update the parent.
371373 courts[_parent].children.push (courtID);
372374 emit CourtCreated (
373- courtID,
375+ uint96 ( courtID) ,
374376 _parent,
375377 _hiddenVotes,
376378 _minStake,
@@ -1061,7 +1063,7 @@ abstract contract KlerosCoreBase is IArbitratorV2 {
10611063 bool _alreadyTransferred ,
10621064 OnError _onError
10631065 ) internal returns (bool ) {
1064- if (_courtID == FORKING_COURT || _courtID > courts.length ) {
1066+ if (_courtID == FORKING_COURT || _courtID >= courts.length ) {
10651067 _stakingFailed (_onError, StakingResult.CannotStakeInThisCourt); // Staking directly into the forking court is not allowed.
10661068 return false ;
10671069 }
@@ -1102,6 +1104,7 @@ abstract contract KlerosCoreBase is IArbitratorV2 {
11021104 if (_result == StakingResult.CannotStakeInMoreCourts) revert StakingInTooManyCourts ();
11031105 if (_result == StakingResult.CannotStakeInThisCourt) revert StakingNotPossibeInThisCourt ();
11041106 if (_result == StakingResult.CannotStakeLessThanMinStake) revert StakingLessThanCourtMinStake ();
1107+ if (_result == StakingResult.CannotStakeZeroWhenNoStake) revert StakingZeroWhenNoStake ();
11051108 }
11061109
11071110 /// @dev Gets a court ID, the minimum number of jurors and an ID of a dispute kit from a specified extra data bytes array.
@@ -1147,13 +1150,11 @@ abstract contract KlerosCoreBase is IArbitratorV2 {
11471150 error SortitionModuleOnly ();
11481151 error UnsuccessfulCall ();
11491152 error InvalidDisputKitParent ();
1150- error DepthLevelMax ();
11511153 error MinStakeLowerThanParentCourt ();
11521154 error UnsupportedDisputeKit ();
11531155 error InvalidForkingCourtAsParent ();
11541156 error WrongDisputeKitIndex ();
11551157 error CannotDisableClassicDK ();
1156- error ArraysLengthMismatch ();
11571158 error StakingInTooManyCourts ();
11581159 error StakingNotPossibeInThisCourt ();
11591160 error StakingLessThanCourtMinStake ();
@@ -1177,4 +1178,5 @@ abstract contract KlerosCoreBase is IArbitratorV2 {
11771178 error TransferFailed ();
11781179 error WhenNotPausedOnly ();
11791180 error WhenPausedOnly ();
1181+ error StakingZeroWhenNoStake ();
11801182}
0 commit comments