Skip to content

Commit 7b99d1a

Browse files
committed
feat(Evidence): evidence submission from the arbitration side
Required splitting the IEvidence interface into 2: the MetaEvidence and Dispute events have been moved to an IMetaEvidence interface which extends IEvidence. Because IMetaEvidence is relevant only to the Arbitrable side but not IEvidence.
1 parent d1b32b6 commit 7b99d1a

File tree

7 files changed

+59
-31
lines changed

7 files changed

+59
-31
lines changed

contracts/src/arbitration/dispute-kits/DisputeKitClassic.sol

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ pragma solidity ^0.8;
1212

1313
import "./BaseDisputeKit.sol";
1414
import "../../rng/RNG.sol";
15+
import "../../evidence/IEvidence.sol";
1516

1617
/**
1718
* @title DisputeKitClassic
@@ -23,7 +24,7 @@ import "../../rng/RNG.sol";
2324
* TODO:
2425
* - phase management: Generating->Drawing->Resolving->Generating in coordination with KlerosCore to freeze staking.
2526
*/
26-
contract DisputeKitClassic is BaseDisputeKit {
27+
contract DisputeKitClassic is BaseDisputeKit, IEvidence {
2728
// ************************************* //
2829
// * Structs * //
2930
// ************************************* //
@@ -384,6 +385,14 @@ contract DisputeKitClassic is BaseDisputeKit {
384385
}
385386
}
386387

388+
/** @dev Submits evidence.
389+
* @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to. It's the submitter responsability to submit the right evidence group ID.
390+
* @param _evidence IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'.
391+
*/
392+
function submitEvidence(uint256 _evidenceGroupID, string calldata _evidence) external {
393+
emit Evidence(core, _evidenceGroupID, msg.sender, _evidence);
394+
}
395+
387396
// ************************************* //
388397
// * Public Views * //
389398
// ************************************* //

contracts/src/arbitration/dispute-kits/DisputeKitSybilResistant.sol

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
pragma solidity ^0.8;
1212

1313
import "./BaseDisputeKit.sol";
14-
1514
import "../../rng/RNG.sol";
15+
import "../../evidence/IEvidence.sol";
1616

1717
interface IProofOfHumanity {
1818
/** @dev Return true if the submission is registered and not expired.
@@ -30,7 +30,7 @@ interface IProofOfHumanity {
3030
* - an incentive system: equal split between coherent votes,
3131
* - an appeal system: fund 2 choices only, vote on any choice.
3232
*/
33-
contract DisputeKitSybilResistant is BaseDisputeKit {
33+
contract DisputeKitSybilResistant is BaseDisputeKit, IEvidence {
3434
// ************************************* //
3535
// * Structs * //
3636
// ************************************* //
@@ -396,6 +396,14 @@ contract DisputeKitSybilResistant is BaseDisputeKit {
396396
}
397397
}
398398

399+
/** @dev Submits evidence.
400+
* @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to. It's the submitter responsability to submit the right evidence group ID.
401+
* @param _evidence IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'.
402+
*/
403+
function submitEvidence(uint256 _evidenceGroupID, string calldata _evidence) external {
404+
emit Evidence(core, _evidenceGroupID, msg.sender, _evidence);
405+
}
406+
399407
// ************************************* //
400408
// * Public Views * //
401409
// ************************************* //

contracts/src/evidence/EvidenceModule.sol

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,17 @@ import "./IEvidence.sol";
2020
import "../arbitration/IArbitrator.sol";
2121

2222
contract EvidenceModule is IEvidence {
23-
IArbitrator private constant NULL_ARBITRATOR = IArbitrator(address(0x0));
23+
IArbitrator public arbitrator;
2424

25-
constructor() {}
25+
constructor(IArbitrator _arbitrator) {
26+
arbitrator = _arbitrator;
27+
}
2628

2729
/** @dev Submits evidence.
2830
* @param _evidenceGroupID Unique identifier of the evidence group the evidence belongs to. It's the submitter responsability to submit the right evidence group ID.
2931
* @param _evidence IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'.
3032
*/
3133
function submitEvidence(uint256 _evidenceGroupID, string calldata _evidence) external {
32-
emit Evidence(NULL_ARBITRATOR, _evidenceGroupID, msg.sender, _evidence);
34+
emit Evidence(arbitrator, _evidenceGroupID, msg.sender, _evidence);
3335
}
3436
}

contracts/src/evidence/IEvidence.sol

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@ import "../arbitration/IArbitrator.sol";
66
* ERC-1497: Evidence Standard
77
*/
88
interface IEvidence {
9-
/**
10-
* @dev To be emitted when meta-evidence is submitted.
11-
* @param _metaEvidenceID Unique identifier of meta-evidence.
12-
* @param _evidence IPFS path to metaevidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/metaevidence.json'
13-
*/
14-
event MetaEvidence(uint256 indexed _metaEvidenceID, string _evidence);
15-
169
/**
1710
* @dev To be raised when evidence is submitted. Should point to the resource (evidences are not to be stored on chain due to gas considerations).
1811
* @param _arbitrator The arbitrator of the contract.
@@ -26,18 +19,4 @@ interface IEvidence {
2619
address indexed _party,
2720
string _evidence
2821
);
29-
30-
/**
31-
* @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.
32-
* @param _arbitrator The arbitrator of the contract.
33-
* @param _disputeID ID of the dispute in the Arbitrator contract.
34-
* @param _metaEvidenceID Unique identifier of meta-evidence.
35-
* @param _evidenceGroupID Unique identifier of the evidence group that is linked to this dispute.
36-
*/
37-
event Dispute(
38-
IArbitrator indexed _arbitrator,
39-
uint256 indexed _disputeID,
40-
uint256 _metaEvidenceID,
41-
uint256 _evidenceGroupID
42-
);
4322
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
pragma solidity ^0.8.0;
2+
3+
import "../arbitration/IArbitrator.sol";
4+
import "./IEvidence.sol";
5+
6+
/** @title IEvidence
7+
* ERC-1497: Evidence Standard
8+
*/
9+
interface IMetaEvidence is IEvidence {
10+
/**
11+
* @dev To be emitted when meta-evidence is submitted.
12+
* @param _metaEvidenceID Unique identifier of meta-evidence.
13+
* @param _evidence IPFS path to metaevidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/metaevidence.json'
14+
*/
15+
event MetaEvidence(uint256 indexed _metaEvidenceID, string _evidence);
16+
17+
/**
18+
* @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.
19+
* @param _arbitrator The arbitrator of the contract.
20+
* @param _disputeID ID of the dispute in the Arbitrator contract.
21+
* @param _metaEvidenceID Unique identifier of meta-evidence.
22+
* @param _evidenceGroupID Unique identifier of the evidence group that is linked to this dispute.
23+
*/
24+
event Dispute(
25+
IArbitrator indexed _arbitrator,
26+
uint256 indexed _disputeID,
27+
uint256 _metaEvidenceID,
28+
uint256 _evidenceGroupID
29+
);
30+
}

contracts/src/evidence/ModeratedEvidenceModule.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ pragma solidity ^0.8;
1818
// TODO: standard interfaces should be placed in a separated repo (?)
1919
import "../arbitration/IArbitrable.sol";
2020
import "../arbitration/IArbitrator.sol";
21-
import "./IEvidence.sol";
21+
import "./IMetaEvidence.sol";
2222
import "../libraries/CappedMath.sol";
2323

24-
contract ModeratedEvidenceModule is IArbitrable, IEvidence {
24+
contract ModeratedEvidenceModule is IArbitrable, IMetaEvidence {
2525
using CappedMath for uint256;
2626

2727
uint256 public constant AMOUNT_OF_CHOICES = 2;

contracts/src/gateway/interfaces/IHomeGateway.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
pragma solidity ^0.8.0;
44

55
import "../../arbitration/IArbitrable.sol";
6-
import "../../evidence/IEvidence.sol";
6+
import "../../evidence/IMetaEvidence.sol";
77

8-
interface IHomeGateway is IArbitrable, IEvidence {
8+
interface IHomeGateway is IArbitrable, IMetaEvidence {
99
function chainID() external view returns (uint256);
1010

1111
function relayCreateDispute(

0 commit comments

Comments
 (0)