Skip to content

Commit

Permalink
refactor(t2cr): clarify code
Browse files Browse the repository at this point in the history
  • Loading branch information
eccentricexit committed Nov 22, 2018
1 parent 9f6fb23 commit 356babc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions contracts/standard/permission/ArbitrableTokenList.sol
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ contract ArbitrableTokenList is PermissionInterface, Arbitrable {

token.lastAction = now;

// Create dispute if both sides are fully funded.
uint arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData);
if (round.paidFees[uint(Party.Requester)] >= arbitrationCost && round.paidFees[uint(Party.Challenger)] >= arbitrationCost) {
request.disputeID = arbitrator.createDispute.value(arbitrationCost)(2, arbitratorExtraData);
Expand Down Expand Up @@ -370,7 +371,7 @@ contract ArbitrableTokenList is PermissionInterface, Arbitrable {
Token storage token = tokens[_tokenID];
Request storage request = token.requests[token.requests.length - 1];
require(token.lastAction + timeToChallenge > now, "The time to challenge has not passed yet.");
require(!request.disputed, "The specified agreement is disputed.");
require(!request.disputed, "The specified token is disputed.");

if (token.status == TokenStatus.RegistrationRequested)
token.status = TokenStatus.Registered;
Expand Down Expand Up @@ -610,7 +611,7 @@ contract ArbitrableTokenList is PermissionInterface, Arbitrable {
pure
returns(uint, uint remainder)
{
if(_available < _requiredAmount)
if(_requiredAmount > _available)
return (_available, 0); // Take whatever is available.

remainder = _available - _requiredAmount;
Expand Down

0 comments on commit 356babc

Please sign in to comment.