Skip to content

Commit

Permalink
fix(t2cr): track if appeal has been raised
Browse files Browse the repository at this point in the history
  • Loading branch information
eccentricexit committed Nov 24, 2018
1 parent 1c14e81 commit d19d1c8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion contracts/standard/permission/ArbitrableTokenList.sol
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ contract ArbitrableTokenList is PermissionInterface, Arbitrable {
uint challengeRewardBalance; // The amount of funds placed at stake for this token.
uint challengeReward; // The challengeReward of the token for the round.
address[3] parties; // Address of requester and challenger, if any.
bool appealed; // True if an appeal was raised.
Round[] rounds; // Tracks fees for each round of dispute and appeals.
}

Expand Down Expand Up @@ -361,6 +362,7 @@ contract ArbitrableTokenList is PermissionInterface, Arbitrable {
Token storage token = tokens[_tokenID];
require(token.lastAction > 0, "The specified token was never submitted");
Request storage request = token.requests[token.requests.length - 1];
require(!request.appealed, "An appeal was already raised.");
require(
arbitrator.disputeStatus(request.disputeID) == Arbitrator.DisputeStatus.Appealable,
"The ruling for the token is not appealable."
Expand Down Expand Up @@ -410,6 +412,7 @@ contract ArbitrableTokenList is PermissionInterface, Arbitrable {
arbitrator.disputeStatus(request.disputeID) == Arbitrator.DisputeStatus.Appealable,
"The ruling for the token is not appealable."
);
require(!request.appealed, "An appeal was already raised.");
Round storage round = request.rounds[request.rounds.length - 1];
require(
round.loserFullyFunded,
Expand Down Expand Up @@ -452,6 +455,7 @@ contract ArbitrableTokenList is PermissionInterface, Arbitrable {
// Raise appeal if both sides are fully funded.
if (round.paidFees[uint(winner)] >= totalRequiredFees) {
arbitrator.appeal.value(arbitrator.appealCost(request.disputeID, arbitratorExtraData))(request.disputeID, arbitratorExtraData);
request.appealed = true;

// Save the ruling. Used for reimbursing unused crowdfunding fees and withdrawing rewards.
round.ruling = RulingOption(arbitrator.currentRuling(request.disputeID));
Expand Down Expand Up @@ -595,7 +599,8 @@ contract ArbitrableTokenList is PermissionInterface, Arbitrable {
Token storage token = tokens[_tokenID];
require(token.lastAction > 0, "The specified token was never submitted.");
Request storage request = token.requests[token.requests.length - 1];
require(request.disputed, "The request is not disputed");
require(request.disputed, "The request is not disputed.");
require(!request.appealed, "Request already appealed.");
emit Evidence(arbitrator, request.disputeID, msg.sender, _evidence);
}

Expand Down

0 comments on commit d19d1c8

Please sign in to comment.