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