tx · 2qRzKZdmurowyBEXEwxVC2au5ZwaH61iEi2Ddcc7neey 3MxZ7YNAqigXR5jrgvpb48Uc6B29ouDzQyN: -0.03700000 Waves 2023.05.23 14:28 [2590562] smart account 3MxZ7YNAqigXR5jrgvpb48Uc6B29ouDzQyN > SELF 0.00000000 Waves
{ "type": 13, "id": "2qRzKZdmurowyBEXEwxVC2au5ZwaH61iEi2Ddcc7neey", "fee": 3700000, "feeAssetId": null, "timestamp": 1684841333903, "version": 2, "chainId": 84, "sender": "3MxZ7YNAqigXR5jrgvpb48Uc6B29ouDzQyN", "senderPublicKey": "HHCdafdi3D2htEYJw8cBoNYC8w76euLWKYENK4kanmGM", "proofs": [ "3SY3pentYxwdRKvQqC8s3iZQv6t51hULXeMj6s68NYThH7TL2ejBMBkRoWpVgtpCrwMTSzmpGUAybwWcQhD2ugbn" ], "script": "base64:BgI1CAISABIFCgMICAESABIDCgEBEgASABIAEgMKAQESAwoBARIAEgASAwoBCBIDCgEIEgMKAQhfAA1rX3RvdGFsU3VwcGx5Ag1rX3RvdGFsU3VwcGx5AA9rX3Jld2FyZEJhbGFuY2UCD2tfcmV3YXJkQmFsYW5jZQAPa19sb2NrZWRCYWxhbmNlAg9rX2xvY2tlZEJhbGFuY2UADWtfZnJlZUJhbGFuY2UCDWtfZnJlZUJhbGFuY2UAD2tfZXhjZXNzQmFsYW5jZQIPa19leGNlc3NCYWxhbmNlAAxrX3ZhdWx0QXNzZXQCDGtfdmF1bHRBc3NldAAUa192YXVsdEFzc2V0RGVjaW1hbHMCFGtfdmF1bHRBc3NldERlY2ltYWxzABRrX21heFNwb3RVdGlsaXphdGlvbgIUa19tYXhTcG90VXRpbGl6YXRpb24ABmtfcmF0ZQIGa19yYXRlABBrX2xhc3RVcGRhdGVUaW1lAhBrX2xhc3RVcGRhdGVUaW1lABZrX3Jld2FyZFBlclRva2VuU3RvcmVkAhZrX3Jld2FyZFBlclRva2VuU3RvcmVkAAxrX3Jld2FyZFJhdGUCDGtfcmV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zCthDYWNRLvfsHSH7W Next: DCzuVn8JPmDJ7YBHy4bXwgg8XT1ndW5FWkzccwFwzhNY Diff:
Old | New | Differences | |
---|---|---|---|
329 | 329 | ||
330 | 330 | ||
331 | 331 | @Callable(i) | |
332 | + | func migrate () = if ((i.caller != adminAddress())) | |
333 | + | then throw("Invalid migrate parameters") | |
334 | + | else { | |
335 | + | let _vaultAsset = toBase58String(quoteAsset()) | |
336 | + | let assetDecimals = if ((_vaultAsset == "WAVES")) | |
337 | + | then 8 | |
338 | + | else { | |
339 | + | let info = valueOrErrorMessage(assetInfo(fromBase58String(_vaultAsset)), ("Invalid token id: " + _vaultAsset)) | |
340 | + | info.decimals | |
341 | + | } | |
342 | + | [StringEntry(k_vaultAsset, _vaultAsset), IntegerEntry(k_vaultAssetDecimals, assetDecimals), IntegerEntry(k_maxSpotUtilization, 0)] | |
343 | + | } | |
344 | + | ||
345 | + | ||
346 | + | ||
347 | + | @Callable(i) | |
332 | 348 | func initialize (_coordinator,_vaultAsset,_maxSpotUtilization) = if (if (if (if (initialized()) | |
333 | 349 | then true | |
334 | 350 | else (i.caller != this)) | |
360 | 376 | else !(initialized())) | |
361 | 377 | then throw("Invalid call to stake") | |
362 | 378 | else { | |
363 | - | let $ | |
364 | - | let newRewardPerTokenStored = $ | |
365 | - | let newLastUpdateTime = $ | |
366 | - | let stakerEarned = $ | |
367 | - | let stakerRewardPerTokenPaid = $ | |
379 | + | let $t01314713376 = updateReward(_staker, 0) | |
380 | + | let newRewardPerTokenStored = $t01314713376._1 | |
381 | + | let newLastUpdateTime = $t01314713376._2 | |
382 | + | let stakerEarned = $t01314713376._3 | |
383 | + | let stakerRewardPerTokenPaid = $t01314713376._4 | |
368 | 384 | let currentRate = rate() | |
369 | 385 | let prevAverageRate = averageRate(_staker) | |
370 | 386 | let vAmount = divd(_amount, currentRate) | |
391 | 407 | else !(initialized())) | |
392 | 408 | then throw("Invalid call to unStake") | |
393 | 409 | else { | |
394 | - | let $ | |
395 | - | let newRewardPerTokenStored = $ | |
396 | - | let newLastUpdateTime = $ | |
397 | - | let stakerEarned = $ | |
398 | - | let stakerRewardPerTokenPaid = $ | |
399 | - | let $ | |
400 | - | let newLastWithdrawnDate = $ | |
401 | - | let withdrawLimitLeft = $ | |
402 | - | let alreadyWithdrawnInPeriod = $ | |
410 | + | let $t01488415100 = updateReward(_staker, 0) | |
411 | + | let newRewardPerTokenStored = $t01488415100._1 | |
412 | + | let newLastUpdateTime = $t01488415100._2 | |
413 | + | let stakerEarned = $t01488415100._3 | |
414 | + | let stakerRewardPerTokenPaid = $t01488415100._4 | |
415 | + | let $t01510715274 = getWithdrawLimitLeft(_staker) | |
416 | + | let newLastWithdrawnDate = $t01510715274._1 | |
417 | + | let withdrawLimitLeft = $t01510715274._2 | |
418 | + | let alreadyWithdrawnInPeriod = $t01510715274._3 | |
403 | 419 | let vAmount = divd(amountOfQuoteAsset, rate()) | |
404 | 420 | if ((vAmount > withdrawLimitLeft)) | |
405 | 421 | then throw("Invalid call to unStake: withdraw over limit") | |
422 | 438 | @Callable(i) | |
423 | 439 | func withdrawRewards () = { | |
424 | 440 | let _staker = toString(i.caller) | |
425 | - | let $ | |
426 | - | let newRewardPerTokenStored = $ | |
427 | - | let newLastUpdateTime = $ | |
428 | - | let stakerEarned = $ | |
429 | - | let stakerRewardPerTokenPaid = $ | |
441 | + | let $t01679116936 = updateReward(_staker, 0) | |
442 | + | let newRewardPerTokenStored = $t01679116936._1 | |
443 | + | let newLastUpdateTime = $t01679116936._2 | |
444 | + | let stakerEarned = $t01679116936._3 | |
445 | + | let stakerRewardPerTokenPaid = $t01679116936._4 | |
430 | 446 | if (if ((0 >= stakerEarned)) | |
431 | 447 | then true | |
432 | 448 | else !(initialized())) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let k_totalSupply = "k_totalSupply" | |
5 | 5 | ||
6 | 6 | let k_rewardBalance = "k_rewardBalance" | |
7 | 7 | ||
8 | 8 | let k_lockedBalance = "k_lockedBalance" | |
9 | 9 | ||
10 | 10 | let k_freeBalance = "k_freeBalance" | |
11 | 11 | ||
12 | 12 | let k_excessBalance = "k_excessBalance" | |
13 | 13 | ||
14 | 14 | let k_vaultAsset = "k_vaultAsset" | |
15 | 15 | ||
16 | 16 | let k_vaultAssetDecimals = "k_vaultAssetDecimals" | |
17 | 17 | ||
18 | 18 | let k_maxSpotUtilization = "k_maxSpotUtilization" | |
19 | 19 | ||
20 | 20 | let k_rate = "k_rate" | |
21 | 21 | ||
22 | 22 | let k_lastUpdateTime = "k_lastUpdateTime" | |
23 | 23 | ||
24 | 24 | let k_rewardPerTokenStored = "k_rewardPerTokenStored" | |
25 | 25 | ||
26 | 26 | let k_rewardRate = "k_rewardRate" | |
27 | 27 | ||
28 | 28 | let k_periodFinish = "k_periodFinish" | |
29 | 29 | ||
30 | 30 | let k_userRewardPerToken = "k_userRewardPerToken" | |
31 | 31 | ||
32 | 32 | let k_userReward = "k_userReward" | |
33 | 33 | ||
34 | 34 | let k_balance = "k_balance" | |
35 | 35 | ||
36 | 36 | let k_average_rate = "k_average_rate" | |
37 | 37 | ||
38 | 38 | let k_withdraw_limit = "k_withdraw_limit" | |
39 | 39 | ||
40 | 40 | let k_last_withdraw_date = "k_last_withdraw_date" | |
41 | 41 | ||
42 | 42 | let k_withdraw_in_period = "k_withdraw_in_period" | |
43 | 43 | ||
44 | 44 | let k_initialized = "k_initialized" | |
45 | 45 | ||
46 | 46 | let k_coordinatorAddress = "k_coordinatorAddress" | |
47 | 47 | ||
48 | 48 | let k_amm = "k_amm" | |
49 | 49 | ||
50 | 50 | let k_governance_asset = "k_gov_asset" | |
51 | 51 | ||
52 | 52 | let k_quote_asset = "k_quote_asset" | |
53 | 53 | ||
54 | 54 | let k_admin_address = "k_admin_address" | |
55 | 55 | ||
56 | 56 | let k_manager_address = "k_manager_address" | |
57 | 57 | ||
58 | 58 | let k_spot_address = "k_spot_address" | |
59 | 59 | ||
60 | 60 | let k_collateral_address = "k_collateral_address" | |
61 | 61 | ||
62 | 62 | func toCompositeKey (_key,_address) = ((_key + "_") + _address) | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func coordinator () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, k_coordinatorAddress), "Coordinator not set")), "Coordinator address invalid") | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func adminAddress () = addressFromString(valueOrErrorMessage(getString(coordinator(), k_admin_address), "Admin address not set")) | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func isWhitelist (_address) = valueOrElse(getBoolean(coordinator(), toCompositeKey(k_amm, _address)), false) | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func governanceAsset () = fromBase58String(valueOrErrorMessage(getString(coordinator(), k_governance_asset), "Governance asset not set")) | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func quoteAsset () = fromBase58String(getStringValue(coordinator(), k_quote_asset)) | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func vaultAssetStr () = valueOrErrorMessage(getString(this, k_vaultAsset), "Vault asset not set") | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func vaultAsset () = { | |
84 | 84 | let _assetIdStr = vaultAssetStr() | |
85 | 85 | if ((_assetIdStr == "WAVES")) | |
86 | 86 | then unit | |
87 | 87 | else fromBase58String(_assetIdStr) | |
88 | 88 | } | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func vaultAssetDecimals () = valueOrErrorMessage(getInteger(this, k_vaultAssetDecimals), "Vault asset decimals not set") | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func managerAddress () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(coordinator(), k_manager_address), "Manager address not set")), "Manager address invalid") | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | let DECIMAL_UNIT = (1 * (((((((10 * 10) * 10) * 10) * 10) * 10) * 10) * 10)) | |
98 | 98 | ||
99 | 99 | let DURATION = (((7 * 60) * 60) * 24) | |
100 | 100 | ||
101 | 101 | let NO_ADDRESS = "" | |
102 | 102 | ||
103 | 103 | let NO_STAKER = 0 | |
104 | 104 | ||
105 | 105 | func assetFromDecimals (_amount) = { | |
106 | 106 | let assetDecimals = vaultAssetDecimals() | |
107 | 107 | if ((assetDecimals == 6)) | |
108 | 108 | then (_amount / 100) | |
109 | 109 | else if ((assetDecimals == 8)) | |
110 | 110 | then _amount | |
111 | 111 | else throw("Invalid asset decimals") | |
112 | 112 | } | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | func assetToDecimals (_amount) = { | |
116 | 116 | let assetDecimals = vaultAssetDecimals() | |
117 | 117 | if ((assetDecimals == 6)) | |
118 | 118 | then (_amount * 100) | |
119 | 119 | else if ((assetDecimals == 8)) | |
120 | 120 | then _amount | |
121 | 121 | else throw("Invalid asset decimals") | |
122 | 122 | } | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | func divd (_x,_y) = fraction(_x, DECIMAL_UNIT, _y, HALFEVEN) | |
126 | 126 | ||
127 | 127 | ||
128 | 128 | func muld (_x,_y) = fraction(_x, _y, DECIMAL_UNIT, HALFEVEN) | |
129 | 129 | ||
130 | 130 | ||
131 | 131 | func abs (_x) = if ((_x > 0)) | |
132 | 132 | then _x | |
133 | 133 | else -(_x) | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | func minv (_x,_y) = if ((_x > _y)) | |
137 | 137 | then _y | |
138 | 138 | else _x | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | let WITHDRAW_PERIOD = (86400 * 1000) | |
142 | 142 | ||
143 | 143 | let WITHDRAW_PER_PERIOD = divd((1 * DECIMAL_UNIT), (4 * DECIMAL_UNIT)) | |
144 | 144 | ||
145 | 145 | func int (k) = valueOrErrorMessage(getInteger(this, k), ("no value for " + k)) | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | func int0 (k) = valueOrElse(getInteger(this, k), 0) | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func int1 (k) = valueOrElse(getInteger(this, k), DECIMAL_UNIT) | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func totalSupply () = int0(k_totalSupply) | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | func rate () = int1(k_rate) | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | func balanceOf (_staker) = int0(toCompositeKey(k_balance, _staker)) | |
161 | 161 | ||
162 | 162 | ||
163 | 163 | func averageRate (_staker) = int0(toCompositeKey(k_average_rate, _staker)) | |
164 | 164 | ||
165 | 165 | ||
166 | 166 | func withdrawLimit (_staker) = int0(toCompositeKey(k_withdraw_limit, _staker)) | |
167 | 167 | ||
168 | 168 | ||
169 | 169 | func withdrawnInPeriod (_staker) = int0(toCompositeKey(k_withdraw_in_period, _staker)) | |
170 | 170 | ||
171 | 171 | ||
172 | 172 | func lastWithdrawnDate (_staker) = int0(toCompositeKey(k_last_withdraw_date, _staker)) | |
173 | 173 | ||
174 | 174 | ||
175 | 175 | func freeBalance () = int0(k_freeBalance) | |
176 | 176 | ||
177 | 177 | ||
178 | 178 | func lockedBalance () = int0(k_lockedBalance) | |
179 | 179 | ||
180 | 180 | ||
181 | 181 | func excessBalance () = int0(k_excessBalance) | |
182 | 182 | ||
183 | 183 | ||
184 | 184 | func rewardPerTokenStored () = int0(k_rewardPerTokenStored) | |
185 | 185 | ||
186 | 186 | ||
187 | 187 | func lastUpdateTime () = int0(k_lastUpdateTime) | |
188 | 188 | ||
189 | 189 | ||
190 | 190 | func rewardRate () = int0(k_rewardRate) | |
191 | 191 | ||
192 | 192 | ||
193 | 193 | func periodFinish () = int0(k_periodFinish) | |
194 | 194 | ||
195 | 195 | ||
196 | 196 | func rewardBalance () = int0(k_rewardBalance) | |
197 | 197 | ||
198 | 198 | ||
199 | 199 | func rewards (_staker) = int0(toCompositeKey(k_userReward, _staker)) | |
200 | 200 | ||
201 | 201 | ||
202 | 202 | func userRewardPerTokenPaid (_staker) = int0(toCompositeKey(k_userRewardPerToken, _staker)) | |
203 | 203 | ||
204 | 204 | ||
205 | 205 | func maxSpotUtilization () = int0(k_maxSpotUtilization) | |
206 | 206 | ||
207 | 207 | ||
208 | 208 | func initialized () = valueOrElse(getBoolean(this, k_initialized), false) | |
209 | 209 | ||
210 | 210 | ||
211 | 211 | func currentTimestamp () = lastBlock.timestamp | |
212 | 212 | ||
213 | 213 | ||
214 | 214 | func currentTimestampSec () = (currentTimestamp() / 1000) | |
215 | 215 | ||
216 | 216 | ||
217 | 217 | func getWithdrawLimitLeft (_staker) = { | |
218 | 218 | let currentDate = currentTimestamp() | |
219 | 219 | let lastWithdrawDate = lastWithdrawnDate(_staker) | |
220 | 220 | let $t062676588 = if (((currentDate - lastWithdrawDate) > WITHDRAW_PERIOD)) | |
221 | 221 | then $Tuple3(currentDate, withdrawLimit(_staker), 0) | |
222 | 222 | else $Tuple3(lastWithdrawDate, (withdrawLimit(_staker) - withdrawnInPeriod(_staker)), withdrawnInPeriod(_staker)) | |
223 | 223 | let newLastWithdrawnDate = $t062676588._1 | |
224 | 224 | let withdrawLimitLeft = $t062676588._2 | |
225 | 225 | let alreadyWithdrawnInPeriod = $t062676588._3 | |
226 | 226 | $Tuple3(newLastWithdrawnDate, withdrawLimitLeft, alreadyWithdrawnInPeriod) | |
227 | 227 | } | |
228 | 228 | ||
229 | 229 | ||
230 | 230 | func computeNewRate (_amountOfQuoteAsset) = { | |
231 | 231 | let newRate = if ((totalSupply() > 0)) | |
232 | 232 | then divd((freeBalance() + _amountOfQuoteAsset), totalSupply()) | |
233 | 233 | else DECIMAL_UNIT | |
234 | 234 | newRate | |
235 | 235 | } | |
236 | 236 | ||
237 | 237 | ||
238 | 238 | func lastTimeRewardApplicable () = minv(currentTimestampSec(), periodFinish()) | |
239 | 239 | ||
240 | 240 | ||
241 | 241 | func rewardPerToken (_balanceDelta) = if (((totalSupply() + _balanceDelta) == 0)) | |
242 | 242 | then rewardPerTokenStored() | |
243 | 243 | else { | |
244 | 244 | let timeInterval = (lastTimeRewardApplicable() - lastUpdateTime()) | |
245 | 245 | let actualTimeInterval = if ((0 > timeInterval)) | |
246 | 246 | then 0 | |
247 | 247 | else timeInterval | |
248 | 248 | let diff = divd((rewardRate() * actualTimeInterval), (totalSupply() + _balanceDelta)) | |
249 | 249 | (rewardPerTokenStored() + diff) | |
250 | 250 | } | |
251 | 251 | ||
252 | 252 | ||
253 | 253 | func earned (_staker,_balanceDelta) = { | |
254 | 254 | let rewardDelta = (rewardPerToken(_balanceDelta) - userRewardPerTokenPaid(_staker)) | |
255 | 255 | (muld((balanceOf(_staker) + _balanceDelta), rewardDelta) + rewards(_staker)) | |
256 | 256 | } | |
257 | 257 | ||
258 | 258 | ||
259 | 259 | func updateReward (_staker,_balanceDelta) = { | |
260 | 260 | let newRewardPerTokenStored = rewardPerToken(_balanceDelta) | |
261 | 261 | let newLastUpdateTime = currentTimestampSec() | |
262 | 262 | let $t078108002 = if ((_staker != "")) | |
263 | 263 | then $Tuple2(earned(_staker, _balanceDelta), newRewardPerTokenStored) | |
264 | 264 | else $Tuple2(0, 0) | |
265 | 265 | let stakerEarned = $t078108002._1 | |
266 | 266 | let stakerRewardPerTokenPaid = $t078108002._2 | |
267 | 267 | $Tuple4(newRewardPerTokenStored, newLastUpdateTime, stakerEarned, stakerRewardPerTokenPaid) | |
268 | 268 | } | |
269 | 269 | ||
270 | 270 | ||
271 | 271 | func updateUserBalance (_user,_change) = if (((balanceOf(_user) + _change) >= 0)) | |
272 | 272 | then [IntegerEntry(toCompositeKey(k_balance, _user), (balanceOf(_user) + _change))] | |
273 | 273 | else throw(((("Vault: can not update user balance. Balance: " + toString(balanceOf(_user))) + " change: ") + toString(_change))) | |
274 | 274 | ||
275 | 275 | ||
276 | 276 | func setUserWithdrawLimit (_user,_rate) = [IntegerEntry(toCompositeKey(k_withdraw_limit, _user), _rate)] | |
277 | 277 | ||
278 | 278 | ||
279 | 279 | func setUserAverageRate (_user,_rate) = [IntegerEntry(toCompositeKey(k_average_rate, _user), _rate)] | |
280 | 280 | ||
281 | 281 | ||
282 | 282 | func updateFreeBalance (_change) = { | |
283 | 283 | let balance = freeBalance() | |
284 | 284 | if (((balance + _change) >= 0)) | |
285 | 285 | then [IntegerEntry(k_freeBalance, (balance + _change))] | |
286 | 286 | else throw(((("Vault: can not update free balance. Balance: " + toString(balance)) + " change: ") + toString(_change))) | |
287 | 287 | } | |
288 | 288 | ||
289 | 289 | ||
290 | 290 | func updateLockedBalance (_change) = { | |
291 | 291 | let balance = lockedBalance() | |
292 | 292 | if (((balance + _change) >= 0)) | |
293 | 293 | then [IntegerEntry(k_lockedBalance, (balance + _change))] | |
294 | 294 | else throw(((("Vault: can not update locked balance. Balance: " + toString(balance)) + " change: ") + toString(_change))) | |
295 | 295 | } | |
296 | 296 | ||
297 | 297 | ||
298 | 298 | func updateExcessBalance (_change) = { | |
299 | 299 | let newImbalance = (excessBalance() + _change) | |
300 | 300 | let utilizationRate = divd(abs(newImbalance), freeBalance()) | |
301 | 301 | if ((maxSpotUtilization() > utilizationRate)) | |
302 | 302 | then [IntegerEntry(k_excessBalance, newImbalance)] | |
303 | 303 | else throw(((((((("Vault: can not update excess balance. Balance: " + toString(excessBalance())) + " change: ") + toString(_change)) + " utilization rate: ") + toString(utilizationRate)) + " max utilization rate: ") + toString(maxSpotUtilization()))) | |
304 | 304 | } | |
305 | 305 | ||
306 | 306 | ||
307 | 307 | func updateTotalSupply (_change) = [IntegerEntry(k_totalSupply, (totalSupply() + _change))] | |
308 | 308 | ||
309 | 309 | ||
310 | 310 | func updateRate (_rate) = [IntegerEntry(k_rate, _rate)] | |
311 | 311 | ||
312 | 312 | ||
313 | 313 | func setUserWithdrawParams (_user,_lastWithdrawDate,_withdrawn) = [IntegerEntry(toCompositeKey(k_last_withdraw_date, _user), _lastWithdrawDate), IntegerEntry(toCompositeKey(k_withdraw_in_period, _user), _withdrawn)] | |
314 | 314 | ||
315 | 315 | ||
316 | 316 | func updateRewardBalance (_delta) = [IntegerEntry(k_rewardBalance, (rewardBalance() + _delta))] | |
317 | 317 | ||
318 | 318 | ||
319 | 319 | func updateRewardRate (_rewardRate) = [IntegerEntry(k_rewardRate, _rewardRate)] | |
320 | 320 | ||
321 | 321 | ||
322 | 322 | func updateTime (_lastUpdateTime,_periodFinish) = [IntegerEntry(k_lastUpdateTime, _lastUpdateTime), IntegerEntry(k_periodFinish, _periodFinish)] | |
323 | 323 | ||
324 | 324 | ||
325 | 325 | func updateRewardPerTokenStored (_rewardPerTokenStored) = [IntegerEntry(k_rewardPerTokenStored, _rewardPerTokenStored)] | |
326 | 326 | ||
327 | 327 | ||
328 | 328 | func updateUserRewards (_staker,_reward,_userRewardPerToken) = [IntegerEntry(toCompositeKey(k_userReward, _staker), _reward), IntegerEntry(toCompositeKey(k_userRewardPerToken, _staker), _userRewardPerToken)] | |
329 | 329 | ||
330 | 330 | ||
331 | 331 | @Callable(i) | |
332 | + | func migrate () = if ((i.caller != adminAddress())) | |
333 | + | then throw("Invalid migrate parameters") | |
334 | + | else { | |
335 | + | let _vaultAsset = toBase58String(quoteAsset()) | |
336 | + | let assetDecimals = if ((_vaultAsset == "WAVES")) | |
337 | + | then 8 | |
338 | + | else { | |
339 | + | let info = valueOrErrorMessage(assetInfo(fromBase58String(_vaultAsset)), ("Invalid token id: " + _vaultAsset)) | |
340 | + | info.decimals | |
341 | + | } | |
342 | + | [StringEntry(k_vaultAsset, _vaultAsset), IntegerEntry(k_vaultAssetDecimals, assetDecimals), IntegerEntry(k_maxSpotUtilization, 0)] | |
343 | + | } | |
344 | + | ||
345 | + | ||
346 | + | ||
347 | + | @Callable(i) | |
332 | 348 | func initialize (_coordinator,_vaultAsset,_maxSpotUtilization) = if (if (if (if (initialized()) | |
333 | 349 | then true | |
334 | 350 | else (i.caller != this)) | |
335 | 351 | then true | |
336 | 352 | else (0 > _maxSpotUtilization)) | |
337 | 353 | then true | |
338 | 354 | else (_maxSpotUtilization > DECIMAL_UNIT)) | |
339 | 355 | then throw("Unable to initialize") | |
340 | 356 | else { | |
341 | 357 | let assetDecimals = if ((_vaultAsset == "WAVES")) | |
342 | 358 | then 8 | |
343 | 359 | else { | |
344 | 360 | let info = valueOrErrorMessage(assetInfo(fromBase58String(_vaultAsset)), ("Invalid token id: " + _vaultAsset)) | |
345 | 361 | info.decimals | |
346 | 362 | } | |
347 | 363 | [StringEntry(k_coordinatorAddress, toString(valueOrErrorMessage(addressFromString(_coordinator), "Invalid coordinator address"))), StringEntry(k_vaultAsset, _vaultAsset), IntegerEntry(k_vaultAssetDecimals, assetDecimals), IntegerEntry(k_maxSpotUtilization, _maxSpotUtilization), BooleanEntry(k_initialized, true)] | |
348 | 364 | } | |
349 | 365 | ||
350 | 366 | ||
351 | 367 | ||
352 | 368 | @Callable(i) | |
353 | 369 | func stake () = { | |
354 | 370 | let _staker = toString(i.caller) | |
355 | 371 | let _amount = assetToDecimals(i.payments[0].amount) | |
356 | 372 | if (if (if ((i.payments[0].assetId != vaultAsset())) | |
357 | 373 | then true | |
358 | 374 | else (size(i.payments) != 1)) | |
359 | 375 | then true | |
360 | 376 | else !(initialized())) | |
361 | 377 | then throw("Invalid call to stake") | |
362 | 378 | else { | |
363 | - | let $ | |
364 | - | let newRewardPerTokenStored = $ | |
365 | - | let newLastUpdateTime = $ | |
366 | - | let stakerEarned = $ | |
367 | - | let stakerRewardPerTokenPaid = $ | |
379 | + | let $t01314713376 = updateReward(_staker, 0) | |
380 | + | let newRewardPerTokenStored = $t01314713376._1 | |
381 | + | let newLastUpdateTime = $t01314713376._2 | |
382 | + | let stakerEarned = $t01314713376._3 | |
383 | + | let stakerRewardPerTokenPaid = $t01314713376._4 | |
368 | 384 | let currentRate = rate() | |
369 | 385 | let prevAverageRate = averageRate(_staker) | |
370 | 386 | let vAmount = divd(_amount, currentRate) | |
371 | 387 | let newAverageRate = divd((muld(vAmount, currentRate) + muld(balanceOf(_staker), prevAverageRate)), (vAmount + balanceOf(_staker))) | |
372 | 388 | let newTotalBalance = (vAmount + balanceOf(_staker)) | |
373 | 389 | let newWithdrawLimit = muld(newTotalBalance, WITHDRAW_PER_PERIOD) | |
374 | 390 | let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(vaultAsset(), assetFromDecimals(_amount))]) | |
375 | 391 | if ((stake == stake)) | |
376 | 392 | then (((((((updateUserRewards(_staker, stakerEarned, stakerRewardPerTokenPaid) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateTime(newLastUpdateTime, periodFinish())) ++ updateFreeBalance(_amount)) ++ updateUserBalance(_staker, vAmount)) ++ setUserAverageRate(_staker, newAverageRate)) ++ setUserWithdrawLimit(_staker, newWithdrawLimit)) ++ updateTotalSupply(vAmount)) | |
377 | 393 | else throw("Strict value is not equal to itself.") | |
378 | 394 | } | |
379 | 395 | } | |
380 | 396 | ||
381 | 397 | ||
382 | 398 | ||
383 | 399 | @Callable(i) | |
384 | 400 | func unStake (_amount) = { | |
385 | 401 | let _staker = toString(i.caller) | |
386 | 402 | let amountOfQuoteAsset = assetToDecimals(_amount) | |
387 | 403 | if (if (if ((i.payments != nil)) | |
388 | 404 | then true | |
389 | 405 | else (0 >= amountOfQuoteAsset)) | |
390 | 406 | then true | |
391 | 407 | else !(initialized())) | |
392 | 408 | then throw("Invalid call to unStake") | |
393 | 409 | else { | |
394 | - | let $ | |
395 | - | let newRewardPerTokenStored = $ | |
396 | - | let newLastUpdateTime = $ | |
397 | - | let stakerEarned = $ | |
398 | - | let stakerRewardPerTokenPaid = $ | |
399 | - | let $ | |
400 | - | let newLastWithdrawnDate = $ | |
401 | - | let withdrawLimitLeft = $ | |
402 | - | let alreadyWithdrawnInPeriod = $ | |
410 | + | let $t01488415100 = updateReward(_staker, 0) | |
411 | + | let newRewardPerTokenStored = $t01488415100._1 | |
412 | + | let newLastUpdateTime = $t01488415100._2 | |
413 | + | let stakerEarned = $t01488415100._3 | |
414 | + | let stakerRewardPerTokenPaid = $t01488415100._4 | |
415 | + | let $t01510715274 = getWithdrawLimitLeft(_staker) | |
416 | + | let newLastWithdrawnDate = $t01510715274._1 | |
417 | + | let withdrawLimitLeft = $t01510715274._2 | |
418 | + | let alreadyWithdrawnInPeriod = $t01510715274._3 | |
403 | 419 | let vAmount = divd(amountOfQuoteAsset, rate()) | |
404 | 420 | if ((vAmount > withdrawLimitLeft)) | |
405 | 421 | then throw("Invalid call to unStake: withdraw over limit") | |
406 | 422 | else { | |
407 | 423 | let newWithdrawnInPeriod = (alreadyWithdrawnInPeriod + vAmount) | |
408 | 424 | if ((amountOfQuoteAsset > freeBalance())) | |
409 | 425 | then throw("Invalid call to unStake: balance too low") | |
410 | 426 | else { | |
411 | 427 | let unstake = invoke(managerAddress(), "withdraw", [vaultAssetStr(), assetFromDecimals(amountOfQuoteAsset)], nil) | |
412 | 428 | if ((unstake == unstake)) | |
413 | 429 | then (((((((updateUserRewards(_staker, stakerEarned, stakerRewardPerTokenPaid) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateTime(newLastUpdateTime, periodFinish())) ++ updateFreeBalance(-(amountOfQuoteAsset))) ++ updateUserBalance(_staker, -(vAmount))) ++ updateTotalSupply(-(vAmount))) ++ setUserWithdrawParams(_staker, newLastWithdrawnDate, newWithdrawnInPeriod)) ++ [ScriptTransfer(i.caller, assetFromDecimals(amountOfQuoteAsset), vaultAsset())]) | |
414 | 430 | else throw("Strict value is not equal to itself.") | |
415 | 431 | } | |
416 | 432 | } | |
417 | 433 | } | |
418 | 434 | } | |
419 | 435 | ||
420 | 436 | ||
421 | 437 | ||
422 | 438 | @Callable(i) | |
423 | 439 | func withdrawRewards () = { | |
424 | 440 | let _staker = toString(i.caller) | |
425 | - | let $ | |
426 | - | let newRewardPerTokenStored = $ | |
427 | - | let newLastUpdateTime = $ | |
428 | - | let stakerEarned = $ | |
429 | - | let stakerRewardPerTokenPaid = $ | |
441 | + | let $t01679116936 = updateReward(_staker, 0) | |
442 | + | let newRewardPerTokenStored = $t01679116936._1 | |
443 | + | let newLastUpdateTime = $t01679116936._2 | |
444 | + | let stakerEarned = $t01679116936._3 | |
445 | + | let stakerRewardPerTokenPaid = $t01679116936._4 | |
430 | 446 | if (if ((0 >= stakerEarned)) | |
431 | 447 | then true | |
432 | 448 | else !(initialized())) | |
433 | 449 | then throw("No reward: Vault") | |
434 | 450 | else ((((updateUserRewards(_staker, 0, stakerRewardPerTokenPaid) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateTime(newLastUpdateTime, periodFinish())) ++ updateRewardBalance(-(stakerEarned))) ++ [ScriptTransfer(i.caller, stakerEarned, governanceAsset())]) | |
435 | 451 | } | |
436 | 452 | ||
437 | 453 | ||
438 | 454 | ||
439 | 455 | @Callable(i) | |
440 | 456 | func addFree () = { | |
441 | 457 | let _amount = assetToDecimals(i.payments[0].amount) | |
442 | 458 | if (if (if (if ((i.payments[0].assetId != vaultAsset())) | |
443 | 459 | then true | |
444 | 460 | else (size(i.payments) != 1)) | |
445 | 461 | then true | |
446 | 462 | else !(initialized())) | |
447 | 463 | then true | |
448 | 464 | else !(if (isWhitelist(toString(i.caller))) | |
449 | 465 | then true | |
450 | 466 | else (i.caller == adminAddress()))) | |
451 | 467 | then throw("Invalid addFree params") | |
452 | 468 | else { | |
453 | 469 | let newRate = computeNewRate(_amount) | |
454 | 470 | let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(vaultAsset(), assetFromDecimals(_amount))]) | |
455 | 471 | if ((stake == stake)) | |
456 | 472 | then (updateFreeBalance(_amount) ++ updateRate(newRate)) | |
457 | 473 | else throw("Strict value is not equal to itself.") | |
458 | 474 | } | |
459 | 475 | } | |
460 | 476 | ||
461 | 477 | ||
462 | 478 | ||
463 | 479 | @Callable(i) | |
464 | 480 | func addLocked () = { | |
465 | 481 | let _amount = assetToDecimals(i.payments[0].amount) | |
466 | 482 | if (if (if (if ((i.payments[0].assetId != vaultAsset())) | |
467 | 483 | then true | |
468 | 484 | else (size(i.payments) != 1)) | |
469 | 485 | then true | |
470 | 486 | else !(initialized())) | |
471 | 487 | then true | |
472 | 488 | else !(if (isWhitelist(toString(i.caller))) | |
473 | 489 | then true | |
474 | 490 | else (i.caller == adminAddress()))) | |
475 | 491 | then throw("Invalid addLocked params") | |
476 | 492 | else { | |
477 | 493 | let unstake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(vaultAsset(), assetFromDecimals(_amount))]) | |
478 | 494 | if ((unstake == unstake)) | |
479 | 495 | then updateLockedBalance(_amount) | |
480 | 496 | else throw("Strict value is not equal to itself.") | |
481 | 497 | } | |
482 | 498 | } | |
483 | 499 | ||
484 | 500 | ||
485 | 501 | ||
486 | 502 | @Callable(i) | |
487 | 503 | func exchangeFreeAndLocked (_amount) = if (if (!(initialized())) | |
488 | 504 | then true | |
489 | 505 | else if (!(isWhitelist(toString(i.caller)))) | |
490 | 506 | then (i.caller != adminAddress()) | |
491 | 507 | else false) | |
492 | 508 | then throw("Invalid exchangeFreeAndLocked params") | |
493 | 509 | else { | |
494 | 510 | let amountOfQuoteAsset = assetToDecimals(_amount) | |
495 | 511 | let newRate = computeNewRate(-(amountOfQuoteAsset)) | |
496 | 512 | ((updateLockedBalance(amountOfQuoteAsset) ++ updateFreeBalance(-(amountOfQuoteAsset))) ++ updateRate(newRate)) | |
497 | 513 | } | |
498 | 514 | ||
499 | 515 | ||
500 | 516 | ||
501 | 517 | @Callable(i) | |
502 | 518 | func withdrawLocked (_amount) = if (if (if (!(initialized())) | |
503 | 519 | then true | |
504 | 520 | else (0 >= _amount)) | |
505 | 521 | then true | |
506 | 522 | else !(isWhitelist(toString(i.caller)))) | |
507 | 523 | then throw("Invalid withdrawLocked params") | |
508 | 524 | else { | |
509 | 525 | let amountOfQuoteAsset = assetToDecimals(_amount) | |
510 | 526 | let unstake = invoke(managerAddress(), "withdraw", [vaultAssetStr(), assetFromDecimals(amountOfQuoteAsset)], nil) | |
511 | 527 | if ((unstake == unstake)) | |
512 | 528 | then (updateLockedBalance(-(amountOfQuoteAsset)) ++ [ScriptTransfer(i.caller, assetFromDecimals(amountOfQuoteAsset), vaultAsset())]) | |
513 | 529 | else throw("Strict value is not equal to itself.") | |
514 | 530 | } | |
515 | 531 | ||
516 | 532 | ||
517 | 533 | ||
518 | 534 | @Callable(i) | |
519 | 535 | func addRewards () = if (if (if ((i.payments[0].assetId != governanceAsset())) | |
520 | 536 | then true | |
521 | 537 | else (size(i.payments) != 1)) | |
522 | 538 | then true | |
523 | 539 | else !(initialized())) | |
524 | 540 | then throw("Invalid addRewards params") | |
525 | 541 | else { | |
526 | 542 | let _reward = i.payments[0].amount | |
527 | 543 | let newRewardPerTokenStored = updateReward(NO_ADDRESS, NO_STAKER)._1 | |
528 | 544 | let timestamp = currentTimestampSec() | |
529 | 545 | let newRewardRate = if ((timestamp > periodFinish())) | |
530 | 546 | then (_reward / DURATION) | |
531 | 547 | else { | |
532 | 548 | let remainingTime = (periodFinish() - timestamp) | |
533 | 549 | let leftover = (rewardRate() * remainingTime) | |
534 | 550 | ((_reward + leftover) / DURATION) | |
535 | 551 | } | |
536 | 552 | (((updateRewardRate(newRewardRate) ++ updateRewardPerTokenStored(newRewardPerTokenStored)) ++ updateRewardBalance(_reward)) ++ updateTime(timestamp, (timestamp + DURATION))) | |
537 | 553 | } | |
538 | 554 | ||
539 | 555 | ||
540 | 556 | ||
541 | 557 | @Callable(i) | |
542 | 558 | func ackRewards () = { | |
543 | 559 | let profitResp = invoke(managerAddress(), "claimProfit", [vaultAssetStr()], nil) | |
544 | 560 | if ((profitResp == profitResp)) | |
545 | 561 | then { | |
546 | 562 | let profit = match profitResp { | |
547 | 563 | case p: Int => | |
548 | 564 | assetToDecimals(p) | |
549 | 565 | case _ => | |
550 | 566 | throw("Invalid claimProfit response") | |
551 | 567 | } | |
552 | 568 | let result = if ((profit > 0)) | |
553 | 569 | then { | |
554 | 570 | let newRate = computeNewRate(profit) | |
555 | 571 | let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(vaultAsset(), assetFromDecimals(profit))]) | |
556 | 572 | if ((stake == stake)) | |
557 | 573 | then (updateFreeBalance(profit) ++ updateRate(newRate)) | |
558 | 574 | else throw("Strict value is not equal to itself.") | |
559 | 575 | } | |
560 | 576 | else nil | |
561 | 577 | if ((result == result)) | |
562 | 578 | then result | |
563 | 579 | else throw("Strict value is not equal to itself.") | |
564 | 580 | } | |
565 | 581 | else throw("Strict value is not equal to itself.") | |
566 | 582 | } | |
567 | 583 | ||
568 | 584 | ||
569 | 585 | ||
570 | 586 | @Callable(i) | |
571 | 587 | func view_reward (_staker) = { | |
572 | 588 | let balance = balanceOf(_staker) | |
573 | 589 | let depositedAmount = muld(averageRate(_staker), balance) | |
574 | 590 | let currentAmount = muld(rate(), balance) | |
575 | 591 | let earnedQuote = (currentAmount - depositedAmount) | |
576 | 592 | throw(toString(earnedQuote)) | |
577 | 593 | } | |
578 | 594 | ||
579 | 595 | ||
580 | 596 | ||
581 | 597 | @Callable(i) | |
582 | 598 | func view_stakingReward (_staker) = { | |
583 | 599 | let stakerEarned = updateReward(_staker, 0)._3 | |
584 | 600 | throw(toString(assetFromDecimals(stakerEarned))) | |
585 | 601 | } | |
586 | 602 | ||
587 | 603 | ||
588 | 604 | ||
589 | 605 | @Callable(i) | |
590 | 606 | func view_withdrawLimit (_staker) = { | |
591 | 607 | let withdrawLimitLeft = getWithdrawLimitLeft(_staker)._2 | |
592 | 608 | let limitInAsset = assetFromDecimals(muld(withdrawLimitLeft, rate())) | |
593 | 609 | throw(toString(limitInAsset)) | |
594 | 610 | } | |
595 | 611 | ||
596 | 612 | ||
597 | 613 | @Verifier(tx) | |
598 | 614 | func verify () = { | |
599 | 615 | let coordinatorStr = getString(this, k_coordinatorAddress) | |
600 | 616 | if (isDefined(coordinatorStr)) | |
601 | 617 | then { | |
602 | 618 | let admin = getString(addressFromStringValue(value(coordinatorStr)), k_admin_address) | |
603 | 619 | if (isDefined(admin)) | |
604 | 620 | then valueOrElse(getBoolean(addressFromStringValue(value(admin)), ((("status_" + toString(this)) + "_") + toBase58String(tx.id))), false) | |
605 | 621 | else throw("unable to verify: admin not set in coordinator") | |
606 | 622 | } | |
607 | 623 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
608 | 624 | } | |
609 | 625 |
github/deemru/w8io/026f985 70.27 ms ◑