tx · BskLMfXpLaR9V9pDsWzAWTWriKeW8XPeQk4d2whGb51u 3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy: -0.02300000 Waves 2023.02.15 16:04 [2450760] smart account 3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy > SELF 0.00000000 Waves
{ "type": 13, "id": "BskLMfXpLaR9V9pDsWzAWTWriKeW8XPeQk4d2whGb51u", "fee": 2300000, "feeAssetId": null, "timestamp": 1676466294820, "version": 2, "chainId": 84, "sender": "3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy", "senderPublicKey": "9W33iCCNfmFxUbiC6XZcH5x7f6xfwC7Jb3BoExT5q2PV", "proofs": [ "3jYWzrxQby6f6sQRf3wK9RkTAwqqixDTGPWjk38jb4s7E4pQTwGaiWCuwnSpPHpeDuz8uLE3jhDmKcVHpSR6q2di" ], "script": "base64:BgKbJggCEggKBggIAQEBCBIFCgMBCAISAwoBARIDCgEBEgQKAggIEgQKAggIEgMKAQgSAwoBCBIECgIIARIAEgMKAQgSACIDU0VQIgZTQ0FMRTgiBU1VTFQ4Ig5QT09MV0VJR0hUTVVMVCIHd3JhcEVyciIDbXNnIgh0aHJvd0VyciIEc3RyZiIHYWRkcmVzcyIDa2V5IgNpb3oiA2lvZCIKZGVmYXVsdFZhbCIDaW9mIgNhYnMiA3ZhbCIDYWFsIgckbWF0Y2gwIgp2YWxBbnlMeXN0IgJhaSIGdmFsSW50IhtrZXlSZWZlcnJhbHNDb250cmFjdEFkZHJlc3MiHnJlZmVycmFsc0NvbnRyYWN0QWRkcmVzc09yRmFpbCIWa2V5UmVmZXJyYWxQcm9ncmFtTmFtZSIacmVmZXJyYWxQcm9ncmFtTmFtZURlZmF1bHQiE3JlZmVycmFsUHJvZ3JhbU5hbWUiEWtleUZhY3RvcnlBZGRyZXNzIhhJZHhGYWN0b3J5Q2ZnU3Rha2luZ0RhcHAiGUlkeEZhY3RvcnlDZmdCb29zdGluZ0RhcHAiFElkeEZhY3R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BQJlQQZwcm9vZnMAAAUCZUO7K12R", "height": 2450760, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Exks2UkriPFqjRP5E8F3QS8vd8gYfCLqdJdYVVTQQwU1 Next: 5tog8x7bSLC6iuCsZ5peaA914TR6cERf2aVHu9YZoL3C Diff:
Old | New | Differences | |
---|---|---|---|
435 | 435 | } | |
436 | 436 | let keyCurrentEpoch = makeString(["%s", "currentEpoch"], SEP) | |
437 | 437 | let lastFinalizedEpoch = { | |
438 | - | let epoch = (value(getInteger( | |
438 | + | let epoch = (value(getInteger(votingEmissionContract, keyCurrentEpoch)) - 1) | |
439 | 439 | if ((0 > epoch)) | |
440 | 440 | then throwErr("invalid epoch") | |
441 | 441 | else epoch | |
445 | 445 | func keyVotingResult (pool,epoch) = makeString(["%s%s%s%d", "votingResult", amountAssetId, priceAssetId, toString(epoch)], SEP) | |
446 | 446 | ||
447 | 447 | let pool = $Tuple2(amountAssetId, priceAssetId) | |
448 | - | let userVote = valueOrElse(getInteger( | |
449 | - | let poolResult = valueOrElse(getInteger( | |
448 | + | let userVote = valueOrElse(getInteger(votingEmissionContract, keyVote(pool, userAddress, lastFinalizedEpoch)), 0) | |
449 | + | let poolResult = valueOrElse(getInteger(votingEmissionContract, keyVotingResult(pool, lastFinalizedEpoch)), 0) | |
450 | 450 | $Tuple2(userVote, poolResult) | |
451 | 451 | } | |
452 | 452 | ||
489 | 489 | let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL() | |
490 | 490 | let userMaxBoostInt = ioz(this, userMaxBoostIntegralKEY) | |
491 | 491 | let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY) | |
492 | - | let $ | |
493 | - | let userVote = $ | |
494 | - | let totalVotes = $ | |
492 | + | let $t01817818256 = getVoteInfoREADONLY(lpAssetIdStr, userAddressStr) | |
493 | + | let userVote = $t01817818256._1 | |
494 | + | let totalVotes = $t01817818256._2 | |
495 | 495 | let userBoostAvalaibleToClaimTotalKEY = keyUserBoostAvalaibleToClaimTotal(userNumStr) | |
496 | 496 | let userBoostAvaliableToClaimTotal = ioz(this, userBoostAvalaibleToClaimTotalKEY) | |
497 | 497 | let poolUserBoostEmissionIntegral = fraction(userBoostEmissionIntegral, poolWeight, POOLWEIGHTMULT) | |
592 | 592 | ||
593 | 593 | @Callable(i) | |
594 | 594 | func lockRef (duration,referrerAddress,signature) = { | |
595 | - | let $ | |
596 | - | let lockActionsResult = $ | |
597 | - | let gWxAmountStart = $ | |
595 | + | let $t02420824273 = lockActions(i, duration) | |
596 | + | let lockActionsResult = $t02420824273._1 | |
597 | + | let gWxAmountStart = $t02420824273._2 | |
598 | 598 | let referralAddress = toString(i.caller) | |
599 | 599 | let refInv = if (if ((referrerAddress == "")) | |
600 | 600 | then true | |
615 | 615 | ||
616 | 616 | @Callable(i) | |
617 | 617 | func lock (duration) = { | |
618 | - | let $ | |
619 | - | let lockActionsResult = $ | |
620 | - | let gWxAmountStart = $ | |
618 | + | let $t02473124796 = lockActions(i, duration) | |
619 | + | let lockActionsResult = $t02473124796._1 | |
620 | + | let gWxAmountStart = $t02473124796._2 | |
621 | 621 | let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil) | |
622 | 622 | if ((updateRefActivity == updateRefActivity)) | |
623 | 623 | then $Tuple2(lockActionsResult, unit) | |
706 | 706 | func claimWxBoost (lpAssetIdStr,userAddressStr) = if ((stakingContract != i.caller)) | |
707 | 707 | then throw("permissions denied") | |
708 | 708 | else { | |
709 | - | let $ | |
710 | - | let userBoostAvailable = $ | |
711 | - | let dataState = $ | |
712 | - | let debug = $ | |
709 | + | let $t02977729879 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false) | |
710 | + | let userBoostAvailable = $t02977729879._1 | |
711 | + | let dataState = $t02977729879._2 | |
712 | + | let debug = $t02977729879._3 | |
713 | 713 | $Tuple2(dataState, [userBoostAvailable]) | |
714 | 714 | } | |
715 | 715 | ||
717 | 717 | ||
718 | 718 | @Callable(i) | |
719 | 719 | func claimWxBoostREADONLY (lpAssetIdStr,userAddressStr) = { | |
720 | - | let $ | |
721 | - | let userBoostAvailable = $ | |
722 | - | let dataState = $ | |
723 | - | let debug = $ | |
720 | + | let $t03001130112 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true) | |
721 | + | let userBoostAvailable = $t03001130112._1 | |
722 | + | let dataState = $t03001130112._2 | |
723 | + | let debug = $t03001130112._3 | |
724 | 724 | $Tuple2(nil, [userBoostAvailable, debug]) | |
725 | 725 | } | |
726 | 726 |
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 keyBoostingV2StartHeight () = "%s%s__boostingV2__startBlock" | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | func keyEmissionDurationInBlocks () = "%s%s__emission__duration" | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | func keyEmissionEndBlock () = "%s%s__emission__endBlock" | |
148 | 148 | ||
149 | 149 | ||
150 | 150 | func keyNextPeriod () = "%s__nextPeriod" | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | func keyGwxRewardEmissionStartHeight () = "%s%s__gwxRewardEmissionPart__startHeight" | |
154 | 154 | ||
155 | 155 | ||
156 | 156 | let IdxCfgAssetId = 1 | |
157 | 157 | ||
158 | 158 | let IdxCfgMinLockAmount = 2 | |
159 | 159 | ||
160 | 160 | let IdxCfgMinLockDuration = 3 | |
161 | 161 | ||
162 | 162 | let IdxCfgMaxLockDuration = 4 | |
163 | 163 | ||
164 | 164 | let IdxCfgMathContract = 5 | |
165 | 165 | ||
166 | 166 | func keyConfig () = "%s__config" | |
167 | 167 | ||
168 | 168 | ||
169 | 169 | func readConfigArrayOrFail () = split(strf(this, keyConfig()), SEP) | |
170 | 170 | ||
171 | 171 | ||
172 | 172 | let mathContract = addressFromStringValue(readConfigArrayOrFail()[IdxCfgMathContract]) | |
173 | 173 | ||
174 | 174 | func formatConfigS (assetId,minLockAmount,minLockDuration,maxLockDuration,mathContract) = makeString(["%s%d%d%d", assetId, minLockAmount, minLockDuration, maxLockDuration, mathContract], SEP) | |
175 | 175 | ||
176 | 176 | ||
177 | 177 | func formatConfig (assetId,minLockAmount,minLockDuration,maxLockDuration,mathContract) = formatConfigS(assetId, toString(minLockAmount), toString(minLockDuration), toString(maxLockDuration), mathContract) | |
178 | 178 | ||
179 | 179 | ||
180 | 180 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
181 | 181 | case s: String => | |
182 | 182 | fromBase58String(s) | |
183 | 183 | case _: Unit => | |
184 | 184 | unit | |
185 | 185 | case _ => | |
186 | 186 | throw("Match error") | |
187 | 187 | } | |
188 | 188 | ||
189 | 189 | ||
190 | 190 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
191 | 191 | case s: String => | |
192 | 192 | fromBase58String(s) | |
193 | 193 | case _: Unit => | |
194 | 194 | unit | |
195 | 195 | case _ => | |
196 | 196 | throw("Match error") | |
197 | 197 | } | |
198 | 198 | ||
199 | 199 | ||
200 | 200 | func mustManager (i) = { | |
201 | 201 | let pd = throw("Permission denied") | |
202 | 202 | match managerPublicKeyOrUnit() { | |
203 | 203 | case pk: ByteVector => | |
204 | 204 | if ((i.callerPublicKey == pk)) | |
205 | 205 | then true | |
206 | 206 | else pd | |
207 | 207 | case _: Unit => | |
208 | 208 | if ((i.caller == this)) | |
209 | 209 | then true | |
210 | 210 | else pd | |
211 | 211 | case _ => | |
212 | 212 | throw("Match error") | |
213 | 213 | } | |
214 | 214 | } | |
215 | 215 | ||
216 | 216 | ||
217 | 217 | let IdxLockUserNum = 1 | |
218 | 218 | ||
219 | 219 | let IdxLockAmount = 2 | |
220 | 220 | ||
221 | 221 | let IdxLockStart = 3 | |
222 | 222 | ||
223 | 223 | let IdxLockDuration = 4 | |
224 | 224 | ||
225 | 225 | let IdxLockParamK = 5 | |
226 | 226 | ||
227 | 227 | let IdxLockParamB = 6 | |
228 | 228 | ||
229 | 229 | func keyLockParamsRecord (userAddress) = makeString(["%s%s__lock", userAddress], SEP) | |
230 | 230 | ||
231 | 231 | ||
232 | 232 | func readLockParamsRecordOrFail (userAddress) = split(strf(this, keyLockParamsRecord(userAddress)), SEP) | |
233 | 233 | ||
234 | 234 | ||
235 | 235 | func formatLockParamsRecordS (userNum,amount,start,duration,paramK,paramB,lastUpdTimestamp,gwxAmount) = makeString(["%d%d%d%d%d%d%d%d", userNum, amount, start, duration, paramK, paramB, lastUpdTimestamp, gwxAmount], SEP) | |
236 | 236 | ||
237 | 237 | ||
238 | 238 | func formatLockParamsRecord (userNum,amount,start,duration,paramK,paramB,gwxAmount) = formatLockParamsRecordS(userNum, toString(amount), toString(start), toString(duration), toString(paramK), toString(paramB), toString(lastBlock.timestamp), toString(gwxAmount)) | |
239 | 239 | ||
240 | 240 | ||
241 | 241 | func keyNextUserNum () = "%s__nextUserNum" | |
242 | 242 | ||
243 | 243 | ||
244 | 244 | func keyUser2NumMapping (userAddress) = makeString(["%s%s%s__mapping__user2num", userAddress], SEP) | |
245 | 245 | ||
246 | 246 | ||
247 | 247 | func keyNum2UserMapping (num) = makeString(["%s%s%s__mapping__num2user", num], SEP) | |
248 | 248 | ||
249 | 249 | ||
250 | 250 | func keyLockParamUserAmount (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "amount"], SEP) | |
251 | 251 | ||
252 | 252 | ||
253 | 253 | func keyLockParamStartBlock (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "start"], SEP) | |
254 | 254 | ||
255 | 255 | ||
256 | 256 | func keyLockParamDuration (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "duration"], SEP) | |
257 | 257 | ||
258 | 258 | ||
259 | 259 | func keyLockParamK (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "k"], SEP) | |
260 | 260 | ||
261 | 261 | ||
262 | 262 | func keyLockParamB (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "b"], SEP) | |
263 | 263 | ||
264 | 264 | ||
265 | 265 | func keyLockParamByPeriodK (userNum,period) = makeString(["%s%d%s%d__paramByPeriod", userNum, "k", period], SEP) | |
266 | 266 | ||
267 | 267 | ||
268 | 268 | func keyLockParamByPeriodB (userNum,period) = makeString(["%s%d%s%d__paramByPeriod", userNum, "b", period], SEP) | |
269 | 269 | ||
270 | 270 | ||
271 | 271 | func keyLockParamTotalAmount () = "%s%s__stats__activeTotalLocked" | |
272 | 272 | ||
273 | 273 | ||
274 | 274 | func keyStatsLocksDurationSumInBlocks () = "%s%s__stats__locksDurationSumInBlocks" | |
275 | 275 | ||
276 | 276 | ||
277 | 277 | func keyStatsLocksCount () = "%s%s__stats__locksCount" | |
278 | 278 | ||
279 | 279 | ||
280 | 280 | func keyStatsUsersCount () = "%s%s__stats__activeUsersCount" | |
281 | 281 | ||
282 | 282 | ||
283 | 283 | func keyUserBoostEmissionLastINTEGRAL (userNum) = makeString(["%s%d__userBoostEmissionLastIntV2", userNum], SEP) | |
284 | 284 | ||
285 | 285 | ||
286 | 286 | func keyUserLpBoostEmissionLastINTEGRAL (userNum,lpAssetId) = makeString(["%s%d__userBoostEmissionLastIntV2", userNum, lpAssetId], SEP) | |
287 | 287 | ||
288 | 288 | ||
289 | 289 | func keyUserMaxBoostINTEGRAL (userNum) = makeString(["%s%d__maxBoostInt", userNum], SEP) | |
290 | 290 | ||
291 | 291 | ||
292 | 292 | func keyTotalMaxBoostINTEGRAL () = "%s%s__maxBoostInt__total" | |
293 | 293 | ||
294 | 294 | ||
295 | 295 | func keyUserBoostAvalaibleToClaimTotal (userNum) = makeString(["%s%d__userBoostAvaliableToClaimTotal", userNum], SEP) | |
296 | 296 | ||
297 | 297 | ||
298 | 298 | func keyUserBoostClaimed (userNum) = makeString(["%s%d__userBoostClaimed", userNum], SEP) | |
299 | 299 | ||
300 | 300 | ||
301 | 301 | func keyTotalCachedGwx () = "%s%s__gwxCached__total" | |
302 | 302 | ||
303 | 303 | ||
304 | 304 | func keyTotalCachedGwxCorrective () = "%s__gwxCachedTotalCorrective" | |
305 | 305 | ||
306 | 306 | ||
307 | 307 | let factoryContract = readFactoryAddressOrFail() | |
308 | 308 | ||
309 | 309 | let factoryCfg = readFactoryCfgOrFail(factoryContract) | |
310 | 310 | ||
311 | 311 | let emissionContract = getEmissionAddressOrFail(factoryCfg) | |
312 | 312 | ||
313 | 313 | let stakingContract = getStakingAddressOrFail(factoryCfg) | |
314 | 314 | ||
315 | 315 | let gwxRewardContract = getGwxRewardAddressOrFail(factoryCfg) | |
316 | 316 | ||
317 | 317 | let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP) | |
318 | 318 | ||
319 | 319 | let votingEmissionContract = addressFromStringValue(getStringValue(factoryContract, keyVotingEmissionContract)) | |
320 | 320 | ||
321 | 321 | let boostCoeff = { | |
322 | 322 | let @ = invoke(emissionContract, "getBoostCoeffREADONLY", nil, nil) | |
323 | 323 | if ($isInstanceOf(@, "Int")) | |
324 | 324 | then @ | |
325 | 325 | else throw(($getType(@) + " couldn't be cast to Int")) | |
326 | 326 | } | |
327 | 327 | ||
328 | 328 | func getTotalCachedGwx (correct) = { | |
329 | 329 | let keyCurrentEpochUi = makeString(["%s", "currentEpochUi"], SEP) | |
330 | 330 | let currentEpochUi = getIntegerValue(votingEmissionContract, keyCurrentEpochUi) | |
331 | 331 | let keyTargetEpoch = makeString(["%s%s", "totalCachedGwxCorrection__activationEpoch"], SEP) | |
332 | 332 | let targetEpochOption = getInteger(this, keyTargetEpoch) | |
333 | 333 | let totalCachedGwxRaw = valueOrElse(getInteger(this, keyTotalCachedGwx()), 0) | |
334 | 334 | let isCorrectionActivated = if (isDefined(targetEpochOption)) | |
335 | 335 | then (currentEpochUi >= value(targetEpochOption)) | |
336 | 336 | else false | |
337 | 337 | let corrective = if (if (isCorrectionActivated) | |
338 | 338 | then correct | |
339 | 339 | else false) | |
340 | 340 | then valueOrElse(getInteger(this, keyTotalCachedGwxCorrective()), 0) | |
341 | 341 | else 0 | |
342 | 342 | max([0, (totalCachedGwxRaw + corrective)]) | |
343 | 343 | } | |
344 | 344 | ||
345 | 345 | ||
346 | 346 | func HistoryEntry (type,user,amount,lockStart,duration,k,b,i) = { | |
347 | 347 | let historyKEY = makeString(["%s%s%s%s__history", type, user, toBase58String(i.transactionId)], SEP) | |
348 | 348 | 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) | |
349 | 349 | StringEntry(historyKEY, historyDATA) | |
350 | 350 | } | |
351 | 351 | ||
352 | 352 | ||
353 | 353 | func StatsEntry (totalLockedInc,durationInc,lockCountInc,usersCountInc) = { | |
354 | 354 | let locksDurationSumInBlocksKEY = keyStatsLocksDurationSumInBlocks() | |
355 | 355 | let locksCountKEY = keyStatsLocksCount() | |
356 | 356 | let usersCountKEY = keyStatsUsersCount() | |
357 | 357 | let totalAmountKEY = keyLockParamTotalAmount() | |
358 | 358 | let locksDurationSumInBlocks = ioz(this, locksDurationSumInBlocksKEY) | |
359 | 359 | let locksCount = ioz(this, locksCountKEY) | |
360 | 360 | let usersCount = ioz(this, usersCountKEY) | |
361 | 361 | let totalAmount = ioz(this, totalAmountKEY) | |
362 | 362 | [IntegerEntry(locksDurationSumInBlocksKEY, (locksDurationSumInBlocks + durationInc)), IntegerEntry(locksCountKEY, (locksCount + lockCountInc)), IntegerEntry(usersCountKEY, (usersCount + usersCountInc)), IntegerEntry(totalAmountKEY, (totalAmount + totalLockedInc))] | |
363 | 363 | } | |
364 | 364 | ||
365 | 365 | ||
366 | 366 | func calcGwxAmount (kRaw,bRaw,h) = { | |
367 | 367 | let SCALE = 1000 | |
368 | 368 | (((kRaw * h) + bRaw) / SCALE) | |
369 | 369 | } | |
370 | 370 | ||
371 | 371 | ||
372 | 372 | func LockParamsEntry (userAddress,userNum,amount,start,duration,k,b,period) = { | |
373 | 373 | let userAmountKEY = keyLockParamUserAmount(userNum) | |
374 | 374 | let startBlockKEY = keyLockParamStartBlock(userNum) | |
375 | 375 | let durationKEY = keyLockParamDuration(userNum) | |
376 | 376 | let kKEY = keyLockParamK(userNum) | |
377 | 377 | let bKEY = keyLockParamB(userNum) | |
378 | 378 | let kByPeriodKEY = keyLockParamByPeriodK(userNum, period) | |
379 | 379 | let bByPeriodKEY = keyLockParamByPeriodB(userNum, period) | |
380 | 380 | let gwxAmount = calcGwxAmount(k, b, height) | |
381 | 381 | [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))] | |
382 | 382 | } | |
383 | 383 | ||
384 | 384 | ||
385 | 385 | func extractOptionalPaymentAmountOrFail (i,expectedAssetId) = if ((size(i.payments) > 1)) | |
386 | 386 | then throw("only one payment is allowed") | |
387 | 387 | else if ((size(i.payments) == 0)) | |
388 | 388 | then 0 | |
389 | 389 | else { | |
390 | 390 | let pmt = i.payments[0] | |
391 | 391 | if ((value(pmt.assetId) != expectedAssetId)) | |
392 | 392 | then throw("invalid asset id in payment") | |
393 | 393 | else pmt.amount | |
394 | 394 | } | |
395 | 395 | ||
396 | 396 | ||
397 | 397 | func calcUserGwxAmountAtHeight (userAddress,targetHeight) = { | |
398 | 398 | let EMPTY = "empty" | |
399 | 399 | let user2NumMappingKEY = keyUser2NumMapping(userAddress) | |
400 | 400 | let userNum = valueOrElse(getString(user2NumMappingKEY), EMPTY) | |
401 | 401 | let k = valueOrElse(getInteger(keyLockParamK(userNum)), 0) | |
402 | 402 | let b = valueOrElse(getInteger(keyLockParamB(userNum)), 0) | |
403 | 403 | let gwxAmountCalc = calcGwxAmount(k, b, targetHeight) | |
404 | 404 | let gwxAmount = if ((0 > gwxAmountCalc)) | |
405 | 405 | then 0 | |
406 | 406 | else gwxAmountCalc | |
407 | 407 | gwxAmount | |
408 | 408 | } | |
409 | 409 | ||
410 | 410 | ||
411 | 411 | func calcCurrentGwxAmount (userAddress) = calcUserGwxAmountAtHeight(userAddress, height) | |
412 | 412 | ||
413 | 413 | ||
414 | 414 | func getVoteInfoREADONLY (lpAssetIdStr,userAddressStr) = { | |
415 | 415 | let userAddress = addressFromStringValue(userAddressStr) | |
416 | 416 | let idxAmountAssetId = 4 | |
417 | 417 | let idxPriceAssetId = 5 | |
418 | 418 | let poolCfg = { | |
419 | 419 | let @ = invoke(factoryContract, "getPoolConfigByLpAssetId", [lpAssetIdStr], nil) | |
420 | 420 | if ($isInstanceOf(@, "List[Any]")) | |
421 | 421 | then @ | |
422 | 422 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
423 | 423 | } | |
424 | 424 | let amountAssetId = { | |
425 | 425 | let @ = poolCfg[idxAmountAssetId] | |
426 | 426 | if ($isInstanceOf(@, "String")) | |
427 | 427 | then @ | |
428 | 428 | else throw(($getType(@) + " couldn't be cast to String")) | |
429 | 429 | } | |
430 | 430 | let priceAssetId = { | |
431 | 431 | let @ = poolCfg[idxPriceAssetId] | |
432 | 432 | if ($isInstanceOf(@, "String")) | |
433 | 433 | then @ | |
434 | 434 | else throw(($getType(@) + " couldn't be cast to String")) | |
435 | 435 | } | |
436 | 436 | let keyCurrentEpoch = makeString(["%s", "currentEpoch"], SEP) | |
437 | 437 | let lastFinalizedEpoch = { | |
438 | - | let epoch = (value(getInteger( | |
438 | + | let epoch = (value(getInteger(votingEmissionContract, keyCurrentEpoch)) - 1) | |
439 | 439 | if ((0 > epoch)) | |
440 | 440 | then throwErr("invalid epoch") | |
441 | 441 | else epoch | |
442 | 442 | } | |
443 | 443 | func keyVote (pool,address,epoch) = makeString(["%s%s%s%s%d", "vote", amountAssetId, priceAssetId, toString(address), toString(epoch)], SEP) | |
444 | 444 | ||
445 | 445 | func keyVotingResult (pool,epoch) = makeString(["%s%s%s%d", "votingResult", amountAssetId, priceAssetId, toString(epoch)], SEP) | |
446 | 446 | ||
447 | 447 | let pool = $Tuple2(amountAssetId, priceAssetId) | |
448 | - | let userVote = valueOrElse(getInteger( | |
449 | - | let poolResult = valueOrElse(getInteger( | |
448 | + | let userVote = valueOrElse(getInteger(votingEmissionContract, keyVote(pool, userAddress, lastFinalizedEpoch)), 0) | |
449 | + | let poolResult = valueOrElse(getInteger(votingEmissionContract, keyVotingResult(pool, lastFinalizedEpoch)), 0) | |
450 | 450 | $Tuple2(userVote, poolResult) | |
451 | 451 | } | |
452 | 452 | ||
453 | 453 | ||
454 | 454 | func internalClaimWxBoost (lpAssetIdStr,userAddressStr,readOnly) = { | |
455 | 455 | let EMPTY = "EMPTY" | |
456 | 456 | let userRecordOrEmpty = valueOrElse(getString(this, keyLockParamsRecord(userAddressStr)), EMPTY) | |
457 | 457 | if ((userRecordOrEmpty == EMPTY)) | |
458 | 458 | then $Tuple3(0, nil, "userRecord::is::empty") | |
459 | 459 | else { | |
460 | 460 | let userRecordArray = split(userRecordOrEmpty, SEP) | |
461 | 461 | let userNumStr = userRecordArray[IdxLockUserNum] | |
462 | 462 | let EMPTYSTR = "empty" | |
463 | 463 | let poolWeight = if ((lpAssetIdStr != EMPTYSTR)) | |
464 | 464 | then { | |
465 | 465 | let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
466 | 466 | getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr)) | |
467 | 467 | } | |
468 | 468 | else if (readOnly) | |
469 | 469 | then 0 | |
470 | 470 | else throw(("not readonly mode: unsupported lp asset " + lpAssetIdStr)) | |
471 | 471 | let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent()) | |
472 | 472 | let boostingV2StartHeight = iof(emissionContract, keyBoostingV2StartHeight()) | |
473 | 473 | let emissionEnd = iof(emissionContract, keyEmissionEndBlock()) | |
474 | 474 | let h = if ((height > emissionEnd)) | |
475 | 475 | then emissionEnd | |
476 | 476 | else height | |
477 | 477 | let dh = max([(h - boostingV2StartHeight), 0]) | |
478 | 478 | let userLpBoostEmissionLastIntegralKEY = keyUserLpBoostEmissionLastINTEGRAL(userNumStr, lpAssetIdStr) | |
479 | 479 | let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr) | |
480 | 480 | let userBoostEmissionLastIntegral = valueOrElse(getInteger(this, userLpBoostEmissionLastIntegralKEY), ioz(this, userBoostEmissionLastIntegralKEY)) | |
481 | 481 | let boostEmissionIntegral = (((wxEmissionPerBlock * dh) * (boostCoeff - 1)) / boostCoeff) | |
482 | 482 | let userBoostEmissionIntegral = (boostEmissionIntegral - userBoostEmissionLastIntegral) | |
483 | 483 | let udh = fraction(userBoostEmissionIntegral, boostCoeff, ((boostCoeff - 1) * wxEmissionPerBlock)) | |
484 | 484 | let uLastH = (h - udh) | |
485 | 485 | if ((0 > userBoostEmissionIntegral)) | |
486 | 486 | then throw("wrong calculations") | |
487 | 487 | else { | |
488 | 488 | let userMaxBoostIntegralKEY = keyUserMaxBoostINTEGRAL(userNumStr) | |
489 | 489 | let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL() | |
490 | 490 | let userMaxBoostInt = ioz(this, userMaxBoostIntegralKEY) | |
491 | 491 | let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY) | |
492 | - | let $ | |
493 | - | let userVote = $ | |
494 | - | let totalVotes = $ | |
492 | + | let $t01817818256 = getVoteInfoREADONLY(lpAssetIdStr, userAddressStr) | |
493 | + | let userVote = $t01817818256._1 | |
494 | + | let totalVotes = $t01817818256._2 | |
495 | 495 | let userBoostAvalaibleToClaimTotalKEY = keyUserBoostAvalaibleToClaimTotal(userNumStr) | |
496 | 496 | let userBoostAvaliableToClaimTotal = ioz(this, userBoostAvalaibleToClaimTotalKEY) | |
497 | 497 | let poolUserBoostEmissionIntegral = fraction(userBoostEmissionIntegral, poolWeight, POOLWEIGHTMULT) | |
498 | 498 | let userBoostAvaliableToClaimTotalNew = if ((totalVotes == 0)) | |
499 | 499 | then 0 | |
500 | 500 | else fraction(poolUserBoostEmissionIntegral, userVote, totalVotes) | |
501 | 501 | let userBoostClaimedKEY = keyUserBoostClaimed(userNumStr) | |
502 | 502 | let userBoostClaimed = ioz(this, userBoostClaimedKEY) | |
503 | 503 | let userBoostAvailable = (userBoostAvaliableToClaimTotalNew - userBoostClaimed) | |
504 | 504 | let dataState = [IntegerEntry(userLpBoostEmissionLastIntegralKEY, boostEmissionIntegral)] | |
505 | 505 | let debug = makeString([toString(userBoostEmissionLastIntegral), toString(userBoostEmissionIntegral), toString(userBoostClaimed), toString(userBoostAvailable), toString(poolWeight), toString(h), toString(udh), toString(uLastH), toString(userVote), toString(totalVotes)], ":") | |
506 | 506 | $Tuple3(userBoostAvaliableToClaimTotalNew, dataState, debug) | |
507 | 507 | } | |
508 | 508 | } | |
509 | 509 | } | |
510 | 510 | ||
511 | 511 | ||
512 | 512 | func lockActions (i,duration) = { | |
513 | 513 | let cfgArray = readConfigArrayOrFail() | |
514 | 514 | let assetIdStr = cfgArray[IdxCfgAssetId] | |
515 | 515 | let assetId = fromBase58String(assetIdStr) | |
516 | 516 | let minLockAmount = parseIntValue(cfgArray[IdxCfgMinLockAmount]) | |
517 | 517 | let minLockDuration = parseIntValue(cfgArray[IdxCfgMinLockDuration]) | |
518 | 518 | let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration]) | |
519 | 519 | if ((size(i.payments) != 1)) | |
520 | 520 | then throw("invalid payment - exact one payment must be attached") | |
521 | 521 | else { | |
522 | 522 | let pmt = i.payments[0] | |
523 | 523 | let pmtAmount = pmt.amount | |
524 | 524 | if ((assetId != value(pmt.assetId))) | |
525 | 525 | then throw((("invalid asset is in payment - " + assetIdStr) + " is expected")) | |
526 | 526 | else { | |
527 | 527 | let nextUserNumKEY = keyNextUserNum() | |
528 | 528 | let userAddressStr = toString(i.caller) | |
529 | 529 | let userIsExisting = isDefined(getString(keyUser2NumMapping(userAddressStr))) | |
530 | 530 | let userNumStr = if (userIsExisting) | |
531 | 531 | then value(getString(keyUser2NumMapping(userAddressStr))) | |
532 | 532 | else toString(iof(this, nextUserNumKEY)) | |
533 | 533 | let userNum = parseIntValue(userNumStr) | |
534 | 534 | let lockStart = height | |
535 | 535 | let startBlockKEY = keyLockParamStartBlock(userNumStr) | |
536 | 536 | let durationKEY = keyLockParamDuration(userNumStr) | |
537 | 537 | let userAmountKEY = keyLockParamUserAmount(userNumStr) | |
538 | 538 | if ((minLockAmount > pmtAmount)) | |
539 | 539 | then throw(("amount is less then minLockAmount=" + toString(minLockAmount))) | |
540 | 540 | else if ((minLockDuration > duration)) | |
541 | 541 | then throw(("passed duration is less then minLockDuration=" + toString(minLockDuration))) | |
542 | 542 | else if ((duration > maxLockDuration)) | |
543 | 543 | then throw(("passed duration is greater then maxLockDuration=" + toString(maxLockDuration))) | |
544 | 544 | else if (if (userIsExisting) | |
545 | 545 | then ((iof(this, startBlockKEY) + iof(this, durationKEY)) >= lockStart) | |
546 | 546 | else false) | |
547 | 547 | then throw("there is an active lock - consider to use increaseLock") | |
548 | 548 | else if ((ioz(this, userAmountKEY) > 0)) | |
549 | 549 | then throw(("there are locked WXs - consider to use increaseLock " + userAmountKEY)) | |
550 | 550 | else { | |
551 | 551 | let coeffX8 = fraction(duration, MULT8, maxLockDuration) | |
552 | 552 | let gWxAmountStart = fraction(pmtAmount, coeffX8, MULT8) | |
553 | 553 | let gWxParamsResultList = aal(invoke(mathContract, "calcGwxParamsREADONLY", [gWxAmountStart, lockStart, duration], nil)) | |
554 | 554 | let k = ai(gWxParamsResultList[0]) | |
555 | 555 | let b = ai(gWxParamsResultList[1]) | |
556 | 556 | let period = toString(ai(gWxParamsResultList[2])) | |
557 | 557 | let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent()) | |
558 | 558 | let emissionStart = iof(emissionContract, keyEmissionStartBlock()) | |
559 | 559 | let emissionEnd = iof(emissionContract, keyEmissionEndBlock()) | |
560 | 560 | let h = if ((height > emissionEnd)) | |
561 | 561 | then emissionEnd | |
562 | 562 | else height | |
563 | 563 | let dh = max([(h - emissionStart), 0]) | |
564 | 564 | let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr) | |
565 | 565 | let boostEmissionIntegral = (((wxEmissionPerBlock * dh) * 2) / 3) | |
566 | 566 | let userMaxBoostIntegralKEY = keyUserMaxBoostINTEGRAL(userNumStr) | |
567 | 567 | let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL() | |
568 | 568 | let userMaxBoostInt = ((gWxAmountStart * duration) / 2) | |
569 | 569 | let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY) | |
570 | 570 | let totalCachedGwxRaw = getTotalCachedGwx(false) | |
571 | 571 | let arr = if (userIsExisting) | |
572 | 572 | then nil | |
573 | 573 | else [IntegerEntry(nextUserNumKEY, (userNum + 1)), StringEntry(keyUser2NumMapping(userAddressStr), userNumStr), StringEntry(keyNum2UserMapping(userNumStr), userAddressStr)] | |
574 | 574 | $Tuple2(((((arr ++ LockParamsEntry(userAddressStr, userNumStr, pmtAmount, lockStart, duration, k, b, period)) ++ StatsEntry(pmtAmount, duration, 1, if (userIsExisting) | |
575 | 575 | then 0 | |
576 | 576 | else 1)) :+ HistoryEntry("lock", userAddressStr, pmtAmount, lockStart, duration, k, b, i)) ++ [IntegerEntry(userBoostEmissionLastIntegralKEY, boostEmissionIntegral), IntegerEntry(keyTotalCachedGwx(), (totalCachedGwxRaw + gWxAmountStart))]), gWxAmountStart) | |
577 | 577 | } | |
578 | 578 | } | |
579 | 579 | } | |
580 | 580 | } | |
581 | 581 | ||
582 | 582 | ||
583 | 583 | @Callable(i) | |
584 | 584 | func constructor (factoryAddressStr,lockAssetIdStr,minLockAmount,minDuration,maxDuration,mathContract) = { | |
585 | 585 | let checkCaller = mustManager(i) | |
586 | 586 | if ((checkCaller == checkCaller)) | |
587 | 587 | then ([IntegerEntry(keyNextUserNum(), 0), StringEntry(keyConfig(), formatConfig(lockAssetIdStr, minLockAmount, minDuration, maxDuration, mathContract)), StringEntry(keyFactoryAddress(), factoryAddressStr)] ++ StatsEntry(0, 0, 0, 0)) | |
588 | 588 | else throw("Strict value is not equal to itself.") | |
589 | 589 | } | |
590 | 590 | ||
591 | 591 | ||
592 | 592 | ||
593 | 593 | @Callable(i) | |
594 | 594 | func lockRef (duration,referrerAddress,signature) = { | |
595 | - | let $ | |
596 | - | let lockActionsResult = $ | |
597 | - | let gWxAmountStart = $ | |
595 | + | let $t02420824273 = lockActions(i, duration) | |
596 | + | let lockActionsResult = $t02420824273._1 | |
597 | + | let gWxAmountStart = $t02420824273._2 | |
598 | 598 | let referralAddress = toString(i.caller) | |
599 | 599 | let refInv = if (if ((referrerAddress == "")) | |
600 | 600 | then true | |
601 | 601 | else (signature == base58'')) | |
602 | 602 | then unit | |
603 | 603 | else invoke(referralsContractAddressOrFail, "createPair", [referralProgramName, referrerAddress, referralAddress, signature], nil) | |
604 | 604 | if ((refInv == refInv)) | |
605 | 605 | then { | |
606 | 606 | let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil) | |
607 | 607 | if ((updateRefActivity == updateRefActivity)) | |
608 | 608 | then $Tuple2(lockActionsResult, unit) | |
609 | 609 | else throw("Strict value is not equal to itself.") | |
610 | 610 | } | |
611 | 611 | else throw("Strict value is not equal to itself.") | |
612 | 612 | } | |
613 | 613 | ||
614 | 614 | ||
615 | 615 | ||
616 | 616 | @Callable(i) | |
617 | 617 | func lock (duration) = { | |
618 | - | let $ | |
619 | - | let lockActionsResult = $ | |
620 | - | let gWxAmountStart = $ | |
618 | + | let $t02473124796 = lockActions(i, duration) | |
619 | + | let lockActionsResult = $t02473124796._1 | |
620 | + | let gWxAmountStart = $t02473124796._2 | |
621 | 621 | let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil) | |
622 | 622 | if ((updateRefActivity == updateRefActivity)) | |
623 | 623 | then $Tuple2(lockActionsResult, unit) | |
624 | 624 | else throw("Strict value is not equal to itself.") | |
625 | 625 | } | |
626 | 626 | ||
627 | 627 | ||
628 | 628 | ||
629 | 629 | @Callable(i) | |
630 | 630 | func increaseLock (deltaDuration) = { | |
631 | 631 | let cfgArray = readConfigArrayOrFail() | |
632 | 632 | let assetIdStr = cfgArray[IdxCfgAssetId] | |
633 | 633 | let assetId = fromBase58String(assetIdStr) | |
634 | 634 | let minLockDuration = parseIntValue(cfgArray[IdxCfgMinLockDuration]) | |
635 | 635 | let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration]) | |
636 | 636 | let pmtAmount = extractOptionalPaymentAmountOrFail(i, assetId) | |
637 | 637 | let userAddressStr = toString(i.caller) | |
638 | 638 | let userRecordArray = readLockParamsRecordOrFail(userAddressStr) | |
639 | 639 | let userNumStr = userRecordArray[IdxLockUserNum] | |
640 | 640 | let userAmount = parseIntValue(userRecordArray[IdxLockAmount]) | |
641 | 641 | let lockStart = parseIntValue(userRecordArray[IdxLockStart]) | |
642 | 642 | let lockDuration = parseIntValue(userRecordArray[IdxLockDuration]) | |
643 | 643 | let lockEnd = (lockStart + lockDuration) | |
644 | 644 | let remainingDuration = max([(lockEnd - height), 0]) | |
645 | 645 | let userAmountNew = (userAmount + pmtAmount) | |
646 | 646 | let lockDurationNew = (remainingDuration + deltaDuration) | |
647 | 647 | if ((0 > deltaDuration)) | |
648 | 648 | then throw("duration is less then zero") | |
649 | 649 | else if ((minLockDuration > lockDurationNew)) | |
650 | 650 | then throw(("lockDurationNew is less then minLockDuration=" + toString(minLockDuration))) | |
651 | 651 | else if ((lockDurationNew > maxLockDuration)) | |
652 | 652 | then throw(("deltaDuration + existedLockDuration is greater then maxLockDuration=" + toString(maxLockDuration))) | |
653 | 653 | else { | |
654 | 654 | let coeffX8 = fraction(lockDurationNew, MULT8, maxLockDuration) | |
655 | 655 | let gWxAmountStart = fraction(userAmountNew, coeffX8, MULT8) | |
656 | 656 | let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil) | |
657 | 657 | if ((updateRefActivity == updateRefActivity)) | |
658 | 658 | then { | |
659 | 659 | let lockStartNew = height | |
660 | 660 | let gWxParamsResultList = aal(invoke(mathContract, "calcGwxParamsREADONLY", [gWxAmountStart, lockStartNew, lockDurationNew], nil)) | |
661 | 661 | let k = ai(gWxParamsResultList[0]) | |
662 | 662 | let b = ai(gWxParamsResultList[1]) | |
663 | 663 | let period = toString(ai(gWxParamsResultList[2])) | |
664 | 664 | let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent()) | |
665 | 665 | let emissionStart = iof(emissionContract, keyEmissionStartBlock()) | |
666 | 666 | let emissionEnd = iof(emissionContract, keyEmissionEndBlock()) | |
667 | 667 | let h = if ((height > emissionEnd)) | |
668 | 668 | then emissionEnd | |
669 | 669 | else height | |
670 | 670 | let dh = max([(h - emissionStart), 0]) | |
671 | 671 | let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr) | |
672 | 672 | let userBoostEmissionLastIntegral = ioz(this, userBoostEmissionLastIntegralKEY) | |
673 | 673 | let boostEmissionIntegral = (((wxEmissionPerBlock * dh) * 2) / 3) | |
674 | 674 | let userBoostEmissionIntegral = (boostEmissionIntegral - userBoostEmissionLastIntegral) | |
675 | 675 | if ((0 > userBoostEmissionIntegral)) | |
676 | 676 | then throw("wrong calculations") | |
677 | 677 | else { | |
678 | 678 | let userMaxBoostIntegralKEY = keyUserMaxBoostINTEGRAL(userNumStr) | |
679 | 679 | let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL() | |
680 | 680 | let userMaxBoostInt = ioz(this, userMaxBoostIntegralKEY) | |
681 | 681 | let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY) | |
682 | 682 | let currUserGwx = calcCurrentGwxAmount(userAddressStr) | |
683 | 683 | let gwxDiff = (gWxAmountStart - currUserGwx) | |
684 | 684 | if ((0 > gwxDiff)) | |
685 | 685 | then throw(("gwxDiff is less then 0: " + toString(gwxDiff))) | |
686 | 686 | else { | |
687 | 687 | let totalCachedGwxRaw = getTotalCachedGwx(false) | |
688 | 688 | let totalCachedGwxCorrected = getTotalCachedGwx(true) | |
689 | 689 | let userBoostAvalaibleToClaimTotalKEY = keyUserBoostAvalaibleToClaimTotal(userNumStr) | |
690 | 690 | let userBoostAvaliableToClaimTotal = ioz(this, userBoostAvalaibleToClaimTotalKEY) | |
691 | 691 | let userBoostAvaliableToClaimTotalNew = fraction(userBoostEmissionIntegral, currUserGwx, totalCachedGwxCorrected) | |
692 | 692 | let userMaxBoostIntNew = ((gWxAmountStart * lockDurationNew) / 2) | |
693 | 693 | let remainingUserMaxBoostInt = ((currUserGwx * remainingDuration) / 2) | |
694 | 694 | let userMaxBoostIntDiff = (userMaxBoostIntNew - remainingUserMaxBoostInt) | |
695 | 695 | (((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))]) | |
696 | 696 | } | |
697 | 697 | } | |
698 | 698 | } | |
699 | 699 | else throw("Strict value is not equal to itself.") | |
700 | 700 | } | |
701 | 701 | } | |
702 | 702 | ||
703 | 703 | ||
704 | 704 | ||
705 | 705 | @Callable(i) | |
706 | 706 | func claimWxBoost (lpAssetIdStr,userAddressStr) = if ((stakingContract != i.caller)) | |
707 | 707 | then throw("permissions denied") | |
708 | 708 | else { | |
709 | - | let $ | |
710 | - | let userBoostAvailable = $ | |
711 | - | let dataState = $ | |
712 | - | let debug = $ | |
709 | + | let $t02977729879 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false) | |
710 | + | let userBoostAvailable = $t02977729879._1 | |
711 | + | let dataState = $t02977729879._2 | |
712 | + | let debug = $t02977729879._3 | |
713 | 713 | $Tuple2(dataState, [userBoostAvailable]) | |
714 | 714 | } | |
715 | 715 | ||
716 | 716 | ||
717 | 717 | ||
718 | 718 | @Callable(i) | |
719 | 719 | func claimWxBoostREADONLY (lpAssetIdStr,userAddressStr) = { | |
720 | - | let $ | |
721 | - | let userBoostAvailable = $ | |
722 | - | let dataState = $ | |
723 | - | let debug = $ | |
720 | + | let $t03001130112 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true) | |
721 | + | let userBoostAvailable = $t03001130112._1 | |
722 | + | let dataState = $t03001130112._2 | |
723 | + | let debug = $t03001130112._3 | |
724 | 724 | $Tuple2(nil, [userBoostAvailable, debug]) | |
725 | 725 | } | |
726 | 726 | ||
727 | 727 | ||
728 | 728 | ||
729 | 729 | @Callable(i) | |
730 | 730 | func unlock (userAddress) = { | |
731 | 731 | let userRecordArray = readLockParamsRecordOrFail(userAddress) | |
732 | 732 | let userNumStr = userRecordArray[IdxLockUserNum] | |
733 | 733 | let userAmount = parseIntValue(userRecordArray[IdxLockAmount]) | |
734 | 734 | let lockStart = parseIntValue(userRecordArray[IdxLockStart]) | |
735 | 735 | let lockDuration = parseIntValue(userRecordArray[IdxLockDuration]) | |
736 | 736 | let lockEnd = (lockStart + lockDuration) | |
737 | 737 | let cfgArray = readConfigArrayOrFail() | |
738 | 738 | let assetId = fromBase58String(cfgArray[IdxCfgAssetId]) | |
739 | 739 | if ((lockEnd >= height)) | |
740 | 740 | then throw((("wait " + toString(lockEnd)) + " to unlock")) | |
741 | 741 | else if ((0 >= userAmount)) | |
742 | 742 | then throw("nothing to unlock") | |
743 | 743 | else { | |
744 | 744 | let period = valueOrElse(getInteger(mathContract, keyNextPeriod()), 0) | |
745 | 745 | (((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)) | |
746 | 746 | } | |
747 | 747 | } | |
748 | 748 | ||
749 | 749 | ||
750 | 750 | ||
751 | 751 | @Callable(i) | |
752 | 752 | func gwxUserInfoREADONLY (userAddress) = { | |
753 | 753 | let gwxAmount = calcCurrentGwxAmount(userAddress) | |
754 | 754 | $Tuple2(nil, [gwxAmount]) | |
755 | 755 | } | |
756 | 756 | ||
757 | 757 | ||
758 | 758 | ||
759 | 759 | @Callable(i) | |
760 | 760 | func getUserGwxAmountAtHeightREADONLY (userAddress,targetHeight) = { | |
761 | 761 | let gwxAmount = calcUserGwxAmountAtHeight(userAddress, targetHeight) | |
762 | 762 | $Tuple2(nil, gwxAmount) | |
763 | 763 | } | |
764 | 764 | ||
765 | 765 | ||
766 | 766 | ||
767 | 767 | @Callable(i) | |
768 | 768 | func getTotalCachedGwxREADONLY () = $Tuple2(nil, getTotalCachedGwx(true)) | |
769 | 769 | ||
770 | 770 | ||
771 | 771 | ||
772 | 772 | @Callable(i) | |
773 | 773 | func setManager (pendingManagerPublicKey) = { | |
774 | 774 | let checkCaller = mustManager(i) | |
775 | 775 | if ((checkCaller == checkCaller)) | |
776 | 776 | then { | |
777 | 777 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
778 | 778 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
779 | 779 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
780 | 780 | else throw("Strict value is not equal to itself.") | |
781 | 781 | } | |
782 | 782 | else throw("Strict value is not equal to itself.") | |
783 | 783 | } | |
784 | 784 | ||
785 | 785 | ||
786 | 786 | ||
787 | 787 | @Callable(i) | |
788 | 788 | func confirmManager () = { | |
789 | 789 | let pm = pendingManagerPublicKeyOrUnit() | |
790 | 790 | let hasPM = if (isDefined(pm)) | |
791 | 791 | then true | |
792 | 792 | else throw("No pending manager") | |
793 | 793 | if ((hasPM == hasPM)) | |
794 | 794 | then { | |
795 | 795 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
796 | 796 | then true | |
797 | 797 | else throw("You are not pending manager") | |
798 | 798 | if ((checkPM == checkPM)) | |
799 | 799 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
800 | 800 | else throw("Strict value is not equal to itself.") | |
801 | 801 | } | |
802 | 802 | else throw("Strict value is not equal to itself.") | |
803 | 803 | } | |
804 | 804 | ||
805 | 805 | ||
806 | 806 | @Verifier(tx) | |
807 | 807 | func verify () = { | |
808 | 808 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
809 | 809 | case pk: ByteVector => | |
810 | 810 | pk | |
811 | 811 | case _: Unit => | |
812 | 812 | tx.senderPublicKey | |
813 | 813 | case _ => | |
814 | 814 | throw("Match error") | |
815 | 815 | } | |
816 | 816 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
817 | 817 | } | |
818 | 818 |
github/deemru/w8io/026f985 104.24 ms ◑