Skip to content

Commit 740193d

Browse files
committed
fix: ruler
1 parent e2a3a58 commit 740193d

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

contracts/src/arbitration/devtools/DisputeResolverRuler.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import {DisputeResolver, IArbitratorV2, IDisputeTemplateRegistry} from "../arbitrables/DisputeResolver.sol";
99

10-
pragma solidity 0.8.18;
10+
pragma solidity 0.8.24;
1111

1212
interface IKlerosCoreRulerFragment {
1313
function getNextDisputeID() external view returns (uint256);

contracts/src/arbitration/devtools/KlerosCoreRuler.sol

+15-16
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
// SPDX-License-Identifier: MIT
22

3-
pragma solidity 0.8.18;
3+
pragma solidity 0.8.24;
44

55
import {IArbitrableV2, IArbitratorV2} from "../interfaces/IArbitratorV2.sol";
66
import {SafeERC20, IERC20} from "../../libraries/SafeERC20.sol";
7-
import {Constants} from "../../libraries/Constants.sol";
8-
import {OnError} from "../../libraries/Types.sol";
97
import {UUPSProxiable} from "../../proxy/UUPSProxiable.sol";
108
import {Initializable} from "../../proxy/Initializable.sol";
9+
import "../../libraries/Constants.sol";
1110

1211
/// @title KlerosCoreRuler
1312
/// Core arbitrator contract for development and testing purposes.
@@ -188,7 +187,7 @@ contract KlerosCoreRuler is IArbitratorV2, UUPSProxiable, Initializable {
188187

189188
// GENERAL_COURT
190189
Court storage court = courts.push();
191-
court.parent = Constants.FORKING_COURT;
190+
court.parent = FORKING_COURT;
192191
court.children = new uint256[](0);
193192
court.hiddenVotes = false;
194193
court.minStake = _courtParameters[0];
@@ -262,7 +261,7 @@ contract KlerosCoreRuler is IArbitratorV2, UUPSProxiable, Initializable {
262261
uint256 _jurorsForCourtJump,
263262
uint256[4] memory _timesPerPeriod
264263
) external onlyByGovernor {
265-
if (_parent == Constants.FORKING_COURT) revert InvalidForkingCourtAsParent();
264+
if (_parent == FORKING_COURT) revert InvalidForkingCourtAsParent();
266265

267266
uint256 courtID = courts.length;
268267
Court storage court = courts.push();
@@ -387,7 +386,7 @@ contract KlerosCoreRuler is IArbitratorV2, UUPSProxiable, Initializable {
387386
) external payable override returns (uint256 disputeID) {
388387
if (msg.value < arbitrationCost(_extraData)) revert ArbitrationFeesNotEnough();
389388

390-
return _createDispute(_numberOfChoices, _extraData, Constants.NATIVE_CURRENCY, msg.value);
389+
return _createDispute(_numberOfChoices, _extraData, NATIVE_CURRENCY, msg.value);
391390
}
392391

393392
/// @inheritdoc IArbitratorV2
@@ -516,7 +515,7 @@ contract KlerosCoreRuler is IArbitratorV2, UUPSProxiable, Initializable {
516515
Round storage round = dispute.rounds[_round];
517516
uint256 feeReward = round.totalFeesForJurors;
518517
round.sumFeeRewardPaid += feeReward;
519-
if (round.feeToken == Constants.NATIVE_CURRENCY) {
518+
if (round.feeToken == NATIVE_CURRENCY) {
520519
// The dispute fees were paid in ETH
521520
payable(account).send(feeReward);
522521
} else {
@@ -573,7 +572,7 @@ contract KlerosCoreRuler is IArbitratorV2, UUPSProxiable, Initializable {
573572
uint256 nbVotes = round.totalFeesForJurors / court.feeForJuror;
574573
if (_jump) {
575574
// Jump to parent court.
576-
if (dispute.courtID == Constants.GENERAL_COURT) {
575+
if (dispute.courtID == GENERAL_COURT) {
577576
// TODO: Handle the forking when appealed in General court.
578577
cost = NON_PAYABLE_AMOUNT; // Get the cost of the parent court.
579578
} else {
@@ -648,19 +647,19 @@ contract KlerosCoreRuler is IArbitratorV2, UUPSProxiable, Initializable {
648647
minJurors := mload(add(_extraData, 0x40))
649648
disputeKitID := mload(add(_extraData, 0x60))
650649
}
651-
if (courtID == Constants.FORKING_COURT || courtID >= courts.length) {
652-
courtID = Constants.GENERAL_COURT;
650+
if (courtID == FORKING_COURT || courtID >= courts.length) {
651+
courtID = GENERAL_COURT;
653652
}
654653
if (minJurors == 0) {
655-
minJurors = Constants.DEFAULT_NB_OF_JURORS;
654+
minJurors = DEFAULT_NB_OF_JURORS;
656655
}
657-
if (disputeKitID == Constants.NULL_DISPUTE_KIT) {
658-
disputeKitID = Constants.DISPUTE_KIT_CLASSIC; // 0 index is not used.
656+
if (disputeKitID == NULL_DISPUTE_KIT) {
657+
disputeKitID = DISPUTE_KIT_CLASSIC; // 0 index is not used.
659658
}
660659
} else {
661-
courtID = Constants.GENERAL_COURT;
662-
minJurors = Constants.DEFAULT_NB_OF_JURORS;
663-
disputeKitID = Constants.DISPUTE_KIT_CLASSIC;
660+
courtID = GENERAL_COURT;
661+
minJurors = DEFAULT_NB_OF_JURORS;
662+
disputeKitID = DISPUTE_KIT_CLASSIC;
664663
}
665664
}
666665

0 commit comments

Comments
 (0)