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
@@ -53,6 +60,7 @@ contract LinguoToken is Arbitrable {
53
60
uint disputeID; // The ID of the dispute created in arbitrator contract.
54
61
Round[] rounds; // Tracks each appeal round of a dispute.
55
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.
56
64
}
57
65
58
66
// Rounds are only used in appeal funding.
@@ -63,10 +71,13 @@ contract LinguoToken is Arbitrable {
63
71
mapping(address=>uint[3]) contributions; // Maps contributors to their contributions for each side.
64
72
}
65
73
74
+
ERC20public WETH; // Address of the wETH token contract. It's required for token -> ETH conversion.
75
+
addresspublic uniswapFactory; // Address of the UniswapPair factory. It's required for token -> ETH conversion.
76
+
66
77
addresspublic governor; // The governor of the contract.
67
78
uintpublic reviewTimeout; // Time in seconds, during which the submitted translation can be challenged.
68
-
uintpublictranslatorBaseDeposit; // The base deposit a translator must pay to self-assign a task, in wei.
69
-
uintpublicchallengerBaseDeposit; // The base deposit a challenger must pay to challenge a translation, in wei.
79
+
uintpublictranslationMultiplier; // Multiplier for calculating the value of the deposit translator must pay to self-assign a task.
80
+
uintpublicchallengeMultiplier; // Multiplier for calculating the value of the deposit challenger must pay to challenge a translation.
70
81
71
82
// All multipliers below are in basis points.
72
83
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 +140,33 @@ contract LinguoToken is Arbitrable {
129
140
/** @dev Constructor.
130
141
* @param _arbitrator The arbitrator of the contract.
131
142
* @param _arbitratorExtraData Extra data for the arbitrator.
143
+
* @param _WETH Address of the WETH token contract
144
+
* @param _uniswapFactory Address of the UniswapPair factory contract.
132
145
* @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.
146
+
* @param _translationMultiplier Multiplier for calculating translator's deposit. In basis points.
147
+
* @param _challengeMultiplier Multiplier for calculating challenger's deposit. In basis points.
135
148
* @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
149
* @param _winnerStakeMultiplier Multiplier of the appeal cost that the winner has to pay for a round. In basis points.
137
150
* @param _loserStakeMultiplier Multiplier of the appeal cost that the loser has to pay for a round. In basis points.
@@ -173,18 +190,18 @@ contract LinguoToken is Arbitrable {
173
190
reviewTimeout = _reviewTimeout;
174
191
}
175
192
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.
193
+
/** @dev Changes the multiplier for translator's deposit.
194
+
* @param _translationMultiplier A new value of the multiplier for calculating translator's deposit. In basis points.
178
195
*/
179
-
functionchangeTranslatorBaseDeposit(uint_translatorBaseDeposit) public onlyGovernor {
180
-
translatorBaseDeposit=_translatorBaseDeposit;
196
+
functionchangeTranslationMultiplier(uint_translationMultiplier) public onlyGovernor {
197
+
translationMultiplier=_translationMultiplier;
181
198
}
182
199
183
-
/** @dev Changes the base deposit for challenger.
184
-
* @param _challengerBaseDeposit A new value of the base deposit required for challenging, in wei.
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.
185
202
*/
186
-
functionchangeChallengerBaseDeposit(uint_challengerBaseDeposit) public onlyGovernor {
187
-
challengerBaseDeposit=_challengerBaseDeposit;
203
+
functionchangeChallengeMultiplier(uint_challengeMultiplier) public onlyGovernor {
204
+
challengeMultiplier=_challengeMultiplier;
188
205
}
189
206
190
207
/** @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 +270,10 @@ contract LinguoToken is Arbitrable {
253
270
require(now- task.lastInteraction <= task.submissionTimeout, "The deadline has already passed.");
0 commit comments