Skip to content

Commit f70050e

Browse files
authored
Merge pull request #2169 from kleros/feat/no-external-dispute-id
Removal of externalDisputeID
2 parents e21d261 + cf59b86 commit f70050e

File tree

14 files changed

+38
-71
lines changed

14 files changed

+38
-71
lines changed

contracts/src/arbitration/KlerosGovernor.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ contract KlerosGovernor is IArbitrableV2 {
303303
// 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.
304304
session.sumDeposit = session.sumDeposit > arbitrationCost ? session.sumDeposit - arbitrationCost : 0;
305305
reservedETH = reservedETH > arbitrationCost ? reservedETH - arbitrationCost : 0;
306-
emit DisputeRequest(arbitrator, session.disputeID, sessions.length - 1, templateId);
306+
emit DisputeRequest(arbitrator, session.disputeID, templateId);
307307
}
308308
}
309309

contracts/src/arbitration/arbitrables/ArbitrableExample.sol

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,7 @@ contract ArbitrableExample is IArbitrableV2 {
123123
disputeID = arbitrator.createDispute{value: msg.value}(numberOfRulingOptions, arbitratorExtraData);
124124
externalIDtoLocalID[disputeID] = localDisputeID;
125125

126-
uint256 externalDisputeID = uint256(keccak256(abi.encodePacked(_action)));
127-
emit DisputeRequest(arbitrator, disputeID, externalDisputeID, templateId);
126+
emit DisputeRequest(arbitrator, disputeID, templateId);
128127
}
129128

130129
/// @notice Calls createDispute function of the specified arbitrator to create a dispute.
@@ -144,8 +143,7 @@ contract ArbitrableExample is IArbitrableV2 {
144143
disputeID = arbitrator.createDispute(numberOfRulingOptions, arbitratorExtraData, weth, _feeInWeth);
145144
externalIDtoLocalID[disputeID] = localDisputeID;
146145

147-
uint256 externalDisputeID = uint256(keccak256(abi.encodePacked(_action)));
148-
emit DisputeRequest(arbitrator, disputeID, externalDisputeID, templateId);
146+
emit DisputeRequest(arbitrator, disputeID, templateId);
149147
}
150148

151149
/// @inheritdoc IArbitrableV2

contracts/src/arbitration/arbitrables/DisputeResolver.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ contract DisputeResolver is IArbitrableV2 {
134134
);
135135
arbitratorDisputeIDToLocalID[arbitratorDisputeID] = localDisputeID;
136136
uint256 templateId = templateRegistry.setDisputeTemplate("", _disputeTemplate, _disputeTemplateDataMappings);
137-
emit DisputeRequest(arbitrator, arbitratorDisputeID, localDisputeID, templateId);
137+
emit DisputeRequest(arbitrator, arbitratorDisputeID, templateId);
138138
}
139139

140140
// ************************************* //

contracts/src/arbitration/devtools/DisputeResolverRuler.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ contract DisputeResolverRuler is DisputeResolver {
4646
arbitratorDisputeID = IKlerosCoreRulerFragment(address(arbitrator)).getNextDisputeID();
4747
arbitratorDisputeIDToLocalID[arbitratorDisputeID] = localDisputeID;
4848
uint256 templateId = templateRegistry.setDisputeTemplate("", _disputeTemplate, _disputeTemplateDataMappings);
49-
emit DisputeRequest(arbitrator, arbitratorDisputeID, localDisputeID, templateId);
49+
emit DisputeRequest(arbitrator, arbitratorDisputeID, templateId);
5050

5151
arbitrator.createDispute{value: msg.value}(_numberOfRulingOptions, _arbitratorExtraData);
5252
}

