tx · FLVoJqYFBv9jiEJ5tTWUyfzzjfMgLfpX9oJGdzsxSPAD 3N5yarEiTQccnnuerogYT3BxM5Zc5bRgDZy: -0.03200000 Waves 2023.03.28 07:50 [2509346] smart account 3N5yarEiTQccnnuerogYT3BxM5Zc5bRgDZy > SELF 0.00000000 Waves
{ "type": 13, "id": "FLVoJqYFBv9jiEJ5tTWUyfzzjfMgLfpX9oJGdzsxSPAD", "fee": 3200000, "feeAssetId": null, "timestamp": 1679979007030, "version": 2, "chainId": 84, "sender": "3N5yarEiTQccnnuerogYT3BxM5Zc5bRgDZy", "senderPublicKey": "FK9j3YFWVChXKESTn33fMZz1JseCNMMqHhfB7smxJo4e", "proofs": [ "3fRsEjc3NTw2brD1J2k74UPqPnSGybnFRK8LRv3chkwbhTaHRavU8qQzTLMsk53yLN5DWjzrC5sZRpBqxUXV5gSA" ], "script": "base64:BgIvCAISBQoDAQgIEgASABIDCgEBEgASABIAEgMKAQgSAwoBCBIECgIIARIDCgEBEgBqAAlzZXBhcmF0b3ICAl9fAANTRVACAl9fAAVNVUxUNgDAhD0ABU1VTFQ4AIDC1y8ABk1VTFRYNgkAtgIBBQVNVUxUNgAGTVVMVFg4CQC2AgEFBU1VTFQ4AAdNVUxUWDE4CQC2AgEAgICQu7rWrfANAApXQVZFU0lEU1RSAgVXQVZFUwAHV0FWRVNJRAkA2QQBBQpXQVZFU0lEU1RSAAlEQVlNSUxMSVMAgLiZKQANREVGQVVMVFBFUklPRAkAaAIAoAsADgAZSWR4Q29udHJvbENmZ05ldXRyaW5vRGFwcAABABhJZHhDb250cm9sQ2ZnQXVjdGlvbkRhcHAAAgAUSWR4Q29udHJvbENmZ1JwZERhcHAAAwAVSWR4Q29udHJvbENmZ01hdGhEYXBwAAQAHElkeENvbnRyb2xDZmdMaXF1aWRhdGlvbkRhcHAABQAVSWR4Q29udHJvbENmZ1Jlc3REYXBwAAYAHUlkeENvbnRyb2xDZmdOb2RlUmVnaXN0cnlEYXBwAAcAHElkeENvb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ARBrZXlNaW5Mb2NrQW1vdW50AAQgc3VyZlZvdGluZ1Bvd2VyUmVzdHJpY3RpdmVQZXJpb2QFDURFRkFVTFRQRVJJT0QEG2JyVG9TdGFydFN1cmZUcmFuc2Zvcm1hdGlvbgCwmEYJAJQKAgUDbmlsCQDMCAIFCm1pbkxvY2tBbXQJAMwIAgkAaAIFEmduc2J0RnJvbVN1cmZDb2VmZgUFTVVMVDYJAMwIAgUgc3VyZlZvdGluZ1Bvd2VyUmVzdHJpY3RpdmVQZXJpb2QJAMwIAgUbYnJUb1N0YXJ0U3VyZlRyYW5zZm9ybWF0aW9uBQNuaWwA91nanQ==", "height": 2509346, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4ux4K8gvKEFmfVZM2xizmVXtrD35gqaR6jJqsgNqwzX2 Next: C8gsepRXBqWsZ5eXKAhQtsymAfNhN4Gq38ubzxoGZtRV Diff:
Old | New | Differences | |
---|---|---|---|
278 | 278 | ||
279 | 279 | let defaultTotalsDATA = (DepositTotalsPREFIX + "__0__0__0__0__0__0__0__0__0__0__0__0__0__0__0__0__0__0") | |
280 | 280 | ||
281 | + | func padList (in) = { | |
282 | + | let currSize = (size(in) - 1) | |
283 | + | func listPadder (acc,idx) = if ((currSize > idx)) | |
284 | + | then acc | |
285 | + | else (acc :+ "0") | |
286 | + | ||
287 | + | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] | |
288 | + | let $s = size($l) | |
289 | + | let $acc0 = in | |
290 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
291 | + | then $a | |
292 | + | else listPadder($a, $l[$i]) | |
293 | + | ||
294 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
295 | + | then $a | |
296 | + | else throw("List size exceeds 18") | |
297 | + | ||
298 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18) | |
299 | + | } | |
300 | + | ||
301 | + | ||
302 | + | func padString (in) = { | |
303 | + | let currSize = (size(split_4C(in, SEP)) - 1) | |
304 | + | func strPadder (acc,idx) = if ((currSize > idx)) | |
305 | + | then acc | |
306 | + | else (acc + "__0") | |
307 | + | ||
308 | + | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] | |
309 | + | let $s = size($l) | |
310 | + | let $acc0 = in | |
311 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
312 | + | then $a | |
313 | + | else strPadder($a, $l[$i]) | |
314 | + | ||
315 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
316 | + | then $a | |
317 | + | else throw("List size exceeds 18") | |
318 | + | ||
319 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18) | |
320 | + | } | |
321 | + | ||
322 | + | ||
281 | 323 | func RewardEntries (isNewUser,userAddress,stakedAmount) = { | |
282 | 324 | let stakedAmountX = toBigInt(stakedAmount) | |
283 | 325 | let userRewardFromDepositNumKEY = keyUserRewardFromDepositNum(userAddress) | |
284 | 326 | let depositNumUser = getIntOrElse(userRewardFromDepositNumKEY, -1) | |
285 | 327 | let depositNumLast = getIntOrElse(keyDepositNumLast(), -1) | |
286 | 328 | func forEachAssetCacheUserReward (accum,asset) = { | |
287 | - | let $ | |
288 | - | let rewardTotal = $ | |
289 | - | let cached = $ | |
290 | - | let dynamic = $ | |
291 | - | let rewardCachedPartKEY = $ | |
329 | + | let $t01155311688 = calcReward(userAddress, asset, stakedAmountX, depositNumUser, depositNumLast) | |
330 | + | let rewardTotal = $t01155311688._1 | |
331 | + | let cached = $t01155311688._2 | |
332 | + | let dynamic = $t01155311688._3 | |
333 | + | let rewardCachedPartKEY = $t01155311688._4 | |
292 | 334 | (accum :+ IntegerEntry(rewardCachedPartKEY, rewardTotal)) | |
293 | 335 | } | |
294 | 336 | ||
334 | 376 | ||
335 | 377 | ||
336 | 378 | func mergeStake (userAddress,amountToAdd,userTeen,userKid) = { | |
337 | - | let $ | |
338 | - | let isNewUser = $ | |
339 | - | let stakedAmount = $ | |
340 | - | let vpEffectiveHeight = $ | |
379 | + | let $t01460914719 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
380 | + | let isNewUser = $t01460914719._1 | |
381 | + | let stakedAmount = $t01460914719._2 | |
382 | + | let vpEffectiveHeight = $t01460914719._3 | |
341 | 383 | let stakedAmountNEW = if (isNewUser) | |
342 | 384 | then amountToAdd | |
343 | 385 | else (amountToAdd + stakedAmount) | |
428 | 470 | ||
429 | 471 | ||
430 | 472 | func commonStake (userAddress,i) = { | |
431 | - | let $ | |
432 | - | let stakedAssetId = $ | |
433 | - | let minLockAmount = $ | |
473 | + | let $t02060620660 = getParamsOrFail() | |
474 | + | let stakedAssetId = $t02060620660._1 | |
475 | + | let minLockAmount = $t02060620660._2 | |
434 | 476 | if ((size(i.payments) != 1)) | |
435 | 477 | then throw("Invalid payments size") | |
436 | 478 | else { | |
452 | 494 | if ((minLockAmount > stakedAmountNEW)) | |
453 | 495 | then throw(("Min lock amount is " + toString(minLockAmount))) | |
454 | 496 | else { | |
455 | - | let $ | |
497 | + | let $t02151421616 = StatsResult(amount, 1, if (isNewUser) | |
456 | 498 | then 1 | |
457 | 499 | else 0) | |
458 | - | let statsEntries = $ | |
459 | - | let totalStaked = $ | |
460 | - | let totalStakedNew = $ | |
500 | + | let statsEntries = $t02151421616._1 | |
501 | + | let totalStaked = $t02151421616._2 | |
502 | + | let totalStakedNew = $t02151421616._3 | |
461 | 503 | (((([HistoryRecordEntry("stake", userAddress, i.transactionId, stakedAmount, vpEffectiveHeight, stakedAmountNEW, vpEffectiveHeightNEW)] ++ RewardEntries(isNewUser, userAddressStr, stakedAmount)) ++ LockParamsEntry(userAddress, stakedAmountNEW, vpEffectiveHeightNEW)) ++ statsEntries) ++ r._1) | |
462 | 504 | } | |
463 | 505 | } | |
470 | 512 | if ((size(i.payments) > 0)) | |
471 | 513 | then throw("payments are not accepted") | |
472 | 514 | else { | |
473 | - | let $ | |
474 | - | let isNewUser = $ | |
475 | - | let stakedAmount = $ | |
476 | - | let stakingStart = $ | |
515 | + | let $t02212322228 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
516 | + | let isNewUser = $t02212322228._1 | |
517 | + | let stakedAmount = $t02212322228._2 | |
518 | + | let stakingStart = $t02212322228._3 | |
477 | 519 | let stakedAmountX = toBigInt(stakedAmount) | |
478 | 520 | let userRewardFromDepositNumKEY = keyUserRewardFromDepositNum(userAddressStr) | |
479 | 521 | let depositNumUser = getIntOrElse(userRewardFromDepositNumKEY, -1) | |
480 | 522 | let depositNumLast = getIntOrElse(keyDepositNumLast(), -1) | |
481 | 523 | func forEachAssetCalcUnclaimedReward (accum,asset) = { | |
482 | - | let $ | |
483 | - | let rewardTotal = $ | |
484 | - | let cached = $ | |
485 | - | let dynamic = $ | |
486 | - | let rewardCachedPartKEY = $ | |
524 | + | let $t02259922737 = calcReward(userAddressStr, asset, stakedAmountX, depositNumUser, depositNumLast) | |
525 | + | let rewardTotal = $t02259922737._1 | |
526 | + | let cached = $t02259922737._2 | |
527 | + | let dynamic = $t02259922737._3 | |
528 | + | let rewardCachedPartKEY = $t02259922737._4 | |
487 | 529 | let claimedKEY = keyClaimed(userAddressStr, asset) | |
488 | - | let $ | |
489 | - | let data = $ | |
490 | - | let claimedAmtByAsset = $ | |
530 | + | let $t02279722834 = accum | |
531 | + | let data = $t02279722834._1 | |
532 | + | let claimedAmtByAsset = $t02279722834._2 | |
491 | 533 | let newPart = makeString([asset, toString(rewardTotal)], ":") | |
492 | 534 | let claimedAmtByAssetNew = makeString([claimedAmtByAsset, newPart], "_") | |
493 | 535 | if ((0 >= rewardTotal)) | |
495 | 537 | else $Tuple2((((data :+ ScriptTransfer(userAddress, rewardTotal, toAssetVect(asset))) :+ IntegerEntry(claimedKEY, (valueOrElse(getInteger(claimedKEY), 0) + rewardTotal))) :+ IntegerEntry(rewardCachedPartKEY, 0)), claimedAmtByAssetNew) | |
496 | 538 | } | |
497 | 539 | ||
498 | - | let $ | |
540 | + | let $t02329423407 = { | |
499 | 541 | let $l = supportedAssetsList | |
500 | 542 | let $s = size($l) | |
501 | 543 | let $acc0 = $Tuple2(nil, "") | |
509 | 551 | ||
510 | 552 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9) | |
511 | 553 | } | |
512 | - | let transfers = $ | |
513 | - | let claimedAmtByAssetResult = $ | |
554 | + | let transfers = $t02329423407._1 | |
555 | + | let claimedAmtByAssetResult = $t02329423407._2 | |
514 | 556 | if ((0 >= size(transfers))) | |
515 | 557 | then $Tuple2(nil, 0) | |
516 | 558 | else $Tuple2(((transfers :+ IntegerEntry(userRewardFromDepositNumKEY, depositNumLast)) :+ ClaimHistoryEntry(userAddress, i.transactionId, drop(claimedAmtByAssetResult, 1))), size(transfers)) | |
541 | 583 | else { | |
542 | 584 | let userAddress = i.caller | |
543 | 585 | let userAddressStr = toString(userAddress) | |
544 | - | let $ | |
545 | - | let stakedAssetId = $ | |
546 | - | let minLockAmount = $ | |
547 | - | let $ | |
548 | - | let isNewUser = $ | |
549 | - | let stakedAmount = $ | |
550 | - | let vpEffectiveHeight = $ | |
586 | + | let $t02434324397 = getParamsOrFail() | |
587 | + | let stakedAssetId = $t02434324397._1 | |
588 | + | let minLockAmount = $t02434324397._2 | |
589 | + | let $t02440024484 = getUserParamsOrFail(userAddress) | |
590 | + | let isNewUser = $t02440024484._1 | |
591 | + | let stakedAmount = $t02440024484._2 | |
592 | + | let vpEffectiveHeight = $t02440024484._3 | |
551 | 593 | let swapParamsSTRUCT = asSwapParamsSTRUCT(reentrantInvoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStr, 0], nil)) | |
552 | 594 | let swapLimitSpentInUsdn = swapParamsSTRUCT._2 | |
553 | 595 | let blcks2LmtReset = swapParamsSTRUCT._3 | |
559 | 601 | then throw(((("Requested " + toString(amount)) + ", but staked only ") + toString(stakedAmount))) | |
560 | 602 | else { | |
561 | 603 | let stakedAmountNEW = (stakedAmount - amount) | |
562 | - | let $ | |
604 | + | let $t02512225280 = StatsResult(-(amount), if ((amount == stakedAmount)) | |
563 | 605 | then -1 | |
564 | 606 | else 0, if ((amount == stakedAmount)) | |
565 | 607 | then -1 | |
566 | 608 | else 0) | |
567 | - | let statsEntries = $ | |
568 | - | let totalStaked = $ | |
569 | - | let totalStakedNew = $ | |
609 | + | let statsEntries = $t02512225280._1 | |
610 | + | let totalStaked = $t02512225280._2 | |
611 | + | let totalStakedNew = $t02512225280._3 | |
570 | 612 | (((([ScriptTransfer(userAddress, amount, stakedAssetId), HistoryRecordEntry("unstake", userAddress, i.transactionId, stakedAmount, vpEffectiveHeight, stakedAmountNEW, vpEffectiveHeight)] ++ RewardEntries(false, userAddressStr, stakedAmount)) ++ LockParamsEntry(userAddress, stakedAmountNEW, vpEffectiveHeight)) ++ statsEntries) ++ onUnstake(userAddressStr, amount)._1) | |
571 | 613 | } | |
572 | 614 | } | |
584 | 626 | let depositNumNew = (depositNumLast + 1) | |
585 | 627 | let totalsKEY = keyStatsDepositAmtTotals() | |
586 | 628 | let byDayKEY = keyStatsDepositAmtByDay(toStartOfDay(lastBlock.timestamp)) | |
587 | - | let currTotals = split(valueOrElse(getString(totalsKEY), defaultTotalsDATA), SEP) | |
588 | - | let currByDay = split(valueOrElse(getString(byDayKEY), defaultTotalsDATA), SEP) | |
629 | + | let currTotals = padList(split(valueOrElse(getString(totalsKEY), defaultTotalsDATA), SEP)) | |
589 | 630 | func dep (acc,pmt) = { | |
590 | 631 | let amount = pmt.amount | |
591 | 632 | let pmtAssetIdStr = toBase58String(valueOrElse(pmt.assetId, WAVESID)) | |
614 | 655 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
615 | 656 | } | |
616 | 657 | func refreshRewardUpdateTotals (accum,nextAsset) = { | |
617 | - | let k = accum._ | |
658 | + | let k = accum._3 | |
618 | 659 | let sumLastStr = getStrOrElse(keyRewardPerNsbtSumAt(depositNumLast, nextAsset), "0") | |
619 | 660 | let idx = indexOf(pmtsResult._2, nextAsset) | |
620 | 661 | let sum = if (isDefined(idx)) | |
621 | 662 | then { | |
622 | 663 | let j = value(idx) | |
623 | 664 | let statsDelta = pmtsResult._4[j] | |
624 | - | $ | |
665 | + | $Tuple2(toString((parseBigIntValue(sumLastStr) + pmtsResult._3[j])), toString((parseIntValue(currTotals[(k + 1)]) + statsDelta))) | |
625 | 666 | } | |
626 | - | else $ | |
627 | - | $ | |
667 | + | else $Tuple2(sumLastStr, currTotals[(k + 1)]) | |
668 | + | $Tuple3((accum._1 :+ StringEntry(keyRewardPerNsbtSumAt(depositNumNew, nextAsset), sum._1)), ((accum._2 + SEP) + sum._2), (k + 1)) | |
628 | 669 | } | |
629 | 670 | ||
630 | 671 | let assetsResult = { | |
631 | 672 | let $l = supportedAssetsList | |
632 | 673 | let $s = size($l) | |
633 | - | let $acc0 = $ | |
674 | + | let $acc0 = $Tuple3(nil, DepositTotalsPREFIX, 0) | |
634 | 675 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
635 | 676 | then $a | |
636 | 677 | else refreshRewardUpdateTotals($a, $l[$i]) | |
641 | 682 | ||
642 | 683 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9) | |
643 | 684 | } | |
644 | - | $Tuple2((((((pmtsResult._1 ++ assetsResult._1) ++ updateTotals()) :+ IntegerEntry(depositNumLastKEY, depositNumNew)) :+ StringEntry(totalsKEY, assetsResult._2)) :+ StringEntry(byDayKEY, assetsResult._3)), depositNumNew) | |
685 | + | let totals = padString(assetsResult._2) | |
686 | + | $Tuple2((((((pmtsResult._1 ++ assetsResult._1) ++ updateTotals()) :+ IntegerEntry(depositNumLastKEY, depositNumNew)) :+ StringEntry(totalsKEY, totals)) :+ StringEntry(byDayKEY, totals)), depositNumNew) | |
645 | 687 | } | |
646 | 688 | } | |
647 | 689 | ||
678 | 720 | } | |
679 | 721 | else { | |
680 | 722 | let userAddress = addressFromStringValue(userAddressStr) | |
681 | - | let $ | |
682 | - | let isNewUser = $ | |
683 | - | let stakedAmount = $ | |
684 | - | let stakingStart = $ | |
723 | + | let $t02910429209 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
724 | + | let isNewUser = $t02910429209._1 | |
725 | + | let stakedAmount = $t02910429209._2 | |
726 | + | let stakingStart = $t02910429209._3 | |
685 | 727 | let stakedAmountX = toBigInt(stakedAmount) | |
686 | 728 | let userRewardFromDepositNumKEY = keyUserRewardFromDepositNum(userAddressStr) | |
687 | 729 | let depositNumUser = getIntOrElse(userRewardFromDepositNumKEY, -1) | |
688 | 730 | let depositNumLast = getIntOrElse(keyDepositNumLast(), -1) | |
689 | 731 | func forEachAssetCalcUnclaimedReward (accum,asset) = { | |
690 | - | let $ | |
691 | - | let rewardTotal = $ | |
692 | - | let cached = $ | |
693 | - | let dynamic = $ | |
694 | - | let rewardCachedPartKEY = $ | |
732 | + | let $t02955529693 = calcReward(userAddressStr, asset, stakedAmountX, depositNumUser, depositNumLast) | |
733 | + | let rewardTotal = $t02955529693._1 | |
734 | + | let cached = $t02955529693._2 | |
735 | + | let dynamic = $t02955529693._3 | |
736 | + | let rewardCachedPartKEY = $t02955529693._4 | |
695 | 737 | let claimed = valueOrElse(getInteger(keyClaimed(userAddressStr, asset)), 0) | |
696 | 738 | ((accum + makeString([asset, toString(rewardTotal), toString(claimed)], ":")) + "_") | |
697 | 739 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separator = "__" | |
5 | 5 | ||
6 | 6 | let SEP = "__" | |
7 | 7 | ||
8 | 8 | let MULT6 = 1000000 | |
9 | 9 | ||
10 | 10 | let MULT8 = 100000000 | |
11 | 11 | ||
12 | 12 | let MULTX6 = toBigInt(MULT6) | |
13 | 13 | ||
14 | 14 | let MULTX8 = toBigInt(MULT8) | |
15 | 15 | ||
16 | 16 | let MULTX18 = toBigInt(1000000000000000000) | |
17 | 17 | ||
18 | 18 | let WAVESIDSTR = "WAVES" | |
19 | 19 | ||
20 | 20 | let WAVESID = fromBase58String(WAVESIDSTR) | |
21 | 21 | ||
22 | 22 | let DAYMILLIS = 86400000 | |
23 | 23 | ||
24 | 24 | let DEFAULTPERIOD = (1440 * 14) | |
25 | 25 | ||
26 | 26 | let IdxControlCfgNeutrinoDapp = 1 | |
27 | 27 | ||
28 | 28 | let IdxControlCfgAuctionDapp = 2 | |
29 | 29 | ||
30 | 30 | let IdxControlCfgRpdDapp = 3 | |
31 | 31 | ||
32 | 32 | let IdxControlCfgMathDapp = 4 | |
33 | 33 | ||
34 | 34 | let IdxControlCfgLiquidationDapp = 5 | |
35 | 35 | ||
36 | 36 | let IdxControlCfgRestDapp = 6 | |
37 | 37 | ||
38 | 38 | let IdxControlCfgNodeRegistryDapp = 7 | |
39 | 39 | ||
40 | 40 | let IdxControlCfgNsbtStakingDapp = 8 | |
41 | 41 | ||
42 | 42 | let IdxControlCfgMediatorDapp = 9 | |
43 | 43 | ||
44 | 44 | let IdxControlCfgSurfStakingDapp = 10 | |
45 | 45 | ||
46 | 46 | let IdxControlCfgGnsbtControllerDapp = 11 | |
47 | 47 | ||
48 | 48 | let IdxControlCfgRestV2Dapp = 12 | |
49 | 49 | ||
50 | 50 | let IdxControlCfgGovernanceDapp = 13 | |
51 | 51 | ||
52 | 52 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined")) | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func keyControlAddress () = "%s%s__config__controlAddress" | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func keyControlCfg () = "%s__controlConfig" | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func keyGnsbtFromSurfCoeff () = "%s%s__cfg__gnsbtFromSurfCoeff" | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func readControlCfgOrFail (control) = split_4C(getStringOrFail(control, keyControlCfg()), SEP) | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func getContractAddressOrFail (controlCfg,idx) = valueOrErrorMessage(addressFromString(controlCfg[idx]), ("Control cfg doesn't contain address at index " + toString(idx))) | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | let controlContract = addressFromStringValue(valueOrElse(getString(this, keyControlAddress()), "3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx")) | |
71 | 71 | ||
72 | 72 | let controlCfg = readControlCfgOrFail(controlContract) | |
73 | 73 | ||
74 | 74 | let mathContract = getContractAddressOrFail(controlCfg, IdxControlCfgMathDapp) | |
75 | 75 | ||
76 | 76 | let neutrinoContract = getContractAddressOrFail(controlCfg, IdxControlCfgNeutrinoDapp) | |
77 | 77 | ||
78 | 78 | let auctionContract = getContractAddressOrFail(controlCfg, IdxControlCfgAuctionDapp) | |
79 | 79 | ||
80 | 80 | let govContract = getContractAddressOrFail(controlCfg, IdxControlCfgGovernanceDapp) | |
81 | 81 | ||
82 | 82 | let gnsbtFromSurfCoeff = valueOrElse(getInteger(this, keyGnsbtFromSurfCoeff()), 300) | |
83 | 83 | ||
84 | 84 | func keyBondAsset () = "bond_asset_id" | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func keyAuctionContractAddress () = "auction_contract" | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func keyMinLockAmount () = "%s__minLockAmount" | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func keyStakedAssetId () = "%s__stakedAssetId" | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func keyLockParamUserAmount (userAddress) = makeString(["%s%s%s", "paramByUser", toString(userAddress), "amount"], separator) | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func keyLockParamStartBlock (userAddress) = makeString(["%s%s%s", "paramByUser", toString(userAddress), "start"], separator) | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func keyLockParamVotingPowerEffectiveHeight (userAddress) = makeString(["%s%s%s", "paramByUser", toString(userAddress), "vpEffectiveHeight"], separator) | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func keyHistoryRecord (type,userAddress,txId) = makeString(["%s%s%s%s", "history", type, toString(userAddress), toBase58String(txId)], separator) | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func keyLockParamTotalAmount () = makeString(["%s%s", "stats", "activeTotalLocked"], separator) | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func keyStatsLocksCount () = makeString(["%s%s", "stats", "locksCount"], separator) | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func keyStatsUsersCount () = makeString(["%s%s", "stats", "activeUsersCount"], separator) | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func keyStatsDepositAmtByDay (timestamp) = makeString(["%s%s%d", "stats", "depositAmtByDay", toString(timestamp)], separator) | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func keyStatsDepositAmtTotals () = makeString(["%s%s%d", "stats", "depositAmtTotals"], separator) | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func keySupportedRewardAssets () = "supportedRewardAssets" | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func keyDepositNumLast () = makeString(["%s%s%s", "dep", "lastNum"], separator) | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func keyUserRewardFromDepositNum (userAddress) = makeString(["%s%s%s", "userRwdFromDepNum", userAddress], separator) | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func keyRewardPerNsbtSumAt (depositNum,tkn) = makeString(["%s%d", "rwdPerNsbtSumByDepNum", toString(depositNum), tkn], separator) | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func keyReward (userAddress,tkn) = makeString(["%s%s%s", "rwd", userAddress, tkn], separator) | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | func keyClaimed (userAddress,tkn) = makeString(["%s%s%s", "clm", userAddress, tkn], separator) | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | func keyNotDistributedReward (tkn) = makeString(["%s%s", "notDistributed", tkn], separator) | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | func keyVpPeriodDuration () = makeString(["%s%s", "vp", "periodDuration"], separator) | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | func keyLastTotalsPeriodProcessed () = makeString(["%s%s", "vp", "lastTotalsPeriodProcessed"], separator) | |
148 | 148 | ||
149 | 149 | ||
150 | 150 | func keyLastUserPeriodProcessed (userAddress) = makeString(["%s%s%s", "vp", "lastUserPeriodProcessed", userAddress], separator) | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | func keyTotalMature () = makeString(["%s%s", "vp", "totalMature"], separator) | |
154 | 154 | ||
155 | 155 | ||
156 | 156 | func keyTotalTeen () = makeString(["%s%s", "vp", "totalTeen"], separator) | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | func keyTotalKid () = makeString(["%s%s", "vp", "totalKid"], separator) | |
160 | 160 | ||
161 | 161 | ||
162 | 162 | func keyUserMature (userAddress) = makeString(["%s%s%s", "vp", "userMature", userAddress], separator) | |
163 | 163 | ||
164 | 164 | ||
165 | 165 | func keyUserTeen (userAddress) = makeString(["%s%s%s", "vp", "userTeen", userAddress], separator) | |
166 | 166 | ||
167 | 167 | ||
168 | 168 | func keyUserKid (userAddress) = makeString(["%s%s%s", "vp", "userKid", userAddress], separator) | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | func toX18 (origVal,origMult) = fraction(toBigInt(origVal), MULTX18, origMult) | |
172 | 172 | ||
173 | 173 | ||
174 | 174 | func getIntOrZero (key) = valueOrElse(getInteger(this, key), 0) | |
175 | 175 | ||
176 | 176 | ||
177 | 177 | func getIntOrElse (key,defaultVal) = valueOrElse(getInteger(this, key), defaultVal) | |
178 | 178 | ||
179 | 179 | ||
180 | 180 | func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), (("Mandatory this." + key) + " is not defined")) | |
181 | 181 | ||
182 | 182 | ||
183 | 183 | func getStrOrElse (key,defaultVal) = valueOrElse(getString(this, key), defaultVal) | |
184 | 184 | ||
185 | 185 | ||
186 | 186 | func toAddressOrFail (addressStr) = valueOrErrorMessage(addressFromString(addressStr), ("couldn't parse passed addressStr=" + addressStr)) | |
187 | 187 | ||
188 | 188 | ||
189 | 189 | func toAssetVect (assetStr) = if ((assetStr == WAVESIDSTR)) | |
190 | 190 | then unit | |
191 | 191 | else fromBase58String(assetStr) | |
192 | 192 | ||
193 | 193 | ||
194 | 194 | func asInt (val) = match val { | |
195 | 195 | case valInt: Int => | |
196 | 196 | valInt | |
197 | 197 | case _ => | |
198 | 198 | throw("fail to cast into Int") | |
199 | 199 | } | |
200 | 200 | ||
201 | 201 | ||
202 | 202 | func asSwapParamsSTRUCT (v) = match v { | |
203 | 203 | case struct: (Int, Int, Int, Int, Int, Int, Int) => | |
204 | 204 | struct | |
205 | 205 | case _ => | |
206 | 206 | throw("fail to cast into Int") | |
207 | 207 | } | |
208 | 208 | ||
209 | 209 | ||
210 | 210 | func formatHistoryRecord (oldAmount,oldStart,newAmount,newStart) = makeString(["%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(oldAmount), toString(oldStart), toString(newAmount), toString(newStart)], separator) | |
211 | 211 | ||
212 | 212 | ||
213 | 213 | func formatClaimHistoryRecord (user,claimedRewards) = makeString(["%s%d%d%s", user, toString(lastBlock.height), toString(lastBlock.timestamp), claimedRewards], separator) | |
214 | 214 | ||
215 | 215 | ||
216 | 216 | func HistoryRecordEntry (type,userAddress,txId,oldAmount,oldStart,newAmount,newStart) = StringEntry(keyHistoryRecord(type, userAddress, txId), formatHistoryRecord(oldAmount, oldStart, newAmount, newStart)) | |
217 | 217 | ||
218 | 218 | ||
219 | 219 | func ClaimHistoryEntry (userAddress,txId,claimedRewards) = StringEntry(keyHistoryRecord("claim", userAddress, txId), formatClaimHistoryRecord(toString(userAddress), claimedRewards)) | |
220 | 220 | ||
221 | 221 | ||
222 | 222 | func StatsResult (totalLockedInc,lockCountInc,usersCountInc) = { | |
223 | 223 | let locksCount = getIntOrZero(keyStatsLocksCount()) | |
224 | 224 | let usersCount = getIntOrZero(keyStatsUsersCount()) | |
225 | 225 | let totalAmount = getIntOrZero(keyLockParamTotalAmount()) | |
226 | 226 | let totalAmountNew = (totalAmount + totalLockedInc) | |
227 | 227 | $Tuple3([IntegerEntry(keyStatsLocksCount(), (locksCount + lockCountInc)), IntegerEntry(keyStatsUsersCount(), (usersCount + usersCountInc)), IntegerEntry(keyLockParamTotalAmount(), totalAmountNew)], totalAmount, totalAmountNew) | |
228 | 228 | } | |
229 | 229 | ||
230 | 230 | ||
231 | 231 | func LockParamsEntry (userAddress,amount,votingPowerEffectiveHeight) = [IntegerEntry(keyLockParamUserAmount(userAddress), amount), IntegerEntry(keyLockParamStartBlock(userAddress), votingPowerEffectiveHeight)] | |
232 | 232 | ||
233 | 233 | ||
234 | 234 | func getParamsOrFail () = $Tuple2(fromBase58String(getStringOrFail(this, keyStakedAssetId())), getIntOrFail(keyMinLockAmount())) | |
235 | 235 | ||
236 | 236 | ||
237 | 237 | func isActiveUser (userAddress) = (getIntOrElse(keyLockParamUserAmount(userAddress), 0) > 0) | |
238 | 238 | ||
239 | 239 | ||
240 | 240 | func getUserParamsOrUnit (userAddress) = if (isActiveUser(userAddress)) | |
241 | 241 | then $Tuple3(false, getIntOrFail(keyLockParamUserAmount(userAddress)), getIntOrFail(keyLockParamStartBlock(userAddress))) | |
242 | 242 | else unit | |
243 | 243 | ||
244 | 244 | ||
245 | 245 | func getUserParamsOrFail (userAddress) = valueOrErrorMessage(getUserParamsOrUnit(userAddress), (("User " + toString(userAddress)) + " is not defined")) | |
246 | 246 | ||
247 | 247 | ||
248 | 248 | let supportedAssetsStr = getStrOrElse(keySupportedRewardAssets(), "") | |
249 | 249 | ||
250 | 250 | let supportedAssetsList = split(supportedAssetsStr, "_") | |
251 | 251 | ||
252 | 252 | func calcReward (userAddress,assetId,stakedAmountX,depositNumUser,depositNumLast) = { | |
253 | 253 | let rewardPerNsbtSumLastKEY = keyRewardPerNsbtSumAt(depositNumLast, assetId) | |
254 | 254 | let sumLastX18 = parseBigIntValue(getStrOrElse(keyRewardPerNsbtSumAt(depositNumLast, assetId), "0")) | |
255 | 255 | let sumUserX18 = parseBigIntValue(getStrOrElse(keyRewardPerNsbtSumAt(depositNumUser, assetId), "0")) | |
256 | 256 | let rewardDynamicPart = toInt(fraction((sumLastX18 - sumUserX18), stakedAmountX, MULTX18)) | |
257 | 257 | let rewardCachedPartKEY = keyReward(userAddress, assetId) | |
258 | 258 | let rewardCachedPart = getIntOrElse(rewardCachedPartKEY, 0) | |
259 | 259 | $Tuple4((rewardCachedPart + rewardDynamicPart), rewardCachedPart, rewardDynamicPart, rewardCachedPartKEY) | |
260 | 260 | } | |
261 | 261 | ||
262 | 262 | ||
263 | 263 | func toStartOfDay (timestamp) = ((timestamp / DAYMILLIS) * DAYMILLIS) | |
264 | 264 | ||
265 | 265 | ||
266 | 266 | func findElementPosition (src,element,sep) = { | |
267 | 267 | let elementStart = valueOrErrorMessage(indexOf(src, element), ((("there is no substring " + element) + " in ") + src)) | |
268 | 268 | if ((elementStart == 0)) | |
269 | 269 | then 0 | |
270 | 270 | else { | |
271 | 271 | let left = take(src, elementStart) | |
272 | 272 | (size(split(left, sep)) - 1) | |
273 | 273 | } | |
274 | 274 | } | |
275 | 275 | ||
276 | 276 | ||
277 | 277 | let DepositTotalsPREFIX = "%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d" | |
278 | 278 | ||
279 | 279 | let defaultTotalsDATA = (DepositTotalsPREFIX + "__0__0__0__0__0__0__0__0__0__0__0__0__0__0__0__0__0__0") | |
280 | 280 | ||
281 | + | func padList (in) = { | |
282 | + | let currSize = (size(in) - 1) | |
283 | + | func listPadder (acc,idx) = if ((currSize > idx)) | |
284 | + | then acc | |
285 | + | else (acc :+ "0") | |
286 | + | ||
287 | + | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] | |
288 | + | let $s = size($l) | |
289 | + | let $acc0 = in | |
290 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
291 | + | then $a | |
292 | + | else listPadder($a, $l[$i]) | |
293 | + | ||
294 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
295 | + | then $a | |
296 | + | else throw("List size exceeds 18") | |
297 | + | ||
298 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18) | |
299 | + | } | |
300 | + | ||
301 | + | ||
302 | + | func padString (in) = { | |
303 | + | let currSize = (size(split_4C(in, SEP)) - 1) | |
304 | + | func strPadder (acc,idx) = if ((currSize > idx)) | |
305 | + | then acc | |
306 | + | else (acc + "__0") | |
307 | + | ||
308 | + | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] | |
309 | + | let $s = size($l) | |
310 | + | let $acc0 = in | |
311 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
312 | + | then $a | |
313 | + | else strPadder($a, $l[$i]) | |
314 | + | ||
315 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
316 | + | then $a | |
317 | + | else throw("List size exceeds 18") | |
318 | + | ||
319 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18) | |
320 | + | } | |
321 | + | ||
322 | + | ||
281 | 323 | func RewardEntries (isNewUser,userAddress,stakedAmount) = { | |
282 | 324 | let stakedAmountX = toBigInt(stakedAmount) | |
283 | 325 | let userRewardFromDepositNumKEY = keyUserRewardFromDepositNum(userAddress) | |
284 | 326 | let depositNumUser = getIntOrElse(userRewardFromDepositNumKEY, -1) | |
285 | 327 | let depositNumLast = getIntOrElse(keyDepositNumLast(), -1) | |
286 | 328 | func forEachAssetCacheUserReward (accum,asset) = { | |
287 | - | let $ | |
288 | - | let rewardTotal = $ | |
289 | - | let cached = $ | |
290 | - | let dynamic = $ | |
291 | - | let rewardCachedPartKEY = $ | |
329 | + | let $t01155311688 = calcReward(userAddress, asset, stakedAmountX, depositNumUser, depositNumLast) | |
330 | + | let rewardTotal = $t01155311688._1 | |
331 | + | let cached = $t01155311688._2 | |
332 | + | let dynamic = $t01155311688._3 | |
333 | + | let rewardCachedPartKEY = $t01155311688._4 | |
292 | 334 | (accum :+ IntegerEntry(rewardCachedPartKEY, rewardTotal)) | |
293 | 335 | } | |
294 | 336 | ||
295 | 337 | if (if ((depositNumLast == -1)) | |
296 | 338 | then (depositNumUser == -1) | |
297 | 339 | else false) | |
298 | 340 | then nil | |
299 | 341 | else if (if ((depositNumLast == -1)) | |
300 | 342 | then (depositNumUser > -1) | |
301 | 343 | else false) | |
302 | 344 | then throw("invalid depositNumLast and depositNumUser state") | |
303 | 345 | else if (if ((depositNumLast > -1)) | |
304 | 346 | then (depositNumUser >= -1) | |
305 | 347 | else false) | |
306 | 348 | then if (isNewUser) | |
307 | 349 | then [IntegerEntry(userRewardFromDepositNumKEY, depositNumLast)] | |
308 | 350 | else ({ | |
309 | 351 | let $l = supportedAssetsList | |
310 | 352 | let $s = size($l) | |
311 | 353 | let $acc0 = nil | |
312 | 354 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
313 | 355 | then $a | |
314 | 356 | else forEachAssetCacheUserReward($a, $l[$i]) | |
315 | 357 | ||
316 | 358 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
317 | 359 | then $a | |
318 | 360 | else throw("List size exceeds 9") | |
319 | 361 | ||
320 | 362 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9) | |
321 | 363 | } :+ IntegerEntry(userRewardFromDepositNumKEY, depositNumLast)) | |
322 | 364 | else throw(((("uncovered condition: depositNumLast=" + toString(depositNumLast)) + " depositNumUser=") + toString(depositNumUser))) | |
323 | 365 | } | |
324 | 366 | ||
325 | 367 | ||
326 | 368 | func IncrementNotDistributedRewardEntry (tkn,amountInc) = { | |
327 | 369 | let notDistributedRewardKEY = keyNotDistributedReward(tkn) | |
328 | 370 | let notDistributedReward = getIntOrElse(notDistributedRewardKEY, 0) | |
329 | 371 | IntegerEntry(notDistributedRewardKEY, (notDistributedReward + amountInc)) | |
330 | 372 | } | |
331 | 373 | ||
332 | 374 | ||
333 | 375 | func surfToGnsbt (surfAmt) = (surfAmt / gnsbtFromSurfCoeff) | |
334 | 376 | ||
335 | 377 | ||
336 | 378 | func mergeStake (userAddress,amountToAdd,userTeen,userKid) = { | |
337 | - | let $ | |
338 | - | let isNewUser = $ | |
339 | - | let stakedAmount = $ | |
340 | - | let vpEffectiveHeight = $ | |
379 | + | let $t01460914719 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
380 | + | let isNewUser = $t01460914719._1 | |
381 | + | let stakedAmount = $t01460914719._2 | |
382 | + | let vpEffectiveHeight = $t01460914719._3 | |
341 | 383 | let stakedAmountNEW = if (isNewUser) | |
342 | 384 | then amountToAdd | |
343 | 385 | else (amountToAdd + stakedAmount) | |
344 | 386 | let W2 = getIntOrElse(keyVpPeriodDuration(), DEFAULTPERIOD) | |
345 | 387 | let period = (height / W2) | |
346 | 388 | let vpEffectivePeriodNEW = if ((userKid > 0)) | |
347 | 389 | then (period + 2) | |
348 | 390 | else if ((userTeen > 0)) | |
349 | 391 | then (period + 1) | |
350 | 392 | else period | |
351 | 393 | $Tuple5(isNewUser, stakedAmount, vpEffectiveHeight, stakedAmountNEW, (vpEffectivePeriodNEW * W2)) | |
352 | 394 | } | |
353 | 395 | ||
354 | 396 | ||
355 | 397 | func updateTotals () = { | |
356 | 398 | let period = (height / getIntOrElse(keyVpPeriodDuration(), DEFAULTPERIOD)) | |
357 | 399 | if ((period > getIntOrZero(keyLastTotalsPeriodProcessed()))) | |
358 | 400 | then { | |
359 | 401 | let totalMature = valueOrElse(getInteger(keyTotalMature()), getIntOrZero(keyLockParamTotalAmount())) | |
360 | 402 | [IntegerEntry(keyTotalMature(), (totalMature + getIntOrZero(keyTotalTeen()))), IntegerEntry(keyTotalTeen(), getIntOrZero(keyTotalKid())), IntegerEntry(keyTotalKid(), 0), IntegerEntry(keyLastTotalsPeriodProcessed(), period)] | |
361 | 403 | } | |
362 | 404 | else nil | |
363 | 405 | } | |
364 | 406 | ||
365 | 407 | ||
366 | 408 | func onStake (userAddressStr,amountToAdd) = if ((0 > amountToAdd)) | |
367 | 409 | then throw("amountToAdd should be >= 0") | |
368 | 410 | else { | |
369 | 411 | let W2 = getIntOrElse(keyVpPeriodDuration(), DEFAULTPERIOD) | |
370 | 412 | let period = (height / W2) | |
371 | 413 | let totalMature = valueOrElse(getInteger(keyTotalMature()), getIntOrZero(keyLockParamTotalAmount())) | |
372 | 414 | let totalTeen = getIntOrZero(keyTotalTeen()) | |
373 | 415 | let totalKid = getIntOrZero(keyTotalKid()) | |
374 | 416 | let userMature = if ((userAddressStr == "")) | |
375 | 417 | then 0 | |
376 | 418 | else valueOrElse(getInteger(keyUserMature(userAddressStr)), getIntOrZero(keyLockParamUserAmount(addressFromStringValue(userAddressStr)))) | |
377 | 419 | let userTeen = getIntOrZero(keyUserTeen(userAddressStr)) | |
378 | 420 | let userKid = getIntOrZero(keyUserKid(userAddressStr)) | |
379 | 421 | let tmp = if ((period > getIntOrZero(keyLastUserPeriodProcessed(userAddressStr)))) | |
380 | 422 | then $Tuple7((totalMature + userTeen), (totalTeen + (userKid - userTeen)), (totalKid - userKid), (userMature + userTeen), userKid, 0, [IntegerEntry(keyLastUserPeriodProcessed(userAddressStr), period)]) | |
381 | 423 | else $Tuple7(totalMature, totalTeen, totalKid, userMature, userTeen, userKid, nil) | |
382 | 424 | let totals = if ((period > getIntOrZero(keyLastTotalsPeriodProcessed()))) | |
383 | 425 | then $Tuple4([IntegerEntry(keyTotalMature(), (tmp._1 + tmp._2)), IntegerEntry(keyTotalTeen(), tmp._3), IntegerEntry(keyTotalKid(), 0), IntegerEntry(keyLastTotalsPeriodProcessed(), period)], (tmp._1 + tmp._2), tmp._3, 0) | |
384 | 426 | else $Tuple4(nil, totalMature, totalTeen, totalKid) | |
385 | 427 | let newKid = fraction(amountToAdd, (height % W2), W2) | |
386 | 428 | let newTeen = (amountToAdd - newKid) | |
387 | 429 | $Tuple7(((((totals._1 :+ IntegerEntry(keyUserMature(userAddressStr), tmp._4)) :+ IntegerEntry(keyUserTeen(userAddressStr), (tmp._5 + newTeen))) :+ IntegerEntry(keyUserKid(userAddressStr), (tmp._6 + newKid))) ++ tmp._7), totals._2, totals._3, totals._4, tmp._4, (tmp._5 + newTeen), (tmp._6 + newKid)) | |
388 | 430 | } | |
389 | 431 | ||
390 | 432 | ||
391 | 433 | let IdxNewDiff = 0 | |
392 | 434 | ||
393 | 435 | let IdxNewGnsbt = 1 | |
394 | 436 | ||
395 | 437 | func userDecrease (gnsbt,diff) = if ((diff >= gnsbt)) | |
396 | 438 | then [(diff - gnsbt), 0] | |
397 | 439 | else [0, (gnsbt - diff)] | |
398 | 440 | ||
399 | 441 | ||
400 | 442 | func onUnstake (userAddressStr,amountToRemove) = if ((0 >= amountToRemove)) | |
401 | 443 | then throw("amountToRemove should be > 0") | |
402 | 444 | else { | |
403 | 445 | let W2 = getIntOrElse(keyVpPeriodDuration(), DEFAULTPERIOD) | |
404 | 446 | let period = (height / W2) | |
405 | 447 | let totalMature = valueOrElse(getInteger(keyTotalMature()), getIntOrZero(keyLockParamTotalAmount())) | |
406 | 448 | let totalTeen = getIntOrZero(keyTotalTeen()) | |
407 | 449 | let totalKid = getIntOrZero(keyTotalKid()) | |
408 | 450 | let userMature = if ((userAddressStr == "")) | |
409 | 451 | then 0 | |
410 | 452 | else valueOrElse(getInteger(keyUserMature(userAddressStr)), getIntOrZero(keyLockParamUserAmount(addressFromStringValue(userAddressStr)))) | |
411 | 453 | let userTeen = getIntOrZero(keyUserTeen(userAddressStr)) | |
412 | 454 | let userKid = getIntOrZero(keyUserKid(userAddressStr)) | |
413 | 455 | let um = userDecrease(userMature, amountToRemove) | |
414 | 456 | let ut = userDecrease(userTeen, um[IdxNewDiff]) | |
415 | 457 | let uk = userDecrease(userKid, ut[IdxNewDiff]) | |
416 | 458 | if ((uk[IdxNewDiff] != 0)) | |
417 | 459 | then throw("Should not happen") | |
418 | 460 | else { | |
419 | 461 | let tmp = if ((period > getIntOrZero(keyLastUserPeriodProcessed(userAddressStr)))) | |
420 | 462 | then $Tuple7((totalMature + ut[IdxNewGnsbt]), (totalTeen + (uk[IdxNewGnsbt] - ut[IdxNewGnsbt])), (totalKid - uk[IdxNewGnsbt]), (um[IdxNewGnsbt] + ut[IdxNewGnsbt]), uk[IdxNewGnsbt], 0, [IntegerEntry(keyLastUserPeriodProcessed(userAddressStr), period)]) | |
421 | 463 | else $Tuple7(totalMature, totalTeen, totalKid, um[IdxNewGnsbt], ut[IdxNewGnsbt], uk[IdxNewGnsbt], nil) | |
422 | 464 | let totals = if ((period > getIntOrZero(keyLastTotalsPeriodProcessed()))) | |
423 | 465 | then $Tuple4([IntegerEntry(keyTotalMature(), (tmp._1 + tmp._2)), IntegerEntry(keyTotalTeen(), tmp._3), IntegerEntry(keyTotalKid(), 0), IntegerEntry(keyLastTotalsPeriodProcessed(), period)], (tmp._1 + tmp._2), tmp._3, 0) | |
424 | 466 | else $Tuple4(nil, totalMature, totalTeen, totalKid) | |
425 | 467 | $Tuple7(((((totals._1 :+ IntegerEntry(keyUserMature(userAddressStr), tmp._4)) :+ IntegerEntry(keyUserTeen(userAddressStr), tmp._5)) :+ IntegerEntry(keyUserKid(userAddressStr), tmp._6)) ++ tmp._7), totals._2, totals._3, totals._4, tmp._4, tmp._5, tmp._6) | |
426 | 468 | } | |
427 | 469 | } | |
428 | 470 | ||
429 | 471 | ||
430 | 472 | func commonStake (userAddress,i) = { | |
431 | - | let $ | |
432 | - | let stakedAssetId = $ | |
433 | - | let minLockAmount = $ | |
473 | + | let $t02060620660 = getParamsOrFail() | |
474 | + | let stakedAssetId = $t02060620660._1 | |
475 | + | let minLockAmount = $t02060620660._2 | |
434 | 476 | if ((size(i.payments) != 1)) | |
435 | 477 | then throw("Invalid payments size") | |
436 | 478 | else { | |
437 | 479 | let payment = i.payments[0] | |
438 | 480 | let amount = payment.amount | |
439 | 481 | let invalidAssetMessage = (("Invalid asset. " + toBase58String(stakedAssetId)) + " is expected") | |
440 | 482 | let assetId = valueOrErrorMessage(payment.assetId, invalidAssetMessage) | |
441 | 483 | if ((assetId != stakedAssetId)) | |
442 | 484 | then throw(invalidAssetMessage) | |
443 | 485 | else { | |
444 | 486 | let userAddressStr = toString(userAddress) | |
445 | 487 | let r = onStake(userAddressStr, amount) | |
446 | 488 | let mergedData = mergeStake(userAddress, amount, r._6, r._7) | |
447 | 489 | let isNewUser = mergedData._1 | |
448 | 490 | let stakedAmount = mergedData._2 | |
449 | 491 | let vpEffectiveHeight = mergedData._3 | |
450 | 492 | let stakedAmountNEW = mergedData._4 | |
451 | 493 | let vpEffectiveHeightNEW = mergedData._5 | |
452 | 494 | if ((minLockAmount > stakedAmountNEW)) | |
453 | 495 | then throw(("Min lock amount is " + toString(minLockAmount))) | |
454 | 496 | else { | |
455 | - | let $ | |
497 | + | let $t02151421616 = StatsResult(amount, 1, if (isNewUser) | |
456 | 498 | then 1 | |
457 | 499 | else 0) | |
458 | - | let statsEntries = $ | |
459 | - | let totalStaked = $ | |
460 | - | let totalStakedNew = $ | |
500 | + | let statsEntries = $t02151421616._1 | |
501 | + | let totalStaked = $t02151421616._2 | |
502 | + | let totalStakedNew = $t02151421616._3 | |
461 | 503 | (((([HistoryRecordEntry("stake", userAddress, i.transactionId, stakedAmount, vpEffectiveHeight, stakedAmountNEW, vpEffectiveHeightNEW)] ++ RewardEntries(isNewUser, userAddressStr, stakedAmount)) ++ LockParamsEntry(userAddress, stakedAmountNEW, vpEffectiveHeightNEW)) ++ statsEntries) ++ r._1) | |
462 | 504 | } | |
463 | 505 | } | |
464 | 506 | } | |
465 | 507 | } | |
466 | 508 | ||
467 | 509 | ||
468 | 510 | func commonClaim (userAddress,i) = { | |
469 | 511 | let userAddressStr = toString(userAddress) | |
470 | 512 | if ((size(i.payments) > 0)) | |
471 | 513 | then throw("payments are not accepted") | |
472 | 514 | else { | |
473 | - | let $ | |
474 | - | let isNewUser = $ | |
475 | - | let stakedAmount = $ | |
476 | - | let stakingStart = $ | |
515 | + | let $t02212322228 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
516 | + | let isNewUser = $t02212322228._1 | |
517 | + | let stakedAmount = $t02212322228._2 | |
518 | + | let stakingStart = $t02212322228._3 | |
477 | 519 | let stakedAmountX = toBigInt(stakedAmount) | |
478 | 520 | let userRewardFromDepositNumKEY = keyUserRewardFromDepositNum(userAddressStr) | |
479 | 521 | let depositNumUser = getIntOrElse(userRewardFromDepositNumKEY, -1) | |
480 | 522 | let depositNumLast = getIntOrElse(keyDepositNumLast(), -1) | |
481 | 523 | func forEachAssetCalcUnclaimedReward (accum,asset) = { | |
482 | - | let $ | |
483 | - | let rewardTotal = $ | |
484 | - | let cached = $ | |
485 | - | let dynamic = $ | |
486 | - | let rewardCachedPartKEY = $ | |
524 | + | let $t02259922737 = calcReward(userAddressStr, asset, stakedAmountX, depositNumUser, depositNumLast) | |
525 | + | let rewardTotal = $t02259922737._1 | |
526 | + | let cached = $t02259922737._2 | |
527 | + | let dynamic = $t02259922737._3 | |
528 | + | let rewardCachedPartKEY = $t02259922737._4 | |
487 | 529 | let claimedKEY = keyClaimed(userAddressStr, asset) | |
488 | - | let $ | |
489 | - | let data = $ | |
490 | - | let claimedAmtByAsset = $ | |
530 | + | let $t02279722834 = accum | |
531 | + | let data = $t02279722834._1 | |
532 | + | let claimedAmtByAsset = $t02279722834._2 | |
491 | 533 | let newPart = makeString([asset, toString(rewardTotal)], ":") | |
492 | 534 | let claimedAmtByAssetNew = makeString([claimedAmtByAsset, newPart], "_") | |
493 | 535 | if ((0 >= rewardTotal)) | |
494 | 536 | then $Tuple2(data, claimedAmtByAssetNew) | |
495 | 537 | else $Tuple2((((data :+ ScriptTransfer(userAddress, rewardTotal, toAssetVect(asset))) :+ IntegerEntry(claimedKEY, (valueOrElse(getInteger(claimedKEY), 0) + rewardTotal))) :+ IntegerEntry(rewardCachedPartKEY, 0)), claimedAmtByAssetNew) | |
496 | 538 | } | |
497 | 539 | ||
498 | - | let $ | |
540 | + | let $t02329423407 = { | |
499 | 541 | let $l = supportedAssetsList | |
500 | 542 | let $s = size($l) | |
501 | 543 | let $acc0 = $Tuple2(nil, "") | |
502 | 544 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
503 | 545 | then $a | |
504 | 546 | else forEachAssetCalcUnclaimedReward($a, $l[$i]) | |
505 | 547 | ||
506 | 548 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
507 | 549 | then $a | |
508 | 550 | else throw("List size exceeds 9") | |
509 | 551 | ||
510 | 552 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9) | |
511 | 553 | } | |
512 | - | let transfers = $ | |
513 | - | let claimedAmtByAssetResult = $ | |
554 | + | let transfers = $t02329423407._1 | |
555 | + | let claimedAmtByAssetResult = $t02329423407._2 | |
514 | 556 | if ((0 >= size(transfers))) | |
515 | 557 | then $Tuple2(nil, 0) | |
516 | 558 | else $Tuple2(((transfers :+ IntegerEntry(userRewardFromDepositNumKEY, depositNumLast)) :+ ClaimHistoryEntry(userAddress, i.transactionId, drop(claimedAmtByAssetResult, 1))), size(transfers)) | |
517 | 559 | } | |
518 | 560 | } | |
519 | 561 | ||
520 | 562 | ||
521 | 563 | @Callable(i) | |
522 | 564 | func constructorV1 (minLockAmount,supportedRewardAssets,stakedAssetId) = if ((i.caller != this)) | |
523 | 565 | then throw("Permission denied") | |
524 | 566 | else [IntegerEntry(keyMinLockAmount(), minLockAmount), StringEntry(keySupportedRewardAssets(), supportedRewardAssets), StringEntry(keyStakedAssetId(), stakedAssetId)] | |
525 | 567 | ||
526 | 568 | ||
527 | 569 | ||
528 | 570 | @Callable(i) | |
529 | 571 | func stake () = commonStake(i.caller, i) | |
530 | 572 | ||
531 | 573 | ||
532 | 574 | ||
533 | 575 | @Callable(i) | |
534 | 576 | func stakeByOriginCaller () = commonStake(i.originCaller, i) | |
535 | 577 | ||
536 | 578 | ||
537 | 579 | ||
538 | 580 | @Callable(i) | |
539 | 581 | func unstake (amount) = if ((size(i.payments) != 0)) | |
540 | 582 | then throw("unstake doesn't require any payment") | |
541 | 583 | else { | |
542 | 584 | let userAddress = i.caller | |
543 | 585 | let userAddressStr = toString(userAddress) | |
544 | - | let $ | |
545 | - | let stakedAssetId = $ | |
546 | - | let minLockAmount = $ | |
547 | - | let $ | |
548 | - | let isNewUser = $ | |
549 | - | let stakedAmount = $ | |
550 | - | let vpEffectiveHeight = $ | |
586 | + | let $t02434324397 = getParamsOrFail() | |
587 | + | let stakedAssetId = $t02434324397._1 | |
588 | + | let minLockAmount = $t02434324397._2 | |
589 | + | let $t02440024484 = getUserParamsOrFail(userAddress) | |
590 | + | let isNewUser = $t02440024484._1 | |
591 | + | let stakedAmount = $t02440024484._2 | |
592 | + | let vpEffectiveHeight = $t02440024484._3 | |
551 | 593 | let swapParamsSTRUCT = asSwapParamsSTRUCT(reentrantInvoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStr, 0], nil)) | |
552 | 594 | let swapLimitSpentInUsdn = swapParamsSTRUCT._2 | |
553 | 595 | let blcks2LmtReset = swapParamsSTRUCT._3 | |
554 | 596 | if ((swapLimitSpentInUsdn > 0)) | |
555 | 597 | then throw((("You have already made a swap operation. Wait " + toString((height + blcks2LmtReset))) + " height to unstake")) | |
556 | 598 | else if ((0 >= stakedAmount)) | |
557 | 599 | then throw("Nothing to unstake") | |
558 | 600 | else if ((amount > stakedAmount)) | |
559 | 601 | then throw(((("Requested " + toString(amount)) + ", but staked only ") + toString(stakedAmount))) | |
560 | 602 | else { | |
561 | 603 | let stakedAmountNEW = (stakedAmount - amount) | |
562 | - | let $ | |
604 | + | let $t02512225280 = StatsResult(-(amount), if ((amount == stakedAmount)) | |
563 | 605 | then -1 | |
564 | 606 | else 0, if ((amount == stakedAmount)) | |
565 | 607 | then -1 | |
566 | 608 | else 0) | |
567 | - | let statsEntries = $ | |
568 | - | let totalStaked = $ | |
569 | - | let totalStakedNew = $ | |
609 | + | let statsEntries = $t02512225280._1 | |
610 | + | let totalStaked = $t02512225280._2 | |
611 | + | let totalStakedNew = $t02512225280._3 | |
570 | 612 | (((([ScriptTransfer(userAddress, amount, stakedAssetId), HistoryRecordEntry("unstake", userAddress, i.transactionId, stakedAmount, vpEffectiveHeight, stakedAmountNEW, vpEffectiveHeight)] ++ RewardEntries(false, userAddressStr, stakedAmount)) ++ LockParamsEntry(userAddress, stakedAmountNEW, vpEffectiveHeight)) ++ statsEntries) ++ onUnstake(userAddressStr, amount)._1) | |
571 | 613 | } | |
572 | 614 | } | |
573 | 615 | ||
574 | 616 | ||
575 | 617 | ||
576 | 618 | @Callable(i) | |
577 | 619 | func deposit () = { | |
578 | 620 | let totalStaked = getIntOrElse(keyLockParamTotalAmount(), 0) | |
579 | 621 | if ((0 > totalStaked)) | |
580 | 622 | then throw("TODO: case is not supported") | |
581 | 623 | else { | |
582 | 624 | let depositNumLastKEY = keyDepositNumLast() | |
583 | 625 | let depositNumLast = getIntOrElse(depositNumLastKEY, -1) | |
584 | 626 | let depositNumNew = (depositNumLast + 1) | |
585 | 627 | let totalsKEY = keyStatsDepositAmtTotals() | |
586 | 628 | let byDayKEY = keyStatsDepositAmtByDay(toStartOfDay(lastBlock.timestamp)) | |
587 | - | let currTotals = split(valueOrElse(getString(totalsKEY), defaultTotalsDATA), SEP) | |
588 | - | let currByDay = split(valueOrElse(getString(byDayKEY), defaultTotalsDATA), SEP) | |
629 | + | let currTotals = padList(split(valueOrElse(getString(totalsKEY), defaultTotalsDATA), SEP)) | |
589 | 630 | func dep (acc,pmt) = { | |
590 | 631 | let amount = pmt.amount | |
591 | 632 | let pmtAssetIdStr = toBase58String(valueOrElse(pmt.assetId, WAVESID)) | |
592 | 633 | if (!(contains(supportedAssetsStr, pmtAssetIdStr))) | |
593 | 634 | then throw(((supportedAssetsStr + " doesn't contain ") + pmtAssetIdStr)) | |
594 | 635 | else if ((totalStaked == 0)) | |
595 | 636 | then $Tuple4((acc._1 :+ IncrementNotDistributedRewardEntry(pmtAssetIdStr, amount)), (acc._2 :+ pmtAssetIdStr), (acc._3 :+ toBigInt(0)), (acc._4 :+ amount)) | |
596 | 637 | else { | |
597 | 638 | let rewardPerNsbtX18 = fraction(toBigInt(amount), MULTX18, toBigInt(totalStaked)) | |
598 | 639 | $Tuple4(acc._1, (acc._2 :+ pmtAssetIdStr), (acc._3 :+ rewardPerNsbtX18), (acc._4 :+ amount)) | |
599 | 640 | } | |
600 | 641 | } | |
601 | 642 | ||
602 | 643 | let pmtsResult = { | |
603 | 644 | let $l = i.payments | |
604 | 645 | let $s = size($l) | |
605 | 646 | let $acc0 = $Tuple4(nil, nil, nil, nil) | |
606 | 647 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
607 | 648 | then $a | |
608 | 649 | else dep($a, $l[$i]) | |
609 | 650 | ||
610 | 651 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
611 | 652 | then $a | |
612 | 653 | else throw("List size exceeds 10") | |
613 | 654 | ||
614 | 655 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
615 | 656 | } | |
616 | 657 | func refreshRewardUpdateTotals (accum,nextAsset) = { | |
617 | - | let k = accum._ | |
658 | + | let k = accum._3 | |
618 | 659 | let sumLastStr = getStrOrElse(keyRewardPerNsbtSumAt(depositNumLast, nextAsset), "0") | |
619 | 660 | let idx = indexOf(pmtsResult._2, nextAsset) | |
620 | 661 | let sum = if (isDefined(idx)) | |
621 | 662 | then { | |
622 | 663 | let j = value(idx) | |
623 | 664 | let statsDelta = pmtsResult._4[j] | |
624 | - | $ | |
665 | + | $Tuple2(toString((parseBigIntValue(sumLastStr) + pmtsResult._3[j])), toString((parseIntValue(currTotals[(k + 1)]) + statsDelta))) | |
625 | 666 | } | |
626 | - | else $ | |
627 | - | $ | |
667 | + | else $Tuple2(sumLastStr, currTotals[(k + 1)]) | |
668 | + | $Tuple3((accum._1 :+ StringEntry(keyRewardPerNsbtSumAt(depositNumNew, nextAsset), sum._1)), ((accum._2 + SEP) + sum._2), (k + 1)) | |
628 | 669 | } | |
629 | 670 | ||
630 | 671 | let assetsResult = { | |
631 | 672 | let $l = supportedAssetsList | |
632 | 673 | let $s = size($l) | |
633 | - | let $acc0 = $ | |
674 | + | let $acc0 = $Tuple3(nil, DepositTotalsPREFIX, 0) | |
634 | 675 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
635 | 676 | then $a | |
636 | 677 | else refreshRewardUpdateTotals($a, $l[$i]) | |
637 | 678 | ||
638 | 679 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
639 | 680 | then $a | |
640 | 681 | else throw("List size exceeds 9") | |
641 | 682 | ||
642 | 683 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9) | |
643 | 684 | } | |
644 | - | $Tuple2((((((pmtsResult._1 ++ assetsResult._1) ++ updateTotals()) :+ IntegerEntry(depositNumLastKEY, depositNumNew)) :+ StringEntry(totalsKEY, assetsResult._2)) :+ StringEntry(byDayKEY, assetsResult._3)), depositNumNew) | |
685 | + | let totals = padString(assetsResult._2) | |
686 | + | $Tuple2((((((pmtsResult._1 ++ assetsResult._1) ++ updateTotals()) :+ IntegerEntry(depositNumLastKEY, depositNumNew)) :+ StringEntry(totalsKEY, totals)) :+ StringEntry(byDayKEY, totals)), depositNumNew) | |
645 | 687 | } | |
646 | 688 | } | |
647 | 689 | ||
648 | 690 | ||
649 | 691 | ||
650 | 692 | @Callable(i) | |
651 | 693 | func claimRewards () = commonClaim(i.caller, i) | |
652 | 694 | ||
653 | 695 | ||
654 | 696 | ||
655 | 697 | @Callable(i) | |
656 | 698 | func claimRewardsByOriginCaller () = commonClaim(i.originCaller, i) | |
657 | 699 | ||
658 | 700 | ||
659 | 701 | ||
660 | 702 | @Callable(i) | |
661 | 703 | func unclaimedRewardsREADONLY (userAddressStr) = { | |
662 | 704 | func forEachAssetZeroReward (accum,asset) = ((accum + makeString([asset, "0", "0"], ":")) + "_") | |
663 | 705 | ||
664 | 706 | let unclaimedRewardStr = if ((userAddressStr == "")) | |
665 | 707 | then { | |
666 | 708 | let $l = supportedAssetsList | |
667 | 709 | let $s = size($l) | |
668 | 710 | let $acc0 = "" | |
669 | 711 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
670 | 712 | then $a | |
671 | 713 | else forEachAssetZeroReward($a, $l[$i]) | |
672 | 714 | ||
673 | 715 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
674 | 716 | then $a | |
675 | 717 | else throw("List size exceeds 9") | |
676 | 718 | ||
677 | 719 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9) | |
678 | 720 | } | |
679 | 721 | else { | |
680 | 722 | let userAddress = addressFromStringValue(userAddressStr) | |
681 | - | let $ | |
682 | - | let isNewUser = $ | |
683 | - | let stakedAmount = $ | |
684 | - | let stakingStart = $ | |
723 | + | let $t02910429209 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
724 | + | let isNewUser = $t02910429209._1 | |
725 | + | let stakedAmount = $t02910429209._2 | |
726 | + | let stakingStart = $t02910429209._3 | |
685 | 727 | let stakedAmountX = toBigInt(stakedAmount) | |
686 | 728 | let userRewardFromDepositNumKEY = keyUserRewardFromDepositNum(userAddressStr) | |
687 | 729 | let depositNumUser = getIntOrElse(userRewardFromDepositNumKEY, -1) | |
688 | 730 | let depositNumLast = getIntOrElse(keyDepositNumLast(), -1) | |
689 | 731 | func forEachAssetCalcUnclaimedReward (accum,asset) = { | |
690 | - | let $ | |
691 | - | let rewardTotal = $ | |
692 | - | let cached = $ | |
693 | - | let dynamic = $ | |
694 | - | let rewardCachedPartKEY = $ | |
732 | + | let $t02955529693 = calcReward(userAddressStr, asset, stakedAmountX, depositNumUser, depositNumLast) | |
733 | + | let rewardTotal = $t02955529693._1 | |
734 | + | let cached = $t02955529693._2 | |
735 | + | let dynamic = $t02955529693._3 | |
736 | + | let rewardCachedPartKEY = $t02955529693._4 | |
695 | 737 | let claimed = valueOrElse(getInteger(keyClaimed(userAddressStr, asset)), 0) | |
696 | 738 | ((accum + makeString([asset, toString(rewardTotal), toString(claimed)], ":")) + "_") | |
697 | 739 | } | |
698 | 740 | ||
699 | 741 | let $l = supportedAssetsList | |
700 | 742 | let $s = size($l) | |
701 | 743 | let $acc0 = "" | |
702 | 744 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
703 | 745 | then $a | |
704 | 746 | else forEachAssetCalcUnclaimedReward($a, $l[$i]) | |
705 | 747 | ||
706 | 748 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
707 | 749 | then $a | |
708 | 750 | else throw("List size exceeds 9") | |
709 | 751 | ||
710 | 752 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9) | |
711 | 753 | } | |
712 | 754 | $Tuple2(nil, dropRight(unclaimedRewardStr, 1)) | |
713 | 755 | } | |
714 | 756 | ||
715 | 757 | ||
716 | 758 | ||
717 | 759 | @Callable(i) | |
718 | 760 | func updateVotingPower (userAddressStr) = if (!(isDefined(addressFromString(userAddressStr)))) | |
719 | 761 | then throw("Invalid user address") | |
720 | 762 | else { | |
721 | 763 | let r = onStake(userAddressStr, 0) | |
722 | 764 | $Tuple2(r._1, [surfToGnsbt(r._2), surfToGnsbt(r._3), surfToGnsbt(r._4), surfToGnsbt(r._5), surfToGnsbt(r._6), surfToGnsbt(r._7)]) | |
723 | 765 | } | |
724 | 766 | ||
725 | 767 | ||
726 | 768 | ||
727 | 769 | @Callable(i) | |
728 | 770 | func surfStakingSYSREADONLY (userAddressStrOrEmpty,surfDiff) = { | |
729 | 771 | let surfTotal = getIntOrElse(keyLockParamTotalAmount(), 0) | |
730 | 772 | let gnsbtFromSurfTotal = surfToGnsbt(surfTotal) | |
731 | 773 | let r = if ((surfDiff >= 0)) | |
732 | 774 | then onStake(userAddressStrOrEmpty, surfDiff) | |
733 | 775 | else onUnstake(userAddressStrOrEmpty, -(surfDiff)) | |
734 | 776 | if ((userAddressStrOrEmpty == "")) | |
735 | 777 | then $Tuple2(nil, [0, surfTotal, 0, gnsbtFromSurfTotal, height, height, surfToGnsbt(r._2), surfToGnsbt(r._3), surfToGnsbt(r._4), surfToGnsbt(r._5), surfToGnsbt(r._6), surfToGnsbt(r._7)]) | |
736 | 778 | else { | |
737 | 779 | let userAddress = toAddressOrFail(userAddressStrOrEmpty) | |
738 | 780 | let mergedData = mergeStake(userAddress, surfDiff, r._6, r._7) | |
739 | 781 | let stakedAmount = mergedData._2 | |
740 | 782 | let vpEffectiveHeight = mergedData._3 | |
741 | 783 | let stakedAmountNEW = mergedData._4 | |
742 | 784 | let vpEffectiveHeightNEW = mergedData._5 | |
743 | 785 | let surfUser = stakedAmount | |
744 | 786 | let gnsbtFromSurfUser = surfToGnsbt(surfUser) | |
745 | 787 | $Tuple2(nil, [surfUser, surfTotal, gnsbtFromSurfUser, gnsbtFromSurfTotal, vpEffectiveHeight, vpEffectiveHeightNEW, surfToGnsbt(r._2), surfToGnsbt(r._3), surfToGnsbt(r._4), surfToGnsbt(r._5), surfToGnsbt(r._6), surfToGnsbt(r._7)]) | |
746 | 788 | } | |
747 | 789 | } | |
748 | 790 | ||
749 | 791 | ||
750 | 792 | ||
751 | 793 | @Callable(i) | |
752 | 794 | func gnsbtFromSurfSYSREADONLY (surfAmt) = $Tuple2(nil, surfToGnsbt(surfAmt)) | |
753 | 795 | ||
754 | 796 | ||
755 | 797 | ||
756 | 798 | @Callable(i) | |
757 | 799 | func configSYSREADONLY () = { | |
758 | 800 | let minLockAmt = getIntegerValue(keyMinLockAmount()) | |
759 | 801 | let surfVotingPowerRestrictivePeriod = DEFAULTPERIOD | |
760 | 802 | let brToStartSurfTransformation = 1150000 | |
761 | 803 | $Tuple2(nil, [minLockAmt, (gnsbtFromSurfCoeff * MULT6), surfVotingPowerRestrictivePeriod, brToStartSurfTransformation]) | |
762 | 804 | } | |
763 | 805 | ||
764 | 806 |
github/deemru/w8io/026f985 138.35 ms ◑