Skip to content

Commit d66cf9d

Browse files
committed
refactor: moved crosschain event to the gateway interface
1 parent 4078d04 commit d66cf9d

File tree

3 files changed

+38
-20
lines changed

3 files changed

+38
-20
lines changed

contracts/src/arbitration/IArbitrableV2.sol

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,6 @@ interface IArbitrableV2 {
3030
string _templateUri
3131
);
3232

33-
/// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.
34-
/// @param _arbitrator The arbitrator of the contract.
35-
/// @param _arbitrableChainId The chain identifier where the Arbitrable contract is deployed.
36-
/// @param _arbitrable The address of the Arbitrable contract.
37-
/// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.
38-
/// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.
39-
/// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.
40-
/// @param _templateUri IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId.
41-
event CrossChainDisputeRequest(
42-
IArbitratorV2 indexed _arbitrator,
43-
uint256 _arbitrableChainId,
44-
address indexed _arbitrable,
45-
uint256 indexed _arbitrableDisputeID,
46-
uint256 _externalDisputeID,
47-
uint256 _templateId,
48-
string _templateUri
49-
);
50-
5133
/// @dev To be raised when a ruling is given.
5234
/// @param _arbitrator The arbitrator giving the ruling.
5335
/// @param _disputeID The identifier of the dispute in the Arbitrator contract.

contracts/src/gateway/interfaces/IForeignGateway.sol

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,29 @@ import "../../arbitration/IArbitrator.sol";
1212
import "@kleros/vea-contracts/src/interfaces/gateways/IReceiverGateway.sol";
1313

1414
interface IForeignGateway is IArbitrator, IReceiverGateway {
15+
/// @dev To be emitted when a dispute is sent to the IHomeGateway.
16+
/// @param _arbitrator The arbitrator of the contract.
17+
/// @param _arbitrableChainId The chain identifier where the Arbitrable contract is deployed.
18+
/// @param _arbitrable The address of the Arbitrable contract.
19+
/// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.
20+
/// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.
21+
/// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.
22+
/// @param _templateUri IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId.
23+
event CrossChainDisputeOutgoing(
24+
IArbitratorV2 indexed _arbitrator,
25+
uint256 _arbitrableChainId,
26+
address indexed _arbitrable,
27+
uint256 indexed _arbitrableDisputeID,
28+
uint256 _externalDisputeID,
29+
uint256 _templateId,
30+
string _templateUri
31+
);
32+
1533
/// Relay the rule call from the home gateway to the arbitrable.
1634
function relayRule(address _messageSender, bytes32 _disputeHash, uint256 _ruling, address _forwarder) external;
1735

1836
function withdrawFees(bytes32 _disputeHash) external;
1937

20-
// For cross-chain Evidence standard
2138
function disputeHashToForeignID(bytes32 _disputeHash) external view returns (uint256);
2239

2340
function createDisputeERC20(

contracts/src/gateway/interfaces/IHomeGateway.sol

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,24 @@ import "../../evidence/IMetaEvidence.sol";
1313
import "@kleros/vea-contracts/src/interfaces/gateways/ISenderGateway.sol";
1414

1515
interface IHomeGateway is IArbitrable, IMetaEvidence, ISenderGateway {
16+
/// @dev To be emitted when a dispute is received from the IForeignGateway.
17+
/// @param _arbitrator The arbitrator of the contract.
18+
/// @param _arbitrableChainId The chain identifier where the Arbitrable contract is deployed.
19+
/// @param _arbitrable The address of the Arbitrable contract.
20+
/// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.
21+
/// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.
22+
/// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.
23+
/// @param _templateUri IPFS path to the dispute template starting with '/ipfs/'. Should not be used with _templateId.
24+
event CrossChainDisputeIncoming(
25+
IArbitratorV2 indexed _arbitrator,
26+
uint256 _arbitrableChainId,
27+
address indexed _arbitrable,
28+
uint256 indexed _arbitrableDisputeID,
29+
uint256 _externalDisputeID,
30+
uint256 _templateId,
31+
string _templateUri
32+
);
33+
1634
/// @dev Provide the same parameters as on the foreignChain while creating a dispute. Providing incorrect parameters will create a different hash than on the foreignChain and will not affect the actual dispute/arbitrable's ruling.
1735
/// @param _foreignChainID foreignChainId
1836
/// @param _foreignBlockHash foreignBlockHash
@@ -29,7 +47,8 @@ interface IHomeGateway is IArbitrable, IMetaEvidence, ISenderGateway {
2947
address _arbitrable
3048
) external payable;
3149

32-
/// @dev Looks up the local home disputeID for a disputeHash. For cross-chain Evidence standard.
50+
/// @dev Looks up the local home disputeID for a disputeHash.
3351
/// @param _disputeHash dispute hash
52+
/// @return disputeID dispute identifier on the home chain
3453
function disputeHashToHomeID(bytes32 _disputeHash) external view returns (uint256);
3554
}

0 commit comments

Comments
 (0)