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/Linguo.sol
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,7 @@ contract Linguo is Arbitrable {
25
25
using CappedMathforuint;
26
26
27
27
/* *** Contract variables *** */
28
+
uint8public constant VERSION_ID =0; // Value that represents the version of the contract. The value is incremented each time the new version is deployed. Range for LinguoETH: 0-127, LinguoToken: 128-255.
28
29
uintpublic constant MULTIPLIER_DIVISOR =10000; // Divisor parameter for multipliers.
29
30
uintconstant NOT_PAYABLE_VALUE = (2**256-2)/2; // A value depositor won't be able to pay.
function getReserves() publicviewreturns (uint112_reserve0, uint112_reserve1, uint32_blockTimestampLast);
20
+
21
+
}
22
+
17
23
/** @title LinguoToken
18
24
* Linguo is a decentralized platform where anyone can submit a document for translation and have it translated by freelancers.
19
25
* It has no platform fees and disputes about translation quality are handled by Kleros jurors.
@@ -27,6 +33,7 @@ contract LinguoToken is Arbitrable {
27
33
using CappedMathforuint;
28
34
29
35
/* *** Contract variables *** */
36
+
uint8public constant VERSION_ID =128; // Value that represents the version of the contract. The value is incremented each time the new version is deployed. Range for LinguoToken: 128-255, LinguoETH: 0-127.
30
37
uintpublic constant MULTIPLIER_DIVISOR =10000; // Divisor parameter for multipliers.
31
38
uintconstant NOT_PAYABLE_VALUE = (2**256-2)/2; // A value depositor won't be able to pay.
32
39
@@ -63,10 +70,12 @@ contract LinguoToken is Arbitrable {
63
70
mapping(address=>uint[3]) contributions; // Maps contributors to their contributions for each side.
64
71
}
65
72
73
+
ERC20public WETH; // Address of the wETH token contract. It's required for token -> ETH conversion.
74
+
addresspublic uniswapFactory; // Address of the UniswapPair factory. It's required for token -> ETH conversion.
75
+
66
76
addresspublic governor; // The governor of the contract.
67
77
uintpublic reviewTimeout; // Time in seconds, during which the submitted translation can be challenged.
68
-
uintpublic translatorBaseDeposit; // The base deposit a translator must pay to self-assign a task, in wei.
69
-
uintpublic challengerBaseDeposit; // The base deposit a challenger must pay to challenge a translation, in wei.
78
+
uintpublic translationMultiplier; // Multiplier for calculating the value of the deposit translator must pay to self-assign a task.
70
79
71
80
// All multipliers below are in basis points.
72
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").
@@ -129,27 +138,30 @@ contract LinguoToken is Arbitrable {
129
138
/** @dev Constructor.
130
139
* @param _arbitrator The arbitrator of the contract.
131
140
* @param _arbitratorExtraData Extra data for the arbitrator.
141
+
* @param _WETH Address of the WETH token contract.
142
+
* @param _uniswapFactory Address of the UniswapPair factory contract.
132
143
* @param _reviewTimeout Time in seconds during which a translation can be challenged.
133
-
* @param _translatorBaseDeposit The base deposit that must be paid in order to self-assign the task, in wei.
134
-
* @param _challengerBaseDeposit The base deposit that must be paid in order to challenge the translation, in wei.
144
+
* @param _translationMultiplier Multiplier for calculating translator's deposit. In basis points.
135
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.
136
146
* @param _winnerStakeMultiplier Multiplier of the appeal cost that the winner has to pay for a round. In basis points.
137
147
* @param _loserStakeMultiplier Multiplier of the appeal cost that the loser has to pay for a round. In basis points.
@@ -173,18 +185,11 @@ contract LinguoToken is Arbitrable {
173
185
reviewTimeout = _reviewTimeout;
174
186
}
175
187
176
-
/** @dev Changes the base deposit for translator.
177
-
* @param _translatorBaseDeposit A new value of the base deposit required for self-assigning the task, in wei.
188
+
/** @dev Changes the multiplier for translator's deposit.
189
+
* @param _translationMultiplier A new value of the multiplier for calculating translator's deposit. In basis points.
178
190
*/
179
-
function changeTranslatorBaseDeposit(uint_translatorBaseDeposit) public onlyGovernor {
180
-
translatorBaseDeposit = _translatorBaseDeposit;
181
-
}
182
-
183
-
/** @dev Changes the base deposit for challenger.
184
-
* @param _challengerBaseDeposit A new value of the base deposit required for challenging, in wei.
185
-
*/
186
-
function changeChallengerBaseDeposit(uint_challengerBaseDeposit) public onlyGovernor {
187
-
challengerBaseDeposit = _challengerBaseDeposit;
191
+
function changeTranslationMultiplier(uint_translationMultiplier) public onlyGovernor {
192
+
translationMultiplier = _translationMultiplier;
188
193
}
189
194
190
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.
@@ -253,8 +258,10 @@ contract LinguoToken is Arbitrable {
253
258
require(now- task.lastInteraction <= task.submissionTimeout, "The deadline has already passed.");
require(task.status == Status.Created, "Task has already been assigned or reimbursed.");
260
267
require(msg.value>= translatorDeposit, "Not enough ETH to reach the required deposit value.");
@@ -264,7 +271,7 @@ contract LinguoToken is Arbitrable {
264
271
265
272
// Update requester's deposit since we reimbursed him the difference between maximal and actual price.
266
273
task.requesterDeposit = price;
267
-
task.sumDeposit += translatorDeposit;
274
+
task.sumDeposit = translatorDeposit;
268
275
269
276
uint remainder =msg.value- translatorDeposit;
270
277
msg.sender.send(remainder);
@@ -301,7 +308,7 @@ contract LinguoToken is Arbitrable {
301
308
uint sumDeposit = task.sumDeposit;
302
309
task.requesterDeposit =0;
303
310
task.sumDeposit =0;
304
-
// 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.
311
+
// Requester gets his deposit back and also the deposit of the translator, if there was one.
305
312
task.requester.send(sumDeposit);
306
313
require(task.token.transfer(task.requester, requesterDeposit), "The token transfer was unsuccessful.");
307
314
@@ -316,7 +323,7 @@ contract LinguoToken is Arbitrable {
316
323
require(task.status == Status.AwaitingReview, "The task is in the wrong status.");
317
324
require(now- task.lastInteraction > reviewTimeout, "The review phase hasn't passed yet.");
318
325
task.status = Status.Resolved;
319
-
// 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