tx · EXepq5tPQBPsLGktxabqgPovbZJs74uzHgp2aNk3eDX4 3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy: -0.02700000 Waves 2023.03.17 15:30 [2493997] smart account 3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy > SELF 0.00000000 Waves
{ "type": 13, "id": "EXepq5tPQBPsLGktxabqgPovbZJs74uzHgp2aNk3eDX4", "fee": 2700000, "feeAssetId": null, "timestamp": 1679056203444, "version": 2, "chainId": 84, "sender": "3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy", "senderPublicKey": "9W33iCCNfmFxUbiC6XZcH5x7f6xfwC7Jb3BoExT5q2PV", "proofs": [ "4NVgd7GSaEqWKFC5DS2JCNAtKQF5789Pg5KxVkes1spwrrrRFQGmQ1kDXB1wCEmvHYPLqDn9RSdTRHfa93fpZUqh" ], "script": "base64:BgLwLwgCEggKBggIAQEBCBIFCgMBCAISAwoBARIDCgEBEgQKAggIEgQKAggIEgMKAQgSAwoBCBIDCgEIEgQKAggBEgASABIFCgMICAQSAwoBCBIDCgEIEgQKAggIEgQKAggIEgMKAQgSACIDU0VQIgZTQ0FMRTgiBU1VTFQ4Ig5QT09MV0VJR0hUTVVMVCIHd3JhcEVyciIDbXNnIgh0aHJvd0VyciIEc3RyZiIHYWRkcmVzcyIDa2V5IgNpb3oiA2lvZCIKZGVmYXVsdFZhbCIDaW9mIgNhYnMiA3ZhbCIDYWFsIgckbWF0Y2gwIgp2YWxBbnlMeXN0IgJhaSIGdmFsSW50IhtrZXlSZWZlcnJhbHNDb250cmFjdEFkZHJlc3MiHnJlZmVycmFsc0NvbnRyYWN0QWRkcmVzc09yRmFpbCIWa2V5UmVmZXJyYWxQcm9ncmFtTmFtZSIacmVmZXJyYWxQcm9ncmFtTmFtZURlZmF1bHQiE3JlZmVycmFsUHJvZ3JhbU5hbWUiEWtleUZhY3RvcnlBZGRyZXNzIhhJZHhGYWN0b3J5Q2ZnU3Rha2luZ0RhcHAiG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FsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAmZ1AQJmdgAEAmZ3BAFyCQECYUUAAwkAAQIFAXICCkJ5dGVWZWN0b3IEAmFLBQFyBQJhSwMJAAECBQFyAgRVbml0CAUCZnUPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAmZ1CWJvZHlCeXRlcwkAkQMCCAUCZnUGcHJvb2ZzAAAFAmZ3t3Tp4A==", "height": 2493997, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7p38ousfrmmnwAANUTtjcJDT1pbtJwYKiFWETf2a6zDx Next: 79UAJmSE16AwzUDMKAgbbQeBbg2pHW9yweFEzcvwCAWP Diff:
Old | New | Differences | |
---|---|---|---|
585 | 585 | let lastFinalizedEpoch = $t02272522805._1 | |
586 | 586 | let currentEpochStartHeight = $t02272522805._2 | |
587 | 587 | let userAddress = addressFromStringValue(userAddressStr) | |
588 | - | let userVoteStaked = getUserVoteStaked(lpAssetIdStr, userAddressStr) | |
589 | - | let votingResultStaked = getVotingResultStaked(lpAssetIdStr) | |
590 | - | let userVoteStakedIntegralPrev = valueOrElse(getInteger(this, keyVoteStakedIntegral(lpAssetIdStr, userAddress, lastFinalizedEpoch)), 0) | |
591 | - | let votingResultStakedIntegralPrev = valueOrElse(getInteger(this, keyVotingResultStakedIntegral(lpAssetIdStr, lastFinalizedEpoch)), 0) | |
592 | - | let userVoteStakedLastUpdateHeight = valueOrElse(getInteger(this, keyVoteStakedLastUpdateHeight(lpAssetIdStr, userAddress, lastFinalizedEpoch)), currentEpochStartHeight) | |
593 | - | let votingResultStakedLastUpdateHeight = valueOrElse(getInteger(this, keyVotingResultStakedLastUpdateHeight(lpAssetIdStr, lastFinalizedEpoch)), currentEpochStartHeight) | |
594 | - | let userVoteStakedIntegralKey = keyVoteStakedIntegralLast(lpAssetIdStr, userAddress, lastFinalizedEpoch) | |
595 | - | let userVoteStakedIntegralLast = valueOrElse(getInteger(this, userVoteStakedIntegralKey), 0) | |
596 | - | let votingResultStakedIntegralKey = keyVotingResultStakedIntegralLast(lpAssetIdStr, userAddress, lastFinalizedEpoch) | |
597 | - | let votingResultStakedIntegralLast = valueOrElse(getInteger(this, votingResultStakedIntegralKey), 0) | |
598 | - | let userVoteStakedIntegralDh = (height - userVoteStakedLastUpdateHeight) | |
599 | - | let votingResultStakedIntegralDh = (height - votingResultStakedLastUpdateHeight) | |
600 | - | let userVoteStakedIntegral = ((userVoteStakedIntegralDh * userVoteStaked) + userVoteStakedIntegralPrev) | |
601 | - | let votingResultStakedIntegral = ((votingResultStakedIntegralDh * votingResultStaked) + votingResultStakedIntegralPrev) | |
588 | + | let userVoteStakedIntegralLastKey = keyVoteStakedIntegralLast(lpAssetIdStr, userAddress, lastFinalizedEpoch) | |
589 | + | let userVoteStakedIntegralLast = valueOrElse(getInteger(this, userVoteStakedIntegralLastKey), 0) | |
590 | + | let votingResultStakedIntegralLastKey = keyVotingResultStakedIntegralLast(lpAssetIdStr, userAddress, lastFinalizedEpoch) | |
591 | + | let votingResultStakedIntegralLast = valueOrElse(getInteger(this, votingResultStakedIntegralLastKey), 0) | |
592 | + | let userVoteStakedIntegral = getUserVoteStakedIntegral(lpAssetIdStr, userAddressStr) | |
593 | + | let votingResultStakedIntegral = getVotingResultStakedIntegral(lpAssetIdStr) | |
602 | 594 | let userVoteStakedIntegralDiff = (userVoteStakedIntegral - userVoteStakedIntegralLast) | |
603 | 595 | let votingResultStakedIntegralDiff = (votingResultStakedIntegral - votingResultStakedIntegralLast) | |
604 | - | $Tuple3([IntegerEntry( | |
596 | + | $Tuple3([IntegerEntry(userVoteStakedIntegralLastKey, userVoteStakedIntegral), IntegerEntry(votingResultStakedIntegralLastKey, votingResultStakedIntegral)], userVoteStakedIntegralDiff, votingResultStakedIntegralDiff) | |
605 | 597 | } | |
606 | 598 | ||
607 | 599 | ||
652 | 644 | if ((0 > userBoostEmissionIntegral)) | |
653 | 645 | then throw("wrong calculations") | |
654 | 646 | else { | |
655 | - | let $ | |
656 | - | let stakedVotesIntegralsActions = $ | |
657 | - | let userVoteIntegralDiff = $ | |
658 | - | let totalVotesIntegralDiff = $ | |
647 | + | let $t02640626545 = getStakedVotesIntegralsDiff(lpAssetIdStr, userAddressStr) | |
648 | + | let stakedVotesIntegralsActions = $t02640626545._1 | |
649 | + | let userVoteIntegralDiff = $t02640626545._2 | |
650 | + | let totalVotesIntegralDiff = $t02640626545._3 | |
659 | 651 | let poolUserBoostEmissionIntegral = fraction(userBoostEmissionIntegral, poolWeight, POOLWEIGHTMULT) | |
660 | 652 | let userBoostAvaliableToClaimTotalNew = if ((totalVotesIntegralDiff == 0)) | |
661 | 653 | then 0 | |
742 | 734 | ||
743 | 735 | @Callable(i) | |
744 | 736 | func lockRef (duration,referrerAddress,signature) = { | |
745 | - | let $ | |
746 | - | let lockActionsResult = $ | |
747 | - | let gWxAmountStart = $ | |
737 | + | let $t03113531200 = lockActions(i, duration) | |
738 | + | let lockActionsResult = $t03113531200._1 | |
739 | + | let gWxAmountStart = $t03113531200._2 | |
748 | 740 | let referralAddress = toString(i.caller) | |
749 | 741 | let refInv = if (if ((referrerAddress == "")) | |
750 | 742 | then true | |
765 | 757 | ||
766 | 758 | @Callable(i) | |
767 | 759 | func lock (duration) = { | |
768 | - | let $ | |
769 | - | let lockActionsResult = $ | |
770 | - | let gWxAmountStart = $ | |
760 | + | let $t03165831723 = lockActions(i, duration) | |
761 | + | let lockActionsResult = $t03165831723._1 | |
762 | + | let gWxAmountStart = $t03165831723._2 | |
771 | 763 | let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil) | |
772 | 764 | if ((updateRefActivity == updateRefActivity)) | |
773 | 765 | then $Tuple2(lockActionsResult, unit) | |
831 | 823 | func claimWxBoost (lpAssetIdStr,userAddressStr) = if ((stakingContract != i.caller)) | |
832 | 824 | then throw("permissions denied") | |
833 | 825 | else { | |
834 | - | let $ | |
835 | - | let userBoostAvailable = $ | |
836 | - | let dataState = $ | |
837 | - | let debug = $ | |
826 | + | let $t03481034912 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false) | |
827 | + | let userBoostAvailable = $t03481034912._1 | |
828 | + | let dataState = $t03481034912._2 | |
829 | + | let debug = $t03481034912._3 | |
838 | 830 | $Tuple2(dataState, [userBoostAvailable]) | |
839 | 831 | } | |
840 | 832 | ||
842 | 834 | ||
843 | 835 | @Callable(i) | |
844 | 836 | func claimWxBoostREADONLY (lpAssetIdStr,userAddressStr) = { | |
845 | - | let $ | |
846 | - | let userBoostAvailable = $ | |
847 | - | let dataState = $ | |
848 | - | let debug = $ | |
837 | + | let $t03504435145 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true) | |
838 | + | let userBoostAvailable = $t03504435145._1 | |
839 | + | let dataState = $t03504435145._2 | |
840 | + | let debug = $t03504435145._3 | |
849 | 841 | $Tuple2(nil, [userBoostAvailable, debug]) | |
850 | 842 | } | |
851 | 843 |
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 | func keyVote (amountAssetId,priceAssetId,address,epoch) = makeString(["%s%s%s%s%d", "vote", amountAssetId, priceAssetId, toString(address), toString(epoch)], SEP) | |
311 | 311 | ||
312 | 312 | ||
313 | 313 | func keyStartHeightByEpoch (epoch) = makeString(["%s%d", "startHeight", toString(epoch)], SEP) | |
314 | 314 | ||
315 | 315 | ||
316 | 316 | func keyCurrentEpochUi () = makeString(["%s", "currentEpochUi"], SEP) | |
317 | 317 | ||
318 | 318 | ||
319 | 319 | func keyVotingResultStaked (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStaked", lpAssetIdStr, toString(epoch)], SEP) | |
320 | 320 | ||
321 | 321 | ||
322 | 322 | func keyVotingResultStakedIntegral (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStakedIntegral", lpAssetIdStr, toString(epoch)], SEP) | |
323 | 323 | ||
324 | 324 | ||
325 | 325 | func keyVotingResultStakedLastUpdateHeight (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStakedIntegralLastUpdateHeight", lpAssetIdStr, toString(epoch)], SEP) | |
326 | 326 | ||
327 | 327 | ||
328 | 328 | func keyVotingResultStakedIntegralLast (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "votingResultStakedIntegralLast", lpAssetIdStr, toString(address), toString(epoch)], SEP) | |
329 | 329 | ||
330 | 330 | ||
331 | 331 | func keyVoteStakedIntegral (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegral", lpAssetIdStr, toString(address), toString(epoch)], SEP) | |
332 | 332 | ||
333 | 333 | ||
334 | 334 | func keyVoteStakedLastUpdateHeight (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegralLastUpdateHeight", lpAssetIdStr, toString(address), toString(epoch)], SEP) | |
335 | 335 | ||
336 | 336 | ||
337 | 337 | func keyVoteStakedIntegralLast (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegralLast", lpAssetIdStr, toString(address), toString(epoch)], SEP) | |
338 | 338 | ||
339 | 339 | ||
340 | 340 | func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s", "staked", userAddressStr, lpAssetIdStr], SEP) | |
341 | 341 | ||
342 | 342 | ||
343 | 343 | let factoryContract = readFactoryAddressOrFail() | |
344 | 344 | ||
345 | 345 | let factoryCfg = readFactoryCfgOrFail(factoryContract) | |
346 | 346 | ||
347 | 347 | let emissionContract = getEmissionAddressOrFail(factoryCfg) | |
348 | 348 | ||
349 | 349 | let stakingContract = getStakingAddressOrFail(factoryCfg) | |
350 | 350 | ||
351 | 351 | let gwxRewardContract = getGwxRewardAddressOrFail(factoryCfg) | |
352 | 352 | ||
353 | 353 | 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 | 354 | ||
355 | 355 | let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP) | |
356 | 356 | ||
357 | 357 | let votingEmissionContract = addressFromStringValue(getStringValue(factoryContract, keyVotingEmissionContract)) | |
358 | 358 | ||
359 | 359 | let boostCoeff = { | |
360 | 360 | let @ = invoke(emissionContract, "getBoostCoeffREADONLY", nil, nil) | |
361 | 361 | if ($isInstanceOf(@, "Int")) | |
362 | 362 | then @ | |
363 | 363 | else throw(($getType(@) + " couldn't be cast to Int")) | |
364 | 364 | } | |
365 | 365 | ||
366 | 366 | func getTotalCachedGwx (correct) = { | |
367 | 367 | let currentEpochUi = getIntegerValue(votingEmissionContract, keyCurrentEpochUi()) | |
368 | 368 | let keyTargetEpoch = makeString(["%s%s", "totalCachedGwxCorrection__activationEpoch"], SEP) | |
369 | 369 | let targetEpochOption = getInteger(this, keyTargetEpoch) | |
370 | 370 | let totalCachedGwxRaw = valueOrElse(getInteger(this, keyTotalCachedGwx()), 0) | |
371 | 371 | let isCorrectionActivated = if (isDefined(targetEpochOption)) | |
372 | 372 | then (currentEpochUi >= value(targetEpochOption)) | |
373 | 373 | else false | |
374 | 374 | let corrective = if (if (isCorrectionActivated) | |
375 | 375 | then correct | |
376 | 376 | else false) | |
377 | 377 | then valueOrElse(getInteger(this, keyTotalCachedGwxCorrective()), 0) | |
378 | 378 | else 0 | |
379 | 379 | max([0, (totalCachedGwxRaw + corrective)]) | |
380 | 380 | } | |
381 | 381 | ||
382 | 382 | ||
383 | 383 | func HistoryEntry (type,user,amount,lockStart,duration,k,b,i) = { | |
384 | 384 | let historyKEY = makeString(["%s%s%s%s__history", type, user, toBase58String(i.transactionId)], SEP) | |
385 | 385 | 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 | 386 | StringEntry(historyKEY, historyDATA) | |
387 | 387 | } | |
388 | 388 | ||
389 | 389 | ||
390 | 390 | func StatsEntry (totalLockedInc,durationInc,lockCountInc,usersCountInc) = { | |
391 | 391 | let locksDurationSumInBlocksKEY = keyStatsLocksDurationSumInBlocks() | |
392 | 392 | let locksCountKEY = keyStatsLocksCount() | |
393 | 393 | let usersCountKEY = keyStatsUsersCount() | |
394 | 394 | let totalAmountKEY = keyLockParamTotalAmount() | |
395 | 395 | let locksDurationSumInBlocks = ioz(this, locksDurationSumInBlocksKEY) | |
396 | 396 | let locksCount = ioz(this, locksCountKEY) | |
397 | 397 | let usersCount = ioz(this, usersCountKEY) | |
398 | 398 | let totalAmount = ioz(this, totalAmountKEY) | |
399 | 399 | [IntegerEntry(locksDurationSumInBlocksKEY, (locksDurationSumInBlocks + durationInc)), IntegerEntry(locksCountKEY, (locksCount + lockCountInc)), IntegerEntry(usersCountKEY, (usersCount + usersCountInc)), IntegerEntry(totalAmountKEY, (totalAmount + totalLockedInc))] | |
400 | 400 | } | |
401 | 401 | ||
402 | 402 | ||
403 | 403 | func calcGwxAmount (kRaw,bRaw,h) = { | |
404 | 404 | let SCALE = 1000 | |
405 | 405 | (((kRaw * h) + bRaw) / SCALE) | |
406 | 406 | } | |
407 | 407 | ||
408 | 408 | ||
409 | 409 | func LockParamsEntry (userAddress,userNum,amount,start,duration,k,b,period) = { | |
410 | 410 | let userAmountKEY = keyLockParamUserAmount(userNum) | |
411 | 411 | let startBlockKEY = keyLockParamStartBlock(userNum) | |
412 | 412 | let durationKEY = keyLockParamDuration(userNum) | |
413 | 413 | let kKEY = keyLockParamK(userNum) | |
414 | 414 | let bKEY = keyLockParamB(userNum) | |
415 | 415 | let kByPeriodKEY = keyLockParamByPeriodK(userNum, period) | |
416 | 416 | let bByPeriodKEY = keyLockParamByPeriodB(userNum, period) | |
417 | 417 | let gwxAmount = calcGwxAmount(k, b, height) | |
418 | 418 | [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 | 419 | } | |
420 | 420 | ||
421 | 421 | ||
422 | 422 | func extractOptionalPaymentAmountOrFail (i,expectedAssetId) = if ((size(i.payments) > 1)) | |
423 | 423 | then throw("only one payment is allowed") | |
424 | 424 | else if ((size(i.payments) == 0)) | |
425 | 425 | then 0 | |
426 | 426 | else { | |
427 | 427 | let pmt = i.payments[0] | |
428 | 428 | if ((value(pmt.assetId) != expectedAssetId)) | |
429 | 429 | then throw("invalid asset id in payment") | |
430 | 430 | else pmt.amount | |
431 | 431 | } | |
432 | 432 | ||
433 | 433 | ||
434 | 434 | func calcUserGwxAmountAtHeight (userAddress,targetHeight) = { | |
435 | 435 | let EMPTY = "empty" | |
436 | 436 | let user2NumMappingKEY = keyUser2NumMapping(userAddress) | |
437 | 437 | let userNum = valueOrElse(getString(user2NumMappingKEY), EMPTY) | |
438 | 438 | let k = valueOrElse(getInteger(keyLockParamK(userNum)), 0) | |
439 | 439 | let b = valueOrElse(getInteger(keyLockParamB(userNum)), 0) | |
440 | 440 | let gwxAmountCalc = calcGwxAmount(k, b, targetHeight) | |
441 | 441 | let gwxAmount = if ((0 > gwxAmountCalc)) | |
442 | 442 | then 0 | |
443 | 443 | else gwxAmountCalc | |
444 | 444 | gwxAmount | |
445 | 445 | } | |
446 | 446 | ||
447 | 447 | ||
448 | 448 | func calcCurrentGwxAmount (userAddress) = calcUserGwxAmountAtHeight(userAddress, height) | |
449 | 449 | ||
450 | 450 | ||
451 | 451 | func getVotingEmissionEpochInfo () = { | |
452 | 452 | let $t01719017480 = { | |
453 | 453 | let currentEpochUi = value(getInteger(votingEmissionContract, keyCurrentEpochUi())) | |
454 | 454 | let lastFinalizedEpoch = (currentEpochUi - 1) | |
455 | 455 | if ((0 > lastFinalizedEpoch)) | |
456 | 456 | then throwErr("invalid epoch") | |
457 | 457 | else $Tuple2(currentEpochUi, lastFinalizedEpoch) | |
458 | 458 | } | |
459 | 459 | let currentEpochUi = $t01719017480._1 | |
460 | 460 | let lastFinalizedEpoch = $t01719017480._2 | |
461 | 461 | let currentEpochStartHeight = value(getInteger(votingEmissionContract, keyStartHeightByEpoch(currentEpochUi))) | |
462 | 462 | $Tuple2(lastFinalizedEpoch, currentEpochStartHeight) | |
463 | 463 | } | |
464 | 464 | ||
465 | 465 | ||
466 | 466 | func getPoolAssetsByLpAssetId (lpAssetIdStr) = { | |
467 | 467 | let idxAmountAssetId = 4 | |
468 | 468 | let idxPriceAssetId = 5 | |
469 | 469 | let poolCfg = { | |
470 | 470 | let @ = invoke(factoryContract, "getPoolConfigByLpAssetIdREADONLY", [lpAssetIdStr], nil) | |
471 | 471 | if ($isInstanceOf(@, "List[Any]")) | |
472 | 472 | then @ | |
473 | 473 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
474 | 474 | } | |
475 | 475 | let amountAssetId = { | |
476 | 476 | let @ = poolCfg[idxAmountAssetId] | |
477 | 477 | if ($isInstanceOf(@, "String")) | |
478 | 478 | then @ | |
479 | 479 | else throw(($getType(@) + " couldn't be cast to String")) | |
480 | 480 | } | |
481 | 481 | let priceAssetId = { | |
482 | 482 | let @ = poolCfg[idxPriceAssetId] | |
483 | 483 | if ($isInstanceOf(@, "String")) | |
484 | 484 | then @ | |
485 | 485 | else throw(($getType(@) + " couldn't be cast to String")) | |
486 | 486 | } | |
487 | 487 | $Tuple2(amountAssetId, priceAssetId) | |
488 | 488 | } | |
489 | 489 | ||
490 | 490 | ||
491 | 491 | func getUserVoteFinalized (lpAssetIdStr,userAddressStr) = { | |
492 | 492 | let userAddress = addressFromStringValue(userAddressStr) | |
493 | 493 | let $t01817118251 = getVotingEmissionEpochInfo() | |
494 | 494 | let lastFinalizedEpoch = $t01817118251._1 | |
495 | 495 | let currentEpochStartHeight = $t01817118251._2 | |
496 | 496 | let $t01825418329 = getPoolAssetsByLpAssetId(lpAssetIdStr) | |
497 | 497 | let amountAssetId = $t01825418329._1 | |
498 | 498 | let priceAssetId = $t01825418329._2 | |
499 | 499 | let userVoteKey = keyVote(amountAssetId, priceAssetId, userAddress, lastFinalizedEpoch) | |
500 | 500 | let userVote = valueOrElse(getInteger(votingEmissionContract, userVoteKey), 0) | |
501 | 501 | userVote | |
502 | 502 | } | |
503 | 503 | ||
504 | 504 | ||
505 | 505 | func getUserVoteStaked (lpAssetIdStr,userAddressStr) = { | |
506 | 506 | let stakedByUser = valueOrElse(getInteger(stakingContract, keyStakedByUser(userAddressStr, lpAssetIdStr)), 0) | |
507 | 507 | let userVote = getUserVoteFinalized(lpAssetIdStr, userAddressStr) | |
508 | 508 | if ((stakedByUser == 0)) | |
509 | 509 | then 0 | |
510 | 510 | else userVote | |
511 | 511 | } | |
512 | 512 | ||
513 | 513 | ||
514 | 514 | func getVotingResultStaked (lpAssetIdStr) = { | |
515 | 515 | let $t01887318953 = getVotingEmissionEpochInfo() | |
516 | 516 | let lastFinalizedEpoch = $t01887318953._1 | |
517 | 517 | let currentEpochStartHeight = $t01887318953._2 | |
518 | 518 | let votingResultStakedStart = valueOrElse(getInteger(votingEmissionContract, keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch)), 0) | |
519 | 519 | let votingResultStaked = valueOrElse(getInteger(this, keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch)), votingResultStakedStart) | |
520 | 520 | votingResultStaked | |
521 | 521 | } | |
522 | 522 | ||
523 | 523 | ||
524 | 524 | func getVotingResultStakedIntegral (lpAssetIdStr) = { | |
525 | 525 | let $t01931519395 = getVotingEmissionEpochInfo() | |
526 | 526 | let lastFinalizedEpoch = $t01931519395._1 | |
527 | 527 | let currentEpochStartHeight = $t01931519395._2 | |
528 | 528 | let votingResultStaked = getVotingResultStaked(lpAssetIdStr) | |
529 | 529 | let votingResultStakedIntegralPrev = valueOrElse(getInteger(this, keyVotingResultStakedIntegral(lpAssetIdStr, lastFinalizedEpoch)), 0) | |
530 | 530 | let votingResultStakedLastUpdateHeight = valueOrElse(getInteger(this, keyVotingResultStakedLastUpdateHeight(lpAssetIdStr, lastFinalizedEpoch)), currentEpochStartHeight) | |
531 | 531 | let votingResultStakedIntegralDh = (height - votingResultStakedLastUpdateHeight) | |
532 | 532 | let votingResultStakedIntegral = ((votingResultStakedIntegralDh * votingResultStaked) + votingResultStakedIntegralPrev) | |
533 | 533 | votingResultStakedIntegral | |
534 | 534 | } | |
535 | 535 | ||
536 | 536 | ||
537 | 537 | func refreshVotingResultStakedIntegral (lpAssetIdStr,stakedVoteDelta) = { | |
538 | 538 | let $t02023220312 = getVotingEmissionEpochInfo() | |
539 | 539 | let lastFinalizedEpoch = $t02023220312._1 | |
540 | 540 | let currentEpochStartHeight = $t02023220312._2 | |
541 | 541 | let votingResultStaked = getVotingResultStaked(lpAssetIdStr) | |
542 | 542 | let votingResultStakedNew = (votingResultStaked + stakedVoteDelta) | |
543 | 543 | let votingResultStakedIntegral = getVotingResultStakedIntegral(lpAssetIdStr) | |
544 | 544 | [IntegerEntry(keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch), votingResultStakedNew), IntegerEntry(keyVotingResultStakedLastUpdateHeight(lpAssetIdStr, lastFinalizedEpoch), height), IntegerEntry(keyVotingResultStakedIntegral(lpAssetIdStr, lastFinalizedEpoch), votingResultStakedIntegral)] | |
545 | 545 | } | |
546 | 546 | ||
547 | 547 | ||
548 | 548 | func getUserVoteStakedIntegral (lpAssetIdStr,userAddressStr) = { | |
549 | 549 | let $t02092321003 = getVotingEmissionEpochInfo() | |
550 | 550 | let lastFinalizedEpoch = $t02092321003._1 | |
551 | 551 | let currentEpochStartHeight = $t02092321003._2 | |
552 | 552 | let userAddress = addressFromStringValue(userAddressStr) | |
553 | 553 | let userVoteStaked = getUserVoteStaked(lpAssetIdStr, userAddressStr) | |
554 | 554 | let userVoteStakedIntegralPrev = valueOrElse(getInteger(this, keyVoteStakedIntegral(lpAssetIdStr, userAddress, lastFinalizedEpoch)), 0) | |
555 | 555 | let userVoteStakedLastUpdateHeight = valueOrElse(getInteger(this, keyVoteStakedLastUpdateHeight(lpAssetIdStr, userAddress, lastFinalizedEpoch)), currentEpochStartHeight) | |
556 | 556 | let userVoteStakedIntegralDh = (height - userVoteStakedLastUpdateHeight) | |
557 | 557 | let userVoteStakedIntegral = ((userVoteStakedIntegralDh * userVoteStaked) + userVoteStakedIntegralPrev) | |
558 | 558 | userVoteStakedIntegral | |
559 | 559 | } | |
560 | 560 | ||
561 | 561 | ||
562 | 562 | func refreshVoteStakedIntegral (lpAssetIdStr,userAddressStr,edge) = { | |
563 | 563 | let $t02179121871 = getVotingEmissionEpochInfo() | |
564 | 564 | let lastFinalizedEpoch = $t02179121871._1 | |
565 | 565 | let currentEpochStartHeight = $t02179121871._2 | |
566 | 566 | let userAddress = addressFromStringValue(userAddressStr) | |
567 | 567 | let userVoteFinalized = getUserVoteFinalized(lpAssetIdStr, userAddressStr) | |
568 | 568 | let actions = if ((userVoteFinalized == 0)) | |
569 | 569 | then nil | |
570 | 570 | else { | |
571 | 571 | let stakedVoteDelta = if (edge) | |
572 | 572 | then userVoteFinalized | |
573 | 573 | else -(userVoteFinalized) | |
574 | 574 | let votingResultActions = refreshVotingResultStakedIntegral(lpAssetIdStr, stakedVoteDelta) | |
575 | 575 | let userVoteStakedIntegral = getUserVoteStakedIntegral(lpAssetIdStr, userAddressStr) | |
576 | 576 | let voteActions = [IntegerEntry(keyVoteStakedLastUpdateHeight(lpAssetIdStr, userAddress, lastFinalizedEpoch), height), IntegerEntry(keyVoteStakedIntegral(lpAssetIdStr, userAddress, lastFinalizedEpoch), userVoteStakedIntegral)] | |
577 | 577 | (votingResultActions ++ voteActions) | |
578 | 578 | } | |
579 | 579 | actions | |
580 | 580 | } | |
581 | 581 | ||
582 | 582 | ||
583 | 583 | func getStakedVotesIntegralsDiff (lpAssetIdStr,userAddressStr) = { | |
584 | 584 | let $t02272522805 = getVotingEmissionEpochInfo() | |
585 | 585 | let lastFinalizedEpoch = $t02272522805._1 | |
586 | 586 | let currentEpochStartHeight = $t02272522805._2 | |
587 | 587 | let userAddress = addressFromStringValue(userAddressStr) | |
588 | - | let userVoteStaked = getUserVoteStaked(lpAssetIdStr, userAddressStr) | |
589 | - | let votingResultStaked = getVotingResultStaked(lpAssetIdStr) | |
590 | - | let userVoteStakedIntegralPrev = valueOrElse(getInteger(this, keyVoteStakedIntegral(lpAssetIdStr, userAddress, lastFinalizedEpoch)), 0) | |
591 | - | let votingResultStakedIntegralPrev = valueOrElse(getInteger(this, keyVotingResultStakedIntegral(lpAssetIdStr, lastFinalizedEpoch)), 0) | |
592 | - | let userVoteStakedLastUpdateHeight = valueOrElse(getInteger(this, keyVoteStakedLastUpdateHeight(lpAssetIdStr, userAddress, lastFinalizedEpoch)), currentEpochStartHeight) | |
593 | - | let votingResultStakedLastUpdateHeight = valueOrElse(getInteger(this, keyVotingResultStakedLastUpdateHeight(lpAssetIdStr, lastFinalizedEpoch)), currentEpochStartHeight) | |
594 | - | let userVoteStakedIntegralKey = keyVoteStakedIntegralLast(lpAssetIdStr, userAddress, lastFinalizedEpoch) | |
595 | - | let userVoteStakedIntegralLast = valueOrElse(getInteger(this, userVoteStakedIntegralKey), 0) | |
596 | - | let votingResultStakedIntegralKey = keyVotingResultStakedIntegralLast(lpAssetIdStr, userAddress, lastFinalizedEpoch) | |
597 | - | let votingResultStakedIntegralLast = valueOrElse(getInteger(this, votingResultStakedIntegralKey), 0) | |
598 | - | let userVoteStakedIntegralDh = (height - userVoteStakedLastUpdateHeight) | |
599 | - | let votingResultStakedIntegralDh = (height - votingResultStakedLastUpdateHeight) | |
600 | - | let userVoteStakedIntegral = ((userVoteStakedIntegralDh * userVoteStaked) + userVoteStakedIntegralPrev) | |
601 | - | let votingResultStakedIntegral = ((votingResultStakedIntegralDh * votingResultStaked) + votingResultStakedIntegralPrev) | |
588 | + | let userVoteStakedIntegralLastKey = keyVoteStakedIntegralLast(lpAssetIdStr, userAddress, lastFinalizedEpoch) | |
589 | + | let userVoteStakedIntegralLast = valueOrElse(getInteger(this, userVoteStakedIntegralLastKey), 0) | |
590 | + | let votingResultStakedIntegralLastKey = keyVotingResultStakedIntegralLast(lpAssetIdStr, userAddress, lastFinalizedEpoch) | |
591 | + | let votingResultStakedIntegralLast = valueOrElse(getInteger(this, votingResultStakedIntegralLastKey), 0) | |
592 | + | let userVoteStakedIntegral = getUserVoteStakedIntegral(lpAssetIdStr, userAddressStr) | |
593 | + | let votingResultStakedIntegral = getVotingResultStakedIntegral(lpAssetIdStr) | |
602 | 594 | let userVoteStakedIntegralDiff = (userVoteStakedIntegral - userVoteStakedIntegralLast) | |
603 | 595 | let votingResultStakedIntegralDiff = (votingResultStakedIntegral - votingResultStakedIntegralLast) | |
604 | - | $Tuple3([IntegerEntry( | |
596 | + | $Tuple3([IntegerEntry(userVoteStakedIntegralLastKey, userVoteStakedIntegral), IntegerEntry(votingResultStakedIntegralLastKey, votingResultStakedIntegral)], userVoteStakedIntegralDiff, votingResultStakedIntegralDiff) | |
605 | 597 | } | |
606 | 598 | ||
607 | 599 | ||
608 | 600 | func refreshBoostEmissionIntegral () = { | |
609 | 601 | let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent()) | |
610 | 602 | let boostingV2LastUpdateHeightOption = getInteger(emissionContract, keyBoostingV2LastUpdateHeight()) | |
611 | 603 | let boostingV2IngergalOption = getInteger(this, keyBoostingV2Integral()) | |
612 | 604 | let emissionEnd = iof(emissionContract, keyEmissionEndBlock()) | |
613 | 605 | let h = if ((height > emissionEnd)) | |
614 | 606 | then emissionEnd | |
615 | 607 | else height | |
616 | 608 | let dh = match boostingV2LastUpdateHeightOption { | |
617 | 609 | case lastUpdateHeight: Int => | |
618 | 610 | max([(h - lastUpdateHeight), 0]) | |
619 | 611 | case _: Unit => | |
620 | 612 | 0 | |
621 | 613 | case _ => | |
622 | 614 | throw("Match error") | |
623 | 615 | } | |
624 | 616 | let boostEmissionPerBlock = ((wxEmissionPerBlock * (boostCoeff - 1)) / boostCoeff) | |
625 | 617 | let boostEmissionIntegralPrev = valueOrElse(boostingV2IngergalOption, 0) | |
626 | 618 | let boostEmissionIntegral = ((boostEmissionPerBlock * dh) + boostEmissionIntegralPrev) | |
627 | 619 | $Tuple2([IntegerEntry(keyBoostingV2Integral(), boostEmissionIntegral), IntegerEntry(keyBoostingV2LastUpdateHeight(), height)], boostEmissionIntegral) | |
628 | 620 | } | |
629 | 621 | ||
630 | 622 | ||
631 | 623 | func internalClaimWxBoost (lpAssetIdStr,userAddressStr,readOnly) = { | |
632 | 624 | let userRecordOption = getString(this, keyLockParamsRecord(userAddressStr)) | |
633 | 625 | if ((userRecordOption == unit)) | |
634 | 626 | then $Tuple3(0, nil, "userRecord::is::empty") | |
635 | 627 | else { | |
636 | 628 | let userRecordArray = split(value(userRecordOption), SEP) | |
637 | 629 | let userNumStr = userRecordArray[IdxLockUserNum] | |
638 | 630 | let EMPTYSTR = "empty" | |
639 | 631 | let poolWeight = if ((lpAssetIdStr != EMPTYSTR)) | |
640 | 632 | then { | |
641 | 633 | let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
642 | 634 | getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr)) | |
643 | 635 | } | |
644 | 636 | else if (readOnly) | |
645 | 637 | then 0 | |
646 | 638 | else throw(("not readonly mode: unsupported lp asset " + lpAssetIdStr)) | |
647 | 639 | let userLpBoostEmissionLastIntegralKEY = keyUserLpBoostEmissionLastINTEGRAL(userNumStr, lpAssetIdStr) | |
648 | 640 | let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr) | |
649 | 641 | let userBoostEmissionLastIntegral = valueOrElse(getInteger(this, userLpBoostEmissionLastIntegralKEY), ioz(this, userBoostEmissionLastIntegralKEY)) | |
650 | 642 | let boostEmissionIntegral = refreshBoostEmissionIntegral()._2 | |
651 | 643 | let userBoostEmissionIntegral = (boostEmissionIntegral - userBoostEmissionLastIntegral) | |
652 | 644 | if ((0 > userBoostEmissionIntegral)) | |
653 | 645 | then throw("wrong calculations") | |
654 | 646 | else { | |
655 | - | let $ | |
656 | - | let stakedVotesIntegralsActions = $ | |
657 | - | let userVoteIntegralDiff = $ | |
658 | - | let totalVotesIntegralDiff = $ | |
647 | + | let $t02640626545 = getStakedVotesIntegralsDiff(lpAssetIdStr, userAddressStr) | |
648 | + | let stakedVotesIntegralsActions = $t02640626545._1 | |
649 | + | let userVoteIntegralDiff = $t02640626545._2 | |
650 | + | let totalVotesIntegralDiff = $t02640626545._3 | |
659 | 651 | let poolUserBoostEmissionIntegral = fraction(userBoostEmissionIntegral, poolWeight, POOLWEIGHTMULT) | |
660 | 652 | let userBoostAvaliableToClaimTotalNew = if ((totalVotesIntegralDiff == 0)) | |
661 | 653 | then 0 | |
662 | 654 | else fraction(poolUserBoostEmissionIntegral, userVoteIntegralDiff, totalVotesIntegralDiff) | |
663 | 655 | let dataState = ([IntegerEntry(userLpBoostEmissionLastIntegralKEY, boostEmissionIntegral)] ++ stakedVotesIntegralsActions) | |
664 | 656 | let debug = makeString([toString(userBoostEmissionLastIntegral), toString(userBoostEmissionIntegral), toString(poolWeight), toString(userVoteIntegralDiff), toString(totalVotesIntegralDiff)], ":") | |
665 | 657 | $Tuple3(userBoostAvaliableToClaimTotalNew, dataState, debug) | |
666 | 658 | } | |
667 | 659 | } | |
668 | 660 | } | |
669 | 661 | ||
670 | 662 | ||
671 | 663 | func lockActions (i,duration) = { | |
672 | 664 | let cfgArray = readConfigArrayOrFail() | |
673 | 665 | let assetIdStr = cfgArray[IdxCfgAssetId] | |
674 | 666 | let assetId = fromBase58String(assetIdStr) | |
675 | 667 | let minLockAmount = parseIntValue(cfgArray[IdxCfgMinLockAmount]) | |
676 | 668 | let minLockDuration = parseIntValue(cfgArray[IdxCfgMinLockDuration]) | |
677 | 669 | let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration]) | |
678 | 670 | if ((size(i.payments) != 1)) | |
679 | 671 | then throw("invalid payment - exact one payment must be attached") | |
680 | 672 | else { | |
681 | 673 | let pmt = i.payments[0] | |
682 | 674 | let pmtAmount = pmt.amount | |
683 | 675 | if ((assetId != value(pmt.assetId))) | |
684 | 676 | then throw((("invalid asset is in payment - " + assetIdStr) + " is expected")) | |
685 | 677 | else { | |
686 | 678 | let nextUserNumKEY = keyNextUserNum() | |
687 | 679 | let userAddressStr = toString(i.caller) | |
688 | 680 | let userIsExisting = isDefined(getString(keyUser2NumMapping(userAddressStr))) | |
689 | 681 | let userNumStr = if (userIsExisting) | |
690 | 682 | then value(getString(keyUser2NumMapping(userAddressStr))) | |
691 | 683 | else toString(iof(this, nextUserNumKEY)) | |
692 | 684 | let userNum = parseIntValue(userNumStr) | |
693 | 685 | let lockStart = height | |
694 | 686 | let startBlockKEY = keyLockParamStartBlock(userNumStr) | |
695 | 687 | let durationKEY = keyLockParamDuration(userNumStr) | |
696 | 688 | let userAmountKEY = keyLockParamUserAmount(userNumStr) | |
697 | 689 | if (if ((minLockAmount > pmtAmount)) | |
698 | 690 | then (i.caller != lpStakingPoolsContract) | |
699 | 691 | else false) | |
700 | 692 | then throw(("amount is less then minLockAmount=" + toString(minLockAmount))) | |
701 | 693 | else if ((minLockDuration > duration)) | |
702 | 694 | then throw(("passed duration is less then minLockDuration=" + toString(minLockDuration))) | |
703 | 695 | else if ((duration > maxLockDuration)) | |
704 | 696 | then throw(("passed duration is greater then maxLockDuration=" + toString(maxLockDuration))) | |
705 | 697 | else if (if (userIsExisting) | |
706 | 698 | then ((iof(this, startBlockKEY) + iof(this, durationKEY)) >= lockStart) | |
707 | 699 | else false) | |
708 | 700 | then throw("there is an active lock - consider to use increaseLock") | |
709 | 701 | else if ((ioz(this, userAmountKEY) > 0)) | |
710 | 702 | then throw(("there are locked WXs - consider to use increaseLock " + userAmountKEY)) | |
711 | 703 | else { | |
712 | 704 | let coeffX8 = fraction(duration, MULT8, maxLockDuration) | |
713 | 705 | let gWxAmountStart = fraction(pmtAmount, coeffX8, MULT8) | |
714 | 706 | let gWxParamsResultList = aal(invoke(mathContract, "calcGwxParamsREADONLY", [gWxAmountStart, lockStart, duration], nil)) | |
715 | 707 | let k = ai(gWxParamsResultList[0]) | |
716 | 708 | let b = ai(gWxParamsResultList[1]) | |
717 | 709 | let period = toString(ai(gWxParamsResultList[2])) | |
718 | 710 | let totalCachedGwxRaw = getTotalCachedGwx(false) | |
719 | 711 | let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr) | |
720 | 712 | let boostEmissionIntegral = refreshBoostEmissionIntegral()._2 | |
721 | 713 | let arr = if (userIsExisting) | |
722 | 714 | then nil | |
723 | 715 | else [IntegerEntry(nextUserNumKEY, (userNum + 1)), StringEntry(keyUser2NumMapping(userAddressStr), userNumStr), StringEntry(keyNum2UserMapping(userNumStr), userAddressStr)] | |
724 | 716 | $Tuple2(((((arr ++ LockParamsEntry(userAddressStr, userNumStr, pmtAmount, lockStart, duration, k, b, period)) ++ StatsEntry(pmtAmount, duration, 1, if (userIsExisting) | |
725 | 717 | then 0 | |
726 | 718 | else 1)) :+ HistoryEntry("lock", userAddressStr, pmtAmount, lockStart, duration, k, b, i)) ++ [IntegerEntry(userBoostEmissionLastIntegralKEY, boostEmissionIntegral), IntegerEntry(keyTotalCachedGwx(), (totalCachedGwxRaw + gWxAmountStart))]), gWxAmountStart) | |
727 | 719 | } | |
728 | 720 | } | |
729 | 721 | } | |
730 | 722 | } | |
731 | 723 | ||
732 | 724 | ||
733 | 725 | @Callable(i) | |
734 | 726 | func constructor (factoryAddressStr,lockAssetIdStr,minLockAmount,minDuration,maxDuration,mathContract) = { | |
735 | 727 | let checkCaller = mustManager(i) | |
736 | 728 | if ((checkCaller == checkCaller)) | |
737 | 729 | then ([IntegerEntry(keyNextUserNum(), 0), StringEntry(keyConfig(), formatConfig(lockAssetIdStr, minLockAmount, minDuration, maxDuration, mathContract)), StringEntry(keyFactoryAddress(), factoryAddressStr)] ++ StatsEntry(0, 0, 0, 0)) | |
738 | 730 | else throw("Strict value is not equal to itself.") | |
739 | 731 | } | |
740 | 732 | ||
741 | 733 | ||
742 | 734 | ||
743 | 735 | @Callable(i) | |
744 | 736 | func lockRef (duration,referrerAddress,signature) = { | |
745 | - | let $ | |
746 | - | let lockActionsResult = $ | |
747 | - | let gWxAmountStart = $ | |
737 | + | let $t03113531200 = lockActions(i, duration) | |
738 | + | let lockActionsResult = $t03113531200._1 | |
739 | + | let gWxAmountStart = $t03113531200._2 | |
748 | 740 | let referralAddress = toString(i.caller) | |
749 | 741 | let refInv = if (if ((referrerAddress == "")) | |
750 | 742 | then true | |
751 | 743 | else (signature == base58'')) | |
752 | 744 | then unit | |
753 | 745 | else invoke(referralsContractAddressOrFail, "createPair", [referralProgramName, referrerAddress, referralAddress, signature], nil) | |
754 | 746 | if ((refInv == refInv)) | |
755 | 747 | then { | |
756 | 748 | let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil) | |
757 | 749 | if ((updateRefActivity == updateRefActivity)) | |
758 | 750 | then $Tuple2(lockActionsResult, unit) | |
759 | 751 | else throw("Strict value is not equal to itself.") | |
760 | 752 | } | |
761 | 753 | else throw("Strict value is not equal to itself.") | |
762 | 754 | } | |
763 | 755 | ||
764 | 756 | ||
765 | 757 | ||
766 | 758 | @Callable(i) | |
767 | 759 | func lock (duration) = { | |
768 | - | let $ | |
769 | - | let lockActionsResult = $ | |
770 | - | let gWxAmountStart = $ | |
760 | + | let $t03165831723 = lockActions(i, duration) | |
761 | + | let lockActionsResult = $t03165831723._1 | |
762 | + | let gWxAmountStart = $t03165831723._2 | |
771 | 763 | let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil) | |
772 | 764 | if ((updateRefActivity == updateRefActivity)) | |
773 | 765 | then $Tuple2(lockActionsResult, unit) | |
774 | 766 | else throw("Strict value is not equal to itself.") | |
775 | 767 | } | |
776 | 768 | ||
777 | 769 | ||
778 | 770 | ||
779 | 771 | @Callable(i) | |
780 | 772 | func increaseLock (deltaDuration) = { | |
781 | 773 | let cfgArray = readConfigArrayOrFail() | |
782 | 774 | let assetIdStr = cfgArray[IdxCfgAssetId] | |
783 | 775 | let assetId = fromBase58String(assetIdStr) | |
784 | 776 | let minLockDuration = parseIntValue(cfgArray[IdxCfgMinLockDuration]) | |
785 | 777 | let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration]) | |
786 | 778 | let pmtAmount = extractOptionalPaymentAmountOrFail(i, assetId) | |
787 | 779 | let userAddressStr = toString(i.caller) | |
788 | 780 | let userRecordArray = readLockParamsRecordOrFail(userAddressStr) | |
789 | 781 | let userNumStr = userRecordArray[IdxLockUserNum] | |
790 | 782 | let userAmount = parseIntValue(userRecordArray[IdxLockAmount]) | |
791 | 783 | let lockStart = parseIntValue(userRecordArray[IdxLockStart]) | |
792 | 784 | let lockDuration = parseIntValue(userRecordArray[IdxLockDuration]) | |
793 | 785 | let lockEnd = (lockStart + lockDuration) | |
794 | 786 | let remainingDuration = max([(lockEnd - height), 0]) | |
795 | 787 | let userAmountNew = (userAmount + pmtAmount) | |
796 | 788 | let lockDurationNew = (remainingDuration + deltaDuration) | |
797 | 789 | if ((0 > deltaDuration)) | |
798 | 790 | then throw("duration is less then zero") | |
799 | 791 | else if ((minLockDuration > lockDurationNew)) | |
800 | 792 | then throw(("lockDurationNew is less then minLockDuration=" + toString(minLockDuration))) | |
801 | 793 | else if ((lockDurationNew > maxLockDuration)) | |
802 | 794 | then throw(("deltaDuration + existedLockDuration is greater then maxLockDuration=" + toString(maxLockDuration))) | |
803 | 795 | else { | |
804 | 796 | let coeffX8 = fraction(lockDurationNew, MULT8, maxLockDuration) | |
805 | 797 | let gWxAmountStart = fraction(userAmountNew, coeffX8, MULT8) | |
806 | 798 | let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil) | |
807 | 799 | if ((updateRefActivity == updateRefActivity)) | |
808 | 800 | then { | |
809 | 801 | let lockStartNew = height | |
810 | 802 | let gWxParamsResultList = aal(invoke(mathContract, "calcGwxParamsREADONLY", [gWxAmountStart, lockStartNew, lockDurationNew], nil)) | |
811 | 803 | let k = ai(gWxParamsResultList[0]) | |
812 | 804 | let b = ai(gWxParamsResultList[1]) | |
813 | 805 | let period = toString(ai(gWxParamsResultList[2])) | |
814 | 806 | let currUserGwx = calcCurrentGwxAmount(userAddressStr) | |
815 | 807 | let gwxDiff = (gWxAmountStart - currUserGwx) | |
816 | 808 | if ((0 > gwxDiff)) | |
817 | 809 | then throw(("gwxDiff is less then 0: " + toString(gwxDiff))) | |
818 | 810 | else { | |
819 | 811 | let totalCachedGwxRaw = getTotalCachedGwx(false) | |
820 | 812 | let totalCachedGwxCorrected = getTotalCachedGwx(true) | |
821 | 813 | (((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))]) | |
822 | 814 | } | |
823 | 815 | } | |
824 | 816 | else throw("Strict value is not equal to itself.") | |
825 | 817 | } | |
826 | 818 | } | |
827 | 819 | ||
828 | 820 | ||
829 | 821 | ||
830 | 822 | @Callable(i) | |
831 | 823 | func claimWxBoost (lpAssetIdStr,userAddressStr) = if ((stakingContract != i.caller)) | |
832 | 824 | then throw("permissions denied") | |
833 | 825 | else { | |
834 | - | let $ | |
835 | - | let userBoostAvailable = $ | |
836 | - | let dataState = $ | |
837 | - | let debug = $ | |
826 | + | let $t03481034912 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false) | |
827 | + | let userBoostAvailable = $t03481034912._1 | |
828 | + | let dataState = $t03481034912._2 | |
829 | + | let debug = $t03481034912._3 | |
838 | 830 | $Tuple2(dataState, [userBoostAvailable]) | |
839 | 831 | } | |
840 | 832 | ||
841 | 833 | ||
842 | 834 | ||
843 | 835 | @Callable(i) | |
844 | 836 | func claimWxBoostREADONLY (lpAssetIdStr,userAddressStr) = { | |
845 | - | let $ | |
846 | - | let userBoostAvailable = $ | |
847 | - | let dataState = $ | |
848 | - | let debug = $ | |
837 | + | let $t03504435145 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true) | |
838 | + | let userBoostAvailable = $t03504435145._1 | |
839 | + | let dataState = $t03504435145._2 | |
840 | + | let debug = $t03504435145._3 | |
849 | 841 | $Tuple2(nil, [userBoostAvailable, debug]) | |
850 | 842 | } | |
851 | 843 | ||
852 | 844 | ||
853 | 845 | ||
854 | 846 | @Callable(i) | |
855 | 847 | func unlock (userAddress) = { | |
856 | 848 | let userRecordArray = readLockParamsRecordOrFail(userAddress) | |
857 | 849 | let userNumStr = userRecordArray[IdxLockUserNum] | |
858 | 850 | let userAmount = parseIntValue(userRecordArray[IdxLockAmount]) | |
859 | 851 | let lockStart = parseIntValue(userRecordArray[IdxLockStart]) | |
860 | 852 | let lockDuration = parseIntValue(userRecordArray[IdxLockDuration]) | |
861 | 853 | let lockEnd = (lockStart + lockDuration) | |
862 | 854 | let cfgArray = readConfigArrayOrFail() | |
863 | 855 | let assetId = fromBase58String(cfgArray[IdxCfgAssetId]) | |
864 | 856 | if ((lockEnd >= height)) | |
865 | 857 | then throw((("wait " + toString(lockEnd)) + " to unlock")) | |
866 | 858 | else if ((0 >= userAmount)) | |
867 | 859 | then throw("nothing to unlock") | |
868 | 860 | else { | |
869 | 861 | let period = valueOrElse(getInteger(mathContract, keyNextPeriod()), 0) | |
870 | 862 | (((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)) | |
871 | 863 | } | |
872 | 864 | } | |
873 | 865 | ||
874 | 866 | ||
875 | 867 | ||
876 | 868 | @Callable(i) | |
877 | 869 | func gwxUserInfoREADONLY (userAddress) = { | |
878 | 870 | let gwxAmount = calcCurrentGwxAmount(userAddress) | |
879 | 871 | $Tuple2(nil, [gwxAmount]) | |
880 | 872 | } | |
881 | 873 | ||
882 | 874 | ||
883 | 875 | ||
884 | 876 | @Callable(i) | |
885 | 877 | func userMaxDurationREADONLY (userAddressStr) = { | |
886 | 878 | let cfgArray = readConfigArrayOrFail() | |
887 | 879 | let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration]) | |
888 | 880 | let userRecordOption = getString(this, keyLockParamsRecord(userAddressStr)) | |
889 | 881 | if ((userRecordOption == unit)) | |
890 | 882 | then $Tuple2(nil, $Tuple2("lock", maxLockDuration)) | |
891 | 883 | else { | |
892 | 884 | let userRecordArray = split(value(userRecordOption), SEP) | |
893 | 885 | let lockStart = parseIntValue(userRecordArray[IdxLockStart]) | |
894 | 886 | let lockDuration = parseIntValue(userRecordArray[IdxLockDuration]) | |
895 | 887 | let lockEnd = (lockStart + lockDuration) | |
896 | 888 | let remainingDuration = max([(lockEnd - height), 0]) | |
897 | 889 | let maxDeltaDuration = (maxLockDuration - remainingDuration) | |
898 | 890 | $Tuple2(nil, $Tuple2("increaseLock", maxDeltaDuration)) | |
899 | 891 | } | |
900 | 892 | } | |
901 | 893 | ||
902 | 894 | ||
903 | 895 | ||
904 | 896 | @Callable(i) | |
905 | 897 | func getUserGwxAmountAtHeightREADONLY (userAddress,targetHeight) = { | |
906 | 898 | let gwxAmount = calcUserGwxAmountAtHeight(userAddress, targetHeight) | |
907 | 899 | $Tuple2(nil, gwxAmount) | |
908 | 900 | } | |
909 | 901 | ||
910 | 902 | ||
911 | 903 | ||
912 | 904 | @Callable(i) | |
913 | 905 | func getTotalCachedGwxREADONLY () = $Tuple2(nil, getTotalCachedGwx(true)) | |
914 | 906 | ||
915 | 907 | ||
916 | 908 | ||
917 | 909 | @Callable(i) | |
918 | 910 | func onBoostEmissionUpdate () = { | |
919 | 911 | let checkCaller = if ((i.caller == emissionContract)) | |
920 | 912 | then true | |
921 | 913 | else mustManager(i) | |
922 | 914 | if ((checkCaller == checkCaller)) | |
923 | 915 | then refreshBoostEmissionIntegral() | |
924 | 916 | else throw("Strict value is not equal to itself.") | |
925 | 917 | } | |
926 | 918 | ||
927 | 919 | ||
928 | 920 | ||
929 | 921 | @Callable(i) | |
930 | 922 | func onStakedVoteUpdate (lpAssetIdStr,userAddressStr,edge) = { | |
931 | 923 | let checkCaller = if ((i.caller == stakingContract)) | |
932 | 924 | then true | |
933 | 925 | else mustManager(i) | |
934 | 926 | if ((checkCaller == checkCaller)) | |
935 | 927 | then { | |
936 | 928 | let actions = refreshVoteStakedIntegral(lpAssetIdStr, userAddressStr, edge) | |
937 | 929 | $Tuple2(actions, unit) | |
938 | 930 | } | |
939 | 931 | else throw("Strict value is not equal to itself.") | |
940 | 932 | } | |
941 | 933 | ||
942 | 934 | ||
943 | 935 | ||
944 | 936 | @Callable(i) | |
945 | 937 | func getVotingResultStakedREADONLY (lpAssetIdStr) = $Tuple2(nil, getVotingResultStaked(lpAssetIdStr)) | |
946 | 938 | ||
947 | 939 | ||
948 | 940 | ||
949 | 941 | @Callable(i) | |
950 | 942 | func getVotingResultStakedIntegralREADONLY (lpAssetIdStr) = $Tuple2(nil, getVotingResultStakedIntegral(lpAssetIdStr)) | |
951 | 943 | ||
952 | 944 | ||
953 | 945 | ||
954 | 946 | @Callable(i) | |
955 | 947 | func getUserVoteFinalizedREADONLY (lpAssetIdStr,userAddressStr) = $Tuple2(nil, getUserVoteFinalized(lpAssetIdStr, userAddressStr)) | |
956 | 948 | ||
957 | 949 | ||
958 | 950 | ||
959 | 951 | @Callable(i) | |
960 | 952 | func getUserVoteStakedIntegralREADONLY (lpAssetIdStr,userAddressStr) = $Tuple2(nil, getUserVoteStakedIntegral(lpAssetIdStr, userAddressStr)) | |
961 | 953 | ||
962 | 954 | ||
963 | 955 | ||
964 | 956 | @Callable(i) | |
965 | 957 | func setManager (pendingManagerPublicKey) = { | |
966 | 958 | let checkCaller = mustManager(i) | |
967 | 959 | if ((checkCaller == checkCaller)) | |
968 | 960 | then { | |
969 | 961 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
970 | 962 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
971 | 963 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
972 | 964 | else throw("Strict value is not equal to itself.") | |
973 | 965 | } | |
974 | 966 | else throw("Strict value is not equal to itself.") | |
975 | 967 | } | |
976 | 968 | ||
977 | 969 | ||
978 | 970 | ||
979 | 971 | @Callable(i) | |
980 | 972 | func confirmManager () = { | |
981 | 973 | let pm = pendingManagerPublicKeyOrUnit() | |
982 | 974 | let hasPM = if (isDefined(pm)) | |
983 | 975 | then true | |
984 | 976 | else throw("No pending manager") | |
985 | 977 | if ((hasPM == hasPM)) | |
986 | 978 | then { | |
987 | 979 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
988 | 980 | then true | |
989 | 981 | else throw("You are not pending manager") | |
990 | 982 | if ((checkPM == checkPM)) | |
991 | 983 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
992 | 984 | else throw("Strict value is not equal to itself.") | |
993 | 985 | } | |
994 | 986 | else throw("Strict value is not equal to itself.") | |
995 | 987 | } | |
996 | 988 | ||
997 | 989 | ||
998 | 990 | @Verifier(tx) | |
999 | 991 | func verify () = { | |
1000 | 992 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
1001 | 993 | case pk: ByteVector => | |
1002 | 994 | pk | |
1003 | 995 | case _: Unit => | |
1004 | 996 | tx.senderPublicKey | |
1005 | 997 | case _ => | |
1006 | 998 | throw("Match error") | |
1007 | 999 | } | |
1008 | 1000 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
1009 | 1001 | } | |
1010 | 1002 |
github/deemru/w8io/169f3d6 141.96 ms ◑