tx · HUdWaWuUtAgmgcCdQUQbdpTBwiR6mwRrM2S2qKGKVfut 3Mp5kisFrqESzrXxAMEPk2k69zpeF41czEE: -0.02500000 Waves 2022.07.26 10:59 [2156499] smart account 3Mp5kisFrqESzrXxAMEPk2k69zpeF41czEE > SELF 0.00000000 Waves
{ "type": 13, "id": "HUdWaWuUtAgmgcCdQUQbdpTBwiR6mwRrM2S2qKGKVfut", "fee": 2500000, "feeAssetId": null, "timestamp": 1658822406290, "version": 1, "sender": "3Mp5kisFrqESzrXxAMEPk2k69zpeF41czEE", "senderPublicKey": "G349Uq3FTox7dRNLeAfAQeoACvwZ9iEnVSaHcEYn6j8J", "proofs": [ "2amDAMJHE6djLeV7AEupXEc4dvKvrL2Z1jS5T5fSaREsqH9UfyN1A3k3dADxb4EKvcB8payJN3UaNqevaFSaEu3A" ], "script": "base64:BgJwCAISABIDCgEBEgASABIICgYCAQEBAQESABIDCgEIEgQKAggBEgMKAQgSBAoCCAESAwoBCBIDCgEIEgUKAwEBARIFCgMBAQESBgoECAgIARIDCgEIEgMKAQgSABIDCgEIEgcKBQgICAgIEgMKAQgSAE8AA1NFUAICX18ACVVTRVJERVBUSAAaAAVTQ0FMRQDoBwAFTVVMVDgAgMLXLwAKemVyb0JpZ0ludAkAtgIBAAAAFHByb2Nlc3NpbmdTdGFnZVRvdGFsAAAAFXByb2Nlc3NpbmdTdGFnZVNoYXJlcwABAQ5nZXROdW1iZXJCeUtleQEDa2V5CQELdmFsdWVPckVsc2UCCQCaCAIFBHRoaXMFA2tleQAAAQ9nZXROdW1iZXJPckZhaWwBA2tleQkBE3ZhbHVlT3JFcnJvck1lc3NhZ2UCCQCaCAIFBHRoaXMFA2tleQkArAICCQCsAgICD21hbmRhdG9yeSB0aGlzLgUDa2V5Ag8gaXMgbm90IGRlZmluZWQBDmdldFN0cmluZ0J5S2V5AQNrZXkJAQt2YWx1ZU9yRWxzZQIJAJ0IAgUEdGhpcwUDa2V5AgABD2dldFN0cmluZ09yRmFpb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Xb9Gf Diff:
Old | New | Differences | |
---|---|---|---|
319 | 319 | then throw("Nothing to claim") | |
320 | 320 | else { | |
321 | 321 | let boostingContract = fromBase58String(cfgArray[IdxCfgBoostingContract]) | |
322 | - | let $ | |
323 | - | let period = $ | |
324 | - | let amountFromMatcher = $ | |
325 | - | let amountFromEmission = $ | |
322 | + | let $t01256912695 = claimInternal(boostingContract, currentPeriod, userIdx, USERDEPTH, 0, 0) | |
323 | + | let period = $t01256912695._1 | |
324 | + | let amountFromMatcher = $t01256912695._2 | |
325 | + | let amountFromEmission = $t01256912695._3 | |
326 | 326 | $Tuple6(period, amountFromMatcher, amountFromEmission, userIdx, cfgArray, nextProcessedPeriod) | |
327 | 327 | } | |
328 | 328 | } | |
342 | 342 | then $Tuple2(nil, false) | |
343 | 343 | else if ((processingStage == processingStageTotal)) | |
344 | 344 | then { | |
345 | - | let $ | |
346 | - | let userWeight = $ | |
347 | - | let userActions = $ | |
345 | + | let $t01368513801 = calcUserWeight(boostingContractOrFail(), heightForPeriod, currentPeriod, currentUser) | |
346 | + | let userWeight = $t01368513801._1 | |
347 | + | let userActions = $t01368513801._2 | |
348 | 348 | let totalWeightNew = (totalWeight + userWeight) | |
349 | 349 | let processingActions = if ((usersCount > currentUser)) | |
350 | 350 | then [IntegerEntry(keyNextProcessedUser(), (currentUser + 1))] | |
450 | 450 | @Callable(i) | |
451 | 451 | func claimReward () = { | |
452 | 452 | let address = toString(i.caller) | |
453 | - | let $ | |
454 | - | let period = $ | |
455 | - | let amountFromMatcher = $ | |
456 | - | let amountFromEmission = $ | |
457 | - | let userIdx = $ | |
458 | - | let cfgArray = $ | |
459 | - | let nextProcessedPeriod = $ | |
453 | + | let $t01903919165 = commonClaimReward(address, unit) | |
454 | + | let period = $t01903919165._1 | |
455 | + | let amountFromMatcher = $t01903919165._2 | |
456 | + | let amountFromEmission = $t01903919165._3 | |
457 | + | let userIdx = $t01903919165._4 | |
458 | + | let cfgArray = $t01903919165._5 | |
459 | + | let nextProcessedPeriod = $t01903919165._6 | |
460 | 460 | $Tuple2([IntegerEntry(keyNextUnlaimedPeriodOfUser(userIdx), period), ScriptTransfer(i.caller, (amountFromMatcher + amountFromEmission), fromBase58String(cfgArray[IdxCfgAssetId])), HistoryEntry("claim", address, amountFromMatcher, amountFromEmission, period, nextProcessedPeriod, i)], [amountFromMatcher, amountFromEmission]) | |
461 | 461 | } | |
462 | 462 | ||
473 | 473 | ||
474 | 474 | @Callable(i) | |
475 | 475 | func claimRewardPaginatedREADONLY (address,startPeriod) = { | |
476 | - | let $ | |
476 | + | let $t01990820025 = commonClaimReward(address, if ((0 > startPeriod)) | |
477 | 477 | then unit | |
478 | 478 | else startPeriod) | |
479 | - | let period = $ | |
480 | - | let fromMatcher = $ | |
481 | - | let fromEmission = $ | |
479 | + | let period = $t01990820025._1 | |
480 | + | let fromMatcher = $t01990820025._2 | |
481 | + | let fromEmission = $t01990820025._3 | |
482 | 482 | let amount = (fromMatcher + fromEmission) | |
483 | 483 | $Tuple2(nil, $Tuple2(amount, period)) | |
484 | 484 | } | |
487 | 487 | ||
488 | 488 | @Callable(i) | |
489 | 489 | func claimRewardDetailedREADONLY (address) = { | |
490 | - | let $ | |
491 | - | let ignored = $ | |
492 | - | let fromMatcher = $ | |
493 | - | let fromEmission = $ | |
490 | + | let $t02027620351 = commonClaimReward(address, unit) | |
491 | + | let ignored = $t02027620351._1 | |
492 | + | let fromMatcher = $t02027620351._2 | |
493 | + | let fromEmission = $t02027620351._3 | |
494 | 494 | $Tuple2(nil, makeString(["%d%d%d", toString((fromMatcher + fromEmission)), toString(fromMatcher), toString(fromEmission)], SEP)) | |
495 | 495 | } | |
496 | 496 | ||
498 | 498 | ||
499 | 499 | @Callable(i) | |
500 | 500 | func claimRewardDetailedPaginatedREADONLY (address,startPeriod) = { | |
501 | - | let $ | |
501 | + | let $t02064720764 = commonClaimReward(address, if ((0 > startPeriod)) | |
502 | 502 | then unit | |
503 | 503 | else startPeriod) | |
504 | - | let period = $ | |
505 | - | let fromMatcher = $ | |
506 | - | let fromEmission = $ | |
504 | + | let period = $t02064720764._1 | |
505 | + | let fromMatcher = $t02064720764._2 | |
506 | + | let fromEmission = $t02064720764._3 | |
507 | 507 | $Tuple2(nil, $Tuple2(makeString(["%d%d%d", toString((fromMatcher + fromEmission)), toString(fromMatcher), toString(fromEmission)], SEP), period)) | |
508 | 508 | } | |
509 | 509 | ||
594 | 594 | let ann = (amp * nCoins) | |
595 | 595 | let arr = [1, 2, 3, 4, 5, 6, 7] | |
596 | 596 | func calc (acc,cur) = { | |
597 | - | let $ | |
598 | - | let d = $ | |
599 | - | let dPrev = $ | |
597 | + | let $t02425324442 = acc | |
598 | + | let d = $t02425324442._1 | |
599 | + | let dPrev = $t02425324442._2 | |
600 | 600 | let dp = (((d * d) * d) / (((x1 * x2) * nCoins) * nCoins)) | |
601 | 601 | let dNext = (((((ann * s) / aPrecision) + (dp * nCoins)) * d) / ((((ann - aPrecision) * d) / aPrecision) + ((nCoins + toBigInt(1)) * dp))) | |
602 | 602 | $Tuple2(dNext, d) | |
603 | 603 | } | |
604 | 604 | ||
605 | - | let $ | |
605 | + | let $t02465524705 = { | |
606 | 606 | let $l = arr | |
607 | 607 | let $s = size($l) | |
608 | 608 | let $acc0 = $Tuple2(s, unit) | |
616 | 616 | ||
617 | 617 | $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) | |
618 | 618 | } | |
619 | - | let dNext = $ | |
620 | - | let dPrev = $ | |
619 | + | let dNext = $t02465524705._1 | |
620 | + | let dPrev = $t02465524705._2 | |
621 | 621 | let dDiff = abs((dNext - value(dPrev))) | |
622 | 622 | if ((targetPrecision >= dDiff)) | |
623 | 623 | 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 | - | let $ | |
323 | - | let period = $ | |
324 | - | let amountFromMatcher = $ | |
325 | - | let amountFromEmission = $ | |
322 | + | let $t01256912695 = claimInternal(boostingContract, currentPeriod, userIdx, USERDEPTH, 0, 0) | |
323 | + | let period = $t01256912695._1 | |
324 | + | let amountFromMatcher = $t01256912695._2 | |
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 | - | let $ | |
346 | - | let userWeight = $ | |
347 | - | let userActions = $ | |
345 | + | let $t01368513801 = calcUserWeight(boostingContractOrFail(), heightForPeriod, currentPeriod, currentUser) | |
346 | + | let userWeight = $t01368513801._1 | |
347 | + | let userActions = $t01368513801._2 | |
348 | 348 | let totalWeightNew = (totalWeight + userWeight) | |
349 | 349 | let processingActions = if ((usersCount > 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 referralInv = if (if ((referrer == unit)) | |
363 | 363 | then true | |
364 | 364 | else (referralMinGWxAmount > userWeight)) | |
365 | 365 | then unit | |
366 | 366 | else { | |
367 | 367 | let referrerReward = fraction(userTotalAmount, referrerRewardPermille, SCALE) | |
368 | 368 | let referralReward = fraction(userTotalAmount, referralRewardPermille, SCALE) | |
369 | 369 | invoke(referralsContractAddressOrFail, "incUnclaimed", [referralProgramName, userAddress, referrerReward, referralReward], nil) | |
370 | 370 | } | |
371 | 371 | if ((referralInv == referralInv)) | |
372 | 372 | then { | |
373 | 373 | let processingActions = if ((usersCount > currentUser)) | |
374 | 374 | then [IntegerEntry(keyNextProcessedUser(), (currentUser + 1))] | |
375 | 375 | else [IntegerEntry(keyNextProcessedPeriod(), (currentPeriod + 1)), IntegerEntry(keyNextProcessedUser(), 0)] | |
376 | 376 | $Tuple2(processingActions, true) | |
377 | 377 | } | |
378 | 378 | else throw("Strict value is not equal to itself.") | |
379 | 379 | } | |
380 | 380 | else throw("invalid processing stage") | |
381 | 381 | } | |
382 | 382 | ||
383 | 383 | ||
384 | 384 | ||
385 | 385 | @Callable(i) | |
386 | 386 | func finalizeWrapper (counter) = { | |
387 | 387 | let result = { | |
388 | 388 | let @ = invoke(this, "finalizeHelper", nil, nil) | |
389 | 389 | if ($isInstanceOf(@, "Boolean")) | |
390 | 390 | then @ | |
391 | 391 | else throw(($getType(invoke(this, "finalizeHelper", nil, nil)) + " couldn't be cast to Boolean")) | |
392 | 392 | } | |
393 | 393 | if ((result == result)) | |
394 | 394 | then if (if (!(result)) | |
395 | 395 | then (counter == maxDepth) | |
396 | 396 | else false) | |
397 | 397 | then throw("Nothing to process") | |
398 | 398 | else if ((counter > 0)) | |
399 | 399 | then $Tuple2(nil, invoke(this, "finalizeWrapper", [(counter - 1)], nil)) | |
400 | 400 | else $Tuple2(nil, unit) | |
401 | 401 | else throw("Strict value is not equal to itself.") | |
402 | 402 | } | |
403 | 403 | ||
404 | 404 | ||
405 | 405 | ||
406 | 406 | @Callable(i) | |
407 | 407 | func processPendingPeriodsAndUsers () = $Tuple2(nil, invoke(this, "finalizeWrapper", [maxDepth], nil)) | |
408 | 408 | ||
409 | 409 | ||
410 | 410 | ||
411 | 411 | @Callable(i) | |
412 | 412 | func deposit () = { | |
413 | 413 | let cfgArray = readConfigArrayOrFail() | |
414 | 414 | if ((i.caller != Address(fromBase58String(cfgArray[IdxCfgPacemakerAddress])))) | |
415 | 415 | then throw("Wrong caller address") | |
416 | 416 | else { | |
417 | 417 | let assetId = value(value(i.payments[0]).assetId) | |
418 | 418 | if ((assetId != fromBase58String(cfgArray[IdxCfgAssetId]))) | |
419 | 419 | then throw("Wrong payment asset") | |
420 | 420 | else { | |
421 | 421 | let period = nextPeriod() | |
422 | 422 | let deltaH = (height - getNumberOrFail(keyGwxRewardEmissionStartHeight())) | |
423 | 423 | let emissionRate = valueOrErrorMessage(getInteger(emissionContract, keyRatePerBlockCurrent()), (("mandatory emission_contract." + keyRatePerBlockCurrent()) + " is not defined")) | |
424 | 424 | let weight = valueOrErrorMessage(getInteger(factoryContract, keyPoolWeightVirtual()), (("mandatory factory_contract." + keyPoolWeightVirtual()) + " is not defined")) | |
425 | 425 | let auxAmount = fraction((deltaH * weight), emissionRate, MULT8) | |
426 | 426 | let em = invoke(emissionContract, "emit", [auxAmount], nil) | |
427 | 427 | if ((em == em)) | |
428 | 428 | then { | |
429 | 429 | let matcherPart = value(i.payments[0]).amount | |
430 | 430 | let payoutInfo = PeriodPayoutInfo(period, matcherPart, auxAmount) | |
431 | 431 | [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)] | |
432 | 432 | } | |
433 | 433 | else throw("Strict value is not equal to itself.") | |
434 | 434 | } | |
435 | 435 | } | |
436 | 436 | } | |
437 | 437 | ||
438 | 438 | ||
439 | 439 | ||
440 | 440 | @Callable(i) | |
441 | 441 | func claimNextBatch (boostingContract,currentPeriod,currentUser,depth,totalFromMatcher,totalFromEmission) = if ((i.caller != this)) | |
442 | 442 | then throw("Should be called by this script only") | |
443 | 443 | else { | |
444 | 444 | let periodAndTotals = claimInternal(boostingContract, currentPeriod, currentUser, depth, totalFromMatcher, totalFromEmission) | |
445 | 445 | $Tuple2(nil, periodAndTotals) | |
446 | 446 | } | |
447 | 447 | ||
448 | 448 | ||
449 | 449 | ||
450 | 450 | @Callable(i) | |
451 | 451 | func claimReward () = { | |
452 | 452 | let address = toString(i.caller) | |
453 | - | let $ | |
454 | - | let period = $ | |
455 | - | let amountFromMatcher = $ | |
456 | - | let amountFromEmission = $ | |
457 | - | let userIdx = $ | |
458 | - | let cfgArray = $ | |
459 | - | let nextProcessedPeriod = $ | |
453 | + | let $t01903919165 = commonClaimReward(address, unit) | |
454 | + | let period = $t01903919165._1 | |
455 | + | let amountFromMatcher = $t01903919165._2 | |
456 | + | let amountFromEmission = $t01903919165._3 | |
457 | + | let userIdx = $t01903919165._4 | |
458 | + | let cfgArray = $t01903919165._5 | |
459 | + | let nextProcessedPeriod = $t01903919165._6 | |
460 | 460 | $Tuple2([IntegerEntry(keyNextUnlaimedPeriodOfUser(userIdx), period), ScriptTransfer(i.caller, (amountFromMatcher + amountFromEmission), fromBase58String(cfgArray[IdxCfgAssetId])), HistoryEntry("claim", address, amountFromMatcher, amountFromEmission, period, nextProcessedPeriod, i)], [amountFromMatcher, amountFromEmission]) | |
461 | 461 | } | |
462 | 462 | ||
463 | 463 | ||
464 | 464 | ||
465 | 465 | @Callable(i) | |
466 | 466 | func claimRewardREADONLY (address) = { | |
467 | 467 | let claimResults = commonClaimReward(address, unit) | |
468 | 468 | let amount = (claimResults._2 + claimResults._3) | |
469 | 469 | $Tuple2(nil, amount) | |
470 | 470 | } | |
471 | 471 | ||
472 | 472 | ||
473 | 473 | ||
474 | 474 | @Callable(i) | |
475 | 475 | func claimRewardPaginatedREADONLY (address,startPeriod) = { | |
476 | - | let $ | |
476 | + | let $t01990820025 = commonClaimReward(address, if ((0 > startPeriod)) | |
477 | 477 | then unit | |
478 | 478 | else startPeriod) | |
479 | - | let period = $ | |
480 | - | let fromMatcher = $ | |
481 | - | let fromEmission = $ | |
479 | + | let period = $t01990820025._1 | |
480 | + | let fromMatcher = $t01990820025._2 | |
481 | + | let fromEmission = $t01990820025._3 | |
482 | 482 | let amount = (fromMatcher + fromEmission) | |
483 | 483 | $Tuple2(nil, $Tuple2(amount, period)) | |
484 | 484 | } | |
485 | 485 | ||
486 | 486 | ||
487 | 487 | ||
488 | 488 | @Callable(i) | |
489 | 489 | func claimRewardDetailedREADONLY (address) = { | |
490 | - | let $ | |
491 | - | let ignored = $ | |
492 | - | let fromMatcher = $ | |
493 | - | let fromEmission = $ | |
490 | + | let $t02027620351 = commonClaimReward(address, unit) | |
491 | + | let ignored = $t02027620351._1 | |
492 | + | let fromMatcher = $t02027620351._2 | |
493 | + | let fromEmission = $t02027620351._3 | |
494 | 494 | $Tuple2(nil, makeString(["%d%d%d", toString((fromMatcher + fromEmission)), toString(fromMatcher), toString(fromEmission)], SEP)) | |
495 | 495 | } | |
496 | 496 | ||
497 | 497 | ||
498 | 498 | ||
499 | 499 | @Callable(i) | |
500 | 500 | func claimRewardDetailedPaginatedREADONLY (address,startPeriod) = { | |
501 | - | let $ | |
501 | + | let $t02064720764 = commonClaimReward(address, if ((0 > startPeriod)) | |
502 | 502 | then unit | |
503 | 503 | else startPeriod) | |
504 | - | let period = $ | |
505 | - | let fromMatcher = $ | |
506 | - | let fromEmission = $ | |
504 | + | let period = $t02064720764._1 | |
505 | + | let fromMatcher = $t02064720764._2 | |
506 | + | let fromEmission = $t02064720764._3 | |
507 | 507 | $Tuple2(nil, $Tuple2(makeString(["%d%d%d", toString((fromMatcher + fromEmission)), toString(fromMatcher), toString(fromEmission)], SEP), period)) | |
508 | 508 | } | |
509 | 509 | ||
510 | 510 | ||
511 | 511 | ||
512 | 512 | @Callable(i) | |
513 | 513 | func latestFinalizedPeriodREADONLY (address) = $Tuple2(nil, valueOrElse(getInteger(this, keyLatestPeriod()), -1)) | |
514 | 514 | ||
515 | 515 | ||
516 | 516 | ||
517 | 517 | @Callable(i) | |
518 | 518 | func latestFinalizedPeriodInfoREADONLY (address) = $Tuple2(nil, getStringByKey(keyLastPayoutInfo())) | |
519 | 519 | ||
520 | 520 | ||
521 | 521 | ||
522 | 522 | @Callable(i) | |
523 | 523 | func calcGwxParamsREADONLY (gwxAmountStart,lockStartHeight,lockDurationBlocks) = { | |
524 | 524 | let lockEndHeight = (lockStartHeight + lockDurationBlocks) | |
525 | 525 | let scale8ParamK = -(fraction(gwxAmountStart, SCALE, lockDurationBlocks)) | |
526 | 526 | let scale8ParamB = (fraction(gwxAmountStart, SCALE, lockDurationBlocks) * lockEndHeight) | |
527 | 527 | $Tuple2(nil, [scale8ParamK, scale8ParamB, nextPeriod()]) | |
528 | 528 | } | |
529 | 529 | ||
530 | 530 | ||
531 | 531 | ||
532 | 532 | @Callable(i) | |
533 | 533 | func calcGwxAmountStartREADONLY (wxLockAmount,lockDuration,maxLockDuration) = { | |
534 | 534 | let coeffX8 = fraction(lockDuration, MULT8, maxLockDuration) | |
535 | 535 | let gWxAmountStart = fraction(wxLockAmount, coeffX8, MULT8) | |
536 | 536 | $Tuple2(nil, [gWxAmountStart]) | |
537 | 537 | } | |
538 | 538 | ||
539 | 539 | ||
540 | 540 | ||
541 | 541 | @Callable(i) | |
542 | 542 | func constructor (wxAssetIdStr,matcherPacemakerAddressStr,boostingContractAddressStr,maxDepth) = if ((this != i.caller)) | |
543 | 543 | then throw("not authorized") | |
544 | 544 | else [StringEntry(keyConfig(), formatConfig(wxAssetIdStr, matcherPacemakerAddressStr, boostingContractAddressStr, maxDepth))] | |
545 | 545 | ||
546 | 546 | ||
547 | 547 | ||
548 | 548 | @Callable(i) | |
549 | 549 | func constructorV2 (factoryAddress) = if ((this != i.caller)) | |
550 | 550 | then throw("not authorized") | |
551 | 551 | else [StringEntry(keyFactoryAddress(), factoryAddress)] | |
552 | 552 | ||
553 | 553 | ||
554 | 554 | ||
555 | 555 | @Callable(i) | |
556 | 556 | func constructorV3 (emissionAddress) = if ((this != i.caller)) | |
557 | 557 | then throw("not authorized") | |
558 | 558 | else { | |
559 | 559 | let initLatestPeriod = if (isDefined(getInteger(this, keyLatestPeriod()))) | |
560 | 560 | then nil | |
561 | 561 | else [IntegerEntry(keyLatestPeriod(), -1)] | |
562 | 562 | (initLatestPeriod :+ StringEntry(keyEmissionAddress(), emissionAddress)) | |
563 | 563 | } | |
564 | 564 | ||
565 | 565 | ||
566 | 566 | ||
567 | 567 | @Callable(i) | |
568 | 568 | func onEmissionForGwxStart () = if ((i.caller != factoryContract)) | |
569 | 569 | then throw("permissions denied") | |
570 | 570 | else [IntegerEntry(keyGwxRewardEmissionStartHeight(), height)] | |
571 | 571 | ||
572 | 572 | ||
573 | 573 | ||
574 | 574 | @Callable(i) | |
575 | 575 | func latestPeriodEmissionRewardsREADONLY (address) = { | |
576 | 576 | let period = nextPeriod() | |
577 | 577 | $Tuple2(nil, [getNumberByKey(keyAuxEmissionRewardForPeriod(period))]) | |
578 | 578 | } | |
579 | 579 | ||
580 | 580 | ||
581 | 581 | ||
582 | 582 | @Callable(i) | |
583 | 583 | func calcD (x1BigIntStr,x2BigIntStr,ampBigIntStr,aPrecisionBigIntStr,targetPrecisionBigIntStr) = { | |
584 | 584 | let nCoins = toBigInt(2) | |
585 | 585 | let aPrecision = parseBigIntValue(aPrecisionBigIntStr) | |
586 | 586 | let targetPrecision = parseBigIntValue(targetPrecisionBigIntStr) | |
587 | 587 | let x1 = parseBigIntValue(x1BigIntStr) | |
588 | 588 | let x2 = parseBigIntValue(x2BigIntStr) | |
589 | 589 | let amp = (parseBigIntValue(ampBigIntStr) * aPrecision) | |
590 | 590 | let s = (x1 + x2) | |
591 | 591 | if ((s == zeroBigInt)) | |
592 | 592 | then $Tuple2(nil, toString(zeroBigInt)) | |
593 | 593 | else { | |
594 | 594 | let ann = (amp * nCoins) | |
595 | 595 | let arr = [1, 2, 3, 4, 5, 6, 7] | |
596 | 596 | func calc (acc,cur) = { | |
597 | - | let $ | |
598 | - | let d = $ | |
599 | - | let dPrev = $ | |
597 | + | let $t02425324442 = acc | |
598 | + | let d = $t02425324442._1 | |
599 | + | let dPrev = $t02425324442._2 | |
600 | 600 | let dp = (((d * d) * d) / (((x1 * x2) * nCoins) * nCoins)) | |
601 | 601 | let dNext = (((((ann * s) / aPrecision) + (dp * nCoins)) * d) / ((((ann - aPrecision) * d) / aPrecision) + ((nCoins + toBigInt(1)) * dp))) | |
602 | 602 | $Tuple2(dNext, d) | |
603 | 603 | } | |
604 | 604 | ||
605 | - | let $ | |
605 | + | let $t02465524705 = { | |
606 | 606 | let $l = arr | |
607 | 607 | let $s = size($l) | |
608 | 608 | let $acc0 = $Tuple2(s, unit) | |
609 | 609 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
610 | 610 | then $a | |
611 | 611 | else calc($a, $l[$i]) | |
612 | 612 | ||
613 | 613 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
614 | 614 | then $a | |
615 | 615 | else throw("List size exceeds 7") | |
616 | 616 | ||
617 | 617 | $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) | |
618 | 618 | } | |
619 | - | let dNext = $ | |
620 | - | let dPrev = $ | |
619 | + | let dNext = $t02465524705._1 | |
620 | + | let dPrev = $t02465524705._2 | |
621 | 621 | let dDiff = abs((dNext - value(dPrev))) | |
622 | 622 | if ((targetPrecision >= dDiff)) | |
623 | 623 | then $Tuple2(nil, toString(dNext)) | |
624 | 624 | else throw(("D calculation error, dDiff = " + toString(dDiff))) | |
625 | 625 | } | |
626 | 626 | } | |
627 | 627 | ||
628 | 628 | ||
629 | 629 | ||
630 | 630 | @Callable(i) | |
631 | 631 | func setManager (pendingManagerPublicKey) = { | |
632 | 632 | let checkCaller = mustManager(i) | |
633 | 633 | if ((checkCaller == checkCaller)) | |
634 | 634 | then { | |
635 | 635 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
636 | 636 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
637 | 637 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
638 | 638 | else throw("Strict value is not equal to itself.") | |
639 | 639 | } | |
640 | 640 | else throw("Strict value is not equal to itself.") | |
641 | 641 | } | |
642 | 642 | ||
643 | 643 | ||
644 | 644 | ||
645 | 645 | @Callable(i) | |
646 | 646 | func confirmManager () = { | |
647 | 647 | let pm = pendingManagerPublicKeyOrUnit() | |
648 | 648 | let hasPM = if (isDefined(pm)) | |
649 | 649 | then true | |
650 | 650 | else throw("No pending manager") | |
651 | 651 | if ((hasPM == hasPM)) | |
652 | 652 | then { | |
653 | 653 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
654 | 654 | then true | |
655 | 655 | else throw("You are not pending manager") | |
656 | 656 | if ((checkPM == checkPM)) | |
657 | 657 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
658 | 658 | else throw("Strict value is not equal to itself.") | |
659 | 659 | } | |
660 | 660 | else throw("Strict value is not equal to itself.") | |
661 | 661 | } | |
662 | 662 | ||
663 | 663 | ||
664 | 664 | @Verifier(tx) | |
665 | 665 | func verify () = { | |
666 | 666 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
667 | 667 | case pk: ByteVector => | |
668 | 668 | pk | |
669 | 669 | case _: Unit => | |
670 | 670 | tx.senderPublicKey | |
671 | 671 | case _ => | |
672 | 672 | throw("Match error") | |
673 | 673 | } | |
674 | 674 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
675 | 675 | } | |
676 | 676 |
github/deemru/w8io/026f985 97.62 ms ◑