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