tx · 4THcn7Ks9pm4T91eUrorvHvzBTNusSHv7wFnk862wsxX 3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy: -0.02700000 Waves 2023.03.27 18:11 [2508531] smart account 3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy > SELF 0.00000000 Waves
{ "type": 13, "id": "4THcn7Ks9pm4T91eUrorvHvzBTNusSHv7wFnk862wsxX", "fee": 2700000, "feeAssetId": null, "timestamp": 1679929935014, "version": 2, "chainId": 84, "sender": "3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy", "senderPublicKey": "9W33iCCNfmFxUbiC6XZcH5x7f6xfwC7Jb3BoExT5q2PV", "proofs": [ "41CuaVXEUEDQMarfcEn3UMgXh3rwQYjFcSrzUUYBtt8ysNuGLrz9MzizoQW9oPRQzDtKQLXgU1Ne8CvCKjo93hBK" ], "script": "base64:BgLULwgCEggKBggIAQEBCBIFCgMBCAISAwoBARIDCgEBEgQKAggIEgQKAggIEgMKAQgSAwoBCBIDCgEIEgQKAggBEgASABIFCgMICAQSAwoBCBIDCgEIEgQKAggIEgQKAggIEgMKAQgSACIDU0VQIgZTQ0FMRTgiBU1VTFQ4Ig5QT09MV0VJR0hUTVVMVCIHd3JhcEVyciIDbXNnIgh0aHJvd0VyciIEc3RyZiIHYWRkcmVzcyIDa2V5IgNpb3oiA2lvZCIKZGVmYXVsdFZhbCIDaW9mIgNhYnMiA3ZhbCIDYWFsIgckbWF0Y2gwIgp2YWxBbnlMeXN0IgJhaSIGdmFsSW50IhtrZXlSZWZlcnJhbHNDb250cmFjdEFkZHJlc3MiHnJlZmVycmFsc0NvbnRyYWN0QWRkcmVzc09yRmFpbCIWa2V5UmVmZXJyYWxQcm9ncmFtTmFtZSIacmVmZXJyYWxQcm9ncmFtTmFtZURlZmF1bHQiE3JlZmVycmFsUHJvZ3JhbU5hbWUiEWtleUZhY3RvcnlBZGRyZXNzIhhJZHhGYWN0b3J5Q2ZnU3Rha2luZ0RhcHAiG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gMJAAECBQFyAgRVbml0CAUCZnQPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAmZ0CWJvZHlCeXRlcwkAkQMCCAUCZnQGcHJvb2ZzAAAFAmZ2Y9EddQ==", "height": 2508531, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: B3dPSHTSBhqHxBvazhqsacBKmpAh3U8YXCyXZZUojSdC Next: 6TW81nvJMFR1dokHTMUqjxLQzJ57yTobWcb1fzqDmR4H Diff:
Old | New | Differences | |
---|---|---|---|
15 | 15 | func throwErr (msg) = throw(wrapErr(msg)) | |
16 | 16 | ||
17 | 17 | ||
18 | - | func strf (address,key) = valueOrErrorMessage(getString(address, key), (("mandatory this." + key) + " is not defined")) | |
18 | + | func strf (address,key) = valueOrErrorMessage(getString(address, key), wrapErr((("mandatory this." + key) + " is not defined"))) | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | func ioz (address,key) = valueOrElse(getInteger(address, key), 0) | |
24 | 24 | func iod (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal) | |
25 | 25 | ||
26 | 26 | ||
27 | - | func iof (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined")) | |
27 | + | func iof (address,key) = valueOrErrorMessage(getInteger(address, key), wrapErr((("mandatory this." + key) + " is not defined"))) | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func abs (val) = if ((0 > val)) | |
36 | 36 | case valAnyLyst: List[Any] => | |
37 | 37 | valAnyLyst | |
38 | 38 | case _ => | |
39 | - | | |
39 | + | throwErr("fail to cast into List[Any]") | |
40 | 40 | } | |
41 | 41 | ||
42 | 42 | ||
44 | 44 | case valInt: Int => | |
45 | 45 | valInt | |
46 | 46 | case _ => | |
47 | - | | |
47 | + | throwErr("fail to cast into Int") | |
48 | 48 | } | |
49 | 49 | ||
50 | 50 | ||
198 | 198 | ||
199 | 199 | ||
200 | 200 | func mustManager (i) = { | |
201 | - | let pd = | |
201 | + | let pd = throwErr("Permission denied") | |
202 | 202 | match managerPublicKeyOrUnit() { | |
203 | 203 | case pk: ByteVector => | |
204 | 204 | if ((i.callerPublicKey == pk)) | |
417 | 417 | ||
418 | 418 | ||
419 | 419 | func extractOptionalPaymentAmountOrFail (i,expectedAssetId) = if ((size(i.payments) > 1)) | |
420 | - | then | |
420 | + | then throwErr("only one payment is allowed") | |
421 | 421 | else if ((size(i.payments) == 0)) | |
422 | 422 | then 0 | |
423 | 423 | else { | |
424 | 424 | let pmt = i.payments[0] | |
425 | 425 | if ((value(pmt.assetId) != expectedAssetId)) | |
426 | - | then | |
426 | + | then throwErr("invalid asset id in payment") | |
427 | 427 | else pmt.amount | |
428 | 428 | } | |
429 | 429 | ||
446 | 446 | ||
447 | 447 | ||
448 | 448 | func getVotingEmissionEpochInfo () = { | |
449 | - | let $ | |
449 | + | let $t01710117391 = { | |
450 | 450 | let currentEpochUi = value(getInteger(votingEmissionContract, keyCurrentEpochUi())) | |
451 | 451 | let lastFinalizedEpoch = (currentEpochUi - 1) | |
452 | 452 | if ((0 > lastFinalizedEpoch)) | |
453 | 453 | then throwErr("invalid epoch") | |
454 | 454 | else $Tuple2(currentEpochUi, lastFinalizedEpoch) | |
455 | 455 | } | |
456 | - | let currentEpochUi = $ | |
457 | - | let lastFinalizedEpoch = $ | |
456 | + | let currentEpochUi = $t01710117391._1 | |
457 | + | let lastFinalizedEpoch = $t01710117391._2 | |
458 | 458 | let currentEpochStartHeight = value(getInteger(votingEmissionContract, keyStartHeightByEpoch(currentEpochUi))) | |
459 | 459 | $Tuple2(lastFinalizedEpoch, currentEpochStartHeight) | |
460 | 460 | } | |
487 | 487 | ||
488 | 488 | func getUserVoteFinalized (lpAssetIdStr,userAddressStr) = { | |
489 | 489 | let userAddress = addressFromStringValue(userAddressStr) | |
490 | - | let $ | |
491 | - | let lastFinalizedEpoch = $ | |
492 | - | let currentEpochStartHeight = $ | |
493 | - | let $ | |
494 | - | let amountAssetId = $ | |
495 | - | let priceAssetId = $ | |
490 | + | let $t01808218162 = getVotingEmissionEpochInfo() | |
491 | + | let lastFinalizedEpoch = $t01808218162._1 | |
492 | + | let currentEpochStartHeight = $t01808218162._2 | |
493 | + | let $t01816518240 = getPoolAssetsByLpAssetId(lpAssetIdStr) | |
494 | + | let amountAssetId = $t01816518240._1 | |
495 | + | let priceAssetId = $t01816518240._2 | |
496 | 496 | let userVoteKey = keyVote(amountAssetId, priceAssetId, userAddress, lastFinalizedEpoch) | |
497 | 497 | let userVote = valueOrElse(getInteger(votingEmissionContract, userVoteKey), 0) | |
498 | 498 | userVote | |
509 | 509 | ||
510 | 510 | ||
511 | 511 | func getVotingResultStaked (lpAssetIdStr) = { | |
512 | - | let $ | |
513 | - | let lastFinalizedEpoch = $ | |
514 | - | let currentEpochStartHeight = $ | |
512 | + | let $t01878418864 = getVotingEmissionEpochInfo() | |
513 | + | let lastFinalizedEpoch = $t01878418864._1 | |
514 | + | let currentEpochStartHeight = $t01878418864._2 | |
515 | 515 | let votingResultStakedStart = valueOrElse(getInteger(votingEmissionContract, keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch)), 0) | |
516 | 516 | let votingResultStaked = valueOrElse(getInteger(this, keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch)), votingResultStakedStart) | |
517 | 517 | votingResultStaked | |
519 | 519 | ||
520 | 520 | ||
521 | 521 | func getVotingResultStakedIntegral (lpAssetIdStr) = { | |
522 | - | let $ | |
523 | - | let lastFinalizedEpoch = $ | |
524 | - | let currentEpochStartHeight = $ | |
522 | + | let $t01922619306 = getVotingEmissionEpochInfo() | |
523 | + | let lastFinalizedEpoch = $t01922619306._1 | |
524 | + | let currentEpochStartHeight = $t01922619306._2 | |
525 | 525 | let votingResultStaked = getVotingResultStaked(lpAssetIdStr) | |
526 | 526 | let votingResultStakedIntegralPrev = valueOrElse(getInteger(this, keyVotingResultStakedIntegral(lpAssetIdStr, lastFinalizedEpoch)), 0) | |
527 | 527 | let votingResultStakedLastUpdateHeight = valueOrElse(getInteger(this, keyVotingResultStakedLastUpdateHeight(lpAssetIdStr, lastFinalizedEpoch)), currentEpochStartHeight) | |
532 | 532 | ||
533 | 533 | ||
534 | 534 | func refreshVotingResultStakedIntegral (lpAssetIdStr,stakedVoteDelta) = { | |
535 | - | let $ | |
536 | - | let lastFinalizedEpoch = $ | |
537 | - | let currentEpochStartHeight = $ | |
535 | + | let $t02014320223 = getVotingEmissionEpochInfo() | |
536 | + | let lastFinalizedEpoch = $t02014320223._1 | |
537 | + | let currentEpochStartHeight = $t02014320223._2 | |
538 | 538 | let votingResultStaked = getVotingResultStaked(lpAssetIdStr) | |
539 | 539 | let votingResultStakedNew = (votingResultStaked + stakedVoteDelta) | |
540 | 540 | let votingResultStakedIntegral = getVotingResultStakedIntegral(lpAssetIdStr) | |
543 | 543 | ||
544 | 544 | ||
545 | 545 | func getUserVoteStakedIntegral (lpAssetIdStr,userAddressStr) = { | |
546 | - | let $ | |
547 | - | let lastFinalizedEpoch = $ | |
548 | - | let currentEpochStartHeight = $ | |
546 | + | let $t02083420914 = getVotingEmissionEpochInfo() | |
547 | + | let lastFinalizedEpoch = $t02083420914._1 | |
548 | + | let currentEpochStartHeight = $t02083420914._2 | |
549 | 549 | let userAddress = addressFromStringValue(userAddressStr) | |
550 | 550 | let userVoteStaked = getUserVoteStaked(lpAssetIdStr, userAddressStr) | |
551 | 551 | let userVoteStakedIntegralPrev = valueOrElse(getInteger(this, keyVoteStakedIntegral(lpAssetIdStr, userAddress, lastFinalizedEpoch)), 0) | |
557 | 557 | ||
558 | 558 | ||
559 | 559 | func refreshVoteStakedIntegral (lpAssetIdStr,userAddressStr,edge) = { | |
560 | - | let $ | |
561 | - | let lastFinalizedEpoch = $ | |
562 | - | let currentEpochStartHeight = $ | |
560 | + | let $t02170221782 = getVotingEmissionEpochInfo() | |
561 | + | let lastFinalizedEpoch = $t02170221782._1 | |
562 | + | let currentEpochStartHeight = $t02170221782._2 | |
563 | 563 | let userAddress = addressFromStringValue(userAddressStr) | |
564 | 564 | let userVoteFinalized = getUserVoteFinalized(lpAssetIdStr, userAddressStr) | |
565 | 565 | let actions = if ((userVoteFinalized == 0)) | |
578 | 578 | ||
579 | 579 | ||
580 | 580 | func getStakedVotesIntegralsDiff (lpAssetIdStr,userAddressStr) = { | |
581 | - | let $ | |
582 | - | let lastFinalizedEpoch = $ | |
583 | - | let currentEpochStartHeight = $ | |
581 | + | let $t02263622716 = getVotingEmissionEpochInfo() | |
582 | + | let lastFinalizedEpoch = $t02263622716._1 | |
583 | + | let currentEpochStartHeight = $t02263622716._2 | |
584 | 584 | let userAddress = addressFromStringValue(userAddressStr) | |
585 | 585 | let userVoteStakedIntegralLastKey = keyVoteStakedIntegralLast(lpAssetIdStr, userAddress, lastFinalizedEpoch) | |
586 | 586 | let userVoteStakedIntegralLast = valueOrElse(getInteger(this, userVoteStakedIntegralLastKey), 0) | |
627 | 627 | let EMPTYSTR = "empty" | |
628 | 628 | let poolWeight = if ((lpAssetIdStr != EMPTYSTR)) | |
629 | 629 | then { | |
630 | - | let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
630 | + | let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)), wrapErr(("unsupported lp asset " + lpAssetIdStr))) | |
631 | 631 | getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr)) | |
632 | 632 | } | |
633 | 633 | else if (readOnly) | |
634 | 634 | then 0 | |
635 | - | else | |
635 | + | else throwErr(("not readonly mode: unsupported lp asset " + lpAssetIdStr)) | |
636 | 636 | let userLpBoostEmissionLastIntegralKEY = keyUserLpBoostEmissionLastINTEGRAL(userNumStr, lpAssetIdStr) | |
637 | 637 | let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr) | |
638 | 638 | let userBoostEmissionLastIntegral = valueOrElse(getInteger(this, userLpBoostEmissionLastIntegralKEY), ioz(this, userBoostEmissionLastIntegralKEY)) | |
639 | 639 | let boostEmissionIntegral = refreshBoostEmissionIntegral()._2 | |
640 | 640 | let userBoostEmissionIntegral = (boostEmissionIntegral - userBoostEmissionLastIntegral) | |
641 | 641 | if ((0 > userBoostEmissionIntegral)) | |
642 | - | then | |
642 | + | then throwErr("wrong calculations") | |
643 | 643 | else { | |
644 | - | let $ | |
645 | - | let stakedVotesIntegralsActions = $ | |
646 | - | let userVoteIntegralDiff = $ | |
647 | - | let totalVotesIntegralDiff = $ | |
644 | + | let $t02633526474 = getStakedVotesIntegralsDiff(lpAssetIdStr, userAddressStr) | |
645 | + | let stakedVotesIntegralsActions = $t02633526474._1 | |
646 | + | let userVoteIntegralDiff = $t02633526474._2 | |
647 | + | let totalVotesIntegralDiff = $t02633526474._3 | |
648 | 648 | let poolUserBoostEmissionIntegral = fraction(userBoostEmissionIntegral, poolWeight, POOLWEIGHTMULT) | |
649 | 649 | let userBoostAvaliableToClaimTotalNew = if ((totalVotesIntegralDiff == 0)) | |
650 | 650 | then 0 | |
665 | 665 | let minLockDuration = parseIntValue(cfgArray[IdxCfgMinLockDuration]) | |
666 | 666 | let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration]) | |
667 | 667 | if ((size(i.payments) != 1)) | |
668 | - | then | |
668 | + | then throwErr("invalid payment - exact one payment must be attached") | |
669 | 669 | else { | |
670 | 670 | let pmt = i.payments[0] | |
671 | 671 | let pmtAmount = pmt.amount | |
672 | 672 | if ((assetId != value(pmt.assetId))) | |
673 | - | then | |
673 | + | then throwErr((("invalid asset is in payment - " + assetIdStr) + " is expected")) | |
674 | 674 | else { | |
675 | 675 | let nextUserNumKEY = keyNextUserNum() | |
676 | 676 | let userAddressStr = toString(i.caller) | |
686 | 686 | if (if ((minLockAmount > pmtAmount)) | |
687 | 687 | then (i.caller != lpStakingPoolsContract) | |
688 | 688 | else false) | |
689 | - | then | |
689 | + | then throwErr(("amount is less then minLockAmount=" + toString(minLockAmount))) | |
690 | 690 | else if ((minLockDuration > duration)) | |
691 | - | then | |
691 | + | then throwErr(("passed duration is less then minLockDuration=" + toString(minLockDuration))) | |
692 | 692 | else if ((duration > maxLockDuration)) | |
693 | - | then | |
693 | + | then throwErr(("passed duration is greater then maxLockDuration=" + toString(maxLockDuration))) | |
694 | 694 | else if (if (userIsExisting) | |
695 | 695 | then ((iof(this, startBlockKEY) + iof(this, durationKEY)) >= lockStart) | |
696 | 696 | else false) | |
697 | - | then | |
697 | + | then throwErr("there is an active lock - consider to use increaseLock") | |
698 | 698 | else if ((ioz(this, userAmountKEY) > 0)) | |
699 | - | then | |
699 | + | then throwErr(("there are locked WXs - consider to use increaseLock " + userAmountKEY)) | |
700 | 700 | else { | |
701 | 701 | let coeffX8 = fraction(duration, MULT8, maxLockDuration) | |
702 | 702 | let gWxAmountStart = fraction(pmtAmount, coeffX8, MULT8) | |
731 | 731 | ||
732 | 732 | @Callable(i) | |
733 | 733 | func lockRef (duration,referrerAddress,signature) = { | |
734 | - | let $ | |
735 | - | let lockActionsResult = $ | |
736 | - | let gWxAmountStart = $ | |
734 | + | let $t03108531150 = lockActions(i, duration) | |
735 | + | let lockActionsResult = $t03108531150._1 | |
736 | + | let gWxAmountStart = $t03108531150._2 | |
737 | 737 | let referralAddress = toString(i.caller) | |
738 | 738 | let refInv = if (if ((referrerAddress == "")) | |
739 | 739 | then true | |
754 | 754 | ||
755 | 755 | @Callable(i) | |
756 | 756 | func lock (duration) = { | |
757 | - | let $ | |
758 | - | let lockActionsResult = $ | |
759 | - | let gWxAmountStart = $ | |
757 | + | let $t03160831673 = lockActions(i, duration) | |
758 | + | let lockActionsResult = $t03160831673._1 | |
759 | + | let gWxAmountStart = $t03160831673._2 | |
760 | 760 | let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil) | |
761 | 761 | if ((updateRefActivity == updateRefActivity)) | |
762 | 762 | then $Tuple2(lockActionsResult, unit) | |
784 | 784 | let userAmountNew = (userAmount + pmtAmount) | |
785 | 785 | let lockDurationNew = (remainingDuration + deltaDuration) | |
786 | 786 | if ((0 > deltaDuration)) | |
787 | - | then | |
787 | + | then throwErr("duration is less then zero") | |
788 | 788 | else if ((minLockDuration > lockDurationNew)) | |
789 | - | then | |
789 | + | then throwErr(("lockDurationNew is less then minLockDuration=" + toString(minLockDuration))) | |
790 | 790 | else if ((lockDurationNew > maxLockDuration)) | |
791 | - | then | |
791 | + | then throwErr(("deltaDuration + existedLockDuration is greater then maxLockDuration=" + toString(maxLockDuration))) | |
792 | 792 | else { | |
793 | 793 | let coeffX8 = fraction(lockDurationNew, MULT8, maxLockDuration) | |
794 | 794 | let gWxAmountStart = fraction(userAmountNew, coeffX8, MULT8) | |
803 | 803 | let currUserGwx = calcCurrentGwxAmount(userAddressStr) | |
804 | 804 | let gwxDiff = (gWxAmountStart - currUserGwx) | |
805 | 805 | if ((0 > gwxDiff)) | |
806 | - | then | |
806 | + | then throwErr(("gwxDiff is less then 0: " + toString(gwxDiff))) | |
807 | 807 | else { | |
808 | 808 | let totalCachedGwxRaw = getTotalCachedGwx(false) | |
809 | 809 | let totalCachedGwxCorrected = getTotalCachedGwx(true) | |
818 | 818 | ||
819 | 819 | @Callable(i) | |
820 | 820 | func claimWxBoost (lpAssetIdStr,userAddressStr) = if ((stakingContract != i.caller)) | |
821 | - | then | |
821 | + | then throwErr("permissions denied") | |
822 | 822 | else { | |
823 | - | let $ | |
824 | - | let userBoostAvailable = $ | |
825 | - | let dataState = $ | |
826 | - | let debug = $ | |
823 | + | let $t03477834880 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false) | |
824 | + | let userBoostAvailable = $t03477834880._1 | |
825 | + | let dataState = $t03477834880._2 | |
826 | + | let debug = $t03477834880._3 | |
827 | 827 | $Tuple2(dataState, [userBoostAvailable]) | |
828 | 828 | } | |
829 | 829 | ||
831 | 831 | ||
832 | 832 | @Callable(i) | |
833 | 833 | func claimWxBoostREADONLY (lpAssetIdStr,userAddressStr) = { | |
834 | - | let $ | |
835 | - | let userBoostAvailable = $ | |
836 | - | let dataState = $ | |
837 | - | let debug = $ | |
834 | + | let $t03501235113 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true) | |
835 | + | let userBoostAvailable = $t03501235113._1 | |
836 | + | let dataState = $t03501235113._2 | |
837 | + | let debug = $t03501235113._3 | |
838 | 838 | $Tuple2(nil, [userBoostAvailable, debug]) | |
839 | 839 | } | |
840 | 840 | ||
851 | 851 | let cfgArray = readConfigArrayOrFail() | |
852 | 852 | let assetId = fromBase58String(cfgArray[IdxCfgAssetId]) | |
853 | 853 | if ((lockEnd >= height)) | |
854 | - | then | |
854 | + | then throwErr((("wait " + toString(lockEnd)) + " to unlock")) | |
855 | 855 | else if ((0 >= userAmount)) | |
856 | - | then | |
856 | + | then throwErr("nothing to unlock") | |
857 | 857 | else { | |
858 | 858 | let period = valueOrElse(getInteger(mathContract, keyNextPeriod()), 0) | |
859 | 859 | (((LockParamsEntry(userAddress, userNumStr, 0, lockStart, lockDuration, 0, 0, toString(period)) ++ StatsEntry(-(userAmount), 0, 0, -1)) :+ HistoryEntry("unlock", userAddress, userAmount, lockStart, lockDuration, 0, 0, i)) :+ ScriptTransfer(addressFromStringValue(userAddress), userAmount, assetId)) | |
970 | 970 | let pm = pendingManagerPublicKeyOrUnit() | |
971 | 971 | let hasPM = if (isDefined(pm)) | |
972 | 972 | then true | |
973 | - | else | |
973 | + | else throwErr("No pending manager") | |
974 | 974 | if ((hasPM == hasPM)) | |
975 | 975 | then { | |
976 | 976 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
977 | 977 | then true | |
978 | - | else | |
978 | + | else throwErr("You are not pending manager") | |
979 | 979 | if ((checkPM == checkPM)) | |
980 | 980 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
981 | 981 | else throw("Strict value is not equal to itself.") |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | let SCALE8 = 8 | |
7 | 7 | ||
8 | 8 | let MULT8 = 100000000 | |
9 | 9 | ||
10 | 10 | let POOLWEIGHTMULT = MULT8 | |
11 | 11 | ||
12 | 12 | func wrapErr (msg) = makeString(["boosting.ride:", msg], " ") | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | func throwErr (msg) = throw(wrapErr(msg)) | |
16 | 16 | ||
17 | 17 | ||
18 | - | func strf (address,key) = valueOrErrorMessage(getString(address, key), (("mandatory this." + key) + " is not defined")) | |
18 | + | func strf (address,key) = valueOrErrorMessage(getString(address, key), wrapErr((("mandatory this." + key) + " is not defined"))) | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | func ioz (address,key) = valueOrElse(getInteger(address, key), 0) | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | func iod (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal) | |
25 | 25 | ||
26 | 26 | ||
27 | - | func iof (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined")) | |
27 | + | func iof (address,key) = valueOrErrorMessage(getInteger(address, key), wrapErr((("mandatory this." + key) + " is not defined"))) | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func abs (val) = if ((0 > val)) | |
31 | 31 | then -(val) | |
32 | 32 | else val | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func aal (val) = match val { | |
36 | 36 | case valAnyLyst: List[Any] => | |
37 | 37 | valAnyLyst | |
38 | 38 | case _ => | |
39 | - | | |
39 | + | throwErr("fail to cast into List[Any]") | |
40 | 40 | } | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func ai (val) = match val { | |
44 | 44 | case valInt: Int => | |
45 | 45 | valInt | |
46 | 46 | case _ => | |
47 | - | | |
47 | + | throwErr("fail to cast into Int") | |
48 | 48 | } | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func keyReferralsContractAddress () = makeString(["%s%s", "config", "referralsContractAddress"], SEP) | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | let referralsContractAddressOrFail = addressFromStringValue(strf(this, keyReferralsContractAddress())) | |
55 | 55 | ||
56 | 56 | let keyReferralProgramName = makeString(["%s%s", "referral", "programName"], SEP) | |
57 | 57 | ||
58 | 58 | let referralProgramNameDefault = "wxlock" | |
59 | 59 | ||
60 | 60 | let referralProgramName = valueOrElse(getString(this, keyReferralProgramName), referralProgramNameDefault) | |
61 | 61 | ||
62 | 62 | func keyFactoryAddress () = "%s%s__config__factoryAddress" | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | let IdxFactoryCfgStakingDapp = 1 | |
66 | 66 | ||
67 | 67 | let IdxFactoryCfgBoostingDapp = 2 | |
68 | 68 | ||
69 | 69 | let IdxFactoryCfgIdoDapp = 3 | |
70 | 70 | ||
71 | 71 | let IdxFactoryCfgTeamDapp = 4 | |
72 | 72 | ||
73 | 73 | let IdxFactoryCfgEmissionDapp = 5 | |
74 | 74 | ||
75 | 75 | let IdxFactoryCfgRestDapp = 6 | |
76 | 76 | ||
77 | 77 | let IdxFactoryCfgSlippageDapp = 7 | |
78 | 78 | ||
79 | 79 | let IdxFactoryCfgDaoDapp = 8 | |
80 | 80 | ||
81 | 81 | let IdxFactoryCfgMarketingDapp = 9 | |
82 | 82 | ||
83 | 83 | let IdxFactoryCfgGwxRewardDapp = 10 | |
84 | 84 | ||
85 | 85 | let IdxFactoryCfgBirdsDapp = 11 | |
86 | 86 | ||
87 | 87 | func keyFactoryCfg () = "%s__factoryConfig" | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func keyFactoryLpList () = "%s__lpTokensList" | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP) | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func keyFactoryPoolWeightHistory (poolAddress,num) = ((("%s%s__poolWeight__" + poolAddress) + "__") + toString(num)) | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func readFactoryAddressOrFail () = addressFromStringValue(strf(this, keyFactoryAddress())) | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func readLpList () = split(valueOrElse(getString(readFactoryAddressOrFail(), keyFactoryLpList()), ""), SEP) | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func readFactoryCfgOrFail (factory) = split(strf(factory, keyFactoryCfg()), SEP) | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp]) | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp]) | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp]) | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func getGwxRewardAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgGwxRewardDapp]) | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current" | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current" | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func keyEmissionStartBlock () = "%s%s__emission__startBlock" | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | func keyBoostingV2LastUpdateHeight () = "%s%s__boostingV2__startBlock" | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | func keyBoostingV2Integral () = "%s%s__boostingV2__integral" | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | func keyEmissionDurationInBlocks () = "%s%s__emission__duration" | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | func keyEmissionEndBlock () = "%s%s__emission__endBlock" | |
148 | 148 | ||
149 | 149 | ||
150 | 150 | func keyNextPeriod () = "%s__nextPeriod" | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | func keyGwxRewardEmissionStartHeight () = "%s%s__gwxRewardEmissionPart__startHeight" | |
154 | 154 | ||
155 | 155 | ||
156 | 156 | let IdxCfgAssetId = 1 | |
157 | 157 | ||
158 | 158 | let IdxCfgMinLockAmount = 2 | |
159 | 159 | ||
160 | 160 | let IdxCfgMinLockDuration = 3 | |
161 | 161 | ||
162 | 162 | let IdxCfgMaxLockDuration = 4 | |
163 | 163 | ||
164 | 164 | let IdxCfgMathContract = 5 | |
165 | 165 | ||
166 | 166 | func keyConfig () = "%s__config" | |
167 | 167 | ||
168 | 168 | ||
169 | 169 | func readConfigArrayOrFail () = split(strf(this, keyConfig()), SEP) | |
170 | 170 | ||
171 | 171 | ||
172 | 172 | let mathContract = addressFromStringValue(readConfigArrayOrFail()[IdxCfgMathContract]) | |
173 | 173 | ||
174 | 174 | func formatConfigS (assetId,minLockAmount,minLockDuration,maxLockDuration,mathContract) = makeString(["%s%d%d%d", assetId, minLockAmount, minLockDuration, maxLockDuration, mathContract], SEP) | |
175 | 175 | ||
176 | 176 | ||
177 | 177 | func formatConfig (assetId,minLockAmount,minLockDuration,maxLockDuration,mathContract) = formatConfigS(assetId, toString(minLockAmount), toString(minLockDuration), toString(maxLockDuration), mathContract) | |
178 | 178 | ||
179 | 179 | ||
180 | 180 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
181 | 181 | case s: String => | |
182 | 182 | fromBase58String(s) | |
183 | 183 | case _: Unit => | |
184 | 184 | unit | |
185 | 185 | case _ => | |
186 | 186 | throw("Match error") | |
187 | 187 | } | |
188 | 188 | ||
189 | 189 | ||
190 | 190 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
191 | 191 | case s: String => | |
192 | 192 | fromBase58String(s) | |
193 | 193 | case _: Unit => | |
194 | 194 | unit | |
195 | 195 | case _ => | |
196 | 196 | throw("Match error") | |
197 | 197 | } | |
198 | 198 | ||
199 | 199 | ||
200 | 200 | func mustManager (i) = { | |
201 | - | let pd = | |
201 | + | let pd = throwErr("Permission denied") | |
202 | 202 | match managerPublicKeyOrUnit() { | |
203 | 203 | case pk: ByteVector => | |
204 | 204 | if ((i.callerPublicKey == pk)) | |
205 | 205 | then true | |
206 | 206 | else pd | |
207 | 207 | case _: Unit => | |
208 | 208 | if ((i.caller == this)) | |
209 | 209 | then true | |
210 | 210 | else pd | |
211 | 211 | case _ => | |
212 | 212 | throw("Match error") | |
213 | 213 | } | |
214 | 214 | } | |
215 | 215 | ||
216 | 216 | ||
217 | 217 | let IdxLockUserNum = 1 | |
218 | 218 | ||
219 | 219 | let IdxLockAmount = 2 | |
220 | 220 | ||
221 | 221 | let IdxLockStart = 3 | |
222 | 222 | ||
223 | 223 | let IdxLockDuration = 4 | |
224 | 224 | ||
225 | 225 | let IdxLockParamK = 5 | |
226 | 226 | ||
227 | 227 | let IdxLockParamB = 6 | |
228 | 228 | ||
229 | 229 | func keyLockParamsRecord (userAddress) = makeString(["%s%s__lock", userAddress], SEP) | |
230 | 230 | ||
231 | 231 | ||
232 | 232 | func readLockParamsRecordOrFail (userAddress) = split(strf(this, keyLockParamsRecord(userAddress)), SEP) | |
233 | 233 | ||
234 | 234 | ||
235 | 235 | func formatLockParamsRecordS (userNum,amount,start,duration,paramK,paramB,lastUpdTimestamp,gwxAmount) = makeString(["%d%d%d%d%d%d%d%d", userNum, amount, start, duration, paramK, paramB, lastUpdTimestamp, gwxAmount], SEP) | |
236 | 236 | ||
237 | 237 | ||
238 | 238 | func formatLockParamsRecord (userNum,amount,start,duration,paramK,paramB,gwxAmount) = formatLockParamsRecordS(userNum, toString(amount), toString(start), toString(duration), toString(paramK), toString(paramB), toString(lastBlock.timestamp), toString(gwxAmount)) | |
239 | 239 | ||
240 | 240 | ||
241 | 241 | func keyNextUserNum () = "%s__nextUserNum" | |
242 | 242 | ||
243 | 243 | ||
244 | 244 | func keyUser2NumMapping (userAddress) = makeString(["%s%s%s__mapping__user2num", userAddress], SEP) | |
245 | 245 | ||
246 | 246 | ||
247 | 247 | func keyNum2UserMapping (num) = makeString(["%s%s%s__mapping__num2user", num], SEP) | |
248 | 248 | ||
249 | 249 | ||
250 | 250 | func keyLockParamUserAmount (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "amount"], SEP) | |
251 | 251 | ||
252 | 252 | ||
253 | 253 | func keyLockParamStartBlock (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "start"], SEP) | |
254 | 254 | ||
255 | 255 | ||
256 | 256 | func keyLockParamDuration (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "duration"], SEP) | |
257 | 257 | ||
258 | 258 | ||
259 | 259 | func keyLockParamK (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "k"], SEP) | |
260 | 260 | ||
261 | 261 | ||
262 | 262 | func keyLockParamB (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "b"], SEP) | |
263 | 263 | ||
264 | 264 | ||
265 | 265 | func keyLockParamByPeriodK (userNum,period) = makeString(["%s%d%s%d__paramByPeriod", userNum, "k", period], SEP) | |
266 | 266 | ||
267 | 267 | ||
268 | 268 | func keyLockParamByPeriodB (userNum,period) = makeString(["%s%d%s%d__paramByPeriod", userNum, "b", period], SEP) | |
269 | 269 | ||
270 | 270 | ||
271 | 271 | func keyLockParamTotalAmount () = "%s%s__stats__activeTotalLocked" | |
272 | 272 | ||
273 | 273 | ||
274 | 274 | func keyStatsLocksDurationSumInBlocks () = "%s%s__stats__locksDurationSumInBlocks" | |
275 | 275 | ||
276 | 276 | ||
277 | 277 | func keyStatsLocksCount () = "%s%s__stats__locksCount" | |
278 | 278 | ||
279 | 279 | ||
280 | 280 | func keyStatsUsersCount () = "%s%s__stats__activeUsersCount" | |
281 | 281 | ||
282 | 282 | ||
283 | 283 | func keyUserBoostEmissionLastINTEGRAL (userNum) = makeString(["%s%d__userBoostEmissionLastIntV2", userNum], SEP) | |
284 | 284 | ||
285 | 285 | ||
286 | 286 | func keyUserLpBoostEmissionLastINTEGRAL (userNum,lpAssetId) = makeString(["%s%d__userBoostEmissionLastIntV2", userNum, lpAssetId], SEP) | |
287 | 287 | ||
288 | 288 | ||
289 | 289 | func keyUserMaxBoostINTEGRAL (userNum) = makeString(["%s%d__maxBoostInt", userNum], SEP) | |
290 | 290 | ||
291 | 291 | ||
292 | 292 | func keyTotalMaxBoostINTEGRAL () = "%s%s__maxBoostInt__total" | |
293 | 293 | ||
294 | 294 | ||
295 | 295 | func keyUserBoostAvalaibleToClaimTotal (userNum) = makeString(["%s%d__userBoostAvaliableToClaimTotal", userNum], SEP) | |
296 | 296 | ||
297 | 297 | ||
298 | 298 | func keyUserBoostClaimed (userNum) = makeString(["%s%d__userBoostClaimed", userNum], SEP) | |
299 | 299 | ||
300 | 300 | ||
301 | 301 | func keyTotalCachedGwx () = "%s%s__gwxCached__total" | |
302 | 302 | ||
303 | 303 | ||
304 | 304 | func keyTotalCachedGwxCorrective () = "%s__gwxCachedTotalCorrective" | |
305 | 305 | ||
306 | 306 | ||
307 | 307 | func keyVote (amountAssetId,priceAssetId,address,epoch) = makeString(["%s%s%s%s%d", "vote", amountAssetId, priceAssetId, toString(address), toString(epoch)], SEP) | |
308 | 308 | ||
309 | 309 | ||
310 | 310 | func keyStartHeightByEpoch (epoch) = makeString(["%s%d", "startHeight", toString(epoch)], SEP) | |
311 | 311 | ||
312 | 312 | ||
313 | 313 | func keyCurrentEpochUi () = makeString(["%s", "currentEpochUi"], SEP) | |
314 | 314 | ||
315 | 315 | ||
316 | 316 | func keyVotingResultStaked (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStaked", lpAssetIdStr, toString(epoch)], SEP) | |
317 | 317 | ||
318 | 318 | ||
319 | 319 | func keyVotingResultStakedIntegral (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStakedIntegral", lpAssetIdStr, toString(epoch)], SEP) | |
320 | 320 | ||
321 | 321 | ||
322 | 322 | func keyVotingResultStakedLastUpdateHeight (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStakedIntegralLastUpdateHeight", lpAssetIdStr, toString(epoch)], SEP) | |
323 | 323 | ||
324 | 324 | ||
325 | 325 | func keyVotingResultStakedIntegralLast (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "votingResultStakedIntegralLast", lpAssetIdStr, toString(address), toString(epoch)], SEP) | |
326 | 326 | ||
327 | 327 | ||
328 | 328 | func keyVoteStakedIntegral (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegral", lpAssetIdStr, toString(address), toString(epoch)], SEP) | |
329 | 329 | ||
330 | 330 | ||
331 | 331 | func keyVoteStakedLastUpdateHeight (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegralLastUpdateHeight", lpAssetIdStr, toString(address), toString(epoch)], SEP) | |
332 | 332 | ||
333 | 333 | ||
334 | 334 | func keyVoteStakedIntegralLast (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegralLast", lpAssetIdStr, toString(address), toString(epoch)], SEP) | |
335 | 335 | ||
336 | 336 | ||
337 | 337 | func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s", "staked", userAddressStr, lpAssetIdStr], SEP) | |
338 | 338 | ||
339 | 339 | ||
340 | 340 | let factoryContract = readFactoryAddressOrFail() | |
341 | 341 | ||
342 | 342 | let factoryCfg = readFactoryCfgOrFail(factoryContract) | |
343 | 343 | ||
344 | 344 | let emissionContract = getEmissionAddressOrFail(factoryCfg) | |
345 | 345 | ||
346 | 346 | let stakingContract = getStakingAddressOrFail(factoryCfg) | |
347 | 347 | ||
348 | 348 | let gwxRewardContract = getGwxRewardAddressOrFail(factoryCfg) | |
349 | 349 | ||
350 | 350 | let lpStakingPoolsContract = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(makeString(["%s", "lpStakingPoolsContract"], SEP)), wrapErr("lp_staking_pools contract address is undefined"))), wrapErr("invalid lp_staking_pools contract address")) | |
351 | 351 | ||
352 | 352 | let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP) | |
353 | 353 | ||
354 | 354 | let votingEmissionContract = addressFromStringValue(getStringValue(factoryContract, keyVotingEmissionContract)) | |
355 | 355 | ||
356 | 356 | let boostCoeff = { | |
357 | 357 | let @ = invoke(emissionContract, "getBoostCoeffREADONLY", nil, nil) | |
358 | 358 | if ($isInstanceOf(@, "Int")) | |
359 | 359 | then @ | |
360 | 360 | else throw(($getType(@) + " couldn't be cast to Int")) | |
361 | 361 | } | |
362 | 362 | ||
363 | 363 | func getTotalCachedGwx (correct) = { | |
364 | 364 | let currentEpochUi = getIntegerValue(votingEmissionContract, keyCurrentEpochUi()) | |
365 | 365 | let keyTargetEpoch = makeString(["%s%s", "totalCachedGwxCorrection__activationEpoch"], SEP) | |
366 | 366 | let targetEpochOption = getInteger(this, keyTargetEpoch) | |
367 | 367 | let totalCachedGwxRaw = valueOrElse(getInteger(this, keyTotalCachedGwx()), 0) | |
368 | 368 | let isCorrectionActivated = if (isDefined(targetEpochOption)) | |
369 | 369 | then (currentEpochUi >= value(targetEpochOption)) | |
370 | 370 | else false | |
371 | 371 | let corrective = if (if (isCorrectionActivated) | |
372 | 372 | then correct | |
373 | 373 | else false) | |
374 | 374 | then valueOrElse(getInteger(this, keyTotalCachedGwxCorrective()), 0) | |
375 | 375 | else 0 | |
376 | 376 | max([0, (totalCachedGwxRaw + corrective)]) | |
377 | 377 | } | |
378 | 378 | ||
379 | 379 | ||
380 | 380 | func HistoryEntry (type,user,amount,lockStart,duration,k,b,i) = { | |
381 | 381 | let historyKEY = makeString(["%s%s%s%s__history", type, user, toBase58String(i.transactionId)], SEP) | |
382 | 382 | let historyDATA = makeString(["%d%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(amount), toString(lockStart), toString(duration), toString(k), toString(b)], SEP) | |
383 | 383 | StringEntry(historyKEY, historyDATA) | |
384 | 384 | } | |
385 | 385 | ||
386 | 386 | ||
387 | 387 | func StatsEntry (totalLockedInc,durationInc,lockCountInc,usersCountInc) = { | |
388 | 388 | let locksDurationSumInBlocksKEY = keyStatsLocksDurationSumInBlocks() | |
389 | 389 | let locksCountKEY = keyStatsLocksCount() | |
390 | 390 | let usersCountKEY = keyStatsUsersCount() | |
391 | 391 | let totalAmountKEY = keyLockParamTotalAmount() | |
392 | 392 | let locksDurationSumInBlocks = ioz(this, locksDurationSumInBlocksKEY) | |
393 | 393 | let locksCount = ioz(this, locksCountKEY) | |
394 | 394 | let usersCount = ioz(this, usersCountKEY) | |
395 | 395 | let totalAmount = ioz(this, totalAmountKEY) | |
396 | 396 | [IntegerEntry(locksDurationSumInBlocksKEY, (locksDurationSumInBlocks + durationInc)), IntegerEntry(locksCountKEY, (locksCount + lockCountInc)), IntegerEntry(usersCountKEY, (usersCount + usersCountInc)), IntegerEntry(totalAmountKEY, (totalAmount + totalLockedInc))] | |
397 | 397 | } | |
398 | 398 | ||
399 | 399 | ||
400 | 400 | func calcGwxAmount (kRaw,bRaw,h) = { | |
401 | 401 | let SCALE = 1000 | |
402 | 402 | (((kRaw * h) + bRaw) / SCALE) | |
403 | 403 | } | |
404 | 404 | ||
405 | 405 | ||
406 | 406 | func LockParamsEntry (userAddress,userNum,amount,start,duration,k,b,period) = { | |
407 | 407 | let userAmountKEY = keyLockParamUserAmount(userNum) | |
408 | 408 | let startBlockKEY = keyLockParamStartBlock(userNum) | |
409 | 409 | let durationKEY = keyLockParamDuration(userNum) | |
410 | 410 | let kKEY = keyLockParamK(userNum) | |
411 | 411 | let bKEY = keyLockParamB(userNum) | |
412 | 412 | let kByPeriodKEY = keyLockParamByPeriodK(userNum, period) | |
413 | 413 | let bByPeriodKEY = keyLockParamByPeriodB(userNum, period) | |
414 | 414 | let gwxAmount = calcGwxAmount(k, b, height) | |
415 | 415 | [IntegerEntry(userAmountKEY, amount), IntegerEntry(startBlockKEY, start), IntegerEntry(durationKEY, duration), IntegerEntry(kKEY, k), IntegerEntry(bKEY, b), IntegerEntry(kByPeriodKEY, k), IntegerEntry(bByPeriodKEY, b), StringEntry(keyLockParamsRecord(userAddress), formatLockParamsRecord(userNum, amount, start, duration, k, b, gwxAmount))] | |
416 | 416 | } | |
417 | 417 | ||
418 | 418 | ||
419 | 419 | func extractOptionalPaymentAmountOrFail (i,expectedAssetId) = if ((size(i.payments) > 1)) | |
420 | - | then | |
420 | + | then throwErr("only one payment is allowed") | |
421 | 421 | else if ((size(i.payments) == 0)) | |
422 | 422 | then 0 | |
423 | 423 | else { | |
424 | 424 | let pmt = i.payments[0] | |
425 | 425 | if ((value(pmt.assetId) != expectedAssetId)) | |
426 | - | then | |
426 | + | then throwErr("invalid asset id in payment") | |
427 | 427 | else pmt.amount | |
428 | 428 | } | |
429 | 429 | ||
430 | 430 | ||
431 | 431 | func calcUserGwxAmountAtHeight (userAddress,targetHeight) = { | |
432 | 432 | let EMPTY = "empty" | |
433 | 433 | let user2NumMappingKEY = keyUser2NumMapping(userAddress) | |
434 | 434 | let userNum = valueOrElse(getString(user2NumMappingKEY), EMPTY) | |
435 | 435 | let k = valueOrElse(getInteger(keyLockParamK(userNum)), 0) | |
436 | 436 | let b = valueOrElse(getInteger(keyLockParamB(userNum)), 0) | |
437 | 437 | let gwxAmountCalc = calcGwxAmount(k, b, targetHeight) | |
438 | 438 | let gwxAmount = if ((0 > gwxAmountCalc)) | |
439 | 439 | then 0 | |
440 | 440 | else gwxAmountCalc | |
441 | 441 | gwxAmount | |
442 | 442 | } | |
443 | 443 | ||
444 | 444 | ||
445 | 445 | func calcCurrentGwxAmount (userAddress) = calcUserGwxAmountAtHeight(userAddress, height) | |
446 | 446 | ||
447 | 447 | ||
448 | 448 | func getVotingEmissionEpochInfo () = { | |
449 | - | let $ | |
449 | + | let $t01710117391 = { | |
450 | 450 | let currentEpochUi = value(getInteger(votingEmissionContract, keyCurrentEpochUi())) | |
451 | 451 | let lastFinalizedEpoch = (currentEpochUi - 1) | |
452 | 452 | if ((0 > lastFinalizedEpoch)) | |
453 | 453 | then throwErr("invalid epoch") | |
454 | 454 | else $Tuple2(currentEpochUi, lastFinalizedEpoch) | |
455 | 455 | } | |
456 | - | let currentEpochUi = $ | |
457 | - | let lastFinalizedEpoch = $ | |
456 | + | let currentEpochUi = $t01710117391._1 | |
457 | + | let lastFinalizedEpoch = $t01710117391._2 | |
458 | 458 | let currentEpochStartHeight = value(getInteger(votingEmissionContract, keyStartHeightByEpoch(currentEpochUi))) | |
459 | 459 | $Tuple2(lastFinalizedEpoch, currentEpochStartHeight) | |
460 | 460 | } | |
461 | 461 | ||
462 | 462 | ||
463 | 463 | func getPoolAssetsByLpAssetId (lpAssetIdStr) = { | |
464 | 464 | let idxAmountAssetId = 4 | |
465 | 465 | let idxPriceAssetId = 5 | |
466 | 466 | let poolCfg = { | |
467 | 467 | let @ = invoke(factoryContract, "getPoolConfigByLpAssetIdREADONLY", [lpAssetIdStr], nil) | |
468 | 468 | if ($isInstanceOf(@, "List[Any]")) | |
469 | 469 | then @ | |
470 | 470 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
471 | 471 | } | |
472 | 472 | let amountAssetId = { | |
473 | 473 | let @ = poolCfg[idxAmountAssetId] | |
474 | 474 | if ($isInstanceOf(@, "String")) | |
475 | 475 | then @ | |
476 | 476 | else throw(($getType(@) + " couldn't be cast to String")) | |
477 | 477 | } | |
478 | 478 | let priceAssetId = { | |
479 | 479 | let @ = poolCfg[idxPriceAssetId] | |
480 | 480 | if ($isInstanceOf(@, "String")) | |
481 | 481 | then @ | |
482 | 482 | else throw(($getType(@) + " couldn't be cast to String")) | |
483 | 483 | } | |
484 | 484 | $Tuple2(amountAssetId, priceAssetId) | |
485 | 485 | } | |
486 | 486 | ||
487 | 487 | ||
488 | 488 | func getUserVoteFinalized (lpAssetIdStr,userAddressStr) = { | |
489 | 489 | let userAddress = addressFromStringValue(userAddressStr) | |
490 | - | let $ | |
491 | - | let lastFinalizedEpoch = $ | |
492 | - | let currentEpochStartHeight = $ | |
493 | - | let $ | |
494 | - | let amountAssetId = $ | |
495 | - | let priceAssetId = $ | |
490 | + | let $t01808218162 = getVotingEmissionEpochInfo() | |
491 | + | let lastFinalizedEpoch = $t01808218162._1 | |
492 | + | let currentEpochStartHeight = $t01808218162._2 | |
493 | + | let $t01816518240 = getPoolAssetsByLpAssetId(lpAssetIdStr) | |
494 | + | let amountAssetId = $t01816518240._1 | |
495 | + | let priceAssetId = $t01816518240._2 | |
496 | 496 | let userVoteKey = keyVote(amountAssetId, priceAssetId, userAddress, lastFinalizedEpoch) | |
497 | 497 | let userVote = valueOrElse(getInteger(votingEmissionContract, userVoteKey), 0) | |
498 | 498 | userVote | |
499 | 499 | } | |
500 | 500 | ||
501 | 501 | ||
502 | 502 | func getUserVoteStaked (lpAssetIdStr,userAddressStr) = { | |
503 | 503 | let stakedByUser = valueOrElse(getInteger(stakingContract, keyStakedByUser(userAddressStr, lpAssetIdStr)), 0) | |
504 | 504 | let userVote = getUserVoteFinalized(lpAssetIdStr, userAddressStr) | |
505 | 505 | if ((stakedByUser == 0)) | |
506 | 506 | then 0 | |
507 | 507 | else userVote | |
508 | 508 | } | |
509 | 509 | ||
510 | 510 | ||
511 | 511 | func getVotingResultStaked (lpAssetIdStr) = { | |
512 | - | let $ | |
513 | - | let lastFinalizedEpoch = $ | |
514 | - | let currentEpochStartHeight = $ | |
512 | + | let $t01878418864 = getVotingEmissionEpochInfo() | |
513 | + | let lastFinalizedEpoch = $t01878418864._1 | |
514 | + | let currentEpochStartHeight = $t01878418864._2 | |
515 | 515 | let votingResultStakedStart = valueOrElse(getInteger(votingEmissionContract, keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch)), 0) | |
516 | 516 | let votingResultStaked = valueOrElse(getInteger(this, keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch)), votingResultStakedStart) | |
517 | 517 | votingResultStaked | |
518 | 518 | } | |
519 | 519 | ||
520 | 520 | ||
521 | 521 | func getVotingResultStakedIntegral (lpAssetIdStr) = { | |
522 | - | let $ | |
523 | - | let lastFinalizedEpoch = $ | |
524 | - | let currentEpochStartHeight = $ | |
522 | + | let $t01922619306 = getVotingEmissionEpochInfo() | |
523 | + | let lastFinalizedEpoch = $t01922619306._1 | |
524 | + | let currentEpochStartHeight = $t01922619306._2 | |
525 | 525 | let votingResultStaked = getVotingResultStaked(lpAssetIdStr) | |
526 | 526 | let votingResultStakedIntegralPrev = valueOrElse(getInteger(this, keyVotingResultStakedIntegral(lpAssetIdStr, lastFinalizedEpoch)), 0) | |
527 | 527 | let votingResultStakedLastUpdateHeight = valueOrElse(getInteger(this, keyVotingResultStakedLastUpdateHeight(lpAssetIdStr, lastFinalizedEpoch)), currentEpochStartHeight) | |
528 | 528 | let votingResultStakedIntegralDh = (height - votingResultStakedLastUpdateHeight) | |
529 | 529 | let votingResultStakedIntegral = ((votingResultStakedIntegralDh * votingResultStaked) + votingResultStakedIntegralPrev) | |
530 | 530 | votingResultStakedIntegral | |
531 | 531 | } | |
532 | 532 | ||
533 | 533 | ||
534 | 534 | func refreshVotingResultStakedIntegral (lpAssetIdStr,stakedVoteDelta) = { | |
535 | - | let $ | |
536 | - | let lastFinalizedEpoch = $ | |
537 | - | let currentEpochStartHeight = $ | |
535 | + | let $t02014320223 = getVotingEmissionEpochInfo() | |
536 | + | let lastFinalizedEpoch = $t02014320223._1 | |
537 | + | let currentEpochStartHeight = $t02014320223._2 | |
538 | 538 | let votingResultStaked = getVotingResultStaked(lpAssetIdStr) | |
539 | 539 | let votingResultStakedNew = (votingResultStaked + stakedVoteDelta) | |
540 | 540 | let votingResultStakedIntegral = getVotingResultStakedIntegral(lpAssetIdStr) | |
541 | 541 | [IntegerEntry(keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch), votingResultStakedNew), IntegerEntry(keyVotingResultStakedLastUpdateHeight(lpAssetIdStr, lastFinalizedEpoch), height), IntegerEntry(keyVotingResultStakedIntegral(lpAssetIdStr, lastFinalizedEpoch), votingResultStakedIntegral)] | |
542 | 542 | } | |
543 | 543 | ||
544 | 544 | ||
545 | 545 | func getUserVoteStakedIntegral (lpAssetIdStr,userAddressStr) = { | |
546 | - | let $ | |
547 | - | let lastFinalizedEpoch = $ | |
548 | - | let currentEpochStartHeight = $ | |
546 | + | let $t02083420914 = getVotingEmissionEpochInfo() | |
547 | + | let lastFinalizedEpoch = $t02083420914._1 | |
548 | + | let currentEpochStartHeight = $t02083420914._2 | |
549 | 549 | let userAddress = addressFromStringValue(userAddressStr) | |
550 | 550 | let userVoteStaked = getUserVoteStaked(lpAssetIdStr, userAddressStr) | |
551 | 551 | let userVoteStakedIntegralPrev = valueOrElse(getInteger(this, keyVoteStakedIntegral(lpAssetIdStr, userAddress, lastFinalizedEpoch)), 0) | |
552 | 552 | let userVoteStakedLastUpdateHeight = valueOrElse(getInteger(this, keyVoteStakedLastUpdateHeight(lpAssetIdStr, userAddress, lastFinalizedEpoch)), currentEpochStartHeight) | |
553 | 553 | let userVoteStakedIntegralDh = (height - userVoteStakedLastUpdateHeight) | |
554 | 554 | let userVoteStakedIntegral = ((userVoteStakedIntegralDh * userVoteStaked) + userVoteStakedIntegralPrev) | |
555 | 555 | userVoteStakedIntegral | |
556 | 556 | } | |
557 | 557 | ||
558 | 558 | ||
559 | 559 | func refreshVoteStakedIntegral (lpAssetIdStr,userAddressStr,edge) = { | |
560 | - | let $ | |
561 | - | let lastFinalizedEpoch = $ | |
562 | - | let currentEpochStartHeight = $ | |
560 | + | let $t02170221782 = getVotingEmissionEpochInfo() | |
561 | + | let lastFinalizedEpoch = $t02170221782._1 | |
562 | + | let currentEpochStartHeight = $t02170221782._2 | |
563 | 563 | let userAddress = addressFromStringValue(userAddressStr) | |
564 | 564 | let userVoteFinalized = getUserVoteFinalized(lpAssetIdStr, userAddressStr) | |
565 | 565 | let actions = if ((userVoteFinalized == 0)) | |
566 | 566 | then nil | |
567 | 567 | else { | |
568 | 568 | let stakedVoteDelta = if (edge) | |
569 | 569 | then userVoteFinalized | |
570 | 570 | else -(userVoteFinalized) | |
571 | 571 | let votingResultActions = refreshVotingResultStakedIntegral(lpAssetIdStr, stakedVoteDelta) | |
572 | 572 | let userVoteStakedIntegral = getUserVoteStakedIntegral(lpAssetIdStr, userAddressStr) | |
573 | 573 | let voteActions = [IntegerEntry(keyVoteStakedLastUpdateHeight(lpAssetIdStr, userAddress, lastFinalizedEpoch), height), IntegerEntry(keyVoteStakedIntegral(lpAssetIdStr, userAddress, lastFinalizedEpoch), userVoteStakedIntegral)] | |
574 | 574 | (votingResultActions ++ voteActions) | |
575 | 575 | } | |
576 | 576 | actions | |
577 | 577 | } | |
578 | 578 | ||
579 | 579 | ||
580 | 580 | func getStakedVotesIntegralsDiff (lpAssetIdStr,userAddressStr) = { | |
581 | - | let $ | |
582 | - | let lastFinalizedEpoch = $ | |
583 | - | let currentEpochStartHeight = $ | |
581 | + | let $t02263622716 = getVotingEmissionEpochInfo() | |
582 | + | let lastFinalizedEpoch = $t02263622716._1 | |
583 | + | let currentEpochStartHeight = $t02263622716._2 | |
584 | 584 | let userAddress = addressFromStringValue(userAddressStr) | |
585 | 585 | let userVoteStakedIntegralLastKey = keyVoteStakedIntegralLast(lpAssetIdStr, userAddress, lastFinalizedEpoch) | |
586 | 586 | let userVoteStakedIntegralLast = valueOrElse(getInteger(this, userVoteStakedIntegralLastKey), 0) | |
587 | 587 | let votingResultStakedIntegralLastKey = keyVotingResultStakedIntegralLast(lpAssetIdStr, userAddress, lastFinalizedEpoch) | |
588 | 588 | let votingResultStakedIntegralLast = valueOrElse(getInteger(this, votingResultStakedIntegralLastKey), 0) | |
589 | 589 | let userVoteStakedIntegral = getUserVoteStakedIntegral(lpAssetIdStr, userAddressStr) | |
590 | 590 | let votingResultStakedIntegral = getVotingResultStakedIntegral(lpAssetIdStr) | |
591 | 591 | let userVoteStakedIntegralDiff = (userVoteStakedIntegral - userVoteStakedIntegralLast) | |
592 | 592 | let votingResultStakedIntegralDiff = (votingResultStakedIntegral - votingResultStakedIntegralLast) | |
593 | 593 | $Tuple3([IntegerEntry(userVoteStakedIntegralLastKey, userVoteStakedIntegral), IntegerEntry(votingResultStakedIntegralLastKey, votingResultStakedIntegral)], userVoteStakedIntegralDiff, votingResultStakedIntegralDiff) | |
594 | 594 | } | |
595 | 595 | ||
596 | 596 | ||
597 | 597 | func refreshBoostEmissionIntegral () = { | |
598 | 598 | let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent()) | |
599 | 599 | let boostingV2LastUpdateHeightOption = getInteger(this, keyBoostingV2LastUpdateHeight()) | |
600 | 600 | let boostingV2IngergalOption = getInteger(this, keyBoostingV2Integral()) | |
601 | 601 | let emissionEnd = iof(emissionContract, keyEmissionEndBlock()) | |
602 | 602 | let h = if ((height > emissionEnd)) | |
603 | 603 | then emissionEnd | |
604 | 604 | else height | |
605 | 605 | let dh = match boostingV2LastUpdateHeightOption { | |
606 | 606 | case lastUpdateHeight: Int => | |
607 | 607 | max([(h - lastUpdateHeight), 0]) | |
608 | 608 | case _: Unit => | |
609 | 609 | 0 | |
610 | 610 | case _ => | |
611 | 611 | throw("Match error") | |
612 | 612 | } | |
613 | 613 | let boostEmissionPerBlock = ((wxEmissionPerBlock * (boostCoeff - 1)) / boostCoeff) | |
614 | 614 | let boostEmissionIntegralPrev = valueOrElse(boostingV2IngergalOption, 0) | |
615 | 615 | let boostEmissionIntegral = ((boostEmissionPerBlock * dh) + boostEmissionIntegralPrev) | |
616 | 616 | $Tuple2([IntegerEntry(keyBoostingV2Integral(), boostEmissionIntegral), IntegerEntry(keyBoostingV2LastUpdateHeight(), height)], boostEmissionIntegral) | |
617 | 617 | } | |
618 | 618 | ||
619 | 619 | ||
620 | 620 | func internalClaimWxBoost (lpAssetIdStr,userAddressStr,readOnly) = { | |
621 | 621 | let userRecordOption = getString(this, keyLockParamsRecord(userAddressStr)) | |
622 | 622 | if ((userRecordOption == unit)) | |
623 | 623 | then $Tuple3(0, nil, "userRecord::is::empty") | |
624 | 624 | else { | |
625 | 625 | let userRecordArray = split(value(userRecordOption), SEP) | |
626 | 626 | let userNumStr = userRecordArray[IdxLockUserNum] | |
627 | 627 | let EMPTYSTR = "empty" | |
628 | 628 | let poolWeight = if ((lpAssetIdStr != EMPTYSTR)) | |
629 | 629 | then { | |
630 | - | let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
630 | + | let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)), wrapErr(("unsupported lp asset " + lpAssetIdStr))) | |
631 | 631 | getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr)) | |
632 | 632 | } | |
633 | 633 | else if (readOnly) | |
634 | 634 | then 0 | |
635 | - | else | |
635 | + | else throwErr(("not readonly mode: unsupported lp asset " + lpAssetIdStr)) | |
636 | 636 | let userLpBoostEmissionLastIntegralKEY = keyUserLpBoostEmissionLastINTEGRAL(userNumStr, lpAssetIdStr) | |
637 | 637 | let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr) | |
638 | 638 | let userBoostEmissionLastIntegral = valueOrElse(getInteger(this, userLpBoostEmissionLastIntegralKEY), ioz(this, userBoostEmissionLastIntegralKEY)) | |
639 | 639 | let boostEmissionIntegral = refreshBoostEmissionIntegral()._2 | |
640 | 640 | let userBoostEmissionIntegral = (boostEmissionIntegral - userBoostEmissionLastIntegral) | |
641 | 641 | if ((0 > userBoostEmissionIntegral)) | |
642 | - | then | |
642 | + | then throwErr("wrong calculations") | |
643 | 643 | else { | |
644 | - | let $ | |
645 | - | let stakedVotesIntegralsActions = $ | |
646 | - | let userVoteIntegralDiff = $ | |
647 | - | let totalVotesIntegralDiff = $ | |
644 | + | let $t02633526474 = getStakedVotesIntegralsDiff(lpAssetIdStr, userAddressStr) | |
645 | + | let stakedVotesIntegralsActions = $t02633526474._1 | |
646 | + | let userVoteIntegralDiff = $t02633526474._2 | |
647 | + | let totalVotesIntegralDiff = $t02633526474._3 | |
648 | 648 | let poolUserBoostEmissionIntegral = fraction(userBoostEmissionIntegral, poolWeight, POOLWEIGHTMULT) | |
649 | 649 | let userBoostAvaliableToClaimTotalNew = if ((totalVotesIntegralDiff == 0)) | |
650 | 650 | then 0 | |
651 | 651 | else fraction(poolUserBoostEmissionIntegral, userVoteIntegralDiff, totalVotesIntegralDiff) | |
652 | 652 | let dataState = ([IntegerEntry(userLpBoostEmissionLastIntegralKEY, boostEmissionIntegral)] ++ stakedVotesIntegralsActions) | |
653 | 653 | let debug = makeString([toString(userBoostEmissionLastIntegral), toString(userBoostEmissionIntegral), toString(poolWeight), toString(userVoteIntegralDiff), toString(totalVotesIntegralDiff)], ":") | |
654 | 654 | $Tuple3(userBoostAvaliableToClaimTotalNew, dataState, debug) | |
655 | 655 | } | |
656 | 656 | } | |
657 | 657 | } | |
658 | 658 | ||
659 | 659 | ||
660 | 660 | func lockActions (i,duration) = { | |
661 | 661 | let cfgArray = readConfigArrayOrFail() | |
662 | 662 | let assetIdStr = cfgArray[IdxCfgAssetId] | |
663 | 663 | let assetId = fromBase58String(assetIdStr) | |
664 | 664 | let minLockAmount = parseIntValue(cfgArray[IdxCfgMinLockAmount]) | |
665 | 665 | let minLockDuration = parseIntValue(cfgArray[IdxCfgMinLockDuration]) | |
666 | 666 | let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration]) | |
667 | 667 | if ((size(i.payments) != 1)) | |
668 | - | then | |
668 | + | then throwErr("invalid payment - exact one payment must be attached") | |
669 | 669 | else { | |
670 | 670 | let pmt = i.payments[0] | |
671 | 671 | let pmtAmount = pmt.amount | |
672 | 672 | if ((assetId != value(pmt.assetId))) | |
673 | - | then | |
673 | + | then throwErr((("invalid asset is in payment - " + assetIdStr) + " is expected")) | |
674 | 674 | else { | |
675 | 675 | let nextUserNumKEY = keyNextUserNum() | |
676 | 676 | let userAddressStr = toString(i.caller) | |
677 | 677 | let userIsExisting = isDefined(getString(keyUser2NumMapping(userAddressStr))) | |
678 | 678 | let userNumStr = if (userIsExisting) | |
679 | 679 | then value(getString(keyUser2NumMapping(userAddressStr))) | |
680 | 680 | else toString(iof(this, nextUserNumKEY)) | |
681 | 681 | let userNum = parseIntValue(userNumStr) | |
682 | 682 | let lockStart = height | |
683 | 683 | let startBlockKEY = keyLockParamStartBlock(userNumStr) | |
684 | 684 | let durationKEY = keyLockParamDuration(userNumStr) | |
685 | 685 | let userAmountKEY = keyLockParamUserAmount(userNumStr) | |
686 | 686 | if (if ((minLockAmount > pmtAmount)) | |
687 | 687 | then (i.caller != lpStakingPoolsContract) | |
688 | 688 | else false) | |
689 | - | then | |
689 | + | then throwErr(("amount is less then minLockAmount=" + toString(minLockAmount))) | |
690 | 690 | else if ((minLockDuration > duration)) | |
691 | - | then | |
691 | + | then throwErr(("passed duration is less then minLockDuration=" + toString(minLockDuration))) | |
692 | 692 | else if ((duration > maxLockDuration)) | |
693 | - | then | |
693 | + | then throwErr(("passed duration is greater then maxLockDuration=" + toString(maxLockDuration))) | |
694 | 694 | else if (if (userIsExisting) | |
695 | 695 | then ((iof(this, startBlockKEY) + iof(this, durationKEY)) >= lockStart) | |
696 | 696 | else false) | |
697 | - | then | |
697 | + | then throwErr("there is an active lock - consider to use increaseLock") | |
698 | 698 | else if ((ioz(this, userAmountKEY) > 0)) | |
699 | - | then | |
699 | + | then throwErr(("there are locked WXs - consider to use increaseLock " + userAmountKEY)) | |
700 | 700 | else { | |
701 | 701 | let coeffX8 = fraction(duration, MULT8, maxLockDuration) | |
702 | 702 | let gWxAmountStart = fraction(pmtAmount, coeffX8, MULT8) | |
703 | 703 | let gWxParamsResultList = aal(invoke(mathContract, "calcGwxParamsREADONLY", [gWxAmountStart, lockStart, duration], nil)) | |
704 | 704 | let k = ai(gWxParamsResultList[0]) | |
705 | 705 | let b = ai(gWxParamsResultList[1]) | |
706 | 706 | let period = toString(ai(gWxParamsResultList[2])) | |
707 | 707 | let totalCachedGwxRaw = getTotalCachedGwx(false) | |
708 | 708 | let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr) | |
709 | 709 | let boostEmissionIntegral = refreshBoostEmissionIntegral()._2 | |
710 | 710 | let arr = if (userIsExisting) | |
711 | 711 | then nil | |
712 | 712 | else [IntegerEntry(nextUserNumKEY, (userNum + 1)), StringEntry(keyUser2NumMapping(userAddressStr), userNumStr), StringEntry(keyNum2UserMapping(userNumStr), userAddressStr)] | |
713 | 713 | $Tuple2(((((arr ++ LockParamsEntry(userAddressStr, userNumStr, pmtAmount, lockStart, duration, k, b, period)) ++ StatsEntry(pmtAmount, duration, 1, if (userIsExisting) | |
714 | 714 | then 0 | |
715 | 715 | else 1)) :+ HistoryEntry("lock", userAddressStr, pmtAmount, lockStart, duration, k, b, i)) ++ [IntegerEntry(userBoostEmissionLastIntegralKEY, boostEmissionIntegral), IntegerEntry(keyTotalCachedGwx(), (totalCachedGwxRaw + gWxAmountStart))]), gWxAmountStart) | |
716 | 716 | } | |
717 | 717 | } | |
718 | 718 | } | |
719 | 719 | } | |
720 | 720 | ||
721 | 721 | ||
722 | 722 | @Callable(i) | |
723 | 723 | func constructor (factoryAddressStr,lockAssetIdStr,minLockAmount,minDuration,maxDuration,mathContract) = { | |
724 | 724 | let checkCaller = mustManager(i) | |
725 | 725 | if ((checkCaller == checkCaller)) | |
726 | 726 | then ([IntegerEntry(keyNextUserNum(), 0), StringEntry(keyConfig(), formatConfig(lockAssetIdStr, minLockAmount, minDuration, maxDuration, mathContract)), StringEntry(keyFactoryAddress(), factoryAddressStr)] ++ StatsEntry(0, 0, 0, 0)) | |
727 | 727 | else throw("Strict value is not equal to itself.") | |
728 | 728 | } | |
729 | 729 | ||
730 | 730 | ||
731 | 731 | ||
732 | 732 | @Callable(i) | |
733 | 733 | func lockRef (duration,referrerAddress,signature) = { | |
734 | - | let $ | |
735 | - | let lockActionsResult = $ | |
736 | - | let gWxAmountStart = $ | |
734 | + | let $t03108531150 = lockActions(i, duration) | |
735 | + | let lockActionsResult = $t03108531150._1 | |
736 | + | let gWxAmountStart = $t03108531150._2 | |
737 | 737 | let referralAddress = toString(i.caller) | |
738 | 738 | let refInv = if (if ((referrerAddress == "")) | |
739 | 739 | then true | |
740 | 740 | else (signature == base58'')) | |
741 | 741 | then unit | |
742 | 742 | else invoke(referralsContractAddressOrFail, "createPair", [referralProgramName, referrerAddress, referralAddress, signature], nil) | |
743 | 743 | if ((refInv == refInv)) | |
744 | 744 | then { | |
745 | 745 | let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil) | |
746 | 746 | if ((updateRefActivity == updateRefActivity)) | |
747 | 747 | then $Tuple2(lockActionsResult, unit) | |
748 | 748 | else throw("Strict value is not equal to itself.") | |
749 | 749 | } | |
750 | 750 | else throw("Strict value is not equal to itself.") | |
751 | 751 | } | |
752 | 752 | ||
753 | 753 | ||
754 | 754 | ||
755 | 755 | @Callable(i) | |
756 | 756 | func lock (duration) = { | |
757 | - | let $ | |
758 | - | let lockActionsResult = $ | |
759 | - | let gWxAmountStart = $ | |
757 | + | let $t03160831673 = lockActions(i, duration) | |
758 | + | let lockActionsResult = $t03160831673._1 | |
759 | + | let gWxAmountStart = $t03160831673._2 | |
760 | 760 | let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil) | |
761 | 761 | if ((updateRefActivity == updateRefActivity)) | |
762 | 762 | then $Tuple2(lockActionsResult, unit) | |
763 | 763 | else throw("Strict value is not equal to itself.") | |
764 | 764 | } | |
765 | 765 | ||
766 | 766 | ||
767 | 767 | ||
768 | 768 | @Callable(i) | |
769 | 769 | func increaseLock (deltaDuration) = { | |
770 | 770 | let cfgArray = readConfigArrayOrFail() | |
771 | 771 | let assetIdStr = cfgArray[IdxCfgAssetId] | |
772 | 772 | let assetId = fromBase58String(assetIdStr) | |
773 | 773 | let minLockDuration = parseIntValue(cfgArray[IdxCfgMinLockDuration]) | |
774 | 774 | let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration]) | |
775 | 775 | let pmtAmount = extractOptionalPaymentAmountOrFail(i, assetId) | |
776 | 776 | let userAddressStr = toString(i.caller) | |
777 | 777 | let userRecordArray = readLockParamsRecordOrFail(userAddressStr) | |
778 | 778 | let userNumStr = userRecordArray[IdxLockUserNum] | |
779 | 779 | let userAmount = parseIntValue(userRecordArray[IdxLockAmount]) | |
780 | 780 | let lockStart = parseIntValue(userRecordArray[IdxLockStart]) | |
781 | 781 | let lockDuration = parseIntValue(userRecordArray[IdxLockDuration]) | |
782 | 782 | let lockEnd = (lockStart + lockDuration) | |
783 | 783 | let remainingDuration = max([(lockEnd - height), 0]) | |
784 | 784 | let userAmountNew = (userAmount + pmtAmount) | |
785 | 785 | let lockDurationNew = (remainingDuration + deltaDuration) | |
786 | 786 | if ((0 > deltaDuration)) | |
787 | - | then | |
787 | + | then throwErr("duration is less then zero") | |
788 | 788 | else if ((minLockDuration > lockDurationNew)) | |
789 | - | then | |
789 | + | then throwErr(("lockDurationNew is less then minLockDuration=" + toString(minLockDuration))) | |
790 | 790 | else if ((lockDurationNew > maxLockDuration)) | |
791 | - | then | |
791 | + | then throwErr(("deltaDuration + existedLockDuration is greater then maxLockDuration=" + toString(maxLockDuration))) | |
792 | 792 | else { | |
793 | 793 | let coeffX8 = fraction(lockDurationNew, MULT8, maxLockDuration) | |
794 | 794 | let gWxAmountStart = fraction(userAmountNew, coeffX8, MULT8) | |
795 | 795 | let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil) | |
796 | 796 | if ((updateRefActivity == updateRefActivity)) | |
797 | 797 | then { | |
798 | 798 | let lockStartNew = height | |
799 | 799 | let gWxParamsResultList = aal(invoke(mathContract, "calcGwxParamsREADONLY", [gWxAmountStart, lockStartNew, lockDurationNew], nil)) | |
800 | 800 | let k = ai(gWxParamsResultList[0]) | |
801 | 801 | let b = ai(gWxParamsResultList[1]) | |
802 | 802 | let period = toString(ai(gWxParamsResultList[2])) | |
803 | 803 | let currUserGwx = calcCurrentGwxAmount(userAddressStr) | |
804 | 804 | let gwxDiff = (gWxAmountStart - currUserGwx) | |
805 | 805 | if ((0 > gwxDiff)) | |
806 | - | then | |
806 | + | then throwErr(("gwxDiff is less then 0: " + toString(gwxDiff))) | |
807 | 807 | else { | |
808 | 808 | let totalCachedGwxRaw = getTotalCachedGwx(false) | |
809 | 809 | let totalCachedGwxCorrected = getTotalCachedGwx(true) | |
810 | 810 | (((LockParamsEntry(userAddressStr, userNumStr, userAmountNew, lockStartNew, lockDurationNew, k, b, period) ++ StatsEntry(pmtAmount, deltaDuration, 0, 0)) :+ HistoryEntry("lock", userAddressStr, pmtAmount, lockStart, lockDurationNew, k, b, i)) ++ [IntegerEntry(keyTotalCachedGwx(), (totalCachedGwxRaw + gwxDiff))]) | |
811 | 811 | } | |
812 | 812 | } | |
813 | 813 | else throw("Strict value is not equal to itself.") | |
814 | 814 | } | |
815 | 815 | } | |
816 | 816 | ||
817 | 817 | ||
818 | 818 | ||
819 | 819 | @Callable(i) | |
820 | 820 | func claimWxBoost (lpAssetIdStr,userAddressStr) = if ((stakingContract != i.caller)) | |
821 | - | then | |
821 | + | then throwErr("permissions denied") | |
822 | 822 | else { | |
823 | - | let $ | |
824 | - | let userBoostAvailable = $ | |
825 | - | let dataState = $ | |
826 | - | let debug = $ | |
823 | + | let $t03477834880 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false) | |
824 | + | let userBoostAvailable = $t03477834880._1 | |
825 | + | let dataState = $t03477834880._2 | |
826 | + | let debug = $t03477834880._3 | |
827 | 827 | $Tuple2(dataState, [userBoostAvailable]) | |
828 | 828 | } | |
829 | 829 | ||
830 | 830 | ||
831 | 831 | ||
832 | 832 | @Callable(i) | |
833 | 833 | func claimWxBoostREADONLY (lpAssetIdStr,userAddressStr) = { | |
834 | - | let $ | |
835 | - | let userBoostAvailable = $ | |
836 | - | let dataState = $ | |
837 | - | let debug = $ | |
834 | + | let $t03501235113 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true) | |
835 | + | let userBoostAvailable = $t03501235113._1 | |
836 | + | let dataState = $t03501235113._2 | |
837 | + | let debug = $t03501235113._3 | |
838 | 838 | $Tuple2(nil, [userBoostAvailable, debug]) | |
839 | 839 | } | |
840 | 840 | ||
841 | 841 | ||
842 | 842 | ||
843 | 843 | @Callable(i) | |
844 | 844 | func unlock (userAddress) = { | |
845 | 845 | let userRecordArray = readLockParamsRecordOrFail(userAddress) | |
846 | 846 | let userNumStr = userRecordArray[IdxLockUserNum] | |
847 | 847 | let userAmount = parseIntValue(userRecordArray[IdxLockAmount]) | |
848 | 848 | let lockStart = parseIntValue(userRecordArray[IdxLockStart]) | |
849 | 849 | let lockDuration = parseIntValue(userRecordArray[IdxLockDuration]) | |
850 | 850 | let lockEnd = (lockStart + lockDuration) | |
851 | 851 | let cfgArray = readConfigArrayOrFail() | |
852 | 852 | let assetId = fromBase58String(cfgArray[IdxCfgAssetId]) | |
853 | 853 | if ((lockEnd >= height)) | |
854 | - | then | |
854 | + | then throwErr((("wait " + toString(lockEnd)) + " to unlock")) | |
855 | 855 | else if ((0 >= userAmount)) | |
856 | - | then | |
856 | + | then throwErr("nothing to unlock") | |
857 | 857 | else { | |
858 | 858 | let period = valueOrElse(getInteger(mathContract, keyNextPeriod()), 0) | |
859 | 859 | (((LockParamsEntry(userAddress, userNumStr, 0, lockStart, lockDuration, 0, 0, toString(period)) ++ StatsEntry(-(userAmount), 0, 0, -1)) :+ HistoryEntry("unlock", userAddress, userAmount, lockStart, lockDuration, 0, 0, i)) :+ ScriptTransfer(addressFromStringValue(userAddress), userAmount, assetId)) | |
860 | 860 | } | |
861 | 861 | } | |
862 | 862 | ||
863 | 863 | ||
864 | 864 | ||
865 | 865 | @Callable(i) | |
866 | 866 | func gwxUserInfoREADONLY (userAddress) = { | |
867 | 867 | let gwxAmount = calcCurrentGwxAmount(userAddress) | |
868 | 868 | $Tuple2(nil, [gwxAmount]) | |
869 | 869 | } | |
870 | 870 | ||
871 | 871 | ||
872 | 872 | ||
873 | 873 | @Callable(i) | |
874 | 874 | func userMaxDurationREADONLY (userAddressStr) = { | |
875 | 875 | let cfgArray = readConfigArrayOrFail() | |
876 | 876 | let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration]) | |
877 | 877 | let userRecordOption = getString(this, keyLockParamsRecord(userAddressStr)) | |
878 | 878 | if ((userRecordOption == unit)) | |
879 | 879 | then $Tuple2(nil, $Tuple2("lock", maxLockDuration)) | |
880 | 880 | else { | |
881 | 881 | let userRecordArray = split(value(userRecordOption), SEP) | |
882 | 882 | let lockStart = parseIntValue(userRecordArray[IdxLockStart]) | |
883 | 883 | let lockDuration = parseIntValue(userRecordArray[IdxLockDuration]) | |
884 | 884 | let lockEnd = (lockStart + lockDuration) | |
885 | 885 | let remainingDuration = max([(lockEnd - height), 0]) | |
886 | 886 | let maxDeltaDuration = (maxLockDuration - remainingDuration) | |
887 | 887 | $Tuple2(nil, $Tuple2("increaseLock", maxDeltaDuration)) | |
888 | 888 | } | |
889 | 889 | } | |
890 | 890 | ||
891 | 891 | ||
892 | 892 | ||
893 | 893 | @Callable(i) | |
894 | 894 | func getUserGwxAmountAtHeightREADONLY (userAddress,targetHeight) = { | |
895 | 895 | let gwxAmount = calcUserGwxAmountAtHeight(userAddress, targetHeight) | |
896 | 896 | $Tuple2(nil, gwxAmount) | |
897 | 897 | } | |
898 | 898 | ||
899 | 899 | ||
900 | 900 | ||
901 | 901 | @Callable(i) | |
902 | 902 | func getTotalCachedGwxREADONLY () = $Tuple2(nil, getTotalCachedGwx(true)) | |
903 | 903 | ||
904 | 904 | ||
905 | 905 | ||
906 | 906 | @Callable(i) | |
907 | 907 | func onBoostEmissionUpdate () = { | |
908 | 908 | let checkCaller = if ((i.caller == emissionContract)) | |
909 | 909 | then true | |
910 | 910 | else mustManager(i) | |
911 | 911 | if ((checkCaller == checkCaller)) | |
912 | 912 | then refreshBoostEmissionIntegral() | |
913 | 913 | else throw("Strict value is not equal to itself.") | |
914 | 914 | } | |
915 | 915 | ||
916 | 916 | ||
917 | 917 | ||
918 | 918 | @Callable(i) | |
919 | 919 | func onStakedVoteUpdate (lpAssetIdStr,userAddressStr,edge) = { | |
920 | 920 | let checkCaller = if ((i.caller == stakingContract)) | |
921 | 921 | then true | |
922 | 922 | else mustManager(i) | |
923 | 923 | if ((checkCaller == checkCaller)) | |
924 | 924 | then { | |
925 | 925 | let actions = refreshVoteStakedIntegral(lpAssetIdStr, userAddressStr, edge) | |
926 | 926 | $Tuple2(actions, unit) | |
927 | 927 | } | |
928 | 928 | else throw("Strict value is not equal to itself.") | |
929 | 929 | } | |
930 | 930 | ||
931 | 931 | ||
932 | 932 | ||
933 | 933 | @Callable(i) | |
934 | 934 | func getVotingResultStakedREADONLY (lpAssetIdStr) = $Tuple2(nil, getVotingResultStaked(lpAssetIdStr)) | |
935 | 935 | ||
936 | 936 | ||
937 | 937 | ||
938 | 938 | @Callable(i) | |
939 | 939 | func getVotingResultStakedIntegralREADONLY (lpAssetIdStr) = $Tuple2(nil, getVotingResultStakedIntegral(lpAssetIdStr)) | |
940 | 940 | ||
941 | 941 | ||
942 | 942 | ||
943 | 943 | @Callable(i) | |
944 | 944 | func getUserVoteFinalizedREADONLY (lpAssetIdStr,userAddressStr) = $Tuple2(nil, getUserVoteFinalized(lpAssetIdStr, userAddressStr)) | |
945 | 945 | ||
946 | 946 | ||
947 | 947 | ||
948 | 948 | @Callable(i) | |
949 | 949 | func getUserVoteStakedIntegralREADONLY (lpAssetIdStr,userAddressStr) = $Tuple2(nil, getUserVoteStakedIntegral(lpAssetIdStr, userAddressStr)) | |
950 | 950 | ||
951 | 951 | ||
952 | 952 | ||
953 | 953 | @Callable(i) | |
954 | 954 | func setManager (pendingManagerPublicKey) = { | |
955 | 955 | let checkCaller = mustManager(i) | |
956 | 956 | if ((checkCaller == checkCaller)) | |
957 | 957 | then { | |
958 | 958 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
959 | 959 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
960 | 960 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
961 | 961 | else throw("Strict value is not equal to itself.") | |
962 | 962 | } | |
963 | 963 | else throw("Strict value is not equal to itself.") | |
964 | 964 | } | |
965 | 965 | ||
966 | 966 | ||
967 | 967 | ||
968 | 968 | @Callable(i) | |
969 | 969 | func confirmManager () = { | |
970 | 970 | let pm = pendingManagerPublicKeyOrUnit() | |
971 | 971 | let hasPM = if (isDefined(pm)) | |
972 | 972 | then true | |
973 | - | else | |
973 | + | else throwErr("No pending manager") | |
974 | 974 | if ((hasPM == hasPM)) | |
975 | 975 | then { | |
976 | 976 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
977 | 977 | then true | |
978 | - | else | |
978 | + | else throwErr("You are not pending manager") | |
979 | 979 | if ((checkPM == checkPM)) | |
980 | 980 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
981 | 981 | else throw("Strict value is not equal to itself.") | |
982 | 982 | } | |
983 | 983 | else throw("Strict value is not equal to itself.") | |
984 | 984 | } | |
985 | 985 | ||
986 | 986 | ||
987 | 987 | @Verifier(tx) | |
988 | 988 | func verify () = { | |
989 | 989 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
990 | 990 | case pk: ByteVector => | |
991 | 991 | pk | |
992 | 992 | case _: Unit => | |
993 | 993 | tx.senderPublicKey | |
994 | 994 | case _ => | |
995 | 995 | throw("Match error") | |
996 | 996 | } | |
997 | 997 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
998 | 998 | } | |
999 | 999 |
github/deemru/w8io/026f985 176.27 ms ◑