Skip to content

Commit ee3eafc

Browse files
authored
Merge branch 'dev' into ManiBAJPAI22-docs/improve-setup-troubleshooting
2 parents 4ea3555 + 257870c commit ee3eafc

File tree

7 files changed

+15
-49
lines changed

7 files changed

+15
-49
lines changed

contracts/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ The format is based on [Common Changelog](https://common-changelog.org/).
1515
- Bump `hardhat` to v2.26.2 ([#2069](https://github.com/kleros/kleros-v2/issues/2069))
1616
- Bump `@kleros/vea-contracts` to v0.7.0 ([#2073](https://github.com/kleros/kleros-v2/issues/2073))
1717

18+
### Fixed
19+
20+
- Do not pass to Voting period if all the commits are cast because it breaks the current Shutter auto-reveal process. ([#2085](https://github.com/kleros/kleros-v2/issues/2085))
21+
1822
## [0.12.0] - 2025-08-05
1923

2024
### Changed

contracts/src/arbitration/KlerosCoreBase.sol

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -566,10 +566,8 @@ abstract contract KlerosCoreBase is IArbitratorV2, Initializable, UUPSProxiable
566566
if (round.drawnJurors.length != round.nbVotes) revert DisputeStillDrawing();
567567
dispute.period = court.hiddenVotes ? Period.commit : Period.vote;
568568
} else if (dispute.period == Period.commit) {
569-
if (
570-
block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)] &&
571-
!disputeKits[round.disputeKitID].areCommitsAllCast(_disputeID)
572-
) {
569+
// Note that we do not want to pass to Voting period if all the commits are cast because it breaks the Shutter auto-reveal currently.
570+
if (block.timestamp - dispute.lastPeriodChange < court.timesPerPeriod[uint256(dispute.period)]) {
573571
revert CommitPeriodNotPassed();
574572
}
575573
dispute.period = Period.vote;

contracts/src/arbitration/evidence/ModeratedEvidenceModule.sol

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@ pragma solidity ^0.8.24;
55
// TODO: standard interfaces should be placed in a separated repo (?)
66
import {IArbitrableV2, IArbitratorV2} from "../interfaces/IArbitrableV2.sol";
77
import "../interfaces/IDisputeTemplateRegistry.sol";
8-
import "../../libraries/CappedMath.sol";
98

109
/// @title Implementation of the Evidence Standard with Moderated Submissions
1110
contract ModeratedEvidenceModule is IArbitrableV2 {
12-
using CappedMath for uint256;
13-
1411
// ************************************* //
1512
// * Enums / Structs * //
1613
// ************************************* //
@@ -205,8 +202,8 @@ contract ModeratedEvidenceModule is IArbitrableV2 {
205202
ArbitratorData storage arbitratorData = arbitratorDataList[arbitratorDataList.length - 1];
206203

207204
uint256 arbitrationCost = arbitrator.arbitrationCost(arbitratorData.arbitratorExtraData);
208-
uint256 totalCost = arbitrationCost.mulCap(totalCostMultiplier) / MULTIPLIER_DIVISOR;
209-
uint256 depositRequired = totalCost.mulCap(initialDepositMultiplier) / MULTIPLIER_DIVISOR;
205+
uint256 totalCost = (arbitrationCost * totalCostMultiplier) / MULTIPLIER_DIVISOR;
206+
uint256 depositRequired = (totalCost * initialDepositMultiplier) / MULTIPLIER_DIVISOR;
210207

211208
Moderation storage moderation = evidenceData.moderations.push();
212209
// Overpaying is allowed.
@@ -245,12 +242,12 @@ contract ModeratedEvidenceModule is IArbitrableV2 {
245242
ArbitratorData storage arbitratorData = arbitratorDataList[moderation.arbitratorDataID];
246243

247244
uint256 arbitrationCost = arbitrator.arbitrationCost(arbitratorData.arbitratorExtraData);
248-
uint256 totalCost = arbitrationCost.mulCap(totalCostMultiplier) / MULTIPLIER_DIVISOR;
245+
uint256 totalCost = (arbitrationCost * totalCostMultiplier) / MULTIPLIER_DIVISOR;
249246

250247
uint256 opposition = 3 - uint256(_side);
251248
uint256 depositRequired = moderation.paidFees[opposition] * 2;
252249
if (depositRequired == 0) {
253-
depositRequired = totalCost.mulCap(initialDepositMultiplier) / MULTIPLIER_DIVISOR;
250+
depositRequired = (totalCost * initialDepositMultiplier) / MULTIPLIER_DIVISOR;
254251
} else if (depositRequired > totalCost) {
255252
depositRequired = totalCost;
256253
}
@@ -317,7 +314,9 @@ contract ModeratedEvidenceModule is IArbitrableV2 {
317314
) internal returns (uint256) {
318315
uint256 contribution;
319316
uint256 remainingETH;
320-
uint256 requiredAmount = _totalRequired.subCap(_moderation.paidFees[uint256(_side)]);
317+
uint256 requiredAmount = _moderation.paidFees[uint256(_side)] >= _totalRequired
318+
? 0
319+
: _totalRequired - _moderation.paidFees[uint256(_side)];
321320
(contribution, remainingETH) = calculateContribution(_amount, requiredAmount);
322321
_moderation.contributions[_contributor][uint256(_side)] += contribution;
323322
_moderation.paidFees[uint256(_side)] += contribution;

contracts/src/kleros-v1/kleros-liquid-xdai/xKlerosLiquidV2.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {ITokenController} from "../interfaces/ITokenController.sol";
99
import {WrappedPinakion} from "./WrappedPinakion.sol";
1010
import {IRandomAuRa} from "./interfaces/IRandomAuRa.sol";
1111

12-
import {SortitionSumTreeFactory} from "../../libraries/SortitionSumTreeFactory.sol";
12+
import {SortitionSumTreeFactory} from "../libraries/SortitionSumTreeFactory.sol";
1313
import "../../gateway/interfaces/IForeignGateway.sol";
1414

1515
/// @title xKlerosLiquidV2

contracts/src/libraries/CappedMath.sol

Lines changed: 0 additions & 36 deletions
This file was deleted.

contracts/test/foundry/KlerosCore.t.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,6 +1622,7 @@ contract KlerosCoreTest is Test {
16221622
}
16231623

16241624
// Check reveal in the next period
1625+
vm.warp(block.timestamp + timesPerPeriod[1]);
16251626
core.passPeriod(disputeID);
16261627

16271628
// Check the require with the wrong choice and then with the wrong salt

0 commit comments

Comments
 (0)