Skip to content

Commit 8ecf061

Browse files
authored
Merge pull request #2136 from kleros/refactor/rename-TokenAndEthShift-event
refactor: renamed event TokenAndEthShift into JurorRewardPenalty
2 parents c97270a + fd465a4 commit 8ecf061

File tree

7 files changed

+17
-16
lines changed

7 files changed

+17
-16
lines changed

contracts/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The format is based on [Common Changelog](https://common-changelog.org/).
88

99
### Changed
1010

11+
- **Breaking:** Rename `KlerosCore.TokenAndETHShift` into `KlerosCore.JurorRewardPenalty` ([#2136](https://github.com/kleros/kleros-v2/issues/2136))
1112
- **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))
1213
- **Breaking:** Move state variable `DisputeKitClassicBase.nbVotes` to the `Round` struct ([#2097](https://github.com/kleros/kleros-v2/issues/2097))
1314
- **Breaking:** Stake the juror's PNK rewards instead of transferring them out ([#2099](https://github.com/kleros/kleros-v2/issues/2099))

contracts/src/arbitration/KlerosCore.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ contract KlerosCore is IArbitratorV2, Initializable, UUPSProxiable {
221221
/// @param _amountPnk Amount of PNK shifted.
222222
/// @param _amountFee Amount of fee shifted.
223223
/// @param _feeToken Address of the fee token.
224-
event TokenAndETHShift(
224+
event JurorRewardPenalty(
225225
address indexed _account,
226226
uint256 indexed _disputeID,
227227
uint256 indexed _roundID,
@@ -927,7 +927,7 @@ contract KlerosCore is IArbitratorV2, Initializable, UUPSProxiable {
927927
);
928928
if (availablePenalty != 0) {
929929
_params.pnkPenaltiesInRound += availablePenalty;
930-
emit TokenAndETHShift(
930+
emit JurorRewardPenalty(
931931
account,
932932
_params.disputeID,
933933
_params.round,
@@ -1009,7 +1009,7 @@ contract KlerosCore is IArbitratorV2, Initializable, UUPSProxiable {
10091009
}
10101010
}
10111011
if (pnkReward != 0 || feeReward != 0) {
1012-
emit TokenAndETHShift(
1012+
emit JurorRewardPenalty(
10131013
account,
10141014
_params.disputeID,
10151015
_params.round,

contracts/src/arbitration/devtools/KlerosCoreRuler.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ contract KlerosCoreRuler is IArbitratorV2, UUPSProxiable, Initializable {
126126
uint96 indexed _fromCourtID,
127127
uint96 _toCourtID
128128
);
129-
event TokenAndETHShift(
129+
event JurorRewardPenalty(
130130
address indexed _account,
131131
uint256 indexed _disputeID,
132132
uint256 indexed _roundID,
@@ -519,7 +519,7 @@ contract KlerosCoreRuler is IArbitratorV2, UUPSProxiable, Initializable {
519519
// The dispute fees were paid in ERC20
520520
round.feeToken.safeTransfer(account, feeReward);
521521
}
522-
emit TokenAndETHShift(
522+
emit JurorRewardPenalty(
523523
account,
524524
_disputeID,
525525
_round,

contracts/src/arbitration/university/KlerosCoreUniversity.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ contract KlerosCoreUniversity is IArbitratorV2, UUPSProxiable, Initializable {
144144
uint256 indexed _fromDisputeKitID,
145145
uint256 _toDisputeKitID
146146
);
147-
event TokenAndETHShift(
147+
event JurorRewardPenalty(
148148
address indexed _account,
149149
uint256 indexed _disputeID,
150150
uint256 indexed _roundID,
@@ -782,7 +782,7 @@ contract KlerosCoreUniversity is IArbitratorV2, UUPSProxiable, Initializable {
782782
penalty
783783
);
784784
_params.pnkPenaltiesInRound += availablePenalty;
785-
emit TokenAndETHShift(
785+
emit JurorRewardPenalty(
786786
account,
787787
_params.disputeID,
788788
_params.round,
@@ -872,7 +872,7 @@ contract KlerosCoreUniversity is IArbitratorV2, UUPSProxiable, Initializable {
872872
pinakion.safeTransfer(account, pnkReward);
873873
}
874874

875-
emit TokenAndETHShift(
875+
emit JurorRewardPenalty(
876876
account,
877877
_params.disputeID,
878878
_params.round,

contracts/test/arbitration/ruler.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ describe("KlerosCoreRuler", async () => {
9494
.withArgs(resolver.target, RulingMode.automaticRandom, disputeID, anyValue, anyValue, anyValue)
9595
.and.to.emit(core, "Ruling")
9696
.withArgs(resolver.target, disputeID, anyValue)
97-
.and.to.emit(core, "TokenAndETHShift")
97+
.and.to.emit(core, "JurorRewardPenalty")
9898
.withArgs(dev.address, disputeID, 0, 10000, 10000, 0, anyValue, ZeroAddress)
9999
.and.to.emit(resolver, "DisputeRequest")
100100
.withArgs(core.target, disputeID, localDisputeID, templateId)
@@ -118,7 +118,7 @@ describe("KlerosCoreRuler", async () => {
118118
.withArgs(resolver.target, RulingMode.automaticPreset, disputeID, 2, true, false)
119119
.and.to.emit(core, "Ruling")
120120
.withArgs(resolver.target, disputeID, 2)
121-
.and.to.emit(core, "TokenAndETHShift")
121+
.and.to.emit(core, "JurorRewardPenalty")
122122
.withArgs(dev.address, disputeID, 0, 10000, 10000, 0, anyValue, ZeroAddress)
123123
.and.to.emit(resolver, "DisputeRequest")
124124
.withArgs(core.target, disputeID, localDisputeID, templateId)
@@ -153,7 +153,7 @@ describe("KlerosCoreRuler", async () => {
153153
.withArgs(core.target, disputeID, 3);
154154

155155
await expect(core.execute(disputeID, 0))
156-
.and.to.emit(core, "TokenAndETHShift")
156+
.and.to.emit(core, "JurorRewardPenalty")
157157
.withArgs(dev.address, disputeID, 0, 10000, 10000, 0, anyValue, ZeroAddress);
158158
});
159159
});

contracts/test/foundry/KlerosCore_Execution.t.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ contract KlerosCore_ExecutionTest is KlerosCore_TestBase {
9999
vm.expectEmit(true, true, true, true);
100100
emit SortitionModule.StakeLocked(staker1, 1000, true);
101101
vm.expectEmit(true, true, true, true);
102-
emit KlerosCore.TokenAndETHShift(staker1, disputeID, 0, 0, 0, -int256(1000), 0, IERC20(address(0))); // penalties
102+
emit KlerosCore.JurorRewardPenalty(staker1, disputeID, 0, 0, 0, -int256(1000), 0, IERC20(address(0))); // penalties
103103
// Check iterations for the winning staker to see the shifts
104104
vm.expectEmit(true, true, true, true);
105105
emit SortitionModule.StakeLocked(staker2, 0, true);
@@ -121,11 +121,11 @@ contract KlerosCore_ExecutionTest is KlerosCore_TestBase {
121121
vm.expectEmit(true, true, true, true);
122122
emit SortitionModule.StakeLocked(staker2, 1000, true);
123123
vm.expectEmit(true, true, true, true);
124-
emit KlerosCore.TokenAndETHShift(staker2, disputeID, 0, 10000, 10000, 500, 0.045 ether, IERC20(address(0))); // rewards
124+
emit KlerosCore.JurorRewardPenalty(staker2, disputeID, 0, 10000, 10000, 500, 0.045 ether, IERC20(address(0))); // rewards
125125
vm.expectEmit(true, true, true, true);
126126
emit SortitionModule.StakeLocked(staker2, 1000, true);
127127
vm.expectEmit(true, true, true, true);
128-
emit KlerosCore.TokenAndETHShift(staker2, disputeID, 0, 10000, 10000, 500, 0.045 ether, IERC20(address(0))); // rewards
128+
emit KlerosCore.JurorRewardPenalty(staker2, disputeID, 0, 10000, 10000, 500, 0.045 ether, IERC20(address(0))); // rewards
129129
core.execute(disputeID, 0, 10); // Finish the iterations. We need only 3 but check that it corrects the count.
130130

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

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

536536
KlerosCore.Round memory round = core.getRoundInfo(disputeID, 0);

contracts/test/integration/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ describe("Integration tests", async () => {
187187
await core.passPeriod(0);
188188
expect((await core.disputes(0)).period).to.equal(Period.execution);
189189
await expect(core.execute(0, 0, 1000))
190-
.to.emit(core, "TokenAndETHShift")
190+
.to.emit(core, "JurorRewardPenalty")
191191
.withArgs(deployer, 0, 0, 10000, 10000, 0, arbitrationCost / 3n, ethers.ZeroAddress);
192192

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

0 commit comments

Comments
 (0)