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