Skip to content

Commit 7a4dd82

Browse files
Merge pull request #316 from kleros/review/linguo
review: Matt's linguo review
2 parents 8be2ce9 + fc6c159 commit 7a4dd82

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

contracts/standard/arbitration/Linguo.sol

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/**
22
* @authors: [@unknownunknown1]
3-
* @reviewers: [@ferittuncer*, @clesaege*, @satello*, @hbarcelos]
3+
* @reviewers: [@ferittuncer*, @clesaege*, @satello*, @hbarcelos, @mtsalenc]
44
* @auditors: []
55
* @bounties: []
66
* @deployments: []
77
*/
88

99
/* solium-disable security/no-block-members */
1010
/* solium-disable max-len*/
11-
pragma solidity ^0.4.24;
11+
pragma solidity ^0.4.26;
1212

1313
import "./Arbitrable.sol";
1414
import "../../libraries/CappedMath.sol";
@@ -81,8 +81,8 @@ contract Linguo is Arbitrable {
8181
event TaskCreated(uint indexed _taskID, address indexed _requester, uint _timestamp);
8282

8383
/** @dev To be emitted when a translator assigns the task to himself.
84-
* @param _taskID The ID of the newly created task.
85-
* @param _translator The address that assigned to the task.
84+
* @param _taskID The ID of the assigned task.
85+
* @param _translator The address that was assigned to the task.
8686
* @param _price The task price at the moment it was assigned.
8787
* @param _timestamp When the task was assigned.
8888
*/
@@ -110,9 +110,9 @@ contract Linguo is Arbitrable {
110110
*/
111111
event TaskResolved(uint indexed _taskID, string _reason, uint _timestamp);
112112

113-
/** @dev To be emitted when one of the parties successfully paid its appeal fees.
113+
/** @dev To be emitted when the appeal fees of one of the parties are fully funded.
114114
* @param _taskID The ID of the respective task.
115-
* @param _party The party that paid appeal fees.
115+
* @param _party The party that is fully funded.
116116
*/
117117
event HasPaidAppealFee(uint indexed _taskID, Party _party);
118118

@@ -180,21 +180,21 @@ contract Linguo is Arbitrable {
180180
challengeMultiplier = _challengeMultiplier;
181181
}
182182

183-
/** @dev Changes the percentage of arbitration fees that must be paid by parties if there was no winner and loser in previous round.
183+
/** @dev Changes the percentage of arbitration fees that must be paid by parties as a fee stake if there was no winner and loser in the previous round.
184184
* @param _sharedStakeMultiplier A new value of the multiplier of the appeal cost in case when there is no winner/loser in previous round. In basis point.
185185
*/
186186
function changeSharedStakeMultiplier(uint _sharedStakeMultiplier) public onlyGovernor {
187187
sharedStakeMultiplier = _sharedStakeMultiplier;
188188
}
189189

190-
/** @dev Changes the percentage of arbitration fees that must be paid by the party that won the previous round.
190+
/** @dev Changes the percentage of arbitration fees that must be paid as a fee stake by the party that won the previous round.
191191
* @param _winnerStakeMultiplier A new value of the multiplier of the appeal cost that the winner of the previous round has to pay. In basis points.
192192
*/
193193
function changeWinnerStakeMultiplier(uint _winnerStakeMultiplier) public onlyGovernor {
194194
winnerStakeMultiplier = _winnerStakeMultiplier;
195195
}
196196

197-
/** @dev Changes the percentage of arbitration fees that must be paid by the party that lost the previous round.
197+
/** @dev Changes the percentage of arbitration fees that must be paid as a fee stake by the party that lost the previous round.
198198
* @param _loserStakeMultiplier A new value of the multiplier of the appeal cost that the party that lost the previous round has to pay. In basis points.
199199
*/
200200
function changeLoserStakeMultiplier(uint _loserStakeMultiplier) public onlyGovernor {
@@ -242,10 +242,10 @@ contract Linguo is Arbitrable {
242242

243243
uint price = task.minPrice + (task.maxPrice - task.minPrice) * (now - task.lastInteraction) / task.submissionTimeout;
244244
uint arbitrationCost = arbitrator.arbitrationCost(arbitratorExtraData);
245-
uint deposit = arbitrationCost.addCap((translationMultiplier.mulCap(price)) / MULTIPLIER_DIVISOR);
245+
uint translatorDeposit = arbitrationCost.addCap((translationMultiplier.mulCap(price)) / MULTIPLIER_DIVISOR);
246246

247247
require(task.status == Status.Created, "Task has already been assigned or reimbursed.");
248-
require(msg.value >= deposit, "Not enough ETH to reach the required deposit value.");
248+
require(msg.value >= translatorDeposit, "Not enough ETH to reach the required deposit value.");
249249

250250
task.parties[uint(Party.Translator)] = msg.sender;
251251
task.status = Status.Assigned;
@@ -254,9 +254,9 @@ contract Linguo is Arbitrable {
254254
task.requester.send(remainder);
255255
// Update requester's deposit since we reimbursed him the difference between maximal and actual price.
256256
task.requesterDeposit = price;
257-
task.sumDeposit += deposit;
257+
task.sumDeposit += translatorDeposit;
258258

259-
remainder = msg.value - deposit;
259+
remainder = msg.value - translatorDeposit;
260260
msg.sender.send(remainder);
261261

262262
emit TaskAssigned(_taskID, msg.sender, price, now);
@@ -463,8 +463,8 @@ contract Linguo is Arbitrable {
463463
withdrawFeesAndRewards(_beneficiary, _taskID, i);
464464
}
465465

466-
/** @dev Gives a ruling for a dispute. Must be called by the arbitrator.
467-
* The purpose of this function is to ensure that the address calling it has the right to rule on the contract.
466+
/** @dev Gives a ruling for a dispute. Can only be called by the arbitrator.
467+
* The purpose of this function is to ensure that the address calling it has the right to rule on the contract and to invert the ruling in the case a party loses from lack of appeal fees funding.
468468
* @param _disputeID ID of the dispute in the Arbitrator contract.
469469
* @param _ruling Ruling given by the arbitrator. Note that 0 is reserved for "Refuse to arbitrate".
470470
*/

0 commit comments

Comments
 (0)