Skip to content

Commit 4ee0bf8

Browse files
fix(Curate): evidenceGroup V1 parity
1 parent a2306b9 commit 4ee0bf8

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

contracts/src/CurateV2.sol

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ contract Curate is IArbitrableV2 {
122122

123123
/// @dev Emitted when someone submits a request.
124124
/// @param _itemID The ID of the affected item.
125-
event RequestSubmitted(bytes32 indexed _itemID);
125+
/// @param _localDisputeID Unique dispute identifier within this contract.
126+
event RequestSubmitted(bytes32 indexed _itemID, uint256 _localDisputeID);
126127

127128
/// @dev Emitted when the address of the connected Curate contract is set. The Curate is an instance of the Curate contract where each item is the address of a Curate contract related to this one.
128129
/// @param _connectedTCR The address of the connected Curate. TODO: change TCR mentions.
@@ -348,7 +349,7 @@ contract Curate is IArbitrableV2 {
348349
request.arbitrationParamsIndex = uint24(arbitrationParamsIndex);
349350
request.requester = payable(msg.sender);
350351

351-
emit RequestSubmitted(itemID);
352+
emit RequestSubmitted(itemID, getLocalDisputeID(itemID, item.requestCount - 1));
352353

353354
if (msg.value > totalCost) {
354355
payable(msg.sender).send(msg.value - totalCost);
@@ -379,7 +380,7 @@ contract Curate is IArbitrableV2 {
379380
request.requester = payable(msg.sender);
380381
request.requestType = RequestType.Clearing;
381382

382-
emit RequestSubmitted(_itemID);
383+
emit RequestSubmitted(_itemID, getLocalDisputeID(_itemID, item.requestCount - 1));
383384

384385
if (msg.value > totalCost) {
385386
payable(msg.sender).send(msg.value - totalCost);
@@ -431,8 +432,7 @@ contract Curate is IArbitrableV2 {
431432
uint256 templateId = request.requestType == RequestType.Registration
432433
? templateIdRegistration
433434
: templateIdRemoval;
434-
uint256 localDisputeID = uint256(keccak256(abi.encodePacked(_itemID, lastRequestIndex)));
435-
emit DisputeRequest(arbitrator, disputeData.disputeID, localDisputeID, templateId, "");
435+
emit DisputeRequest(arbitrator, disputeData.disputeID, getLocalDisputeID(_itemID, lastRequestIndex), templateId, "");
436436

437437
if (msg.value > totalCost) {
438438
payable(msg.sender).send(msg.value - totalCost);
@@ -528,6 +528,14 @@ contract Curate is IArbitrableV2 {
528528
// * Public Views * //
529529
// ************************************* //
530530

531+
/// @notice Gets the local dispute ID for a given item and request.
532+
/// @param _itemID The ID of the item.
533+
/// @param _requestID The ID of the request.
534+
/// @return Local dispute ID.
535+
function getLocalDisputeID(bytes32 _itemID, uint256 _requestID) public pure returns (uint256) {
536+
return uint256(keccak256(abi.encodePacked(_itemID, _requestID)));
537+
}
538+
531539
/// @notice Gets the arbitrator for new requests.
532540
/// @dev Gets the latest value in arbitrationParamsChanges.
533541
/// @return The arbitrator address.

0 commit comments

Comments
 (0)