tx · GsLUb9dpdNVscnP7U2ijTwc3kesXhUnLCAcBec14k8wU 3N5yarEiTQccnnuerogYT3BxM5Zc5bRgDZy: -0.03100000 Waves 2023.02.10 10:54 [2443255] smart account 3N5yarEiTQccnnuerogYT3BxM5Zc5bRgDZy > SELF 0.00000000 Waves
{ "type": 13, "id": "GsLUb9dpdNVscnP7U2ijTwc3kesXhUnLCAcBec14k8wU", "fee": 3100000, "feeAssetId": null, "timestamp": 1676015675393, "version": 2, "chainId": 84, "sender": "3N5yarEiTQccnnuerogYT3BxM5Zc5bRgDZy", "senderPublicKey": "FK9j3YFWVChXKESTn33fMZz1JseCNMMqHhfB7smxJo4e", "proofs": [ "57tQRRWAgFJgZpZn1gyeaUeUHehTMUugZhXiCxUd2KKmfKLhwmqizUX7kQhkqtYw8cMHYLx8ijjhWn94WTLHBTx1" ], "script": "base64:BgIvCAISBQoDAQgIEgASABIDCgEBEgASABIAEgMKAQgSAwoBCBIECgIIARIDCgEBEgBpAAlzZXBhcmF0b3ICAl9fAANTRVACAl9fAAVNVUxUNgDAhD0ABU1VTFQ4AIDC1y8ABk1VTFRYNgkAtgIBBQVNVUxUNgAGTVVMVFg4CQC2AgEFBU1VTFQ4AAdNVUxUWDE4CQC2AgEAgICQu7rWrfANAApXQVZFU0lEU1RSAgVXQVZFUwAHV0FWRVNJRAkA2QQBBQpXQVZFU0lEU1RSAAlEQVlNSUxMSVMAgLiZKQANREVGQVVMVFBFUklPRAkAaAIAoAsADgAZSWR4Q29udHJvbENmZ05ldXRyaW5vRGFwcAABABhJZHhDb250cm9sQ2ZnQXVjdGlvbkRhcHAAAgAUSWR4Q29udHJvbENmZ1JwZERhcHAAAwAVSWR4Q29udHJvbENmZ01hdGhEYXBwAAQAHElkeENvbnRyb2xDZmdMaXF1aWRhdGlvbkRhcHAABQAVSWR4Q29udHJvbENmZ1Jlc3REYXBwAAYAHUlkeENvbnRyb2xDZmdOb2RlUmVnaXN0cnlEYXBwAAcAHElkeENvbnRyb2xDZm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cmZUcmFuc2Zvcm1hdGlvbgCwmEYJAJQKAgUDbmlsCQDMCAIFCm1pbkxvY2tBbXQJAMwIAgkAaAIFEmduc2J0RnJvbVN1cmZDb2VmZgUFTVVMVDYJAMwIAgUgc3VyZlZvdGluZ1Bvd2VyUmVzdHJpY3RpdmVQZXJpb2QJAMwIAgUbYnJUb1N0YXJ0U3VyZlRyYW5zZm9ybWF0aW9uBQNuaWwASLBkiA==", "height": 2443255, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BPc8E4DJmBDdKqE58NFoQaajKT35tKuEqz8aBYMFufUR Next: 94erSyJ8UaKoRPtegm4j4K6jMHv8AHodkbVV7SdUX3T9 Diff:
Old | New | Differences | |
---|---|---|---|
117 | 117 | func keyStatsDepositAmtByDay (timestamp) = makeString(["%s%s%d", "stats", "depositAmtByDay", toString(timestamp)], separator) | |
118 | 118 | ||
119 | 119 | ||
120 | - | func keyStatsDepositAmtTotals () = makeString(["%s%s", "stats", "depositAmtTotals"], separator) | |
120 | + | func keyStatsDepositAmtTotals () = makeString(["%s%s%d", "stats", "depositAmtTotals"], separator) | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func keySupportedRewardAssets () = "supportedRewardAssets" | |
124 | 124 | ||
125 | 125 | ||
126 | - | func keyDepositNumLast () = makeString(["%s%s", "dep", "lastNum"], separator) | |
126 | + | func keyDepositNumLast () = makeString(["%s%s%s", "dep", "lastNum"], separator) | |
127 | 127 | ||
128 | 128 | ||
129 | - | func keyUserRewardFromDepositNum (userAddress) = makeString(["%s%s", "userRwdFromDepNum", userAddress], separator) | |
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) | |
304 | 304 | let depositNumUser = getIntOrElse(userRewardFromDepositNumKEY, -1) | |
305 | 305 | let depositNumLast = getIntOrElse(keyDepositNumLast(), -1) | |
306 | 306 | func forEachAssetCacheUserReward (accum,asset) = { | |
307 | - | let $ | |
308 | - | let rewardTotal = $ | |
309 | - | let cached = $ | |
310 | - | let dynamic = $ | |
311 | - | let rewardCachedPartKEY = $ | |
307 | + | let $t01211012245 = calcReward(userAddress, asset, stakedAmountX, depositNumUser, depositNumLast) | |
308 | + | let rewardTotal = $t01211012245._1 | |
309 | + | let cached = $t01211012245._2 | |
310 | + | let dynamic = $t01211012245._3 | |
311 | + | let rewardCachedPartKEY = $t01211012245._4 | |
312 | 312 | (accum :+ IntegerEntry(rewardCachedPartKEY, rewardTotal)) | |
313 | 313 | } | |
314 | 314 | ||
346 | 346 | func IncrementNotDistributedRewardEntry (tkn,amountInc) = { | |
347 | 347 | let notDistributedRewardKEY = keyNotDistributedReward(tkn) | |
348 | 348 | let notDistributedReward = getIntOrElse(notDistributedRewardKEY, 0) | |
349 | - | ||
349 | + | IntegerEntry(notDistributedRewardKEY, (notDistributedReward + amountInc)) | |
350 | 350 | } | |
351 | 351 | ||
352 | 352 | ||
354 | 354 | ||
355 | 355 | ||
356 | 356 | func mergeStake (userAddress,amountToAdd,userTeen,userKid) = { | |
357 | - | let $ | |
358 | - | let isNewUser = $ | |
359 | - | let stakedAmount = $ | |
360 | - | let vpEffectiveHeight = $ | |
357 | + | let $t01516615276 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
358 | + | let isNewUser = $t01516615276._1 | |
359 | + | let stakedAmount = $t01516615276._2 | |
360 | + | let vpEffectiveHeight = $t01516615276._3 | |
361 | 361 | let stakedAmountNEW = if (isNewUser) | |
362 | 362 | then amountToAdd | |
363 | 363 | else (amountToAdd + stakedAmount) | |
417 | 417 | else [0, (gnsbt - diff)] | |
418 | 418 | ||
419 | 419 | ||
420 | - | func onUnstake (userAddressStr,amountToRemove) = if (( | |
421 | - | then throw("amountToRemove should be | |
420 | + | func onUnstake (userAddressStr,amountToRemove) = if ((0 >= amountToRemove)) | |
421 | + | then throw("amountToRemove should be > 0") | |
422 | 422 | else { | |
423 | 423 | let W2 = getIntOrElse(keyVpPeriodDuration(), DEFAULTPERIOD) | |
424 | 424 | let period = (height / W2) | |
448 | 448 | ||
449 | 449 | ||
450 | 450 | func commonStake (userAddress,i) = { | |
451 | - | let $ | |
452 | - | let stakedAssetId = $ | |
453 | - | let minLockAmount = $ | |
451 | + | let $t02116321217 = getParamsOrFail() | |
452 | + | let stakedAssetId = $t02116321217._1 | |
453 | + | let minLockAmount = $t02116321217._2 | |
454 | 454 | if ((size(i.payments) != 1)) | |
455 | 455 | then throw("Invalid payments size") | |
456 | 456 | else { | |
472 | 472 | if ((minLockAmount > stakedAmountNEW)) | |
473 | 473 | then throw(("Min lock amount is " + toString(minLockAmount))) | |
474 | 474 | else { | |
475 | - | let $ | |
475 | + | let $t02207122173 = StatsResult(amount, 1, if (isNewUser) | |
476 | 476 | then 1 | |
477 | 477 | else 0) | |
478 | - | let statsEntries = $ | |
479 | - | let totalStaked = $ | |
480 | - | let totalStakedNew = $ | |
478 | + | let statsEntries = $t02207122173._1 | |
479 | + | let totalStaked = $t02207122173._2 | |
480 | + | let totalStakedNew = $t02207122173._3 | |
481 | 481 | (((([HistoryRecordEntry("stake", userAddress, i.transactionId, stakedAmount, vpEffectiveHeight, stakedAmountNEW, vpEffectiveHeightNEW)] ++ RewardEntries(isNewUser, userAddressStr, stakedAmount)) ++ LockParamsEntry(userAddress, stakedAmountNEW, vpEffectiveHeightNEW)) ++ statsEntries) ++ r._1) | |
482 | 482 | } | |
483 | 483 | } | |
490 | 490 | if ((size(i.payments) > 0)) | |
491 | 491 | then throw("payments are not accepted") | |
492 | 492 | else { | |
493 | - | let $ | |
494 | - | let isNewUser = $ | |
495 | - | let stakedAmount = $ | |
496 | - | let stakingStart = $ | |
493 | + | let $t02268022785 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
494 | + | let isNewUser = $t02268022785._1 | |
495 | + | let stakedAmount = $t02268022785._2 | |
496 | + | let stakingStart = $t02268022785._3 | |
497 | 497 | let stakedAmountX = toBigInt(stakedAmount) | |
498 | 498 | let userRewardFromDepositNumKEY = keyUserRewardFromDepositNum(userAddressStr) | |
499 | 499 | let depositNumUser = getIntOrElse(userRewardFromDepositNumKEY, -1) | |
500 | 500 | let depositNumLast = getIntOrElse(keyDepositNumLast(), -1) | |
501 | 501 | func forEachAssetCalcUnclaimedReward (accum,asset) = { | |
502 | - | let $ | |
503 | - | let rewardTotal = $ | |
504 | - | let cached = $ | |
505 | - | let dynamic = $ | |
506 | - | let rewardCachedPartKEY = $ | |
502 | + | let $t02315623294 = calcReward(userAddressStr, asset, stakedAmountX, depositNumUser, depositNumLast) | |
503 | + | let rewardTotal = $t02315623294._1 | |
504 | + | let cached = $t02315623294._2 | |
505 | + | let dynamic = $t02315623294._3 | |
506 | + | let rewardCachedPartKEY = $t02315623294._4 | |
507 | 507 | let claimedKEY = keyClaimed(userAddressStr, asset) | |
508 | - | let $ | |
509 | - | let data = $ | |
510 | - | let claimedAmtByAsset = $ | |
508 | + | let $t02335423391 = accum | |
509 | + | let data = $t02335423391._1 | |
510 | + | let claimedAmtByAsset = $t02335423391._2 | |
511 | 511 | let newPart = makeString([asset, toString(rewardTotal)], ":") | |
512 | 512 | let claimedAmtByAssetNew = makeString([claimedAmtByAsset, newPart], "_") | |
513 | 513 | if ((0 >= rewardTotal)) | |
515 | 515 | else $Tuple2((((data :+ ScriptTransfer(userAddress, rewardTotal, toAssetVect(asset))) :+ IntegerEntry(claimedKEY, (valueOrElse(getInteger(claimedKEY), 0) + rewardTotal))) :+ IntegerEntry(rewardCachedPartKEY, 0)), claimedAmtByAssetNew) | |
516 | 516 | } | |
517 | 517 | ||
518 | - | let $ | |
518 | + | let $t02385123964 = { | |
519 | 519 | let $l = supportedAssetsList | |
520 | 520 | let $s = size($l) | |
521 | 521 | let $acc0 = $Tuple2(nil, "") | |
529 | 529 | ||
530 | 530 | $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) | |
531 | 531 | } | |
532 | - | let transfers = $ | |
533 | - | let claimedAmtByAssetResult = $ | |
532 | + | let transfers = $t02385123964._1 | |
533 | + | let claimedAmtByAssetResult = $t02385123964._2 | |
534 | 534 | if ((0 >= size(transfers))) | |
535 | 535 | then $Tuple2(nil, 0) | |
536 | 536 | else $Tuple2(((transfers :+ IntegerEntry(userRewardFromDepositNumKEY, depositNumLast)) :+ ClaimHistoryEntry(userAddress, i.transactionId, drop(claimedAmtByAssetResult, 1))), size(transfers)) | |
539 | 539 | ||
540 | 540 | ||
541 | 541 | @Callable(i) | |
542 | - | func | |
542 | + | func constructorV1 (minLockAmount,supportedRewardAssets,stakedAssetId) = if ((i.caller != this)) | |
543 | 543 | then throw("Permission denied") | |
544 | 544 | else [IntegerEntry(keyMinLockAmount(), minLockAmount), StringEntry(keySupportedRewardAssets(), supportedRewardAssets), StringEntry(keyStakedAssetId(), stakedAssetId)] | |
545 | 545 | ||
561 | 561 | else { | |
562 | 562 | let userAddress = i.caller | |
563 | 563 | let userAddressStr = toString(userAddress) | |
564 | - | let $ | |
565 | - | let stakedAssetId = $ | |
566 | - | let minLockAmount = $ | |
567 | - | let $ | |
568 | - | let isNewUser = $ | |
569 | - | let stakedAmount = $ | |
570 | - | let vpEffectiveHeight = $ | |
564 | + | let $t02490024954 = getParamsOrFail() | |
565 | + | let stakedAssetId = $t02490024954._1 | |
566 | + | let minLockAmount = $t02490024954._2 | |
567 | + | let $t02495725041 = getUserParamsOrFail(userAddress) | |
568 | + | let isNewUser = $t02495725041._1 | |
569 | + | let stakedAmount = $t02495725041._2 | |
570 | + | let vpEffectiveHeight = $t02495725041._3 | |
571 | 571 | let swapParamsSTRUCT = asSwapParamsSTRUCT(reentrantInvoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStr, 0], nil)) | |
572 | 572 | let swapLimitSpentInUsdn = swapParamsSTRUCT._2 | |
573 | 573 | let blcks2LmtReset = swapParamsSTRUCT._3 | |
579 | 579 | then throw(((("Requested " + toString(amount)) + ", but staked only ") + toString(stakedAmount))) | |
580 | 580 | else { | |
581 | 581 | let stakedAmountNEW = (stakedAmount - amount) | |
582 | - | let $ | |
582 | + | let $t02567925837 = StatsResult(-(amount), if ((amount == stakedAmount)) | |
583 | 583 | then -1 | |
584 | 584 | else 0, if ((amount == stakedAmount)) | |
585 | 585 | then -1 | |
586 | 586 | else 0) | |
587 | - | let statsEntries = $ | |
588 | - | let totalStaked = $ | |
589 | - | let totalStakedNew = $ | |
587 | + | let statsEntries = $t02567925837._1 | |
588 | + | let totalStaked = $t02567925837._2 | |
589 | + | let totalStakedNew = $t02567925837._3 | |
590 | 590 | (((([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) | |
591 | 591 | } | |
592 | 592 | } | |
594 | 594 | ||
595 | 595 | ||
596 | 596 | @Callable(i) | |
597 | - | func deposit () = if ((size(i.payments) != 1)) | |
598 | - | then throw("exact 1 payment is allowed only") | |
599 | - | else { | |
600 | - | let pmt = i.payments[0] | |
601 | - | let amount = pmt.amount | |
602 | - | let pmtAssetId = valueOrElse(pmt.assetId, WAVESID) | |
603 | - | let pmtAssetIdStr = toBase58String(pmtAssetId) | |
604 | - | let pmtMultX = if ((pmtAssetId == WAVESID)) | |
605 | - | then MULTX8 | |
606 | - | else MULTX6 | |
607 | - | let amountX = toBigInt(amount) | |
608 | - | let totalStaked = getIntOrElse(keyLockParamTotalAmount(), 0) | |
609 | - | let totalStakedX = toBigInt(totalStaked) | |
610 | - | if ((0 > totalStaked)) | |
611 | - | then throw("TODO: case is not supported") | |
612 | - | else if ((totalStaked == 0)) | |
613 | - | then IncrementNotDistributedRewardEntry(pmtAssetIdStr, amount) | |
614 | - | else { | |
615 | - | let rewardPerNsbtX18 = fraction(amountX, MULTX18, totalStakedX) | |
616 | - | let depositNumLastKEY = keyDepositNumLast() | |
617 | - | let depositNumLast = getIntOrElse(depositNumLastKEY, -1) | |
618 | - | let depositNumNew = (depositNumLast + 1) | |
619 | - | if (!(contains(supportedAssetsStr, pmtAssetIdStr))) | |
620 | - | then throw(((supportedAssetsStr + " doesn't contain ") + pmtAssetIdStr)) | |
597 | + | func deposit () = { | |
598 | + | let totalStaked = getIntOrElse(keyLockParamTotalAmount(), 0) | |
599 | + | if ((0 > totalStaked)) | |
600 | + | then throw("TODO: case is not supported") | |
601 | + | else { | |
602 | + | let depositNumLastKEY = keyDepositNumLast() | |
603 | + | let depositNumLast = getIntOrElse(depositNumLastKEY, -1) | |
604 | + | let depositNumNew = (depositNumLast + 1) | |
605 | + | func dep (acc,pmt) = { | |
606 | + | let amount = pmt.amount | |
607 | + | let pmtAssetId = valueOrElse(pmt.assetId, WAVESID) | |
608 | + | let pmtAssetIdStr = toBase58String(pmtAssetId) | |
609 | + | if (!(contains(supportedAssetsStr, pmtAssetIdStr))) | |
610 | + | then throw(((supportedAssetsStr + " doesn't contain ") + pmtAssetIdStr)) | |
611 | + | else if ((totalStaked == 0)) | |
612 | + | then (acc :+ IncrementNotDistributedRewardEntry(pmtAssetIdStr, amount)) | |
621 | 613 | else { | |
614 | + | let rewardPerNsbtX18 = fraction(toBigInt(amount), MULTX18, toBigInt(totalStaked)) | |
622 | 615 | func refreshRewardPerNsbtSUM (accum,nextAsset) = { | |
623 | - | let rewardPerNsbtSumNewKEY = keyRewardPerNsbtSumAt(depositNumNew, nextAsset) | |
624 | 616 | let sumLastStr = getStrOrElse(keyRewardPerNsbtSumAt(depositNumLast, nextAsset), "0") | |
625 | - | (accum :+ (if ((nextAsset == pmtAssetIdStr)) | |
626 | - | then | |
627 | - | else | |
617 | + | (accum :+ StringEntry(keyRewardPerNsbtSumAt(depositNumNew, nextAsset), if ((nextAsset == pmtAssetIdStr)) | |
618 | + | then toString((parseBigIntValue(sumLastStr) + rewardPerNsbtX18)) | |
619 | + | else sumLastStr)) | |
628 | 620 | } | |
629 | 621 | ||
630 | - | (( | |
622 | + | ((acc ++ { | |
631 | 623 | let $l = supportedAssetsList | |
632 | 624 | let $s = size($l) | |
633 | 625 | let $acc0 = nil | |
640 | 632 | else throw("List size exceeds 9") | |
641 | 633 | ||
642 | 634 | $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) | |
643 | - | } | |
635 | + | }) ++ DepositsTotalsEntries(amount, pmtAssetIdStr)) | |
644 | 636 | } | |
645 | - | } | |
646 | - | } | |
637 | + | } | |
638 | + | ||
639 | + | (({ | |
640 | + | let $l = i.payments | |
641 | + | let $s = size($l) | |
642 | + | let $acc0 = nil | |
643 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
644 | + | then $a | |
645 | + | else dep($a, $l[$i]) | |
646 | + | ||
647 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
648 | + | then $a | |
649 | + | else throw("List size exceeds 10") | |
650 | + | ||
651 | + | $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) | |
652 | + | } ++ updateTotals()) :+ IntegerEntry(depositNumLastKEY, depositNumNew)) | |
653 | + | } | |
654 | + | } | |
647 | 655 | ||
648 | 656 | ||
649 | 657 | ||
678 | 686 | } | |
679 | 687 | else { | |
680 | 688 | let userAddress = addressFromStringValue(userAddressStr) | |
681 | - | let $ | |
682 | - | let isNewUser = $ | |
683 | - | let stakedAmount = $ | |
684 | - | let stakingStart = $ | |
689 | + | let $t02835928464 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
690 | + | let isNewUser = $t02835928464._1 | |
691 | + | let stakedAmount = $t02835928464._2 | |
692 | + | let stakingStart = $t02835928464._3 | |
685 | 693 | let stakedAmountX = toBigInt(stakedAmount) | |
686 | 694 | let userRewardFromDepositNumKEY = keyUserRewardFromDepositNum(userAddressStr) | |
687 | 695 | let depositNumUser = getIntOrElse(userRewardFromDepositNumKEY, -1) | |
688 | 696 | let depositNumLast = getIntOrElse(keyDepositNumLast(), -1) | |
689 | 697 | func forEachAssetCalcUnclaimedReward (accum,asset) = { | |
690 | - | let $ | |
691 | - | let rewardTotal = $ | |
692 | - | let cached = $ | |
693 | - | let dynamic = $ | |
694 | - | let rewardCachedPartKEY = $ | |
698 | + | let $t02881028948 = calcReward(userAddressStr, asset, stakedAmountX, depositNumUser, depositNumLast) | |
699 | + | let rewardTotal = $t02881028948._1 | |
700 | + | let cached = $t02881028948._2 | |
701 | + | let dynamic = $t02881028948._3 | |
702 | + | let rewardCachedPartKEY = $t02881028948._4 | |
695 | 703 | let claimed = valueOrElse(getInteger(keyClaimed(userAddressStr, asset)), 0) | |
696 | 704 | ((accum + makeString([asset, toString(rewardTotal), toString(claimed)], ":")) + "_") | |
697 | 705 | } | |
730 | 738 | let gnsbtFromSurfTotal = surfToGnsbt(surfTotal) | |
731 | 739 | let r = if ((surfDiff >= 0)) | |
732 | 740 | then onStake(userAddressStrOrEmpty, surfDiff) | |
733 | - | else onUnstake(userAddressStrOrEmpty, surfDiff) | |
741 | + | else onUnstake(userAddressStrOrEmpty, -(surfDiff)) | |
734 | 742 | if ((userAddressStrOrEmpty == "")) | |
735 | 743 | 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 | 744 | else { |
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 | - | func keyStatsDepositAmtTotals () = makeString(["%s%s", "stats", "depositAmtTotals"], separator) | |
120 | + | func keyStatsDepositAmtTotals () = makeString(["%s%s%d", "stats", "depositAmtTotals"], separator) | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func keySupportedRewardAssets () = "supportedRewardAssets" | |
124 | 124 | ||
125 | 125 | ||
126 | - | func keyDepositNumLast () = makeString(["%s%s", "dep", "lastNum"], separator) | |
126 | + | func keyDepositNumLast () = makeString(["%s%s%s", "dep", "lastNum"], separator) | |
127 | 127 | ||
128 | 128 | ||
129 | - | func keyUserRewardFromDepositNum (userAddress) = makeString(["%s%s", "userRwdFromDepNum", userAddress], separator) | |
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 | func updateDepositTotals (currVal,idxToUpdate,deltaAmt) = { | |
280 | 280 | let currArr = split(currVal, SEP) | |
281 | 281 | func updDepTotByIdx (idx) = if ((idx != idxToUpdate)) | |
282 | 282 | then currArr[idx] | |
283 | 283 | else toString((parseIntValue(currArr[idx]) + deltaAmt)) | |
284 | 284 | ||
285 | 285 | makeString([DepositTotalsPREFIX, updDepTotByIdx(1), updDepTotByIdx(2), updDepTotByIdx(3), updDepTotByIdx(4), updDepTotByIdx(5), updDepTotByIdx(6), updDepTotByIdx(7), updDepTotByIdx(8), updDepTotByIdx(9), updDepTotByIdx(10), updDepTotByIdx(11), updDepTotByIdx(12), updDepTotByIdx(13), updDepTotByIdx(14), updDepTotByIdx(15), updDepTotByIdx(16), updDepTotByIdx(17), updDepTotByIdx(18)], SEP) | |
286 | 286 | } | |
287 | 287 | ||
288 | 288 | ||
289 | 289 | func DepositsTotalsEntries (depositAmount,assetIdStr) = { | |
290 | 290 | let startOfDay = toStartOfDay(lastBlock.timestamp) | |
291 | 291 | let byDayKEY = keyStatsDepositAmtByDay(startOfDay) | |
292 | 292 | let totalsKEY = keyStatsDepositAmtTotals() | |
293 | 293 | let position = findElementPosition(supportedAssetsStr, assetIdStr, "_") | |
294 | 294 | let defaultDATA = (DepositTotalsPREFIX + "__0__0__0__0__0__0__0__0__0__0__0__0__0__0__0__0__0__0") | |
295 | 295 | let currTotalsDATA = valueOrElse(getString(this, totalsKEY), defaultDATA) | |
296 | 296 | let newTotalsDATA = updateDepositTotals(currTotalsDATA, (position + 1), depositAmount) | |
297 | 297 | [StringEntry(totalsKEY, newTotalsDATA), StringEntry(byDayKEY, newTotalsDATA)] | |
298 | 298 | } | |
299 | 299 | ||
300 | 300 | ||
301 | 301 | func RewardEntries (isNewUser,userAddress,stakedAmount) = { | |
302 | 302 | let stakedAmountX = toBigInt(stakedAmount) | |
303 | 303 | let userRewardFromDepositNumKEY = keyUserRewardFromDepositNum(userAddress) | |
304 | 304 | let depositNumUser = getIntOrElse(userRewardFromDepositNumKEY, -1) | |
305 | 305 | let depositNumLast = getIntOrElse(keyDepositNumLast(), -1) | |
306 | 306 | func forEachAssetCacheUserReward (accum,asset) = { | |
307 | - | let $ | |
308 | - | let rewardTotal = $ | |
309 | - | let cached = $ | |
310 | - | let dynamic = $ | |
311 | - | let rewardCachedPartKEY = $ | |
307 | + | let $t01211012245 = calcReward(userAddress, asset, stakedAmountX, depositNumUser, depositNumLast) | |
308 | + | let rewardTotal = $t01211012245._1 | |
309 | + | let cached = $t01211012245._2 | |
310 | + | let dynamic = $t01211012245._3 | |
311 | + | let rewardCachedPartKEY = $t01211012245._4 | |
312 | 312 | (accum :+ IntegerEntry(rewardCachedPartKEY, rewardTotal)) | |
313 | 313 | } | |
314 | 314 | ||
315 | 315 | if (if ((depositNumLast == -1)) | |
316 | 316 | then (depositNumUser == -1) | |
317 | 317 | else false) | |
318 | 318 | then nil | |
319 | 319 | else if (if ((depositNumLast == -1)) | |
320 | 320 | then (depositNumUser > -1) | |
321 | 321 | else false) | |
322 | 322 | then throw("invalid depositNumLast and depositNumUser state") | |
323 | 323 | else if (if ((depositNumLast > -1)) | |
324 | 324 | then (depositNumUser >= -1) | |
325 | 325 | else false) | |
326 | 326 | then if (isNewUser) | |
327 | 327 | then [IntegerEntry(userRewardFromDepositNumKEY, depositNumLast)] | |
328 | 328 | else ({ | |
329 | 329 | let $l = supportedAssetsList | |
330 | 330 | let $s = size($l) | |
331 | 331 | let $acc0 = nil | |
332 | 332 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
333 | 333 | then $a | |
334 | 334 | else forEachAssetCacheUserReward($a, $l[$i]) | |
335 | 335 | ||
336 | 336 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
337 | 337 | then $a | |
338 | 338 | else throw("List size exceeds 9") | |
339 | 339 | ||
340 | 340 | $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) | |
341 | 341 | } :+ IntegerEntry(userRewardFromDepositNumKEY, depositNumLast)) | |
342 | 342 | else throw(((("uncovered condition: depositNumLast=" + toString(depositNumLast)) + " depositNumUser=") + toString(depositNumUser))) | |
343 | 343 | } | |
344 | 344 | ||
345 | 345 | ||
346 | 346 | func IncrementNotDistributedRewardEntry (tkn,amountInc) = { | |
347 | 347 | let notDistributedRewardKEY = keyNotDistributedReward(tkn) | |
348 | 348 | let notDistributedReward = getIntOrElse(notDistributedRewardKEY, 0) | |
349 | - | ||
349 | + | IntegerEntry(notDistributedRewardKEY, (notDistributedReward + amountInc)) | |
350 | 350 | } | |
351 | 351 | ||
352 | 352 | ||
353 | 353 | func surfToGnsbt (surfAmt) = (surfAmt / gnsbtFromSurfCoeff) | |
354 | 354 | ||
355 | 355 | ||
356 | 356 | func mergeStake (userAddress,amountToAdd,userTeen,userKid) = { | |
357 | - | let $ | |
358 | - | let isNewUser = $ | |
359 | - | let stakedAmount = $ | |
360 | - | let vpEffectiveHeight = $ | |
357 | + | let $t01516615276 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
358 | + | let isNewUser = $t01516615276._1 | |
359 | + | let stakedAmount = $t01516615276._2 | |
360 | + | let vpEffectiveHeight = $t01516615276._3 | |
361 | 361 | let stakedAmountNEW = if (isNewUser) | |
362 | 362 | then amountToAdd | |
363 | 363 | else (amountToAdd + stakedAmount) | |
364 | 364 | let W2 = getIntOrElse(keyVpPeriodDuration(), DEFAULTPERIOD) | |
365 | 365 | let period = (height / W2) | |
366 | 366 | let vpEffectivePeriodNEW = if ((userKid > 0)) | |
367 | 367 | then (period + 2) | |
368 | 368 | else if ((userTeen > 0)) | |
369 | 369 | then (period + 1) | |
370 | 370 | else period | |
371 | 371 | $Tuple5(isNewUser, stakedAmount, vpEffectiveHeight, stakedAmountNEW, (vpEffectivePeriodNEW * W2)) | |
372 | 372 | } | |
373 | 373 | ||
374 | 374 | ||
375 | 375 | func updateTotals () = { | |
376 | 376 | let period = (height / getIntOrElse(keyVpPeriodDuration(), DEFAULTPERIOD)) | |
377 | 377 | if ((period > getIntOrZero(keyLastTotalsPeriodProcessed()))) | |
378 | 378 | then { | |
379 | 379 | let totalMature = valueOrElse(getInteger(keyTotalMature()), getIntOrZero(keyLockParamTotalAmount())) | |
380 | 380 | [IntegerEntry(keyTotalMature(), (totalMature + getIntOrZero(keyTotalTeen()))), IntegerEntry(keyTotalTeen(), getIntOrZero(keyTotalKid())), IntegerEntry(keyTotalKid(), 0), IntegerEntry(keyLastTotalsPeriodProcessed(), period)] | |
381 | 381 | } | |
382 | 382 | else nil | |
383 | 383 | } | |
384 | 384 | ||
385 | 385 | ||
386 | 386 | func onStake (userAddressStr,amountToAdd) = if ((0 > amountToAdd)) | |
387 | 387 | then throw("amountToAdd should be >= 0") | |
388 | 388 | else { | |
389 | 389 | let W2 = getIntOrElse(keyVpPeriodDuration(), DEFAULTPERIOD) | |
390 | 390 | let period = (height / W2) | |
391 | 391 | let totalMature = valueOrElse(getInteger(keyTotalMature()), getIntOrZero(keyLockParamTotalAmount())) | |
392 | 392 | let totalTeen = getIntOrZero(keyTotalTeen()) | |
393 | 393 | let totalKid = getIntOrZero(keyTotalKid()) | |
394 | 394 | let userMature = if ((userAddressStr == "")) | |
395 | 395 | then 0 | |
396 | 396 | else valueOrElse(getInteger(keyUserMature(userAddressStr)), getIntOrZero(keyLockParamUserAmount(addressFromStringValue(userAddressStr)))) | |
397 | 397 | let userTeen = getIntOrZero(keyUserTeen(userAddressStr)) | |
398 | 398 | let userKid = getIntOrZero(keyUserKid(userAddressStr)) | |
399 | 399 | let tmp = if ((period > getIntOrZero(keyLastUserPeriodProcessed(userAddressStr)))) | |
400 | 400 | then $Tuple7((totalMature + userTeen), (totalTeen + (userKid - userTeen)), (totalKid - userKid), (userMature + userTeen), userKid, 0, [IntegerEntry(keyLastUserPeriodProcessed(userAddressStr), period)]) | |
401 | 401 | else $Tuple7(totalMature, totalTeen, totalKid, userMature, userTeen, userKid, nil) | |
402 | 402 | let totals = if ((period > getIntOrZero(keyLastTotalsPeriodProcessed()))) | |
403 | 403 | 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) | |
404 | 404 | else $Tuple4(nil, totalMature, totalTeen, totalKid) | |
405 | 405 | let newKid = fraction(amountToAdd, (height % W2), W2) | |
406 | 406 | let newTeen = (amountToAdd - newKid) | |
407 | 407 | $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)) | |
408 | 408 | } | |
409 | 409 | ||
410 | 410 | ||
411 | 411 | let IdxNewDiff = 0 | |
412 | 412 | ||
413 | 413 | let IdxNewGnsbt = 1 | |
414 | 414 | ||
415 | 415 | func userDecrease (gnsbt,diff) = if ((diff >= gnsbt)) | |
416 | 416 | then [(diff - gnsbt), 0] | |
417 | 417 | else [0, (gnsbt - diff)] | |
418 | 418 | ||
419 | 419 | ||
420 | - | func onUnstake (userAddressStr,amountToRemove) = if (( | |
421 | - | then throw("amountToRemove should be | |
420 | + | func onUnstake (userAddressStr,amountToRemove) = if ((0 >= amountToRemove)) | |
421 | + | then throw("amountToRemove should be > 0") | |
422 | 422 | else { | |
423 | 423 | let W2 = getIntOrElse(keyVpPeriodDuration(), DEFAULTPERIOD) | |
424 | 424 | let period = (height / W2) | |
425 | 425 | let totalMature = valueOrElse(getInteger(keyTotalMature()), getIntOrZero(keyLockParamTotalAmount())) | |
426 | 426 | let totalTeen = getIntOrZero(keyTotalTeen()) | |
427 | 427 | let totalKid = getIntOrZero(keyTotalKid()) | |
428 | 428 | let userMature = if ((userAddressStr == "")) | |
429 | 429 | then 0 | |
430 | 430 | else valueOrElse(getInteger(keyUserMature(userAddressStr)), getIntOrZero(keyLockParamUserAmount(addressFromStringValue(userAddressStr)))) | |
431 | 431 | let userTeen = getIntOrZero(keyUserTeen(userAddressStr)) | |
432 | 432 | let userKid = getIntOrZero(keyUserKid(userAddressStr)) | |
433 | 433 | let um = userDecrease(userMature, amountToRemove) | |
434 | 434 | let ut = userDecrease(userTeen, um[IdxNewDiff]) | |
435 | 435 | let uk = userDecrease(userKid, ut[IdxNewDiff]) | |
436 | 436 | if ((uk[IdxNewDiff] != 0)) | |
437 | 437 | then throw("Should not happen") | |
438 | 438 | else { | |
439 | 439 | let tmp = if ((period > getIntOrZero(keyLastUserPeriodProcessed(userAddressStr)))) | |
440 | 440 | then $Tuple7((totalMature + ut[IdxNewGnsbt]), (totalTeen + (uk[IdxNewGnsbt] - ut[IdxNewGnsbt])), (totalKid - uk[IdxNewGnsbt]), (um[IdxNewGnsbt] + ut[IdxNewGnsbt]), uk[IdxNewGnsbt], 0, [IntegerEntry(keyLastUserPeriodProcessed(userAddressStr), period)]) | |
441 | 441 | else $Tuple7(totalMature, totalTeen, totalKid, um[IdxNewGnsbt], ut[IdxNewGnsbt], uk[IdxNewGnsbt], nil) | |
442 | 442 | let totals = if ((period > getIntOrZero(keyLastTotalsPeriodProcessed()))) | |
443 | 443 | 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) | |
444 | 444 | else $Tuple4(nil, totalMature, totalTeen, totalKid) | |
445 | 445 | $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) | |
446 | 446 | } | |
447 | 447 | } | |
448 | 448 | ||
449 | 449 | ||
450 | 450 | func commonStake (userAddress,i) = { | |
451 | - | let $ | |
452 | - | let stakedAssetId = $ | |
453 | - | let minLockAmount = $ | |
451 | + | let $t02116321217 = getParamsOrFail() | |
452 | + | let stakedAssetId = $t02116321217._1 | |
453 | + | let minLockAmount = $t02116321217._2 | |
454 | 454 | if ((size(i.payments) != 1)) | |
455 | 455 | then throw("Invalid payments size") | |
456 | 456 | else { | |
457 | 457 | let payment = i.payments[0] | |
458 | 458 | let amount = payment.amount | |
459 | 459 | let invalidAssetMessage = (("Invalid asset. " + toBase58String(stakedAssetId)) + " is expected") | |
460 | 460 | let assetId = valueOrErrorMessage(payment.assetId, invalidAssetMessage) | |
461 | 461 | if ((assetId != stakedAssetId)) | |
462 | 462 | then throw(invalidAssetMessage) | |
463 | 463 | else { | |
464 | 464 | let userAddressStr = toString(userAddress) | |
465 | 465 | let r = onStake(userAddressStr, amount) | |
466 | 466 | let mergedData = mergeStake(userAddress, amount, r._6, r._7) | |
467 | 467 | let isNewUser = mergedData._1 | |
468 | 468 | let stakedAmount = mergedData._2 | |
469 | 469 | let vpEffectiveHeight = mergedData._3 | |
470 | 470 | let stakedAmountNEW = mergedData._4 | |
471 | 471 | let vpEffectiveHeightNEW = mergedData._5 | |
472 | 472 | if ((minLockAmount > stakedAmountNEW)) | |
473 | 473 | then throw(("Min lock amount is " + toString(minLockAmount))) | |
474 | 474 | else { | |
475 | - | let $ | |
475 | + | let $t02207122173 = StatsResult(amount, 1, if (isNewUser) | |
476 | 476 | then 1 | |
477 | 477 | else 0) | |
478 | - | let statsEntries = $ | |
479 | - | let totalStaked = $ | |
480 | - | let totalStakedNew = $ | |
478 | + | let statsEntries = $t02207122173._1 | |
479 | + | let totalStaked = $t02207122173._2 | |
480 | + | let totalStakedNew = $t02207122173._3 | |
481 | 481 | (((([HistoryRecordEntry("stake", userAddress, i.transactionId, stakedAmount, vpEffectiveHeight, stakedAmountNEW, vpEffectiveHeightNEW)] ++ RewardEntries(isNewUser, userAddressStr, stakedAmount)) ++ LockParamsEntry(userAddress, stakedAmountNEW, vpEffectiveHeightNEW)) ++ statsEntries) ++ r._1) | |
482 | 482 | } | |
483 | 483 | } | |
484 | 484 | } | |
485 | 485 | } | |
486 | 486 | ||
487 | 487 | ||
488 | 488 | func commonClaim (userAddress,i) = { | |
489 | 489 | let userAddressStr = toString(userAddress) | |
490 | 490 | if ((size(i.payments) > 0)) | |
491 | 491 | then throw("payments are not accepted") | |
492 | 492 | else { | |
493 | - | let $ | |
494 | - | let isNewUser = $ | |
495 | - | let stakedAmount = $ | |
496 | - | let stakingStart = $ | |
493 | + | let $t02268022785 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
494 | + | let isNewUser = $t02268022785._1 | |
495 | + | let stakedAmount = $t02268022785._2 | |
496 | + | let stakingStart = $t02268022785._3 | |
497 | 497 | let stakedAmountX = toBigInt(stakedAmount) | |
498 | 498 | let userRewardFromDepositNumKEY = keyUserRewardFromDepositNum(userAddressStr) | |
499 | 499 | let depositNumUser = getIntOrElse(userRewardFromDepositNumKEY, -1) | |
500 | 500 | let depositNumLast = getIntOrElse(keyDepositNumLast(), -1) | |
501 | 501 | func forEachAssetCalcUnclaimedReward (accum,asset) = { | |
502 | - | let $ | |
503 | - | let rewardTotal = $ | |
504 | - | let cached = $ | |
505 | - | let dynamic = $ | |
506 | - | let rewardCachedPartKEY = $ | |
502 | + | let $t02315623294 = calcReward(userAddressStr, asset, stakedAmountX, depositNumUser, depositNumLast) | |
503 | + | let rewardTotal = $t02315623294._1 | |
504 | + | let cached = $t02315623294._2 | |
505 | + | let dynamic = $t02315623294._3 | |
506 | + | let rewardCachedPartKEY = $t02315623294._4 | |
507 | 507 | let claimedKEY = keyClaimed(userAddressStr, asset) | |
508 | - | let $ | |
509 | - | let data = $ | |
510 | - | let claimedAmtByAsset = $ | |
508 | + | let $t02335423391 = accum | |
509 | + | let data = $t02335423391._1 | |
510 | + | let claimedAmtByAsset = $t02335423391._2 | |
511 | 511 | let newPart = makeString([asset, toString(rewardTotal)], ":") | |
512 | 512 | let claimedAmtByAssetNew = makeString([claimedAmtByAsset, newPart], "_") | |
513 | 513 | if ((0 >= rewardTotal)) | |
514 | 514 | then $Tuple2(data, claimedAmtByAssetNew) | |
515 | 515 | else $Tuple2((((data :+ ScriptTransfer(userAddress, rewardTotal, toAssetVect(asset))) :+ IntegerEntry(claimedKEY, (valueOrElse(getInteger(claimedKEY), 0) + rewardTotal))) :+ IntegerEntry(rewardCachedPartKEY, 0)), claimedAmtByAssetNew) | |
516 | 516 | } | |
517 | 517 | ||
518 | - | let $ | |
518 | + | let $t02385123964 = { | |
519 | 519 | let $l = supportedAssetsList | |
520 | 520 | let $s = size($l) | |
521 | 521 | let $acc0 = $Tuple2(nil, "") | |
522 | 522 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
523 | 523 | then $a | |
524 | 524 | else forEachAssetCalcUnclaimedReward($a, $l[$i]) | |
525 | 525 | ||
526 | 526 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
527 | 527 | then $a | |
528 | 528 | else throw("List size exceeds 9") | |
529 | 529 | ||
530 | 530 | $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) | |
531 | 531 | } | |
532 | - | let transfers = $ | |
533 | - | let claimedAmtByAssetResult = $ | |
532 | + | let transfers = $t02385123964._1 | |
533 | + | let claimedAmtByAssetResult = $t02385123964._2 | |
534 | 534 | if ((0 >= size(transfers))) | |
535 | 535 | then $Tuple2(nil, 0) | |
536 | 536 | else $Tuple2(((transfers :+ IntegerEntry(userRewardFromDepositNumKEY, depositNumLast)) :+ ClaimHistoryEntry(userAddress, i.transactionId, drop(claimedAmtByAssetResult, 1))), size(transfers)) | |
537 | 537 | } | |
538 | 538 | } | |
539 | 539 | ||
540 | 540 | ||
541 | 541 | @Callable(i) | |
542 | - | func | |
542 | + | func constructorV1 (minLockAmount,supportedRewardAssets,stakedAssetId) = if ((i.caller != this)) | |
543 | 543 | then throw("Permission denied") | |
544 | 544 | else [IntegerEntry(keyMinLockAmount(), minLockAmount), StringEntry(keySupportedRewardAssets(), supportedRewardAssets), StringEntry(keyStakedAssetId(), stakedAssetId)] | |
545 | 545 | ||
546 | 546 | ||
547 | 547 | ||
548 | 548 | @Callable(i) | |
549 | 549 | func stake () = commonStake(i.caller, i) | |
550 | 550 | ||
551 | 551 | ||
552 | 552 | ||
553 | 553 | @Callable(i) | |
554 | 554 | func stakeByOriginCaller () = commonStake(i.originCaller, i) | |
555 | 555 | ||
556 | 556 | ||
557 | 557 | ||
558 | 558 | @Callable(i) | |
559 | 559 | func unstake (amount) = if ((size(i.payments) != 0)) | |
560 | 560 | then throw("unstake doesn't require any payment") | |
561 | 561 | else { | |
562 | 562 | let userAddress = i.caller | |
563 | 563 | let userAddressStr = toString(userAddress) | |
564 | - | let $ | |
565 | - | let stakedAssetId = $ | |
566 | - | let minLockAmount = $ | |
567 | - | let $ | |
568 | - | let isNewUser = $ | |
569 | - | let stakedAmount = $ | |
570 | - | let vpEffectiveHeight = $ | |
564 | + | let $t02490024954 = getParamsOrFail() | |
565 | + | let stakedAssetId = $t02490024954._1 | |
566 | + | let minLockAmount = $t02490024954._2 | |
567 | + | let $t02495725041 = getUserParamsOrFail(userAddress) | |
568 | + | let isNewUser = $t02495725041._1 | |
569 | + | let stakedAmount = $t02495725041._2 | |
570 | + | let vpEffectiveHeight = $t02495725041._3 | |
571 | 571 | let swapParamsSTRUCT = asSwapParamsSTRUCT(reentrantInvoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStr, 0], nil)) | |
572 | 572 | let swapLimitSpentInUsdn = swapParamsSTRUCT._2 | |
573 | 573 | let blcks2LmtReset = swapParamsSTRUCT._3 | |
574 | 574 | if ((swapLimitSpentInUsdn > 0)) | |
575 | 575 | then throw((("You have already made a swap operation. Wait " + toString((height + blcks2LmtReset))) + " height to unstake")) | |
576 | 576 | else if ((0 >= stakedAmount)) | |
577 | 577 | then throw("Nothing to unstake") | |
578 | 578 | else if ((amount > stakedAmount)) | |
579 | 579 | then throw(((("Requested " + toString(amount)) + ", but staked only ") + toString(stakedAmount))) | |
580 | 580 | else { | |
581 | 581 | let stakedAmountNEW = (stakedAmount - amount) | |
582 | - | let $ | |
582 | + | let $t02567925837 = StatsResult(-(amount), if ((amount == stakedAmount)) | |
583 | 583 | then -1 | |
584 | 584 | else 0, if ((amount == stakedAmount)) | |
585 | 585 | then -1 | |
586 | 586 | else 0) | |
587 | - | let statsEntries = $ | |
588 | - | let totalStaked = $ | |
589 | - | let totalStakedNew = $ | |
587 | + | let statsEntries = $t02567925837._1 | |
588 | + | let totalStaked = $t02567925837._2 | |
589 | + | let totalStakedNew = $t02567925837._3 | |
590 | 590 | (((([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) | |
591 | 591 | } | |
592 | 592 | } | |
593 | 593 | ||
594 | 594 | ||
595 | 595 | ||
596 | 596 | @Callable(i) | |
597 | - | func deposit () = if ((size(i.payments) != 1)) | |
598 | - | then throw("exact 1 payment is allowed only") | |
599 | - | else { | |
600 | - | let pmt = i.payments[0] | |
601 | - | let amount = pmt.amount | |
602 | - | let pmtAssetId = valueOrElse(pmt.assetId, WAVESID) | |
603 | - | let pmtAssetIdStr = toBase58String(pmtAssetId) | |
604 | - | let pmtMultX = if ((pmtAssetId == WAVESID)) | |
605 | - | then MULTX8 | |
606 | - | else MULTX6 | |
607 | - | let amountX = toBigInt(amount) | |
608 | - | let totalStaked = getIntOrElse(keyLockParamTotalAmount(), 0) | |
609 | - | let totalStakedX = toBigInt(totalStaked) | |
610 | - | if ((0 > totalStaked)) | |
611 | - | then throw("TODO: case is not supported") | |
612 | - | else if ((totalStaked == 0)) | |
613 | - | then IncrementNotDistributedRewardEntry(pmtAssetIdStr, amount) | |
614 | - | else { | |
615 | - | let rewardPerNsbtX18 = fraction(amountX, MULTX18, totalStakedX) | |
616 | - | let depositNumLastKEY = keyDepositNumLast() | |
617 | - | let depositNumLast = getIntOrElse(depositNumLastKEY, -1) | |
618 | - | let depositNumNew = (depositNumLast + 1) | |
619 | - | if (!(contains(supportedAssetsStr, pmtAssetIdStr))) | |
620 | - | then throw(((supportedAssetsStr + " doesn't contain ") + pmtAssetIdStr)) | |
597 | + | func deposit () = { | |
598 | + | let totalStaked = getIntOrElse(keyLockParamTotalAmount(), 0) | |
599 | + | if ((0 > totalStaked)) | |
600 | + | then throw("TODO: case is not supported") | |
601 | + | else { | |
602 | + | let depositNumLastKEY = keyDepositNumLast() | |
603 | + | let depositNumLast = getIntOrElse(depositNumLastKEY, -1) | |
604 | + | let depositNumNew = (depositNumLast + 1) | |
605 | + | func dep (acc,pmt) = { | |
606 | + | let amount = pmt.amount | |
607 | + | let pmtAssetId = valueOrElse(pmt.assetId, WAVESID) | |
608 | + | let pmtAssetIdStr = toBase58String(pmtAssetId) | |
609 | + | if (!(contains(supportedAssetsStr, pmtAssetIdStr))) | |
610 | + | then throw(((supportedAssetsStr + " doesn't contain ") + pmtAssetIdStr)) | |
611 | + | else if ((totalStaked == 0)) | |
612 | + | then (acc :+ IncrementNotDistributedRewardEntry(pmtAssetIdStr, amount)) | |
621 | 613 | else { | |
614 | + | let rewardPerNsbtX18 = fraction(toBigInt(amount), MULTX18, toBigInt(totalStaked)) | |
622 | 615 | func refreshRewardPerNsbtSUM (accum,nextAsset) = { | |
623 | - | let rewardPerNsbtSumNewKEY = keyRewardPerNsbtSumAt(depositNumNew, nextAsset) | |
624 | 616 | let sumLastStr = getStrOrElse(keyRewardPerNsbtSumAt(depositNumLast, nextAsset), "0") | |
625 | - | (accum :+ (if ((nextAsset == pmtAssetIdStr)) | |
626 | - | then | |
627 | - | else | |
617 | + | (accum :+ StringEntry(keyRewardPerNsbtSumAt(depositNumNew, nextAsset), if ((nextAsset == pmtAssetIdStr)) | |
618 | + | then toString((parseBigIntValue(sumLastStr) + rewardPerNsbtX18)) | |
619 | + | else sumLastStr)) | |
628 | 620 | } | |
629 | 621 | ||
630 | - | (( | |
622 | + | ((acc ++ { | |
631 | 623 | let $l = supportedAssetsList | |
632 | 624 | let $s = size($l) | |
633 | 625 | let $acc0 = nil | |
634 | 626 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
635 | 627 | then $a | |
636 | 628 | else refreshRewardPerNsbtSUM($a, $l[$i]) | |
637 | 629 | ||
638 | 630 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
639 | 631 | then $a | |
640 | 632 | else throw("List size exceeds 9") | |
641 | 633 | ||
642 | 634 | $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) | |
643 | - | } | |
635 | + | }) ++ DepositsTotalsEntries(amount, pmtAssetIdStr)) | |
644 | 636 | } | |
645 | - | } | |
646 | - | } | |
637 | + | } | |
638 | + | ||
639 | + | (({ | |
640 | + | let $l = i.payments | |
641 | + | let $s = size($l) | |
642 | + | let $acc0 = nil | |
643 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
644 | + | then $a | |
645 | + | else dep($a, $l[$i]) | |
646 | + | ||
647 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
648 | + | then $a | |
649 | + | else throw("List size exceeds 10") | |
650 | + | ||
651 | + | $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) | |
652 | + | } ++ updateTotals()) :+ IntegerEntry(depositNumLastKEY, depositNumNew)) | |
653 | + | } | |
654 | + | } | |
647 | 655 | ||
648 | 656 | ||
649 | 657 | ||
650 | 658 | @Callable(i) | |
651 | 659 | func claimRewards () = commonClaim(i.caller, i) | |
652 | 660 | ||
653 | 661 | ||
654 | 662 | ||
655 | 663 | @Callable(i) | |
656 | 664 | func claimRewardsByOriginCaller () = commonClaim(i.originCaller, i) | |
657 | 665 | ||
658 | 666 | ||
659 | 667 | ||
660 | 668 | @Callable(i) | |
661 | 669 | func unclaimedRewardsREADONLY (userAddressStr) = { | |
662 | 670 | func forEachAssetZeroReward (accum,asset) = ((accum + makeString([asset, "0", "0"], ":")) + "_") | |
663 | 671 | ||
664 | 672 | let unclaimedRewardStr = if ((userAddressStr == "")) | |
665 | 673 | then { | |
666 | 674 | let $l = supportedAssetsList | |
667 | 675 | let $s = size($l) | |
668 | 676 | let $acc0 = "" | |
669 | 677 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
670 | 678 | then $a | |
671 | 679 | else forEachAssetZeroReward($a, $l[$i]) | |
672 | 680 | ||
673 | 681 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
674 | 682 | then $a | |
675 | 683 | else throw("List size exceeds 9") | |
676 | 684 | ||
677 | 685 | $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 | 686 | } | |
679 | 687 | else { | |
680 | 688 | let userAddress = addressFromStringValue(userAddressStr) | |
681 | - | let $ | |
682 | - | let isNewUser = $ | |
683 | - | let stakedAmount = $ | |
684 | - | let stakingStart = $ | |
689 | + | let $t02835928464 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
690 | + | let isNewUser = $t02835928464._1 | |
691 | + | let stakedAmount = $t02835928464._2 | |
692 | + | let stakingStart = $t02835928464._3 | |
685 | 693 | let stakedAmountX = toBigInt(stakedAmount) | |
686 | 694 | let userRewardFromDepositNumKEY = keyUserRewardFromDepositNum(userAddressStr) | |
687 | 695 | let depositNumUser = getIntOrElse(userRewardFromDepositNumKEY, -1) | |
688 | 696 | let depositNumLast = getIntOrElse(keyDepositNumLast(), -1) | |
689 | 697 | func forEachAssetCalcUnclaimedReward (accum,asset) = { | |
690 | - | let $ | |
691 | - | let rewardTotal = $ | |
692 | - | let cached = $ | |
693 | - | let dynamic = $ | |
694 | - | let rewardCachedPartKEY = $ | |
698 | + | let $t02881028948 = calcReward(userAddressStr, asset, stakedAmountX, depositNumUser, depositNumLast) | |
699 | + | let rewardTotal = $t02881028948._1 | |
700 | + | let cached = $t02881028948._2 | |
701 | + | let dynamic = $t02881028948._3 | |
702 | + | let rewardCachedPartKEY = $t02881028948._4 | |
695 | 703 | let claimed = valueOrElse(getInteger(keyClaimed(userAddressStr, asset)), 0) | |
696 | 704 | ((accum + makeString([asset, toString(rewardTotal), toString(claimed)], ":")) + "_") | |
697 | 705 | } | |
698 | 706 | ||
699 | 707 | let $l = supportedAssetsList | |
700 | 708 | let $s = size($l) | |
701 | 709 | let $acc0 = "" | |
702 | 710 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
703 | 711 | then $a | |
704 | 712 | else forEachAssetCalcUnclaimedReward($a, $l[$i]) | |
705 | 713 | ||
706 | 714 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
707 | 715 | then $a | |
708 | 716 | else throw("List size exceeds 9") | |
709 | 717 | ||
710 | 718 | $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 | 719 | } | |
712 | 720 | $Tuple2(nil, dropRight(unclaimedRewardStr, 1)) | |
713 | 721 | } | |
714 | 722 | ||
715 | 723 | ||
716 | 724 | ||
717 | 725 | @Callable(i) | |
718 | 726 | func updateVotingPower (userAddressStr) = if (!(isDefined(addressFromString(userAddressStr)))) | |
719 | 727 | then throw("Invalid user address") | |
720 | 728 | else { | |
721 | 729 | let r = onStake(userAddressStr, 0) | |
722 | 730 | $Tuple2(r._1, [surfToGnsbt(r._2), surfToGnsbt(r._3), surfToGnsbt(r._4), surfToGnsbt(r._5), surfToGnsbt(r._6), surfToGnsbt(r._7)]) | |
723 | 731 | } | |
724 | 732 | ||
725 | 733 | ||
726 | 734 | ||
727 | 735 | @Callable(i) | |
728 | 736 | func surfStakingSYSREADONLY (userAddressStrOrEmpty,surfDiff) = { | |
729 | 737 | let surfTotal = getIntOrElse(keyLockParamTotalAmount(), 0) | |
730 | 738 | let gnsbtFromSurfTotal = surfToGnsbt(surfTotal) | |
731 | 739 | let r = if ((surfDiff >= 0)) | |
732 | 740 | then onStake(userAddressStrOrEmpty, surfDiff) | |
733 | - | else onUnstake(userAddressStrOrEmpty, surfDiff) | |
741 | + | else onUnstake(userAddressStrOrEmpty, -(surfDiff)) | |
734 | 742 | if ((userAddressStrOrEmpty == "")) | |
735 | 743 | 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 | 744 | else { | |
737 | 745 | let userAddress = toAddressOrFail(userAddressStrOrEmpty) | |
738 | 746 | let mergedData = mergeStake(userAddress, surfDiff, r._6, r._7) | |
739 | 747 | let stakedAmount = mergedData._2 | |
740 | 748 | let vpEffectiveHeight = mergedData._3 | |
741 | 749 | let stakedAmountNEW = mergedData._4 | |
742 | 750 | let vpEffectiveHeightNEW = mergedData._5 | |
743 | 751 | let surfUser = stakedAmount | |
744 | 752 | let gnsbtFromSurfUser = surfToGnsbt(surfUser) | |
745 | 753 | $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 | 754 | } | |
747 | 755 | } | |
748 | 756 | ||
749 | 757 | ||
750 | 758 | ||
751 | 759 | @Callable(i) | |
752 | 760 | func gnsbtFromSurfSYSREADONLY (surfAmt) = $Tuple2(nil, surfToGnsbt(surfAmt)) | |
753 | 761 | ||
754 | 762 | ||
755 | 763 | ||
756 | 764 | @Callable(i) | |
757 | 765 | func configSYSREADONLY () = { | |
758 | 766 | let minLockAmt = getIntegerValue(keyMinLockAmount()) | |
759 | 767 | let surfVotingPowerRestrictivePeriod = DEFAULTPERIOD | |
760 | 768 | let brToStartSurfTransformation = 1150000 | |
761 | 769 | $Tuple2(nil, [minLockAmt, (gnsbtFromSurfCoeff * MULT6), surfVotingPowerRestrictivePeriod, brToStartSurfTransformation]) | |
762 | 770 | } | |
763 | 771 | ||
764 | 772 |
github/deemru/w8io/026f985 108.96 ms ◑