Skip to content

Commit 96bb505

Browse files
committed
chore: event parameter tweaks
Added TokenAndETHShift._degreeOfCoherencyFee, rename other parameters Removed IArbitrableV2.DisputeRequest._templateUri
1 parent 568eb40 commit 96bb505

File tree

15 files changed

+68
-80
lines changed

15 files changed

+68
-80
lines changed

contracts/src/arbitration/KlerosCore.sol

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -216,31 +216,33 @@ contract KlerosCore is IArbitratorV2, Initializable, UUPSProxiable {
216216
/// @param _account Juror's address.
217217
/// @param _disputeID ID of the dispute.
218218
/// @param _roundID ID of the round.
219-
/// @param _degreeOfCoherency Juror's degree of coherency in this round.
220-
/// @param _pnkAmount Amount of PNK shifted.
221-
/// @param _feeAmount Amount of fee shifted.
219+
/// @param _degreeOfCoherencyPnk Juror's degree of coherency in this round applied to PNK.
220+
/// @param _degreeOfCoherencyFee Juror's degree of coherency in this round applied to the dispute fee.
221+
/// @param _amountPnk Amount of PNK shifted.
222+
/// @param _amountFee Amount of fee shifted.
222223
/// @param _feeToken Address of the fee token.
223224
event TokenAndETHShift(
224225
address indexed _account,
225226
uint256 indexed _disputeID,
226227
uint256 indexed _roundID,
227-
uint256 _degreeOfCoherency,
228-
int256 _pnkAmount,
229-
int256 _feeAmount,
228+
uint256 _degreeOfCoherencyPnk,
229+
uint256 _degreeOfCoherencyFee,
230+
int256 _amountPnk,
231+
int256 _amountFee,
230232
IERC20 _feeToken
231233
);
232234

233235
/// @dev Emitted when leftover reward sent to owner.
234236
/// @param _disputeID ID of the dispute.
235237
/// @param _roundID ID of the round.
236-
/// @param _pnkAmount Amount of PNK sent.
237-
/// @param _feeAmount Amount of fee sent.
238+
/// @param _amountPnk Amount of PNK sent.
239+
/// @param _amountFee Amount of fee sent.
238240
/// @param _feeToken Address of the fee token.
239241
event LeftoverRewardSent(
240242
uint256 indexed _disputeID,
241243
uint256 indexed _roundID,
242-
uint256 _pnkAmount,
243-
uint256 _feeAmount,
244+
uint256 _amountPnk,
245+
uint256 _amountFee,
244246
IERC20 _feeToken
245247
);
246248

@@ -929,6 +931,7 @@ contract KlerosCore is IArbitratorV2, Initializable, UUPSProxiable {
929931
_params.disputeID,
930932
_params.round,
931933
coherence,
934+
0,
932935
-int256(availablePenalty),
933936
0,
934937
round.feeToken
@@ -1006,6 +1009,7 @@ contract KlerosCore is IArbitratorV2, Initializable, UUPSProxiable {
10061009
_params.disputeID,
10071010
_params.round,
10081011
pnkCoherence,
1012+
feeCoherence,
10091013
int256(pnkReward),
10101014
int256(feeReward),
10111015
round.feeToken

contracts/src/arbitration/KlerosGovernor.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ contract KlerosGovernor is IArbitrableV2 {
300300
// Check in case arbitration cost increased after the submission. It's unlikely that its increase won't be covered by the base deposit, but technically possible.
301301
session.sumDeposit = session.sumDeposit > arbitrationCost ? session.sumDeposit - arbitrationCost : 0;
302302
reservedETH = reservedETH > arbitrationCost ? reservedETH - arbitrationCost : 0;
303-
emit DisputeRequest(arbitrator, session.disputeID, sessions.length - 1, templateId, "");
303+
emit DisputeRequest(arbitrator, session.disputeID, sessions.length - 1, templateId);
304304
}
305305
}
306306

contracts/src/arbitration/arbitrables/ArbitrableExample.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ contract ArbitrableExample is IArbitrableV2 {
111111
externalIDtoLocalID[disputeID] = localDisputeID;
112112

113113
uint256 externalDisputeID = uint256(keccak256(abi.encodePacked(_action)));
114-
emit DisputeRequest(arbitrator, disputeID, externalDisputeID, templateId, "");
114+
emit DisputeRequest(arbitrator, disputeID, externalDisputeID, templateId);
115115
}
116116

117117
/// @dev Calls createDispute function of the specified arbitrator to create a dispute.
@@ -133,7 +133,7 @@ contract ArbitrableExample is IArbitrableV2 {
133133
externalIDtoLocalID[disputeID] = localDisputeID;
134134

135135
uint256 externalDisputeID = uint256(keccak256(abi.encodePacked(_action)));
136-
emit DisputeRequest(arbitrator, disputeID, externalDisputeID, templateId, "");
136+
emit DisputeRequest(arbitrator, disputeID, externalDisputeID, templateId);
137137
}
138138

139139
/// @dev To be called by the arbitrator of the dispute, to declare the winning ruling.

contracts/src/arbitration/arbitrables/DisputeResolver.sol

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -84,25 +84,10 @@ contract DisputeResolver is IArbitrableV2 {
8484
_arbitratorExtraData,
8585
_disputeTemplate,
8686
_disputeTemplateDataMappings,
87-
"",
8887
_numberOfRulingOptions
8988
);
9089
}
9190

92-
/// @dev Calls createDispute function of the specified arbitrator to create a dispute.
93-
/// Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract.
94-
/// @param _arbitratorExtraData Extra data for the arbitrator of the dispute.
95-
/// @param _disputeTemplateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'.
96-
/// @param _numberOfRulingOptions Number of ruling options.
97-
/// @return disputeID Dispute id (on arbitrator side) of the created dispute.
98-
function createDisputeForTemplateUri(
99-
bytes calldata _arbitratorExtraData,
100-
string calldata _disputeTemplateUri,
101-
uint256 _numberOfRulingOptions
102-
) external payable returns (uint256 disputeID) {
103-
return _createDispute(_arbitratorExtraData, "", "", _disputeTemplateUri, _numberOfRulingOptions);
104-
}
105-
10691
/// @dev To be called by the arbitrator of the dispute, to declare the winning ruling.
10792
/// @param _arbitratorDisputeID ID of the dispute in arbitrator contract.
10893
/// @param _ruling The ruling choice of the arbitration.
@@ -127,7 +112,6 @@ contract DisputeResolver is IArbitrableV2 {
127112
bytes calldata _arbitratorExtraData,
128113
string memory _disputeTemplate,
129114
string memory _disputeTemplateDataMappings,
130-
string memory _disputeTemplateUri,
131115
uint256 _numberOfRulingOptions
132116
) internal virtual returns (uint256 arbitratorDisputeID) {
133117
if (_numberOfRulingOptions <= 1) revert ShouldBeAtLeastTwoRulingOptions();
@@ -144,7 +128,7 @@ contract DisputeResolver is IArbitrableV2 {
144128
);
145129
arbitratorDisputeIDToLocalID[arbitratorDisputeID] = localDisputeID;
146130
uint256 templateId = templateRegistry.setDisputeTemplate("", _disputeTemplate, _disputeTemplateDataMappings);
147-
emit DisputeRequest(arbitrator, arbitratorDisputeID, localDisputeID, templateId, _disputeTemplateUri);
131+
emit DisputeRequest(arbitrator, arbitratorDisputeID, localDisputeID, templateId);
148132
}
149133

150134
// ************************************* //

contracts/src/arbitration/devtools/DisputeResolverRuler.sol

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ contract DisputeResolverRuler is DisputeResolver {
3333
bytes calldata _arbitratorExtraData,
3434
string memory _disputeTemplate,
3535
string memory _disputeTemplateDataMappings,
36-
string memory _disputeTemplateUri,
3736
uint256 _numberOfRulingOptions
3837
) internal override returns (uint256 arbitratorDisputeID) {
3938
if (_numberOfRulingOptions <= 1) revert ShouldBeAtLeastTwoRulingOptions();
@@ -47,7 +46,7 @@ contract DisputeResolverRuler is DisputeResolver {
4746
arbitratorDisputeID = IKlerosCoreRulerFragment(address(arbitrator)).getNextDisputeID();
4847
arbitratorDisputeIDToLocalID[arbitratorDisputeID] = localDisputeID;
4948
uint256 templateId = templateRegistry.setDisputeTemplate("", _disputeTemplate, _disputeTemplateDataMappings);
50-
emit DisputeRequest(arbitrator, arbitratorDisputeID, localDisputeID, templateId, _disputeTemplateUri);
49+
emit DisputeRequest(arbitrator, arbitratorDisputeID, localDisputeID, templateId);
5150

5251
arbitrator.createDispute{value: msg.value}(_numberOfRulingOptions, _arbitratorExtraData);
5352
}

contracts/src/arbitration/devtools/KlerosCoreRuler.sol

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,17 @@ contract KlerosCoreRuler is IArbitratorV2, UUPSProxiable, Initializable {
130130
address indexed _account,
131131
uint256 indexed _disputeID,
132132
uint256 indexed _roundID,
133-
uint256 _degreeOfCoherency,
134-
int256 _pnkAmount,
135-
int256 _feeAmount,
133+
uint256 _degreeOfCoherencyPnk,
134+
uint256 _degreeOfCoherencyFee,
135+
int256 _amountPnk,
136+
int256 _amountFee,
136137
IERC20 _feeToken
137138
);
138139
event LeftoverRewardSent(
139140
uint256 indexed _disputeID,
140141
uint256 indexed _roundID,
141-
uint256 _pnkAmount,
142-
uint256 _feeAmount,
142+
uint256 _amountPnk,
143+
uint256 _amountFee,
143144
IERC20 _feeToken
144145
);
145146
event AutoRuled(
@@ -518,7 +519,16 @@ contract KlerosCoreRuler is IArbitratorV2, UUPSProxiable, Initializable {
518519
// The dispute fees were paid in ERC20
519520
round.feeToken.safeTransfer(account, feeReward);
520521
}
521-
emit TokenAndETHShift(account, _disputeID, _round, 1, int256(0), int256(feeReward), round.feeToken);
522+
emit TokenAndETHShift(
523+
account,
524+
_disputeID,
525+
_round,
526+
ONE_BASIS_POINT,
527+
ONE_BASIS_POINT,
528+
int256(0),
529+
int256(feeReward),
530+
round.feeToken
531+
);
522532
}
523533

524534
/// @dev Executes a specified dispute's ruling.

contracts/src/arbitration/evidence/ModeratedEvidenceModule.sol

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,7 @@ contract ModeratedEvidenceModule is IArbitrableV2 {
269269
arbitrator,
270270
evidenceData.disputeID,
271271
uint256(_evidenceID),
272-
arbitratorData.disputeTemplateId,
273-
""
272+
arbitratorData.disputeTemplateId
274273
);
275274
evidenceData.disputed = true;
276275
moderation.bondDeadline = 0;

contracts/src/arbitration/interfaces/IArbitrableV2.sol

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ interface IArbitrableV2 {
1414
/// @param _arbitrator The arbitrator of the contract.
1515
/// @param _arbitratorDisputeID The identifier of the dispute in the Arbitrator contract.
1616
/// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.
17-
/// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.
18-
/// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.
17+
/// @param _templateId The identifier of the dispute template.
1918
event DisputeRequest(
2019
IArbitratorV2 indexed _arbitrator,
2120
uint256 indexed _arbitratorDisputeID,
2221
uint256 _externalDisputeID,
23-
uint256 _templateId,
24-
string _templateUri
22+
uint256 _templateId
2523
);
2624

2725
/// @dev To be raised when a ruling is given.

contracts/src/arbitration/university/KlerosCoreUniversity.sol

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,16 +148,17 @@ contract KlerosCoreUniversity is IArbitratorV2, UUPSProxiable, Initializable {
148148
address indexed _account,
149149
uint256 indexed _disputeID,
150150
uint256 indexed _roundID,
151-
uint256 _degreeOfCoherency,
152-
int256 _pnkAmount,
153-
int256 _feeAmount,
151+
uint256 _degreeOfCoherencyPnk,
152+
uint256 _degreeOfCoherencyFee,
153+
int256 _amountPnk,
154+
int256 _amountFee,
154155
IERC20 _feeToken
155156
);
156157
event LeftoverRewardSent(
157158
uint256 indexed _disputeID,
158159
uint256 indexed _roundID,
159-
uint256 _pnkAmount,
160-
uint256 _feeAmount,
160+
uint256 _amountPnk,
161+
uint256 _amountFee,
161162
IERC20 _feeToken
162163
);
163164

@@ -786,6 +787,7 @@ contract KlerosCoreUniversity is IArbitratorV2, UUPSProxiable, Initializable {
786787
_params.disputeID,
787788
_params.round,
788789
coherence,
790+
coherence,
789791
-int256(availablePenalty),
790792
0,
791793
round.feeToken
@@ -875,6 +877,7 @@ contract KlerosCoreUniversity is IArbitratorV2, UUPSProxiable, Initializable {
875877
_params.disputeID,
876878
_params.round,
877879
pnkCoherence,
880+
feeCoherence,
878881
int256(pnkReward),
879882
int256(feeReward),
880883
round.feeToken

contracts/src/gateway/HomeGateway.sol

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ contract HomeGateway is IHomeGateway, UUPSProxiable, Initializable {
151151
disputeHashtoID[disputeHash] = disputeID;
152152
relayedData.relayer = msg.sender;
153153

154-
emit DisputeRequest(arbitrator, disputeID, _params.externalDisputeID, _params.templateId, _params.templateUri);
154+
emit DisputeRequest(arbitrator, disputeID, _params.externalDisputeID, _params.templateId);
155155

156156
emit CrossChainDisputeIncoming(
157157
arbitrator,
@@ -160,8 +160,7 @@ contract HomeGateway is IHomeGateway, UUPSProxiable, Initializable {
160160
_params.foreignDisputeID,
161161
disputeID,
162162
_params.externalDisputeID,
163-
_params.templateId,
164-
_params.templateUri
163+
_params.templateId
165164
);
166165
}
167166

@@ -193,7 +192,7 @@ contract HomeGateway is IHomeGateway, UUPSProxiable, Initializable {
193192
relayedData.relayer = msg.sender;
194193

195194
// Not strictly necessary for functionality, only to satisfy IArbitrableV2
196-
emit DisputeRequest(arbitrator, disputeID, _params.externalDisputeID, _params.templateId, _params.templateUri);
195+
emit DisputeRequest(arbitrator, disputeID, _params.externalDisputeID, _params.templateId);
197196

198197
emit CrossChainDisputeIncoming(
199198
arbitrator,
@@ -202,8 +201,7 @@ contract HomeGateway is IHomeGateway, UUPSProxiable, Initializable {
202201
_params.foreignDisputeID,
203202
disputeID,
204203
_params.externalDisputeID,
205-
_params.templateId,
206-
_params.templateUri
204+
_params.templateId
207205
);
208206
}
209207

0 commit comments

Comments
 (0)