You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: contracts/standard/arbitration/LinguoToken.sol
+21-50Lines changed: 21 additions & 50 deletions
Original file line number
Diff line number
Diff line change
@@ -55,12 +55,11 @@ contract LinguoToken is Arbitrable {
55
55
uint lastInteraction; // The time of the last action performed on the task. Note that lastInteraction is updated only during timeout-related actions such as the creation of the task and the submission of the translation.
56
56
address requester; // The party requesting the translation.
57
57
uint requesterDeposit; // The deposit requester makes when creating the task. Once a task is assigned this deposit will be partially reimbursed and its value will be replaced by task price.
58
-
uintsumDeposit; // The sum of the deposits of translator and challenger, if any. This value (minus arbitration fees) will be paid to the party that wins the dispute.
58
+
uinttranslatorDeposit; // The deposit of the translator, if any. This value will be paid/reimbursed to the party that wins the dispute.
59
59
address[3] parties; // Translator and challenger of the task.
60
60
uint disputeID; // The ID of the dispute created in arbitrator contract.
61
61
Round[] rounds; // Tracks each appeal round of a dispute.
62
62
uint ruling; // Ruling given to the dispute of the task by the arbitrator.
63
-
uint priceETH; // Price of the task, converted into ETH. We store it for challenger, to make sure the token price for him doesn't differ from translator.
64
63
}
65
64
66
65
// Rounds are only used in appeal funding.
@@ -77,7 +76,6 @@ contract LinguoToken is Arbitrable {
77
76
addresspublic governor; // The governor of the contract.
78
77
uintpublic reviewTimeout; // Time in seconds, during which the submitted translation can be challenged.
79
78
uintpublic translationMultiplier; // Multiplier for calculating the value of the deposit translator must pay to self-assign a task.
80
-
uintpublic challengeMultiplier; // Multiplier for calculating the value of the deposit challenger must pay to challenge a translation.
81
79
82
80
// All multipliers below are in basis points.
83
81
uintpublic sharedStakeMultiplier; // Multiplier for calculating the appeal fee that must be paid by submitter in the case where there is no winner or loser (e.g. when the arbitrator ruled "refuse to arbitrate").
@@ -144,7 +142,6 @@ contract LinguoToken is Arbitrable {
144
142
* @param _uniswapFactory Address of the UniswapPair factory contract.
145
143
* @param _reviewTimeout Time in seconds during which a translation can be challenged.
146
144
* @param _translationMultiplier Multiplier for calculating translator's deposit. In basis points.
147
-
* @param _challengeMultiplier Multiplier for calculating challenger's deposit. In basis points.
148
145
* @param _sharedStakeMultiplier Multiplier of the appeal cost that submitter must pay for a round when there is no winner/loser in the previous round. In basis points.
149
146
* @param _winnerStakeMultiplier Multiplier of the appeal cost that the winner has to pay for a round. In basis points.
150
147
* @param _loserStakeMultiplier Multiplier of the appeal cost that the loser has to pay for a round. In basis points.
@@ -156,7 +153,6 @@ contract LinguoToken is Arbitrable {
156
153
address_uniswapFactory,
157
154
uint_reviewTimeout,
158
155
uint_translationMultiplier,
159
-
uint_challengeMultiplier,
160
156
uint_sharedStakeMultiplier,
161
157
uint_winnerStakeMultiplier,
162
158
uint_loserStakeMultiplier
@@ -166,7 +162,6 @@ contract LinguoToken is Arbitrable {
166
162
uniswapFactory = _uniswapFactory;
167
163
reviewTimeout = _reviewTimeout;
168
164
translationMultiplier = _translationMultiplier;
169
-
challengeMultiplier = _challengeMultiplier;
170
165
sharedStakeMultiplier = _sharedStakeMultiplier;
171
166
winnerStakeMultiplier = _winnerStakeMultiplier;
172
167
loserStakeMultiplier = _loserStakeMultiplier;
@@ -197,13 +192,6 @@ contract LinguoToken is Arbitrable {
197
192
translationMultiplier = _translationMultiplier;
198
193
}
199
194
200
-
/** @dev Changes the multiplier for challenger's deposit.
201
-
* @param _challengeMultiplier A new value of the multiplier for calculating challenger's deposit. In basis points.
202
-
*/
203
-
function changeChallengeMultiplier(uint_challengeMultiplier) public onlyGovernor {
204
-
challengeMultiplier = _challengeMultiplier;
205
-
}
206
-
207
195
/** @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.
208
196
* @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.
209
197
*/
@@ -283,9 +271,7 @@ contract LinguoToken is Arbitrable {
283
271
284
272
// Update requester's deposit since we reimbursed him the difference between maximal and actual price.
285
273
task.requesterDeposit = price;
286
-
287
-
task.priceETH = priceETH;
288
-
task.sumDeposit += translatorDeposit;
274
+
task.translatorDeposit = translatorDeposit;
289
275
290
276
uint remainder =msg.value- translatorDeposit;
291
277
msg.sender.send(remainder);
@@ -319,11 +305,11 @@ contract LinguoToken is Arbitrable {
319
305
require(now- task.lastInteraction > task.submissionTimeout, "Can't reimburse if the deadline hasn't passed yet.");
320
306
task.status = Status.Resolved;
321
307
uint requesterDeposit = task.requesterDeposit;
322
-
uintsumDeposit= task.sumDeposit;
308
+
uinttranslatorDeposit= task.translatorDeposit;
323
309
task.requesterDeposit =0;
324
-
task.sumDeposit=0;
325
-
// Requester gets his deposit back and also the deposit of the translator, if there was one. Note that sumDeposit can't contain challenger's deposit until the task is in DisputeCreated status.
326
-
task.requester.send(sumDeposit);
310
+
task.translatorDeposit=0;
311
+
// Requester gets his deposit back and also the deposit of the translator, if there was one.
312
+
task.requester.send(translatorDeposit);
327
313
require(task.token.transfer(task.requester, requesterDeposit), "The token transfer was unsuccessful.");
@@ -337,13 +323,13 @@ contract LinguoToken is Arbitrable {
337
323
require(task.status == Status.AwaitingReview, "The task is in the wrong status.");
338
324
require(now- task.lastInteraction > reviewTimeout, "The review phase hasn't passed yet.");
339
325
task.status = Status.Resolved;
340
-
// Translator gets the price of the task and his deposit back. Note that sumDeposit can't contain challenger's deposit until the task is in DisputeCreated status.
326
+
// Translator gets the price of the task and his deposit back.
0 commit comments