Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions contracts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The format is based on [Common Changelog](https://common-changelog.org/).

### Changed

- **Breaking:** Rename `KlerosCore.TokenAndETHShift` into `KlerosCore.JurorRewardPenalty` ([#2136](https://github.com/kleros/kleros-v2/issues/2136))
- **Breaking:** Add event parameter `KlerosCore.TokenAndETHShift._degreeOfCoherencyFee` and renamed the other parameters to `_degreeOfCoherencyPnk`, `_amountPnk`, `_amountFee` ([#2097](https://github.com/kleros/kleros-v2/issues/2097))
- **Breaking:** Move state variable `DisputeKitClassicBase.nbVotes` to the `Round` struct ([#2097](https://github.com/kleros/kleros-v2/issues/2097))
- **Breaking:** Stake the juror's PNK rewards instead of transferring them out ([#2099](https://github.com/kleros/kleros-v2/issues/2099))
Expand Down
6 changes: 3 additions & 3 deletions contracts/src/arbitration/KlerosCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ contract KlerosCore is IArbitratorV2, Initializable, UUPSProxiable {
/// @param _amountPnk Amount of PNK shifted.
/// @param _amountFee Amount of fee shifted.
/// @param _feeToken Address of the fee token.
event TokenAndETHShift(
event JurorRewardPenalty(
address indexed _account,
uint256 indexed _disputeID,
uint256 indexed _roundID,
Expand Down Expand Up @@ -927,7 +927,7 @@ contract KlerosCore is IArbitratorV2, Initializable, UUPSProxiable {
);
if (availablePenalty != 0) {
_params.pnkPenaltiesInRound += availablePenalty;
emit TokenAndETHShift(
emit JurorRewardPenalty(
account,
_params.disputeID,
_params.round,
Expand Down Expand Up @@ -1009,7 +1009,7 @@ contract KlerosCore is IArbitratorV2, Initializable, UUPSProxiable {
}
}
if (pnkReward != 0 || feeReward != 0) {
emit TokenAndETHShift(
emit JurorRewardPenalty(
account,
_params.disputeID,
_params.round,
Expand Down
4 changes: 2 additions & 2 deletions contracts/src/arbitration/devtools/KlerosCoreRuler.sol
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ contract KlerosCoreRuler is IArbitratorV2, UUPSProxiable, Initializable {
uint96 indexed _fromCourtID,
uint96 _toCourtID
);
event TokenAndETHShift(
event JurorRewardPenalty(
address indexed _account,
uint256 indexed _disputeID,
uint256 indexed _roundID,
Expand Down Expand Up @@ -519,7 +519,7 @@ contract KlerosCoreRuler is IArbitratorV2, UUPSProxiable, Initializable {
// The dispute fees were paid in ERC20
round.feeToken.safeTransfer(account, feeReward);
}
emit TokenAndETHShift(
emit JurorRewardPenalty(
account,
_disputeID,
_round,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ contract KlerosCoreUniversity is IArbitratorV2, UUPSProxiable, Initializable {
uint256 indexed _fromDisputeKitID,
uint256 _toDisputeKitID
);
event TokenAndETHShift(
event JurorRewardPenalty(
address indexed _account,
uint256 indexed _disputeID,
uint256 indexed _roundID,
Expand Down Expand Up @@ -782,7 +782,7 @@ contract KlerosCoreUniversity is IArbitratorV2, UUPSProxiable, Initializable {
penalty
);
_params.pnkPenaltiesInRound += availablePenalty;
emit TokenAndETHShift(
emit JurorRewardPenalty(
account,
_params.disputeID,
_params.round,
Expand Down Expand Up @@ -872,7 +872,7 @@ contract KlerosCoreUniversity is IArbitratorV2, UUPSProxiable, Initializable {
pinakion.safeTransfer(account, pnkReward);
}

emit TokenAndETHShift(
emit JurorRewardPenalty(
account,
_params.disputeID,
_params.round,
Expand Down
6 changes: 3 additions & 3 deletions contracts/test/arbitration/ruler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ describe("KlerosCoreRuler", async () => {
.withArgs(resolver.target, RulingMode.automaticRandom, disputeID, anyValue, anyValue, anyValue)
.and.to.emit(core, "Ruling")
.withArgs(resolver.target, disputeID, anyValue)
.and.to.emit(core, "TokenAndETHShift")
.and.to.emit(core, "JurorRewardPenalty")
.withArgs(dev.address, disputeID, 0, 10000, 10000, 0, anyValue, ZeroAddress)
.and.to.emit(resolver, "DisputeRequest")
.withArgs(core.target, disputeID, localDisputeID, templateId)
Expand All @@ -118,7 +118,7 @@ describe("KlerosCoreRuler", async () => {
.withArgs(resolver.target, RulingMode.automaticPreset, disputeID, 2, true, false)
.and.to.emit(core, "Ruling")
.withArgs(resolver.target, disputeID, 2)
.and.to.emit(core, "TokenAndETHShift")
.and.to.emit(core, "JurorRewardPenalty")
.withArgs(dev.address, disputeID, 0, 10000, 10000, 0, anyValue, ZeroAddress)
.and.to.emit(resolver, "DisputeRequest")
.withArgs(core.target, disputeID, localDisputeID, templateId)
Expand Down Expand Up @@ -153,7 +153,7 @@ describe("KlerosCoreRuler", async () => {
.withArgs(core.target, disputeID, 3);

await expect(core.execute(disputeID, 0))
.and.to.emit(core, "TokenAndETHShift")
.and.to.emit(core, "JurorRewardPenalty")
.withArgs(dev.address, disputeID, 0, 10000, 10000, 0, anyValue, ZeroAddress);
});
});
Expand Down
8 changes: 4 additions & 4 deletions contracts/test/foundry/KlerosCore_Execution.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ contract KlerosCore_ExecutionTest is KlerosCore_TestBase {
vm.expectEmit(true, true, true, true);
emit SortitionModule.StakeLocked(staker1, 1000, true);
vm.expectEmit(true, true, true, true);
emit KlerosCore.TokenAndETHShift(staker1, disputeID, 0, 0, 0, -int256(1000), 0, IERC20(address(0))); // penalties
emit KlerosCore.JurorRewardPenalty(staker1, disputeID, 0, 0, 0, -int256(1000), 0, IERC20(address(0))); // penalties
// Check iterations for the winning staker to see the shifts
vm.expectEmit(true, true, true, true);
emit SortitionModule.StakeLocked(staker2, 0, true);
Expand All @@ -121,11 +121,11 @@ contract KlerosCore_ExecutionTest is KlerosCore_TestBase {
vm.expectEmit(true, true, true, true);
emit SortitionModule.StakeLocked(staker2, 1000, true);
vm.expectEmit(true, true, true, true);
emit KlerosCore.TokenAndETHShift(staker2, disputeID, 0, 10000, 10000, 500, 0.045 ether, IERC20(address(0))); // rewards
emit KlerosCore.JurorRewardPenalty(staker2, disputeID, 0, 10000, 10000, 500, 0.045 ether, IERC20(address(0))); // rewards
vm.expectEmit(true, true, true, true);
emit SortitionModule.StakeLocked(staker2, 1000, true);
vm.expectEmit(true, true, true, true);
emit KlerosCore.TokenAndETHShift(staker2, disputeID, 0, 10000, 10000, 500, 0.045 ether, IERC20(address(0))); // rewards
emit KlerosCore.JurorRewardPenalty(staker2, disputeID, 0, 10000, 10000, 500, 0.045 ether, IERC20(address(0))); // rewards
core.execute(disputeID, 0, 10); // Finish the iterations. We need only 3 but check that it corrects the count.

(, totalLocked, , ) = sortitionModule.getJurorBalance(staker2, GENERAL_COURT);
Expand Down Expand Up @@ -530,7 +530,7 @@ contract KlerosCore_ExecutionTest is KlerosCore_TestBase {

// Check only once per penalty and per reward
vm.expectEmit(true, true, true, true);
emit KlerosCore.TokenAndETHShift(staker1, disputeID, 0, 10000, 10000, 0, 0.06 ether, feeToken); // rewards
emit KlerosCore.JurorRewardPenalty(staker1, disputeID, 0, 10000, 10000, 0, 0.06 ether, feeToken); // rewards
core.execute(disputeID, 0, 6);

KlerosCore.Round memory round = core.getRoundInfo(disputeID, 0);
Expand Down
2 changes: 1 addition & 1 deletion contracts/test/integration/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ describe("Integration tests", async () => {
await core.passPeriod(0);
expect((await core.disputes(0)).period).to.equal(Period.execution);
await expect(core.execute(0, 0, 1000))
.to.emit(core, "TokenAndETHShift")
.to.emit(core, "JurorRewardPenalty")
.withArgs(deployer, 0, 0, 10000, 10000, 0, arbitrationCost / 3n, ethers.ZeroAddress);

await expect(core.executeRuling(0, { gasLimit: 10000000, gasPrice: 5000000000 }))
Expand Down
Loading