Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contracts/src/arbitration/KlerosCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,7 @@ contract KlerosCore is IArbitratorV2, Initializable, UUPSProxiable {
error DisputeKitOnly();
error SortitionModuleOnly();
error UnsuccessfulCall();
error InvalidDisputKitParent();
error InvalidDisputeKitParent();
error MinStakeLowerThanParentCourt();
error UnsupportedDisputeKit();
error InvalidForkingCourtAsParent();
Expand Down
4 changes: 2 additions & 2 deletions contracts/src/arbitration/SortitionModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -343,14 +343,14 @@ contract SortitionModule is ISortitionModule, Initializable, UUPSProxiable {

if (availablePenalty == 0) return (juror.stakedPnk, newCourtStake, 0); // No penalty to apply.

uint256 currentStake = _stakeOf(_account, _courtID);
uint256 currentStake = newCourtStake;
uint256 newStake = 0;
if (currentStake >= availablePenalty) {
newStake = currentStake - availablePenalty;
}
_setStake(_account, _courtID, 0, availablePenalty, newStake);
pnkBalance = juror.stakedPnk; // updated by _setStake()
newCourtStake = _stakeOf(_account, _courtID); // updated by _setStake()
newCourtStake = newStake;
}

/// @inheritdoc ISortitionModule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ abstract contract DisputeKitClassicBase is IDisputeKit, Initializable, UUPSProxi
if (!coreDisputeIDToActive[_coreDisputeID]) revert NotActiveForCoreDisputeID();

(uint256 appealPeriodStart, uint256 appealPeriodEnd) = core.appealPeriod(_coreDisputeID);
if (block.timestamp < appealPeriodStart || block.timestamp >= appealPeriodEnd) revert AppealPeriodIsOver();
if (block.timestamp < appealPeriodStart || block.timestamp >= appealPeriodEnd) revert NotAppealPeriod();

uint256 multiplier;
(uint256 ruling, , ) = this.currentRuling(_coreDisputeID);
Expand All @@ -381,7 +381,7 @@ abstract contract DisputeKitClassicBase is IDisputeKit, Initializable, UUPSProxi
block.timestamp - appealPeriodStart >=
((appealPeriodEnd - appealPeriodStart) * LOSER_APPEAL_PERIOD_MULTIPLIER) / ONE_BASIS_POINT
) {
revert AppealPeriodIsOverForLoser();
revert NotAppealPeriodForLoser();
}
multiplier = LOSER_STAKE_MULTIPLIER;
}
Expand Down Expand Up @@ -759,8 +759,8 @@ abstract contract DisputeKitClassicBase is IDisputeKit, Initializable, UUPSProxi
error ChoiceOutOfBounds();
error HashDoesNotMatchHiddenVoteCommitment();
error VoteAlreadyCast();
error AppealPeriodIsOver();
error AppealPeriodIsOverForLoser();
error NotAppealPeriod();
error NotAppealPeriodForLoser();
error AppealFeeIsAlreadyPaid();
error DisputeNotResolved();
error CoreIsPaused();
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/arbitration/interfaces/IArbitratorV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ interface IArbitratorV2 {
) external payable returns (uint256 disputeID);

/// @notice Create a dispute and pay for the fees in a supported ERC20 token.
/// @dev Must be called by the arbitrable contract and pay at least `arbitrationCost(_extraData)` in the supported ERC20 token.
/// @dev Must be called by the arbitrable contract and pay at least `arbitrationCost(_extraData, _feeToken)` in the supported ERC20 token.
/// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.
/// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).
/// @param _feeToken The ERC20 token used to pay fees.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ interface ISortitionModule {
uint256 _newStake
) external;

/// @notice Update the state of the stakes with a PNK reward deposit, called by KC during rewards execution.
/// @notice Update the state of the stakes with a PNK penalty, called by KC during rewards execution.
///
/// @dev `O(n + p * log_k(j))` where
/// `n` is the number of courts the juror has staked in,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1173,7 +1173,7 @@ contract KlerosCoreUniversity is IArbitratorV2, UUPSProxiable, Initializable {
error DisputeKitOnly();
error SortitionModuleOnly();
error UnsuccessfulCall();
error InvalidDisputKitParent();
error InvalidDisputeKitParent();
error MinStakeLowerThanParentCourt();
error UnsupportedDisputeKit();
error InvalidForkingCourtAsParent();
Expand Down
6 changes: 3 additions & 3 deletions contracts/test/foundry/KlerosCore_Appeals.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -127,22 +127,22 @@ contract KlerosCore_AppealsTest is KlerosCore_TestBase {
disputeKit.castVote(disputeID, voteIDs, 2, 0, "XYZ");

vm.prank(crowdfunder1);
vm.expectRevert(DisputeKitClassicBase.AppealPeriodIsOver.selector);
vm.expectRevert(DisputeKitClassicBase.NotAppealPeriod.selector);
disputeKit.fundAppeal{value: 0.1 ether}(disputeID, 1);
core.passPeriod(disputeID);

(uint256 start, uint256 end) = core.appealPeriod(0);

vm.prank(crowdfunder1);
vm.warp(block.timestamp + ((end - start) / 2 + 1));
vm.expectRevert(DisputeKitClassicBase.AppealPeriodIsOverForLoser.selector);
vm.expectRevert(DisputeKitClassicBase.NotAppealPeriodForLoser.selector);
disputeKit.fundAppeal{value: 0.1 ether}(disputeID, 1); // Losing choice

disputeKit.fundAppeal(disputeID, 2); // Winning choice funding should not revert yet

vm.prank(crowdfunder1);
vm.warp(block.timestamp + (end - start) / 2); // Warp one more to cover the whole period
vm.expectRevert(DisputeKitClassicBase.AppealPeriodIsOver.selector);
vm.expectRevert(DisputeKitClassicBase.NotAppealPeriod.selector);
disputeKit.fundAppeal{value: 0.1 ether}(disputeID, 2);
}

Expand Down
Loading