tx · aLSqKiHxtoT4rdT91jZAVZ3pSyjifCEEgVfR77CxoUu 3Mp5kisFrqESzrXxAMEPk2k69zpeF41czEE: -0.02500000 Waves 2022.07.27 09:53 [2157890] smart account 3Mp5kisFrqESzrXxAMEPk2k69zpeF41czEE > SELF 0.00000000 Waves
{ "type": 13, "id": "aLSqKiHxtoT4rdT91jZAVZ3pSyjifCEEgVfR77CxoUu", "fee": 2500000, "feeAssetId": null, "timestamp": 1658904823693, "version": 1, "sender": "3Mp5kisFrqESzrXxAMEPk2k69zpeF41czEE", "senderPublicKey": "G349Uq3FTox7dRNLeAfAQeoACvwZ9iEnVSaHcEYn6j8J", "proofs": [ "51DXDgesN6ji6T2UiZcyySvhuHxiSpELEgY4S9QGeZ3Y1VcHRSFD4uoqo3toCNnNVNJ7eeNTYLgFbDQ5HhKddceX" ], "script": "base64:BgJwCAISABIDCgEBEgASABIICgYCAQEBAQESABIDCgEIEgQKAggBEgMKAQgSBAoCCAESAwoBCBIDCgEIEgUKAwEBARIFCgMBAQESBgoECAgIARIDCgEIEgMKAQgSABIDCgEIEgcKBQgICAgIEgMKAQgSAE8AA1NFUAICX18ACVVTRVJERVBUSAAaAAVTQ0FMRQDoBwAFTVVMVDgAgMLXLwAKemVyb0JpZ0ludAkAtgIBAAAAFHByb2Nlc3NpbmdTdGFnZVRvdGFsAAAAFXByb2Nlc3NpbmdTdGFnZVNoYXJlcwABAQ5nZXROdW1iZXJCeUtleQEDa2V5CQELdmFsdWVPckVsc2UCCQCaCAIFBHRoaXMFA2tleQAAAQ9nZXROdW1iZXJPckZhaWwBA2tleQkBE3ZhbHVlT3JFcnJvck1lc3NhZ2UCCQCaCAIFBHRoaXMFA2tleQkArAICCQCsAgICD21hbmRhdG9yeSB0aGlzLgUDa2V5Ag8gaXMgbm90IGRlZmluZWQBDmdldFN0cmluZ0J5S2V5AQNrZXkJAQt2YWx1ZU9yRWxzZQIJAJ0IAgUEdGhpcwUDa2V5AgABD2dldFN0cmluZ09yRmFpb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ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECdHgBBnZlcmlmeQAED3RhcmdldFB1YmxpY0tleQQHJG1hdGNoMAkBFm1hbmFnZXJQdWJsaWNLZXlPclVuaXQAAwkAAQIFByRtYXRjaDACCkJ5dGVWZWN0b3IEAnBrBQckbWF0Y2gwBQJwawMJAAECBQckbWF0Y2gwAgRVbml0CAUCdHgPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFD3RhcmdldFB1YmxpY0tlechWvK8=", "chainId": 84, "height": 2157890, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CSX47KyqYvnfvjfbp7jmtWXmW78HD78aKQ3HGbZvVasQ Next: A1ichLYXomENmwL7xKAmyQgqWz8tiegia1TctBb2uBkL Diff:
Old | New | Differences | |
---|---|---|---|
377 | 377 | then { | |
378 | 378 | let processingActions = if (((usersCount - 1) > currentUser)) | |
379 | 379 | then [IntegerEntry(keyNextProcessedUser(), (currentUser + 1))] | |
380 | - | else [IntegerEntry(keyNextProcessedPeriod(), (currentPeriod + 1)), IntegerEntry(keyNextProcessedUser(), 0)] | |
380 | + | else [IntegerEntry(keyNextProcessedPeriod(), (currentPeriod + 1)), IntegerEntry(keyNextProcessedUser(), 0), DeleteEntry(keyProcessingStage())] | |
381 | 381 | $Tuple2(processingActions, true) | |
382 | 382 | } | |
383 | 383 | else throw("Strict value is not equal to itself.") | |
457 | 457 | @Callable(i) | |
458 | 458 | func claimReward () = { | |
459 | 459 | let address = toString(i.caller) | |
460 | - | let $ | |
461 | - | let period = $ | |
462 | - | let amountFromMatcher = $ | |
463 | - | let amountFromEmission = $ | |
464 | - | let userIdx = $ | |
465 | - | let cfgArray = $ | |
466 | - | let nextProcessedPeriod = $ | |
460 | + | let $t01933519461 = commonClaimReward(address, unit) | |
461 | + | let period = $t01933519461._1 | |
462 | + | let amountFromMatcher = $t01933519461._2 | |
463 | + | let amountFromEmission = $t01933519461._3 | |
464 | + | let userIdx = $t01933519461._4 | |
465 | + | let cfgArray = $t01933519461._5 | |
466 | + | let nextProcessedPeriod = $t01933519461._6 | |
467 | 467 | $Tuple2([IntegerEntry(keyNextUnlaimedPeriodOfUser(userIdx), period), ScriptTransfer(i.caller, (amountFromMatcher + amountFromEmission), fromBase58String(cfgArray[IdxCfgAssetId])), HistoryEntry("claim", address, amountFromMatcher, amountFromEmission, period, nextProcessedPeriod, i)], [amountFromMatcher, amountFromEmission]) | |
468 | 468 | } | |
469 | 469 | ||
480 | 480 | ||
481 | 481 | @Callable(i) | |
482 | 482 | func claimRewardPaginatedREADONLY (address,startPeriod) = { | |
483 | - | let $ | |
483 | + | let $t02020420321 = commonClaimReward(address, if ((0 > startPeriod)) | |
484 | 484 | then unit | |
485 | 485 | else startPeriod) | |
486 | - | let period = $ | |
487 | - | let fromMatcher = $ | |
488 | - | let fromEmission = $ | |
486 | + | let period = $t02020420321._1 | |
487 | + | let fromMatcher = $t02020420321._2 | |
488 | + | let fromEmission = $t02020420321._3 | |
489 | 489 | let amount = (fromMatcher + fromEmission) | |
490 | 490 | $Tuple2(nil, $Tuple2(amount, period)) | |
491 | 491 | } | |
494 | 494 | ||
495 | 495 | @Callable(i) | |
496 | 496 | func claimRewardDetailedREADONLY (address) = { | |
497 | - | let $ | |
498 | - | let ignored = $ | |
499 | - | let fromMatcher = $ | |
500 | - | let fromEmission = $ | |
497 | + | let $t02057220647 = commonClaimReward(address, unit) | |
498 | + | let ignored = $t02057220647._1 | |
499 | + | let fromMatcher = $t02057220647._2 | |
500 | + | let fromEmission = $t02057220647._3 | |
501 | 501 | $Tuple2(nil, makeString(["%d%d%d", toString((fromMatcher + fromEmission)), toString(fromMatcher), toString(fromEmission)], SEP)) | |
502 | 502 | } | |
503 | 503 | ||
505 | 505 | ||
506 | 506 | @Callable(i) | |
507 | 507 | func claimRewardDetailedPaginatedREADONLY (address,startPeriod) = { | |
508 | - | let $ | |
508 | + | let $t02094321060 = commonClaimReward(address, if ((0 > startPeriod)) | |
509 | 509 | then unit | |
510 | 510 | else startPeriod) | |
511 | - | let period = $ | |
512 | - | let fromMatcher = $ | |
513 | - | let fromEmission = $ | |
511 | + | let period = $t02094321060._1 | |
512 | + | let fromMatcher = $t02094321060._2 | |
513 | + | let fromEmission = $t02094321060._3 | |
514 | 514 | $Tuple2(nil, $Tuple2(makeString(["%d%d%d", toString((fromMatcher + fromEmission)), toString(fromMatcher), toString(fromEmission)], SEP), period)) | |
515 | 515 | } | |
516 | 516 | ||
601 | 601 | let ann = (amp * nCoins) | |
602 | 602 | let arr = [1, 2, 3, 4, 5, 6, 7] | |
603 | 603 | func calc (acc,cur) = { | |
604 | - | let $ | |
605 | - | let d = $ | |
606 | - | let dPrev = $ | |
604 | + | let $t02454924738 = acc | |
605 | + | let d = $t02454924738._1 | |
606 | + | let dPrev = $t02454924738._2 | |
607 | 607 | let dp = (((d * d) * d) / (((x1 * x2) * nCoins) * nCoins)) | |
608 | 608 | let dNext = (((((ann * s) / aPrecision) + (dp * nCoins)) * d) / ((((ann - aPrecision) * d) / aPrecision) + ((nCoins + toBigInt(1)) * dp))) | |
609 | 609 | $Tuple2(dNext, d) | |
610 | 610 | } | |
611 | 611 | ||
612 | - | let $ | |
612 | + | let $t02495125001 = { | |
613 | 613 | let $l = arr | |
614 | 614 | let $s = size($l) | |
615 | 615 | let $acc0 = $Tuple2(s, unit) | |
623 | 623 | ||
624 | 624 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7) | |
625 | 625 | } | |
626 | - | let dNext = $ | |
627 | - | let dPrev = $ | |
626 | + | let dNext = $t02495125001._1 | |
627 | + | let dPrev = $t02495125001._2 | |
628 | 628 | let dDiff = abs((dNext - value(dPrev))) | |
629 | 629 | if ((targetPrecision >= dDiff)) | |
630 | 630 | then $Tuple2(nil, toString(dNext)) |
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 USERDEPTH = 26 | |
7 | 7 | ||
8 | 8 | let SCALE = 1000 | |
9 | 9 | ||
10 | 10 | let MULT8 = 100000000 | |
11 | 11 | ||
12 | 12 | let zeroBigInt = toBigInt(0) | |
13 | 13 | ||
14 | 14 | let processingStageTotal = 0 | |
15 | 15 | ||
16 | 16 | let processingStageShares = 1 | |
17 | 17 | ||
18 | 18 | func getNumberByKey (key) = valueOrElse(getInteger(this, key), 0) | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | func getNumberOrFail (key) = valueOrErrorMessage(getInteger(this, key), (("mandatory this." + key) + " is not defined")) | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | func getStringByKey (key) = valueOrElse(getString(this, key), "") | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (("mandatory this." + key) + " is not defined")) | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func abs (val) = if ((zeroBigInt > val)) | |
31 | 31 | then -(val) | |
32 | 32 | else val | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | let keyMaxDepth = "%s__maxDepth" | |
36 | 36 | ||
37 | 37 | let maxDepthDefault = 30 | |
38 | 38 | ||
39 | 39 | let maxDepth = valueOrElse(getInteger(this, keyMaxDepth), maxDepthDefault) | |
40 | 40 | ||
41 | 41 | func keyFactoryAddress () = "%s%s__config__factoryAddress" | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | let factoryAddressStr = getStringOrFail(keyFactoryAddress()) | |
45 | 45 | ||
46 | 46 | let factoryContract = addressFromStringValue(factoryAddressStr) | |
47 | 47 | ||
48 | 48 | func keyEmissionAddress () = "%s%s__config__emissionAddress" | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func keyNumToUserMapping (num) = makeString(["%s%s%s", "mapping", "num2user", toString(num)], SEP) | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | let keyReferralProgramName = makeString(["%s%s", "referral", "programName"], SEP) | |
55 | 55 | ||
56 | 56 | let referralProgramNameDefault = "wxlock" | |
57 | 57 | ||
58 | 58 | let referralProgramName = valueOrElse(getString(this, keyReferralProgramName), referralProgramNameDefault) | |
59 | 59 | ||
60 | 60 | let keyReferralMinGWxAmount = makeString(["%s%s", "referral", "minGWxAmount"], SEP) | |
61 | 61 | ||
62 | 62 | let referralMinGWxAmountDefault = (500 * MULT8) | |
63 | 63 | ||
64 | 64 | let referralMinGWxAmount = valueOrElse(getInteger(this, keyReferralMinGWxAmount), referralMinGWxAmountDefault) | |
65 | 65 | ||
66 | 66 | let keyReferrerRewardPermille = makeString(["%s%s", "referral", "referrerRewardPermille"], SEP) | |
67 | 67 | ||
68 | 68 | let referrerRewardPermilleDefault = 50 | |
69 | 69 | ||
70 | 70 | let referrerRewardPermille = valueOrElse(getInteger(this, keyReferrerRewardPermille), referrerRewardPermilleDefault) | |
71 | 71 | ||
72 | 72 | let keyReferralRewardPermille = makeString(["%s%s", "referral", "referralRewardPermille"], SEP) | |
73 | 73 | ||
74 | 74 | let referralRewardPermilleDefault = 50 | |
75 | 75 | ||
76 | 76 | let referralRewardPermille = valueOrElse(getInteger(this, keyReferralRewardPermille), referralRewardPermilleDefault) | |
77 | 77 | ||
78 | 78 | func keyReferrer (referralAddress) = makeString(["%s%s%s", "referrer", referralProgramName, referralAddress], SEP) | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | let emissionAddressStr = getStringOrFail(keyEmissionAddress()) | |
82 | 82 | ||
83 | 83 | let emissionContract = addressFromStringValue(emissionAddressStr) | |
84 | 84 | ||
85 | 85 | let IdxCfgAssetId = 1 | |
86 | 86 | ||
87 | 87 | let IdxCfgPacemakerAddress = 2 | |
88 | 88 | ||
89 | 89 | let IdxCfgBoostingContract = 3 | |
90 | 90 | ||
91 | 91 | let IdxCfgMaxDepth = 4 | |
92 | 92 | ||
93 | 93 | func keyConfig () = "%s__config" | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func readConfigArrayOrFail () = split(getStringOrFail(keyConfig()), SEP) | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func formatConfig (wxAssetIdStr,matcherPacemakerAddressStr,boostingContractAddressStr,maxDepth) = makeString(["%s%s%s%d", wxAssetIdStr, matcherPacemakerAddressStr, boostingContractAddressStr, toString(maxDepth)], SEP) | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func boostingContractOrFail () = { | |
103 | 103 | let cfgArray = readConfigArrayOrFail() | |
104 | 104 | valueOrErrorMessage(addressFromString(cfgArray[IdxCfgBoostingContract]), "boosting contract address is not defined") | |
105 | 105 | } | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func keyGwxRewardEmissionStartHeight () = "%s%s__gwxRewardEmissionPart__startHeight" | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func keyUsersCount () = "%s__nextUserNum" | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func keyRatePerBlockCurrent () = "%s%s__ratePerBlock__current" | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func keyPoolWeightVirtual () = "%s%s__poolWeight__GWXvirtualPOOL" | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func keyNextProcessedUser () = "%s__nextProcessedUser" | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func keyLatestPeriod () = "%s__latestPeriod" | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func keyNextPeriod () = "%s__nextPeriod" | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func keyProcessingStage () = "%s__processingStage" | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func keyNextProcessedPeriod () = "%s__nextProcessedPeriod" | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func keyNextUnlaimedPeriodOfUser (userIndex) = makeString(["%s%d__nextClaimedPeriod", toString(userIndex)], SEP) | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | func keyLastProcessedPeriodOfUser (userIndex) = makeString(["%s%d__lastProcessedPeriod", toString(userIndex)], SEP) | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | func keyHeightForPeriod (period) = makeString(["%s%d__startHeightForPeriod", toString(period)], SEP) | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | func keyAuxEmissionRewardForPeriod (period) = makeString(["%s%d__auxEmissionReward", toString(period)], SEP) | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | func keyTotalAmountForPeriod (period) = makeString(["%s%d__totalAmountForPeriod", toString(period)], SEP) | |
148 | 148 | ||
149 | 149 | ||
150 | 150 | func keyLastPayoutInfo () = "%s__lastPayoutInfo" | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | func PeriodPayoutInfo (period,matcherReward,emissionReward) = makeString(["%d%d%d", toString(period), toString(matcherReward), toString(emissionReward)], SEP) | |
154 | 154 | ||
155 | 155 | ||
156 | 156 | func keyPayoutHistoryInfo (period) = makeString(["%s%s%d__payouts__history", toString(period)], SEP) | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | func keyTotalWeightForPeriod (period) = makeString(["%s%d__totalWeightForPeriod", toString(period)], SEP) | |
160 | 160 | ||
161 | 161 | ||
162 | 162 | func keyUserKValueForPeriod (period,userIndex) = makeString(["%s%d%s%d__paramByPeriod", toString(userIndex), "k", toString(period)], SEP) | |
163 | 163 | ||
164 | 164 | ||
165 | 165 | func keyUserBValueForPeriod (period,userIndex) = makeString(["%s%d%s%d__paramByPeriod", toString(userIndex), "b", toString(period)], SEP) | |
166 | 166 | ||
167 | 167 | ||
168 | 168 | func keyUserWeightForPeriod (period,userIndex) = makeString(["%s%d%s%d__paramByPeriod", toString(userIndex), "weight", toString(period)], SEP) | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | func keyReferralsContractAddress () = makeString(["%s%s", "config", "referralsContractAddress"], SEP) | |
172 | 172 | ||
173 | 173 | ||
174 | 174 | let referralsContractAddressOrFail = addressFromStringValue(getStringOrFail(keyReferralsContractAddress())) | |
175 | 175 | ||
176 | 176 | func HistoryEntry (type,user,amountFromMatcher,amountFromEmission,currentPeriod,latestPeriod,i) = { | |
177 | 177 | let historyKEY = makeString(["%s%s%s%s__history", type, user, toBase58String(i.transactionId)], SEP) | |
178 | 178 | let historyDATA = makeString(["%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(amountFromMatcher), toString(amountFromEmission), toString(currentPeriod), toString(latestPeriod)], SEP) | |
179 | 179 | StringEntry(historyKEY, historyDATA) | |
180 | 180 | } | |
181 | 181 | ||
182 | 182 | ||
183 | 183 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
184 | 184 | ||
185 | 185 | ||
186 | 186 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
187 | 187 | ||
188 | 188 | ||
189 | 189 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
190 | 190 | case s: String => | |
191 | 191 | fromBase58String(s) | |
192 | 192 | case _: Unit => | |
193 | 193 | unit | |
194 | 194 | case _ => | |
195 | 195 | throw("Match error") | |
196 | 196 | } | |
197 | 197 | ||
198 | 198 | ||
199 | 199 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
200 | 200 | case s: String => | |
201 | 201 | fromBase58String(s) | |
202 | 202 | case _: Unit => | |
203 | 203 | unit | |
204 | 204 | case _ => | |
205 | 205 | throw("Match error") | |
206 | 206 | } | |
207 | 207 | ||
208 | 208 | ||
209 | 209 | func mustManager (i) = { | |
210 | 210 | let pd = throw("Permission denied") | |
211 | 211 | match managerPublicKeyOrUnit() { | |
212 | 212 | case pk: ByteVector => | |
213 | 213 | if ((i.callerPublicKey == pk)) | |
214 | 214 | then true | |
215 | 215 | else pd | |
216 | 216 | case _: Unit => | |
217 | 217 | if ((i.caller == this)) | |
218 | 218 | then true | |
219 | 219 | else pd | |
220 | 220 | case _ => | |
221 | 221 | throw("Match error") | |
222 | 222 | } | |
223 | 223 | } | |
224 | 224 | ||
225 | 225 | ||
226 | 226 | func calcUserWeight (boostingContractAddress,heightForPeriod,period,userIndex) = { | |
227 | 227 | let kLast = keyLastProcessedPeriodOfUser(userIndex) | |
228 | 228 | let kKey = keyUserKValueForPeriod(period, userIndex) | |
229 | 229 | let kRaw = getInteger(boostingContractAddress, kKey) | |
230 | 230 | let kUserWeight = keyUserWeightForPeriod(period, userIndex) | |
231 | 231 | if (isDefined(kRaw)) | |
232 | 232 | then { | |
233 | 233 | let k = value(kRaw) | |
234 | 234 | let b = value(getInteger(boostingContractAddress, keyUserBValueForPeriod(period, userIndex))) | |
235 | 235 | let w = ((k * heightForPeriod) + b) | |
236 | 236 | if ((w > 0)) | |
237 | 237 | then $Tuple2((w / SCALE), [IntegerEntry(kLast, period), IntegerEntry(kUserWeight, w)]) | |
238 | 238 | else $Tuple2(0, nil) | |
239 | 239 | } | |
240 | 240 | else { | |
241 | 241 | let p = getInteger(this, kLast) | |
242 | 242 | if (if (isDefined(p)) | |
243 | 243 | then (period >= value(p)) | |
244 | 244 | else false) | |
245 | 245 | then { | |
246 | 246 | let pv = value(p) | |
247 | 247 | let k = value(getInteger(boostingContractAddress, keyUserKValueForPeriod(pv, userIndex))) | |
248 | 248 | let b = value(getInteger(boostingContractAddress, keyUserBValueForPeriod(pv, userIndex))) | |
249 | 249 | let w = ((k * heightForPeriod) + b) | |
250 | 250 | if ((w > 0)) | |
251 | 251 | then $Tuple2((w / SCALE), [IntegerEntry(kUserWeight, w)]) | |
252 | 252 | else $Tuple2(0, nil) | |
253 | 253 | } | |
254 | 254 | else $Tuple2(0, nil) | |
255 | 255 | } | |
256 | 256 | } | |
257 | 257 | ||
258 | 258 | ||
259 | 259 | func calcUserWeightForClaim (boostingContractAddress,heightForPeriod,period,userIndex) = { | |
260 | 260 | let kUserWeight = keyUserWeightForPeriod(period, userIndex) | |
261 | 261 | let userWeightOrUnit = getInteger(kUserWeight) | |
262 | 262 | match userWeightOrUnit { | |
263 | 263 | case _: Unit => | |
264 | 264 | 0 | |
265 | 265 | case w: Int => | |
266 | 266 | (w / SCALE) | |
267 | 267 | case _ => | |
268 | 268 | throw("Match error") | |
269 | 269 | } | |
270 | 270 | } | |
271 | 271 | ||
272 | 272 | ||
273 | 273 | func getUserIndexByAddress (boostingContractAddressStr,userAddress) = { | |
274 | 274 | let key = makeString(["%s%s%s", "mapping", "user2num", userAddress], SEP) | |
275 | 275 | parseIntValue(valueOrErrorMessage(getString(Address(fromBase58String(boostingContractAddressStr)), key), ((("User address " + userAddress) + " is not found in boosting contract data, key=") + key))) | |
276 | 276 | } | |
277 | 277 | ||
278 | 278 | ||
279 | 279 | func nextPeriod () = getNumberByKey(keyNextPeriod()) | |
280 | 280 | ||
281 | 281 | ||
282 | 282 | func invokeClaim (boostingContract,period,user,depth,totalFromMatcher,totalFromEmission) = { | |
283 | 283 | let result = invoke(this, "claimNextBatch", [boostingContract, period, user, depth, totalFromMatcher, totalFromEmission], nil) | |
284 | 284 | if ((result == result)) | |
285 | 285 | then match result { | |
286 | 286 | case r: (Int, Int, Int) => | |
287 | 287 | r | |
288 | 288 | case _ => | |
289 | 289 | throw("Incorrect invoke result") | |
290 | 290 | } | |
291 | 291 | else throw("Strict value is not equal to itself.") | |
292 | 292 | } | |
293 | 293 | ||
294 | 294 | ||
295 | 295 | func claimInternal (boostingContract,currentPeriod,currentUser,depth,userAccumulatedMatcher,userAccumulatedEmission) = { | |
296 | 296 | let boostingContractAddress = Address(boostingContract) | |
297 | 297 | let latestPeriod = getNumberByKey(keyNextProcessedPeriod()) | |
298 | 298 | let totalWeight = getNumberByKey(keyTotalWeightForPeriod(currentPeriod)) | |
299 | 299 | let heightForPeriod = getNumberByKey(keyHeightForPeriod(currentPeriod)) | |
300 | 300 | let userWeight = calcUserWeightForClaim(boostingContractAddress, heightForPeriod, currentPeriod, currentUser) | |
301 | 301 | let userAmountMatcherForPeriod = fraction(getNumberByKey(keyTotalAmountForPeriod(currentPeriod)), userWeight, totalWeight) | |
302 | 302 | let userAmountEmissionForPeriod = fraction(getNumberByKey(keyAuxEmissionRewardForPeriod(currentPeriod)), userWeight, totalWeight) | |
303 | 303 | if (if ((0 >= depth)) | |
304 | 304 | then true | |
305 | 305 | else ((currentPeriod + 1) >= latestPeriod)) | |
306 | 306 | then $Tuple3((currentPeriod + 1), (userAccumulatedMatcher + userAmountMatcherForPeriod), (userAccumulatedEmission + userAmountEmissionForPeriod)) | |
307 | 307 | else invokeClaim(boostingContract, (currentPeriod + 1), currentUser, (depth - 1), (userAccumulatedMatcher + userAmountMatcherForPeriod), (userAccumulatedEmission + userAmountEmissionForPeriod)) | |
308 | 308 | } | |
309 | 309 | ||
310 | 310 | ||
311 | 311 | func commonClaimReward (userAddress,startPeriod) = { | |
312 | 312 | let cfgArray = readConfigArrayOrFail() | |
313 | 313 | let userIdx = getUserIndexByAddress(cfgArray[IdxCfgBoostingContract], userAddress) | |
314 | 314 | let currentPeriod = if ((startPeriod != unit)) | |
315 | 315 | then value(startPeriod) | |
316 | 316 | else getNumberByKey(keyNextUnlaimedPeriodOfUser(userIdx)) | |
317 | 317 | let nextProcessedPeriod = getNumberByKey(keyNextProcessedPeriod()) | |
318 | 318 | if ((currentPeriod >= nextProcessedPeriod)) | |
319 | 319 | then throw("Nothing to claim") | |
320 | 320 | else { | |
321 | 321 | let boostingContract = fromBase58String(cfgArray[IdxCfgBoostingContract]) | |
322 | 322 | let $t01256912695 = claimInternal(boostingContract, currentPeriod, userIdx, USERDEPTH, 0, 0) | |
323 | 323 | let period = $t01256912695._1 | |
324 | 324 | let amountFromMatcher = $t01256912695._2 | |
325 | 325 | let amountFromEmission = $t01256912695._3 | |
326 | 326 | $Tuple6(period, amountFromMatcher, amountFromEmission, userIdx, cfgArray, nextProcessedPeriod) | |
327 | 327 | } | |
328 | 328 | } | |
329 | 329 | ||
330 | 330 | ||
331 | 331 | @Callable(i) | |
332 | 332 | func finalizeHelper () = { | |
333 | 333 | let processingStage = valueOrElse(getInteger(keyProcessingStage()), processingStageTotal) | |
334 | 334 | let currentPeriod = getNumberByKey(keyNextProcessedPeriod()) | |
335 | 335 | let currentUser = getNumberByKey(keyNextProcessedUser()) | |
336 | 336 | let latestPeriod = getNumberByKey(keyLatestPeriod()) | |
337 | 337 | let usersCount = valueOrElse(getInteger(boostingContractOrFail(), keyUsersCount()), 0) | |
338 | 338 | let totalWeightKey = keyTotalWeightForPeriod(currentPeriod) | |
339 | 339 | let totalWeight = getNumberByKey(keyTotalWeightForPeriod(currentPeriod)) | |
340 | 340 | let heightForPeriod = getNumberByKey(keyHeightForPeriod(currentPeriod)) | |
341 | 341 | if ((currentPeriod > latestPeriod)) | |
342 | 342 | then $Tuple2(nil, false) | |
343 | 343 | else if ((processingStage == processingStageTotal)) | |
344 | 344 | then { | |
345 | 345 | let $t01368513801 = calcUserWeight(boostingContractOrFail(), heightForPeriod, currentPeriod, currentUser) | |
346 | 346 | let userWeight = $t01368513801._1 | |
347 | 347 | let userActions = $t01368513801._2 | |
348 | 348 | let totalWeightNew = (totalWeight + userWeight) | |
349 | 349 | let processingActions = if (((usersCount - 1) > currentUser)) | |
350 | 350 | then [IntegerEntry(keyNextProcessedUser(), (currentUser + 1))] | |
351 | 351 | else [IntegerEntry(keyProcessingStage(), processingStageShares), IntegerEntry(keyNextProcessedUser(), 0)] | |
352 | 352 | $Tuple2((([IntegerEntry(totalWeightKey, totalWeightNew)] ++ processingActions) ++ userActions), true) | |
353 | 353 | } | |
354 | 354 | else if ((processingStage == processingStageShares)) | |
355 | 355 | then { | |
356 | 356 | let userWeight = calcUserWeightForClaim(boostingContractOrFail(), heightForPeriod, currentPeriod, currentUser) | |
357 | 357 | let userAmountMatcherForPeriod = fraction(getNumberByKey(keyTotalAmountForPeriod(currentPeriod)), userWeight, totalWeight) | |
358 | 358 | let userAmountEmissionForPeriod = fraction(getNumberByKey(keyAuxEmissionRewardForPeriod(currentPeriod)), userWeight, totalWeight) | |
359 | 359 | let userTotalAmount = (userAmountEmissionForPeriod + userAmountMatcherForPeriod) | |
360 | 360 | let userAddress = getStringValue(boostingContractOrFail(), keyNumToUserMapping(currentUser)) | |
361 | 361 | let referrer = getString(referralsContractAddressOrFail, keyReferrer(userAddress)) | |
362 | 362 | let activeReferralInv = if ((referrer == unit)) | |
363 | 363 | then unit | |
364 | 364 | else invoke(referralsContractAddressOrFail, "updateReferralActivity", [referralProgramName, userAddress, (userWeight >= referralMinGWxAmount)], nil) | |
365 | 365 | if ((activeReferralInv == activeReferralInv)) | |
366 | 366 | then { | |
367 | 367 | let referralInv = if (if ((referrer == unit)) | |
368 | 368 | then true | |
369 | 369 | else (referralMinGWxAmount > userWeight)) | |
370 | 370 | then unit | |
371 | 371 | else { | |
372 | 372 | let referrerReward = fraction(userTotalAmount, referrerRewardPermille, SCALE) | |
373 | 373 | let referralReward = fraction(userTotalAmount, referralRewardPermille, SCALE) | |
374 | 374 | invoke(referralsContractAddressOrFail, "incUnclaimed", [referralProgramName, userAddress, referrerReward, referralReward], nil) | |
375 | 375 | } | |
376 | 376 | if ((referralInv == referralInv)) | |
377 | 377 | then { | |
378 | 378 | let processingActions = if (((usersCount - 1) > currentUser)) | |
379 | 379 | then [IntegerEntry(keyNextProcessedUser(), (currentUser + 1))] | |
380 | - | else [IntegerEntry(keyNextProcessedPeriod(), (currentPeriod + 1)), IntegerEntry(keyNextProcessedUser(), 0)] | |
380 | + | else [IntegerEntry(keyNextProcessedPeriod(), (currentPeriod + 1)), IntegerEntry(keyNextProcessedUser(), 0), DeleteEntry(keyProcessingStage())] | |
381 | 381 | $Tuple2(processingActions, true) | |
382 | 382 | } | |
383 | 383 | else throw("Strict value is not equal to itself.") | |
384 | 384 | } | |
385 | 385 | else throw("Strict value is not equal to itself.") | |
386 | 386 | } | |
387 | 387 | else throw("invalid processing stage") | |
388 | 388 | } | |
389 | 389 | ||
390 | 390 | ||
391 | 391 | ||
392 | 392 | @Callable(i) | |
393 | 393 | func finalizeWrapper (counter) = { | |
394 | 394 | let result = { | |
395 | 395 | let @ = invoke(this, "finalizeHelper", nil, nil) | |
396 | 396 | if ($isInstanceOf(@, "Boolean")) | |
397 | 397 | then @ | |
398 | 398 | else throw(($getType(invoke(this, "finalizeHelper", nil, nil)) + " couldn't be cast to Boolean")) | |
399 | 399 | } | |
400 | 400 | if ((result == result)) | |
401 | 401 | then if (!(result)) | |
402 | 402 | then if ((counter == maxDepth)) | |
403 | 403 | then throw("Nothing to process") | |
404 | 404 | else $Tuple2(nil, unit) | |
405 | 405 | else if ((counter > 0)) | |
406 | 406 | then $Tuple2(nil, invoke(this, "finalizeWrapper", [(counter - 1)], nil)) | |
407 | 407 | else $Tuple2(nil, unit) | |
408 | 408 | else throw("Strict value is not equal to itself.") | |
409 | 409 | } | |
410 | 410 | ||
411 | 411 | ||
412 | 412 | ||
413 | 413 | @Callable(i) | |
414 | 414 | func processPendingPeriodsAndUsers () = $Tuple2(nil, invoke(this, "finalizeWrapper", [maxDepth], nil)) | |
415 | 415 | ||
416 | 416 | ||
417 | 417 | ||
418 | 418 | @Callable(i) | |
419 | 419 | func deposit () = { | |
420 | 420 | let cfgArray = readConfigArrayOrFail() | |
421 | 421 | if ((i.caller != Address(fromBase58String(cfgArray[IdxCfgPacemakerAddress])))) | |
422 | 422 | then throw("Wrong caller address") | |
423 | 423 | else { | |
424 | 424 | let assetId = value(value(i.payments[0]).assetId) | |
425 | 425 | if ((assetId != fromBase58String(cfgArray[IdxCfgAssetId]))) | |
426 | 426 | then throw("Wrong payment asset") | |
427 | 427 | else { | |
428 | 428 | let period = nextPeriod() | |
429 | 429 | let deltaH = (height - getNumberOrFail(keyGwxRewardEmissionStartHeight())) | |
430 | 430 | let emissionRate = valueOrErrorMessage(getInteger(emissionContract, keyRatePerBlockCurrent()), (("mandatory emission_contract." + keyRatePerBlockCurrent()) + " is not defined")) | |
431 | 431 | let weight = valueOrErrorMessage(getInteger(factoryContract, keyPoolWeightVirtual()), (("mandatory factory_contract." + keyPoolWeightVirtual()) + " is not defined")) | |
432 | 432 | let auxAmount = fraction((deltaH * weight), emissionRate, MULT8) | |
433 | 433 | let em = invoke(emissionContract, "emit", [auxAmount], nil) | |
434 | 434 | if ((em == em)) | |
435 | 435 | then { | |
436 | 436 | let matcherPart = value(i.payments[0]).amount | |
437 | 437 | let payoutInfo = PeriodPayoutInfo(period, matcherPart, auxAmount) | |
438 | 438 | [IntegerEntry(keyLatestPeriod(), period), IntegerEntry(keyHeightForPeriod(period), height), IntegerEntry(keyAuxEmissionRewardForPeriod(period), auxAmount), IntegerEntry(keyGwxRewardEmissionStartHeight(), height), IntegerEntry(keyTotalAmountForPeriod(period), matcherPart), IntegerEntry(keyNextPeriod(), (period + 1)), StringEntry(keyLastPayoutInfo(), payoutInfo), StringEntry(keyPayoutHistoryInfo(period), payoutInfo)] | |
439 | 439 | } | |
440 | 440 | else throw("Strict value is not equal to itself.") | |
441 | 441 | } | |
442 | 442 | } | |
443 | 443 | } | |
444 | 444 | ||
445 | 445 | ||
446 | 446 | ||
447 | 447 | @Callable(i) | |
448 | 448 | func claimNextBatch (boostingContract,currentPeriod,currentUser,depth,totalFromMatcher,totalFromEmission) = if ((i.caller != this)) | |
449 | 449 | then throw("Should be called by this script only") | |
450 | 450 | else { | |
451 | 451 | let periodAndTotals = claimInternal(boostingContract, currentPeriod, currentUser, depth, totalFromMatcher, totalFromEmission) | |
452 | 452 | $Tuple2(nil, periodAndTotals) | |
453 | 453 | } | |
454 | 454 | ||
455 | 455 | ||
456 | 456 | ||
457 | 457 | @Callable(i) | |
458 | 458 | func claimReward () = { | |
459 | 459 | let address = toString(i.caller) | |
460 | - | let $ | |
461 | - | let period = $ | |
462 | - | let amountFromMatcher = $ | |
463 | - | let amountFromEmission = $ | |
464 | - | let userIdx = $ | |
465 | - | let cfgArray = $ | |
466 | - | let nextProcessedPeriod = $ | |
460 | + | let $t01933519461 = commonClaimReward(address, unit) | |
461 | + | let period = $t01933519461._1 | |
462 | + | let amountFromMatcher = $t01933519461._2 | |
463 | + | let amountFromEmission = $t01933519461._3 | |
464 | + | let userIdx = $t01933519461._4 | |
465 | + | let cfgArray = $t01933519461._5 | |
466 | + | let nextProcessedPeriod = $t01933519461._6 | |
467 | 467 | $Tuple2([IntegerEntry(keyNextUnlaimedPeriodOfUser(userIdx), period), ScriptTransfer(i.caller, (amountFromMatcher + amountFromEmission), fromBase58String(cfgArray[IdxCfgAssetId])), HistoryEntry("claim", address, amountFromMatcher, amountFromEmission, period, nextProcessedPeriod, i)], [amountFromMatcher, amountFromEmission]) | |
468 | 468 | } | |
469 | 469 | ||
470 | 470 | ||
471 | 471 | ||
472 | 472 | @Callable(i) | |
473 | 473 | func claimRewardREADONLY (address) = { | |
474 | 474 | let claimResults = commonClaimReward(address, unit) | |
475 | 475 | let amount = (claimResults._2 + claimResults._3) | |
476 | 476 | $Tuple2(nil, amount) | |
477 | 477 | } | |
478 | 478 | ||
479 | 479 | ||
480 | 480 | ||
481 | 481 | @Callable(i) | |
482 | 482 | func claimRewardPaginatedREADONLY (address,startPeriod) = { | |
483 | - | let $ | |
483 | + | let $t02020420321 = commonClaimReward(address, if ((0 > startPeriod)) | |
484 | 484 | then unit | |
485 | 485 | else startPeriod) | |
486 | - | let period = $ | |
487 | - | let fromMatcher = $ | |
488 | - | let fromEmission = $ | |
486 | + | let period = $t02020420321._1 | |
487 | + | let fromMatcher = $t02020420321._2 | |
488 | + | let fromEmission = $t02020420321._3 | |
489 | 489 | let amount = (fromMatcher + fromEmission) | |
490 | 490 | $Tuple2(nil, $Tuple2(amount, period)) | |
491 | 491 | } | |
492 | 492 | ||
493 | 493 | ||
494 | 494 | ||
495 | 495 | @Callable(i) | |
496 | 496 | func claimRewardDetailedREADONLY (address) = { | |
497 | - | let $ | |
498 | - | let ignored = $ | |
499 | - | let fromMatcher = $ | |
500 | - | let fromEmission = $ | |
497 | + | let $t02057220647 = commonClaimReward(address, unit) | |
498 | + | let ignored = $t02057220647._1 | |
499 | + | let fromMatcher = $t02057220647._2 | |
500 | + | let fromEmission = $t02057220647._3 | |
501 | 501 | $Tuple2(nil, makeString(["%d%d%d", toString((fromMatcher + fromEmission)), toString(fromMatcher), toString(fromEmission)], SEP)) | |
502 | 502 | } | |
503 | 503 | ||
504 | 504 | ||
505 | 505 | ||
506 | 506 | @Callable(i) | |
507 | 507 | func claimRewardDetailedPaginatedREADONLY (address,startPeriod) = { | |
508 | - | let $ | |
508 | + | let $t02094321060 = commonClaimReward(address, if ((0 > startPeriod)) | |
509 | 509 | then unit | |
510 | 510 | else startPeriod) | |
511 | - | let period = $ | |
512 | - | let fromMatcher = $ | |
513 | - | let fromEmission = $ | |
511 | + | let period = $t02094321060._1 | |
512 | + | let fromMatcher = $t02094321060._2 | |
513 | + | let fromEmission = $t02094321060._3 | |
514 | 514 | $Tuple2(nil, $Tuple2(makeString(["%d%d%d", toString((fromMatcher + fromEmission)), toString(fromMatcher), toString(fromEmission)], SEP), period)) | |
515 | 515 | } | |
516 | 516 | ||
517 | 517 | ||
518 | 518 | ||
519 | 519 | @Callable(i) | |
520 | 520 | func latestFinalizedPeriodREADONLY (address) = $Tuple2(nil, valueOrElse(getInteger(this, keyLatestPeriod()), -1)) | |
521 | 521 | ||
522 | 522 | ||
523 | 523 | ||
524 | 524 | @Callable(i) | |
525 | 525 | func latestFinalizedPeriodInfoREADONLY (address) = $Tuple2(nil, getStringByKey(keyLastPayoutInfo())) | |
526 | 526 | ||
527 | 527 | ||
528 | 528 | ||
529 | 529 | @Callable(i) | |
530 | 530 | func calcGwxParamsREADONLY (gwxAmountStart,lockStartHeight,lockDurationBlocks) = { | |
531 | 531 | let lockEndHeight = (lockStartHeight + lockDurationBlocks) | |
532 | 532 | let scale8ParamK = -(fraction(gwxAmountStart, SCALE, lockDurationBlocks)) | |
533 | 533 | let scale8ParamB = (fraction(gwxAmountStart, SCALE, lockDurationBlocks) * lockEndHeight) | |
534 | 534 | $Tuple2(nil, [scale8ParamK, scale8ParamB, nextPeriod()]) | |
535 | 535 | } | |
536 | 536 | ||
537 | 537 | ||
538 | 538 | ||
539 | 539 | @Callable(i) | |
540 | 540 | func calcGwxAmountStartREADONLY (wxLockAmount,lockDuration,maxLockDuration) = { | |
541 | 541 | let coeffX8 = fraction(lockDuration, MULT8, maxLockDuration) | |
542 | 542 | let gWxAmountStart = fraction(wxLockAmount, coeffX8, MULT8) | |
543 | 543 | $Tuple2(nil, [gWxAmountStart]) | |
544 | 544 | } | |
545 | 545 | ||
546 | 546 | ||
547 | 547 | ||
548 | 548 | @Callable(i) | |
549 | 549 | func constructor (wxAssetIdStr,matcherPacemakerAddressStr,boostingContractAddressStr,maxDepth) = if ((this != i.caller)) | |
550 | 550 | then throw("not authorized") | |
551 | 551 | else [StringEntry(keyConfig(), formatConfig(wxAssetIdStr, matcherPacemakerAddressStr, boostingContractAddressStr, maxDepth))] | |
552 | 552 | ||
553 | 553 | ||
554 | 554 | ||
555 | 555 | @Callable(i) | |
556 | 556 | func constructorV2 (factoryAddress) = if ((this != i.caller)) | |
557 | 557 | then throw("not authorized") | |
558 | 558 | else [StringEntry(keyFactoryAddress(), factoryAddress)] | |
559 | 559 | ||
560 | 560 | ||
561 | 561 | ||
562 | 562 | @Callable(i) | |
563 | 563 | func constructorV3 (emissionAddress) = if ((this != i.caller)) | |
564 | 564 | then throw("not authorized") | |
565 | 565 | else { | |
566 | 566 | let initLatestPeriod = if (isDefined(getInteger(this, keyLatestPeriod()))) | |
567 | 567 | then nil | |
568 | 568 | else [IntegerEntry(keyLatestPeriod(), -1)] | |
569 | 569 | (initLatestPeriod :+ StringEntry(keyEmissionAddress(), emissionAddress)) | |
570 | 570 | } | |
571 | 571 | ||
572 | 572 | ||
573 | 573 | ||
574 | 574 | @Callable(i) | |
575 | 575 | func onEmissionForGwxStart () = if ((i.caller != factoryContract)) | |
576 | 576 | then throw("permissions denied") | |
577 | 577 | else [IntegerEntry(keyGwxRewardEmissionStartHeight(), height)] | |
578 | 578 | ||
579 | 579 | ||
580 | 580 | ||
581 | 581 | @Callable(i) | |
582 | 582 | func latestPeriodEmissionRewardsREADONLY (address) = { | |
583 | 583 | let period = nextPeriod() | |
584 | 584 | $Tuple2(nil, [getNumberByKey(keyAuxEmissionRewardForPeriod(period))]) | |
585 | 585 | } | |
586 | 586 | ||
587 | 587 | ||
588 | 588 | ||
589 | 589 | @Callable(i) | |
590 | 590 | func calcD (x1BigIntStr,x2BigIntStr,ampBigIntStr,aPrecisionBigIntStr,targetPrecisionBigIntStr) = { | |
591 | 591 | let nCoins = toBigInt(2) | |
592 | 592 | let aPrecision = parseBigIntValue(aPrecisionBigIntStr) | |
593 | 593 | let targetPrecision = parseBigIntValue(targetPrecisionBigIntStr) | |
594 | 594 | let x1 = parseBigIntValue(x1BigIntStr) | |
595 | 595 | let x2 = parseBigIntValue(x2BigIntStr) | |
596 | 596 | let amp = (parseBigIntValue(ampBigIntStr) * aPrecision) | |
597 | 597 | let s = (x1 + x2) | |
598 | 598 | if ((s == zeroBigInt)) | |
599 | 599 | then $Tuple2(nil, toString(zeroBigInt)) | |
600 | 600 | else { | |
601 | 601 | let ann = (amp * nCoins) | |
602 | 602 | let arr = [1, 2, 3, 4, 5, 6, 7] | |
603 | 603 | func calc (acc,cur) = { | |
604 | - | let $ | |
605 | - | let d = $ | |
606 | - | let dPrev = $ | |
604 | + | let $t02454924738 = acc | |
605 | + | let d = $t02454924738._1 | |
606 | + | let dPrev = $t02454924738._2 | |
607 | 607 | let dp = (((d * d) * d) / (((x1 * x2) * nCoins) * nCoins)) | |
608 | 608 | let dNext = (((((ann * s) / aPrecision) + (dp * nCoins)) * d) / ((((ann - aPrecision) * d) / aPrecision) + ((nCoins + toBigInt(1)) * dp))) | |
609 | 609 | $Tuple2(dNext, d) | |
610 | 610 | } | |
611 | 611 | ||
612 | - | let $ | |
612 | + | let $t02495125001 = { | |
613 | 613 | let $l = arr | |
614 | 614 | let $s = size($l) | |
615 | 615 | let $acc0 = $Tuple2(s, unit) | |
616 | 616 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
617 | 617 | then $a | |
618 | 618 | else calc($a, $l[$i]) | |
619 | 619 | ||
620 | 620 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
621 | 621 | then $a | |
622 | 622 | else throw("List size exceeds 7") | |
623 | 623 | ||
624 | 624 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7) | |
625 | 625 | } | |
626 | - | let dNext = $ | |
627 | - | let dPrev = $ | |
626 | + | let dNext = $t02495125001._1 | |
627 | + | let dPrev = $t02495125001._2 | |
628 | 628 | let dDiff = abs((dNext - value(dPrev))) | |
629 | 629 | if ((targetPrecision >= dDiff)) | |
630 | 630 | then $Tuple2(nil, toString(dNext)) | |
631 | 631 | else throw(("D calculation error, dDiff = " + toString(dDiff))) | |
632 | 632 | } | |
633 | 633 | } | |
634 | 634 | ||
635 | 635 | ||
636 | 636 | ||
637 | 637 | @Callable(i) | |
638 | 638 | func setManager (pendingManagerPublicKey) = { | |
639 | 639 | let checkCaller = mustManager(i) | |
640 | 640 | if ((checkCaller == checkCaller)) | |
641 | 641 | then { | |
642 | 642 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
643 | 643 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
644 | 644 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
645 | 645 | else throw("Strict value is not equal to itself.") | |
646 | 646 | } | |
647 | 647 | else throw("Strict value is not equal to itself.") | |
648 | 648 | } | |
649 | 649 | ||
650 | 650 | ||
651 | 651 | ||
652 | 652 | @Callable(i) | |
653 | 653 | func confirmManager () = { | |
654 | 654 | let pm = pendingManagerPublicKeyOrUnit() | |
655 | 655 | let hasPM = if (isDefined(pm)) | |
656 | 656 | then true | |
657 | 657 | else throw("No pending manager") | |
658 | 658 | if ((hasPM == hasPM)) | |
659 | 659 | then { | |
660 | 660 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
661 | 661 | then true | |
662 | 662 | else throw("You are not pending manager") | |
663 | 663 | if ((checkPM == checkPM)) | |
664 | 664 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
665 | 665 | else throw("Strict value is not equal to itself.") | |
666 | 666 | } | |
667 | 667 | else throw("Strict value is not equal to itself.") | |
668 | 668 | } | |
669 | 669 | ||
670 | 670 | ||
671 | 671 | @Verifier(tx) | |
672 | 672 | func verify () = { | |
673 | 673 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
674 | 674 | case pk: ByteVector => | |
675 | 675 | pk | |
676 | 676 | case _: Unit => | |
677 | 677 | tx.senderPublicKey | |
678 | 678 | case _ => | |
679 | 679 | throw("Match error") | |
680 | 680 | } | |
681 | 681 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
682 | 682 | } | |
683 | 683 |
github/deemru/w8io/169f3d6 110.21 ms ◑