contracts/src/arbitration/evidence/EvidenceModule.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ contract EvidenceModule is IEvidence, Initializable, UUPSProxiable {
5858
// ************************************* //
5959

6060
/// @notice Submits evidence for a dispute.
61-
/// @param _externalDisputeID Unique identifier for this dispute outside Kleros. It's the submitter responsibility to submit the right evidence group ID.
61+
/// @param _arbitratorDisputeID The identifier of the dispute in the Arbitrator contract.
6262
/// @param _evidence Stringified evidence object, example: `{"name" : "Justification", "description" : "Description", "fileURI" : "/ipfs/QmWQV5ZFFhEJiW8Lm7ay2zLxC2XS4wx1b2W7FfdrLMyQQc"}`.
63-
function submitEvidence(uint256 _externalDisputeID, string calldata _evidence) external {
64-
emit Evidence(_externalDisputeID, msg.sender, _evidence);
63+
function submitEvidence(uint256 _arbitratorDisputeID, string calldata _evidence) external {
64+
emit Evidence(_arbitratorDisputeID, msg.sender, _evidence);
6565
}
6666

6767
// ************************************* //

contracts/src/arbitration/evidence/ModeratedEvidenceModule.sol

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ contract ModeratedEvidenceModule is IArbitrableV2 {
7272

7373
/// @notice To be raised when a moderated evidence is submitted. Should point to the resource (evidences are not to be stored on chain due to gas considerations).
7474
/// @param _arbitrator The arbitrator of the contract.
75-
/// @param _externalDisputeID Unique identifier for this dispute outside Kleros. It's the submitter responsibility to submit the right evidence group ID.
75+
/// @param _arbitratorDisputeID The identifier of the dispute in the Arbitrator contract.
7676
/// @param _party The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party.
7777
/// @param _evidence Stringified evidence object, example: '{"name" : "Justification", "description" : "Description", "fileURI" : "/ipfs/QmWQV5ZFFhEJiW8Lm7ay2zLxC2XS4wx1b2W7FfdrLMyQQc"}'.
7878
event ModeratedEvidence(
7979
IArbitratorV2 indexed _arbitrator,
80-
uint256 indexed _externalDisputeID,
80+
uint256 indexed _arbitratorDisputeID,
8181
address indexed _party,
8282
string _evidence
8383
);
@@ -214,7 +214,7 @@ contract ModeratedEvidenceModule is IArbitrableV2 {
214214
moderation.arbitratorDataID = arbitratorDataList.length - 1;
215215

216216
// When evidence is submitted for a foreign arbitrable, the arbitrator field of Evidence is ignored.
217-
emit ModeratedEvidence(arbitrator, _evidenceGroupID, msg.sender, _evidence);
217+
emit ModeratedEvidence(arbitrator, evidenceData.disputeID, msg.sender, _evidence);
218218
}
219219

220220
/// @notice Moderates an evidence submission. Requires the contester to at least double the accumulated stake of the oposing party.
@@ -265,12 +265,7 @@ contract ModeratedEvidenceModule is IArbitrableV2 {
265265
);
266266
disputeIDtoEvidenceID[evidenceData.disputeID] = _evidenceID;
267267

268-
emit DisputeRequest(
269-
arbitrator,
270-
evidenceData.disputeID,
271-
uint256(_evidenceID),
272-
arbitratorData.disputeTemplateId
273-
);
268+
emit DisputeRequest(arbitrator, evidenceData.disputeID, arbitratorData.disputeTemplateId);
274269
evidenceData.disputed = true;
275270
moderation.bondDeadline = 0;
276271
moderation.currentWinner = Party.None;

contracts/src/arbitration/interfaces/IArbitrableV2.sol

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,8 @@ interface IArbitrableV2 {
1717
/// @notice To be emitted when a dispute is created to link the correct template to the disputeID.
1818
/// @param _arbitrator The arbitrator of the contract.
1919
/// @param _arbitratorDisputeID The identifier of the dispute in the Arbitrator contract.
20-
/// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.
2120
/// @param _templateId The identifier of the dispute template.
22-
event DisputeRequest(
23-
IArbitratorV2 indexed _arbitrator,
24-
uint256 indexed _arbitratorDisputeID,
25-
uint256 _externalDisputeID,
26-
uint256 _templateId
27-
);
21+
event DisputeRequest(IArbitratorV2 indexed _arbitrator, uint256 indexed _arbitratorDisputeID, uint256 _templateId);
2822

2923
/// @notice To be raised when a ruling is given.
3024
/// @param _arbitrator The arbitrator giving the ruling.

contracts/src/arbitration/interfaces/IEvidence.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ pragma solidity >=0.8.0 <0.9.0;
55
/// @title IEvidence
66
interface IEvidence {
77
/// @notice To be raised when evidence is submitted. Should point to the resource (evidences are not to be stored on chain due to gas considerations).
8-
/// @param _externalDisputeID Unique identifier for this dispute outside Kleros. It's the submitter responsibility to submit the right external dispute ID.
8+
/// @param _arbitratorDisputeID The identifier of the dispute in the Arbitrator contract.
99
/// @param _party The address of the party submitting the evidence.
1010
/// @param _evidence Stringified evidence object, example: '{"name" : "Justification", "description" : "Description", "fileURI" : "/ipfs/QmWQV5ZFFhEJiW8Lm7ay2zLxC2XS4wx1b2W7FfdrLMyQQc"}'.
11-
event Evidence(uint256 indexed _externalDisputeID, address indexed _party, string _evidence);
11+
event Evidence(uint256 indexed _arbitratorDisputeID, address indexed _party, string _evidence);
1212
}

contracts/src/gateway/HomeGateway.sol

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,14 @@ 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);
154+
emit DisputeRequest(arbitrator, disputeID, _params.templateId);
155155

156156
emit CrossChainDisputeIncoming(
157157
arbitrator,
158158
_params.foreignChainID,
159159
_params.foreignArbitrable,
160160
_params.foreignDisputeID,
161161
disputeID,
162-
_params.externalDisputeID,
163162
_params.templateId
164163
);
165164
}
@@ -192,15 +191,14 @@ contract HomeGateway is IHomeGateway, UUPSProxiable, Initializable {
192191
relayedData.relayer = msg.sender;
193192

194193
// Not strictly necessary for functionality, only to satisfy IArbitrableV2
195-
emit DisputeRequest(arbitrator, disputeID, _params.externalDisputeID, _params.templateId);
194+
emit DisputeRequest(arbitrator, disputeID, _params.templateId);
196195

197196
emit CrossChainDisputeIncoming(
198197
arbitrator,
199198
_params.foreignChainID,
200199
_params.foreignArbitrable,
201200
_params.foreignDisputeID,
202201
disputeID,
203-
_params.externalDisputeID,
204202
_params.templateId
205203
);
206204
}

contracts/src/gateway/interfaces/IHomeGateway.sol

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@ interface IHomeGateway is IArbitrableV2, ISenderGateway {
1818
/// @param _arbitrable The address of the Arbitrable contract.
1919
/// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.
2020
/// @param _arbitratorDisputeID The identifier of the dispute in the Arbitrator contract.
21-
/// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.
2221
event CrossChainDisputeIncoming(
2322
IArbitratorV2 _arbitrator,
2423
uint256 _arbitrableChainId,
2524
address indexed _arbitrable,
2625
uint256 indexed _arbitrableDisputeID,
2726
uint256 indexed _arbitratorDisputeID,
28-
uint256 _externalDisputeID,
2927
uint256 _templateId
3028
);
3129

@@ -39,7 +37,6 @@ interface IHomeGateway is IArbitrableV2, ISenderGateway {
3937
uint256 foreignChainID;
4038
address foreignArbitrable;
4139
uint256 foreignDisputeID;
42-
uint256 externalDisputeID;
4340
uint256 templateId;
4441
uint256 choices;
4542
bytes extraData;

0 commit comments

Comments
 (0)