Skip to content

Commit

Permalink
feat(t2cr): use one meta evidence object for each type of request
Browse files Browse the repository at this point in the history
  • Loading branch information
eccentricexit committed Jan 28, 2019
1 parent 5bd07a9 commit 81c5aa7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
11 changes: 8 additions & 3 deletions contracts/standard/permission/ArbitrableAddressList.sol
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ contract ArbitrableAddressList is PermissionInterface, Arbitrable {
* @dev Constructs the arbitrable token curated list.
* @param _arbitrator The chosen arbitrator.
* @param _arbitratorExtraData Extra data for the arbitrator contract.
* @param _metaEvidence The URI of the meta evidence object.
* @param _registrationMetaEvidence The URI of the meta evidence object for registration requests.
* @param _clearingMetaEvidence The URI of the meta evidence object for clearing requests.
* @param _governor The governor of this contract.
* @param _arbitrationFeesWaitingTime The maximum time to wait for arbitration fees if the dispute is raised.
* @param _challengeReward The amount in weis required to submit or a challenge a request.
Expand All @@ -200,7 +201,8 @@ contract ArbitrableAddressList is PermissionInterface, Arbitrable {
constructor(
Arbitrator _arbitrator,
bytes _arbitratorExtraData,
string _metaEvidence,
string _registrationMetaEvidence,
string _clearingMetaEvidence,
address _governor,
uint _arbitrationFeesWaitingTime,
uint _challengeReward,
Expand All @@ -209,7 +211,8 @@ contract ArbitrableAddressList is PermissionInterface, Arbitrable {
uint _winnerStakeMultiplier,
uint _loserStakeMultiplier
) Arbitrable(_arbitrator, _arbitratorExtraData) public {
emit MetaEvidence(0, _metaEvidence);
emit MetaEvidence(0, _registrationMetaEvidence);
emit MetaEvidence(1, _clearingMetaEvidence);
governor = _governor;
arbitrationFeesWaitingTime = _arbitrationFeesWaitingTime;
challengeReward = _challengeReward;
Expand Down Expand Up @@ -328,6 +331,7 @@ contract ArbitrableAddressList is PermissionInterface, Arbitrable {
request.disputeID = arbitrator.createDispute.value(arbitrationCost)(2, arbitratorExtraData);
disputeIDToAddress[request.disputeID] = _address;
request.disputed = true;
emit Dispute(arbitrator, request.disputeID, addr.status == AddressStatus.RegistrationRequested ? 0 : 1);

request.rounds.length++;
round.feeRewards -= arbitrationCost;
Expand Down Expand Up @@ -426,6 +430,7 @@ contract ArbitrableAddressList is PermissionInterface, Arbitrable {
request.disputeID = arbitrator.createDispute.value(cost)(2, arbitratorExtraData);
disputeIDToAddress[request.disputeID] = _address;
request.disputed = true;
emit Dispute(arbitrator, request.disputeID, addr.status == AddressStatus.RegistrationRequested ? 0 : 1);
} else {
// Later round, raise an appeal.
arbitrator.appeal.value(cost)(request.disputeID, arbitratorExtraData);
Expand Down
11 changes: 8 additions & 3 deletions contracts/standard/permission/ArbitrableTokenList.sol
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ contract ArbitrableTokenList is PermissionInterface, Arbitrable {
* @dev Constructs the arbitrable token curated list.
* @param _arbitrator The chosen arbitrator.
* @param _arbitratorExtraData Extra data for the arbitrator contract.
* @param _metaEvidence The URI of the meta evidence object.
* @param _registrationMetaEvidence The URI of the meta evidence object for registration requests.
* @param _clearingMetaEvidence The URI of the meta evidence object for clearing requests.
* @param _governor The governor of this contract.
* @param _arbitrationFeesWaitingTime The maximum time to wait for arbitration fees if the dispute is raised.
* @param _challengeReward The amount in weis required to submit or a challenge a request.
Expand All @@ -209,7 +210,8 @@ contract ArbitrableTokenList is PermissionInterface, Arbitrable {
constructor(
Arbitrator _arbitrator,
bytes _arbitratorExtraData,
string _metaEvidence,
string _registrationMetaEvidence,
string _clearingMetaEvidence,
address _governor,
uint _arbitrationFeesWaitingTime,
uint _challengeReward,
Expand All @@ -218,7 +220,8 @@ contract ArbitrableTokenList is PermissionInterface, Arbitrable {
uint _winnerStakeMultiplier,
uint _loserStakeMultiplier
) Arbitrable(_arbitrator, _arbitratorExtraData) public {
emit MetaEvidence(0, _metaEvidence);
emit MetaEvidence(0, _registrationMetaEvidence);
emit MetaEvidence(1, _clearingMetaEvidence);
governor = _governor;
arbitrationFeesWaitingTime = _arbitrationFeesWaitingTime;
challengeReward = _challengeReward;
Expand Down Expand Up @@ -365,6 +368,7 @@ contract ArbitrableTokenList is PermissionInterface, Arbitrable {
request.disputeID = arbitrator.createDispute.value(arbitrationCost)(2, arbitratorExtraData);
disputeIDToTokenID[request.disputeID] = _tokenID;
request.disputed = true;
emit Dispute(arbitrator, request.disputeID, token.status == TokenStatus.RegistrationRequested ? 0 : 1);

request.rounds.length++;
round.feeRewards -= arbitrationCost;
Expand Down Expand Up @@ -463,6 +467,7 @@ contract ArbitrableTokenList is PermissionInterface, Arbitrable {
request.disputeID = arbitrator.createDispute.value(cost)(2, arbitratorExtraData);
disputeIDToTokenID[request.disputeID] = _tokenID;
request.disputed = true;
emit Dispute(arbitrator, request.disputeID, token.status == TokenStatus.RegistrationRequested ? 0 : 1);
} else {
// Later round, raise an appeal.
arbitrator.appeal.value(cost)(request.disputeID, arbitratorExtraData);
Expand Down

0 comments on commit 81c5aa7

Please sign in to comment.