tx · GoXZZEcVuWBh2rTvBiqZ55BCVqE39ZX66mu9sM5NVL83 3Mp5kisFrqESzrXxAMEPk2k69zpeF41czEE: -0.01000000 Waves 2022.03.23 11:25 [1976321] smart account 3Mp5kisFrqESzrXxAMEPk2k69zpeF41czEE > SELF 0.00000000 Waves
{ "type": 13, "id": "GoXZZEcVuWBh2rTvBiqZ55BCVqE39ZX66mu9sM5NVL83", "fee": 1000000, "feeAssetId": null, "timestamp": 1648023902582, "version": 2, "chainId": 84, "sender": "3Mp5kisFrqESzrXxAMEPk2k69zpeF41czEE", "senderPublicKey": "G349Uq3FTox7dRNLeAfAQeoACvwZ9iEnVSaHcEYn6j8J", "proofs": [ "4psWMyDzZ4fRkXqsPpUkkQoY9QKm4zpBiJXaRjkHKZNhJekbVyMRUxa4z3J4rXAMLvEserLDZERJWLVUyQM6QFLW" ], "script": "base64:AAIFAAAAAAAAAF8IAhIHCgUCAQEBARIAEgASCAoGAgEBAQEBEgASAwoBCBIDCgEIEgMKAQgSAwoBCBIFCgMBAQESBQoDAQEBEgYKBAgICAESAwoBCBIDCgEIEgASAwoBCBIHCgUICAgICAAAADUAAAAAC3JldmlzaW9uTnVtAgAAAAAAAAAAA1NFUAIAAAACX18AAAAACE1BWERFUFRIAAAAAAAAAAARAAAAAAlVU0VSREVQVEgAAAAAAAAAABoAAAAABVNDQUxFAAAAAAAAAAPoAAAAAAVNVUxUOAAAAAAABfXhAAAAAAAKemVyb0JpZ0ludAkAATYAAAABAAAAAAAAAAAAAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5CQEAAAALdmFsdWVPckVsc2UAAAACCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQAAAAAAAAAAAAEAAAAPZ2V0TnVtYmVyT3JGYWlsAAAAAQAAAANrZXkJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkJAAEsAAAAAgkAASwAAAACAgAAAA9tYW5kYXRv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AAAAAQkAATgAAAACBQAAAAVkTmV4dAkBAAAABXZhbHVlAAAAAQUAAAAFZFByZXYDCQABQAAAAAIFAAAAD3RhcmdldFByZWNpc2lvbgUAAAAFZERpZmYJAAUUAAAAAgUAAAADbmlsCQABpgAAAAEFAAAABWROZXh0CQAAAgAAAAEJAAEsAAAAAgIAAAAdRCBjYWxjdWxhdGlvbiBlcnJvciwgZERpZmYgPSAJAAGmAAAAAQUAAAAFZERpZmYAAAAAQAf6iw==", "height": 1976321, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EE7FEd2mEEHCgA9ZANsVsP6fPfoLENBrR6VJ5HeaLAuV Next: 8sxpqpajxTzmu2ixUVi5Xn3m3GMR93vUaCUCcfrLV31G Diff:
Old | New | Differences | |
---|---|---|---|
142 | 142 | } | |
143 | 143 | else { | |
144 | 144 | let p = getInteger(this, kLast) | |
145 | - | if (isDefined(p)) | |
145 | + | if (if (isDefined(p)) | |
146 | + | then (period >= value(p)) | |
147 | + | else false) | |
146 | 148 | then { | |
147 | 149 | let pv = value(p) | |
148 | 150 | let k = value(getInteger(boostingContractAddress, keyUserKValueForPeriod(pv, userIndex))) | |
252 | 254 | let latestPeriod = getNumberByKey(keyNextProcessedPeriod()) | |
253 | 255 | let totalWeight = getNumberByKey(keyTotalWeightForPeriod(currentPeriod)) | |
254 | 256 | let heightForPeriod = getNumberByKey(keyHeightForPeriod(currentPeriod)) | |
255 | - | let $ | |
256 | - | let userWeight = $ | |
257 | - | let ignored = $ | |
257 | + | let $t01172411836 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, currentUser) | |
258 | + | let userWeight = $t01172411836._1 | |
259 | + | let ignored = $t01172411836._2 | |
258 | 260 | let userAmountMatcherForPeriod = fraction(getNumberByKey(keyTotalAmountForPeriod(currentPeriod)), userWeight, totalWeight) | |
259 | 261 | let userAmountEmissionForPeriod = fraction(getNumberByKey(keyAuxEmissionRewardForPeriod(currentPeriod)), userWeight, totalWeight) | |
260 | 262 | if (if ((0 >= depth)) | |
274 | 276 | then throw("Nothing to claim") | |
275 | 277 | else { | |
276 | 278 | let boostingContract = fromBase58String(cfgArray[IdxCfgBoostingContract]) | |
277 | - | let $ | |
278 | - | let period = $ | |
279 | - | let amountFromMatcher = $ | |
280 | - | let amountFromEmission = $ | |
279 | + | let $t01304813174 = claimInternal(boostingContract, currentPeriod, userIdx, USERDEPTH, 0, 0) | |
280 | + | let period = $t01304813174._1 | |
281 | + | let amountFromMatcher = $t01304813174._2 | |
282 | + | let amountFromEmission = $t01304813174._3 | |
281 | 283 | $Tuple6(period, amountFromMatcher, amountFromEmission, userIdx, cfgArray, nextProcessedPeriod) | |
282 | 284 | } | |
283 | 285 | } | |
329 | 331 | let deltaH = (height - getNumberOrFail(keyGwxRewardEmissionStartHeight())) | |
330 | 332 | let emissionRate = valueOrErrorMessage(getInteger(emissionContract, keyRatePerBlockCurrent()), (("mandatory emission_contract." + keyRatePerBlockCurrent()) + " is not defined")) | |
331 | 333 | let weight = valueOrErrorMessage(getInteger(factoryContract, keyPoolWeightVirtual()), (("mandatory factory_contract." + keyPoolWeightVirtual()) + " is not defined")) | |
332 | - | let auxAmount = fraction((deltaH * | |
334 | + | let auxAmount = fraction((deltaH * weight), emissionRate, MULT8) | |
333 | 335 | let em = invoke(emissionContract, "emit", [auxAmount], nil) | |
334 | 336 | if ((em == em)) | |
335 | 337 | then { | |
357 | 359 | @Callable(i) | |
358 | 360 | func claimReward () = { | |
359 | 361 | let address = toString(i.caller) | |
360 | - | let $ | |
361 | - | let period = $ | |
362 | - | let amountFromMatcher = $ | |
363 | - | let amountFromEmission = $ | |
364 | - | let userIdx = $ | |
365 | - | let cfgArray = $ | |
366 | - | let nextProcessedPeriod = $ | |
362 | + | let $t01746017580 = commonClaimReward(address) | |
363 | + | let period = $t01746017580._1 | |
364 | + | let amountFromMatcher = $t01746017580._2 | |
365 | + | let amountFromEmission = $t01746017580._3 | |
366 | + | let userIdx = $t01746017580._4 | |
367 | + | let cfgArray = $t01746017580._5 | |
368 | + | let nextProcessedPeriod = $t01746017580._6 | |
367 | 369 | $Tuple2([IntegerEntry(keyNextUnlaimedPeriodOfUser(userIdx), period), ScriptTransfer(i.caller, (amountFromMatcher + amountFromEmission), fromBase58String(cfgArray[IdxCfgAssetId])), HistoryEntry("claim", address, amountFromMatcher, amountFromEmission, period, nextProcessedPeriod, i)], [amountFromMatcher, amountFromEmission]) | |
368 | 370 | } | |
369 | 371 | ||
380 | 382 | ||
381 | 383 | @Callable(i) | |
382 | 384 | func claimRewardDetailedREADONLY (address) = { | |
383 | - | let $ | |
384 | - | let ignored = $ | |
385 | - | let fromMatcher = $ | |
386 | - | let fromEmission = $ | |
385 | + | let $t01832218391 = commonClaimReward(address) | |
386 | + | let ignored = $t01832218391._1 | |
387 | + | let fromMatcher = $t01832218391._2 | |
388 | + | let fromEmission = $t01832218391._3 | |
387 | 389 | $Tuple2(nil, makeString(["%d%d%d", toString((fromMatcher + fromEmission)), toString(fromMatcher), toString(fromEmission)], SEP)) | |
388 | 390 | } | |
389 | 391 | ||
474 | 476 | let ann = (amp * nCoins) | |
475 | 477 | let arr = [1, 2, 3, 4, 5, 6, 7] | |
476 | 478 | func calc (acc,cur) = { | |
477 | - | let $ | |
478 | - | let d = $ | |
479 | - | let dPrev = $ | |
479 | + | let $t02187022059 = acc | |
480 | + | let d = $t02187022059._1 | |
481 | + | let dPrev = $t02187022059._2 | |
480 | 482 | let dp = (((d * d) * d) / (((x1 * x2) * nCoins) * nCoins)) | |
481 | 483 | let dNext = (((((ann * s) / aPrecision) + (dp * nCoins)) * d) / ((((ann - aPrecision) * d) / aPrecision) + ((nCoins + toBigInt(1)) * dp))) | |
482 | 484 | $Tuple2(dNext, d) | |
483 | 485 | } | |
484 | 486 | ||
485 | - | let $ | |
487 | + | let $t02227222322 = { | |
486 | 488 | let $l = arr | |
487 | 489 | let $s = size($l) | |
488 | 490 | let $acc0 = $Tuple2(s, unit) | |
496 | 498 | ||
497 | 499 | $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) | |
498 | 500 | } | |
499 | - | let dNext = $ | |
500 | - | let dPrev = $ | |
501 | + | let dNext = $t02227222322._1 | |
502 | + | let dPrev = $t02227222322._2 | |
501 | 503 | let dDiff = abs((dNext - value(dPrev))) | |
502 | 504 | if ((targetPrecision >= dDiff)) | |
503 | 505 | then $Tuple2(nil, toString(dNext)) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let revisionNum = "" | |
5 | 5 | ||
6 | 6 | let SEP = "__" | |
7 | 7 | ||
8 | 8 | let MAXDEPTH = 17 | |
9 | 9 | ||
10 | 10 | let USERDEPTH = 26 | |
11 | 11 | ||
12 | 12 | let SCALE = 1000 | |
13 | 13 | ||
14 | 14 | let MULT8 = 100000000 | |
15 | 15 | ||
16 | 16 | let zeroBigInt = toBigInt(0) | |
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(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 | func keyFactoryAddress () = "%s%s__config__factoryAddress" | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | let factoryAddressStr = getStringOrFail(keyFactoryAddress()) | |
39 | 39 | ||
40 | 40 | let factoryContract = addressFromStringValue(factoryAddressStr) | |
41 | 41 | ||
42 | 42 | func keyEmissionAddress () = "%s%s__config__emissionAddress" | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | let emissionAddressStr = getStringOrFail(keyEmissionAddress()) | |
46 | 46 | ||
47 | 47 | let emissionContract = addressFromStringValue(emissionAddressStr) | |
48 | 48 | ||
49 | 49 | let IdxCfgAssetId = 1 | |
50 | 50 | ||
51 | 51 | let IdxCfgPacemakerAddress = 2 | |
52 | 52 | ||
53 | 53 | let IdxCfgBoostingContract = 3 | |
54 | 54 | ||
55 | 55 | let IdxCfgMaxDepth = 4 | |
56 | 56 | ||
57 | 57 | func keyConfig () = "%s__config" | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func readConfigArrayOrFail () = split(getStringOrFail(keyConfig()), SEP) | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func formatConfig (wxAssetIdStr,matcherPacemakerAddressStr,boostingContractAddressStr,maxDepth) = makeString(["%s%s%s%d", wxAssetIdStr, matcherPacemakerAddressStr, boostingContractAddressStr, toString(maxDepth)], SEP) | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func keyGwxRewardEmissionStartHeight () = "%s%s__gwxRewardEmissionPart__startHeight" | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func keyUsersCount () = "%s__nextUserNum" | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func keyRatePerBlockCurrent () = "%s%s__ratePerBlock__current" | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func keyPoolWeightVirtual () = "%s%s__poolWeight__GWXvirtualPOOL" | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func keyNextProcessedUser () = "%s__nextProcessedUser" | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func keyLatestPeriod () = "%s__latestPeriod" | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func keyNextPeriod () = "%s__nextPeriod" | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func keyNextProcessedPeriod () = "%s__nextProcessedPeriod" | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func keyNextUnlaimedPeriodOfUser (userIndex) = makeString(["%s%d__nextClaimedPeriod", toString(userIndex)], SEP) | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func keyLastProcessedPeriodOfUser (userIndex) = makeString(["%s%d__lastProcessedPeriod", toString(userIndex)], SEP) | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func keyHeightForPeriod (period) = makeString(["%s%d__startHeightForPeriod", toString(period)], SEP) | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func keyAuxEmissionRewardForPeriod (period) = makeString(["%s%d__auxEmissionReward", toString(period)], SEP) | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func keyTotalAmountForPeriod (period) = makeString(["%s%d__totalAmountForPeriod", toString(period)], SEP) | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func keyLastPayoutInfo () = "%s__lastPayoutInfo" | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func PeriodPayoutInfo (period,matcherReward,emissionReward) = makeString(["%d%d%d", toString(period), toString(matcherReward), toString(emissionReward)], SEP) | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func keyPayoutHistoryInfo (period) = makeString(["%s%s%d__payouts__history", toString(period)], SEP) | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func keyTotalWeightForPeriod (period) = makeString(["%s%d__totalWeightForPeriod", toString(period)], SEP) | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func keyUserKValueForPeriod (period,userIndex) = makeString(["%s%d%s%d__paramByPeriod", toString(userIndex), "k", toString(period)], SEP) | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func keyUserBValueForPeriod (period,userIndex) = makeString(["%s%d%s%d__paramByPeriod", toString(userIndex), "b", toString(period)], SEP) | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func HistoryEntry (type,user,amountFromMatcher,amountFromEmission,currentPeriod,latestPeriod,i) = { | |
124 | 124 | let historyKEY = makeString(["%s%s%s%s__history", type, user, toBase58String(i.transactionId)], SEP) | |
125 | 125 | let historyDATA = makeString(["%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(amountFromMatcher), toString(amountFromEmission), toString(currentPeriod), toString(latestPeriod)], SEP) | |
126 | 126 | StringEntry(historyKEY, historyDATA) | |
127 | 127 | } | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | func calcUserWeight (boostingContractAddress,heightForPeriod,period,userIndex) = { | |
131 | 131 | let kLast = keyLastProcessedPeriodOfUser(userIndex) | |
132 | 132 | let kKey = keyUserKValueForPeriod(period, userIndex) | |
133 | 133 | let kRaw = getInteger(boostingContractAddress, kKey) | |
134 | 134 | if (isDefined(kRaw)) | |
135 | 135 | then { | |
136 | 136 | let k = value(kRaw) | |
137 | 137 | let b = value(getInteger(boostingContractAddress, keyUserBValueForPeriod(period, userIndex))) | |
138 | 138 | let w = ((k * heightForPeriod) + b) | |
139 | 139 | if ((w > 0)) | |
140 | 140 | then $Tuple2((w / SCALE), [IntegerEntry(kLast, period)]) | |
141 | 141 | else $Tuple2(0, nil) | |
142 | 142 | } | |
143 | 143 | else { | |
144 | 144 | let p = getInteger(this, kLast) | |
145 | - | if (isDefined(p)) | |
145 | + | if (if (isDefined(p)) | |
146 | + | then (period >= value(p)) | |
147 | + | else false) | |
146 | 148 | then { | |
147 | 149 | let pv = value(p) | |
148 | 150 | let k = value(getInteger(boostingContractAddress, keyUserKValueForPeriod(pv, userIndex))) | |
149 | 151 | let b = value(getInteger(boostingContractAddress, keyUserBValueForPeriod(pv, userIndex))) | |
150 | 152 | let w = ((k * heightForPeriod) + b) | |
151 | 153 | if ((w > 0)) | |
152 | 154 | then $Tuple2((w / SCALE), nil) | |
153 | 155 | else $Tuple2(0, nil) | |
154 | 156 | } | |
155 | 157 | else $Tuple2(0, nil) | |
156 | 158 | } | |
157 | 159 | } | |
158 | 160 | ||
159 | 161 | ||
160 | 162 | func getUserIndexByAddress (boostingContractAddressStr,userAddress) = { | |
161 | 163 | let key = makeString(["%s%s%s", "mapping", "user2num", userAddress], SEP) | |
162 | 164 | parseIntValue(valueOrErrorMessage(getString(Address(fromBase58String(boostingContractAddressStr)), key), ((("User address " + userAddress) + " is not found in boosting contract data, key=") + key))) | |
163 | 165 | } | |
164 | 166 | ||
165 | 167 | ||
166 | 168 | func nextPeriod () = getNumberByKey(keyNextPeriod()) | |
167 | 169 | ||
168 | 170 | ||
169 | 171 | func invokeProcess (boostingContract,period,user,depth,weight) = { | |
170 | 172 | let result = invoke(this, "processNextBatch", [boostingContract, period, user, depth, weight], nil) | |
171 | 173 | if ((result == result)) | |
172 | 174 | then match result { | |
173 | 175 | case r: (Int, Int, Int) => | |
174 | 176 | r | |
175 | 177 | case _ => | |
176 | 178 | throw("Incorrect invoke result") | |
177 | 179 | } | |
178 | 180 | else throw("Strict value is not equal to itself.") | |
179 | 181 | } | |
180 | 182 | ||
181 | 183 | ||
182 | 184 | func processNextBatchInternal (boostingContract,currentPeriod,currentUser,depth,totalWeight) = { | |
183 | 185 | let boostingContractAddress = Address(boostingContract) | |
184 | 186 | let latestPeriod = getNumberByKey(keyLatestPeriod()) | |
185 | 187 | let usersCount = valueOrElse(getInteger(boostingContractAddress, keyUsersCount()), 0) | |
186 | 188 | let totalWeightKey = keyTotalWeightForPeriod(currentPeriod) | |
187 | 189 | let heightForPeriod = getNumberByKey(keyHeightForPeriod(currentPeriod)) | |
188 | 190 | if (if ((depth > 0)) | |
189 | 191 | then (latestPeriod >= currentPeriod) | |
190 | 192 | else false) | |
191 | 193 | then { | |
192 | 194 | let t0 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, currentUser) | |
193 | 195 | let weight0 = (totalWeight + t0._1) | |
194 | 196 | if ((usersCount > (currentUser + 1))) | |
195 | 197 | then { | |
196 | 198 | let t1 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, (currentUser + 1)) | |
197 | 199 | let weight1 = (weight0 + t1._1) | |
198 | 200 | if ((usersCount > (currentUser + 2))) | |
199 | 201 | then { | |
200 | 202 | let t2 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, (currentUser + 2)) | |
201 | 203 | let weight2 = (weight1 + t2._1) | |
202 | 204 | if ((usersCount > (currentUser + 3))) | |
203 | 205 | then { | |
204 | 206 | let t3 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, (currentUser + 3)) | |
205 | 207 | let weight3 = (weight2 + t3._1) | |
206 | 208 | if ((usersCount > (currentUser + 4))) | |
207 | 209 | then { | |
208 | 210 | let t4 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, (currentUser + 4)) | |
209 | 211 | let weight4 = (weight3 + t4._1) | |
210 | 212 | if ((usersCount > (currentUser + 5))) | |
211 | 213 | then { | |
212 | 214 | let t5 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, (currentUser + 5)) | |
213 | 215 | let weight5 = (weight4 + t5._1) | |
214 | 216 | if ((usersCount > (currentUser + 6))) | |
215 | 217 | then { | |
216 | 218 | let r5 = invokeProcess(boostingContract, currentPeriod, (currentUser + 6), (depth - 1), weight5) | |
217 | 219 | $Tuple4((((((t0._2 ++ t1._2) ++ t2._2) ++ t3._2) ++ t4._2) ++ t5._2), r5._1, r5._2, r5._3) | |
218 | 220 | } | |
219 | 221 | else $Tuple4((((((([IntegerEntry(totalWeightKey, weight5)] ++ t0._2) ++ t1._2) ++ t2._2) ++ t3._2) ++ t4._2) ++ t5._2), (currentPeriod + 1), 0, 0) | |
220 | 222 | } | |
221 | 223 | else $Tuple4(((((([IntegerEntry(totalWeightKey, weight4)] ++ t0._2) ++ t1._2) ++ t2._2) ++ t3._2) ++ t4._2), (currentPeriod + 1), 0, 0) | |
222 | 224 | } | |
223 | 225 | else $Tuple4((((([IntegerEntry(totalWeightKey, weight3)] ++ t0._2) ++ t1._2) ++ t2._2) ++ t3._2), (currentPeriod + 1), 0, 0) | |
224 | 226 | } | |
225 | 227 | else $Tuple4(((([IntegerEntry(totalWeightKey, weight2)] ++ t0._2) ++ t1._2) ++ t2._2), (currentPeriod + 1), 0, 0) | |
226 | 228 | } | |
227 | 229 | else $Tuple4((([IntegerEntry(totalWeightKey, weight1)] ++ t0._2) ++ t1._2), (currentPeriod + 1), 0, 0) | |
228 | 230 | } | |
229 | 231 | else $Tuple4(([IntegerEntry(totalWeightKey, weight0)] ++ t0._2), (currentPeriod + 1), 0, 0) | |
230 | 232 | } | |
231 | 233 | else if ((currentUser == 0)) | |
232 | 234 | then $Tuple4(nil, currentPeriod, 0, 0) | |
233 | 235 | else $Tuple4([IntegerEntry(totalWeightKey, totalWeight)], currentPeriod, currentUser, 0) | |
234 | 236 | } | |
235 | 237 | ||
236 | 238 | ||
237 | 239 | func invokeClaim (boostingContract,period,user,depth,totalFromMatcher,totalFromEmission) = { | |
238 | 240 | let result = invoke(this, "claimNextBatch", [boostingContract, period, user, depth, totalFromMatcher, totalFromEmission], nil) | |
239 | 241 | if ((result == result)) | |
240 | 242 | then match result { | |
241 | 243 | case r: (Int, Int, Int) => | |
242 | 244 | r | |
243 | 245 | case _ => | |
244 | 246 | throw("Incorrect invoke result") | |
245 | 247 | } | |
246 | 248 | else throw("Strict value is not equal to itself.") | |
247 | 249 | } | |
248 | 250 | ||
249 | 251 | ||
250 | 252 | func claimInternal (boostingContract,currentPeriod,currentUser,depth,userAccumulatedMatcher,userAccumulatedEmission) = { | |
251 | 253 | let boostingContractAddress = Address(boostingContract) | |
252 | 254 | let latestPeriod = getNumberByKey(keyNextProcessedPeriod()) | |
253 | 255 | let totalWeight = getNumberByKey(keyTotalWeightForPeriod(currentPeriod)) | |
254 | 256 | let heightForPeriod = getNumberByKey(keyHeightForPeriod(currentPeriod)) | |
255 | - | let $ | |
256 | - | let userWeight = $ | |
257 | - | let ignored = $ | |
257 | + | let $t01172411836 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, currentUser) | |
258 | + | let userWeight = $t01172411836._1 | |
259 | + | let ignored = $t01172411836._2 | |
258 | 260 | let userAmountMatcherForPeriod = fraction(getNumberByKey(keyTotalAmountForPeriod(currentPeriod)), userWeight, totalWeight) | |
259 | 261 | let userAmountEmissionForPeriod = fraction(getNumberByKey(keyAuxEmissionRewardForPeriod(currentPeriod)), userWeight, totalWeight) | |
260 | 262 | if (if ((0 >= depth)) | |
261 | 263 | then true | |
262 | 264 | else ((currentPeriod + 1) >= latestPeriod)) | |
263 | 265 | then $Tuple3((currentPeriod + 1), (userAccumulatedMatcher + userAmountMatcherForPeriod), (userAccumulatedEmission + userAmountEmissionForPeriod)) | |
264 | 266 | else invokeClaim(boostingContract, (currentPeriod + 1), currentUser, (depth - 1), (userAccumulatedMatcher + userAmountMatcherForPeriod), (userAccumulatedEmission + userAmountEmissionForPeriod)) | |
265 | 267 | } | |
266 | 268 | ||
267 | 269 | ||
268 | 270 | func commonClaimReward (userAddress) = { | |
269 | 271 | let cfgArray = readConfigArrayOrFail() | |
270 | 272 | let userIdx = getUserIndexByAddress(cfgArray[IdxCfgBoostingContract], userAddress) | |
271 | 273 | let currentPeriod = getNumberByKey(keyNextUnlaimedPeriodOfUser(userIdx)) | |
272 | 274 | let nextProcessedPeriod = getNumberByKey(keyNextProcessedPeriod()) | |
273 | 275 | if ((currentPeriod >= nextProcessedPeriod)) | |
274 | 276 | then throw("Nothing to claim") | |
275 | 277 | else { | |
276 | 278 | let boostingContract = fromBase58String(cfgArray[IdxCfgBoostingContract]) | |
277 | - | let $ | |
278 | - | let period = $ | |
279 | - | let amountFromMatcher = $ | |
280 | - | let amountFromEmission = $ | |
279 | + | let $t01304813174 = claimInternal(boostingContract, currentPeriod, userIdx, USERDEPTH, 0, 0) | |
280 | + | let period = $t01304813174._1 | |
281 | + | let amountFromMatcher = $t01304813174._2 | |
282 | + | let amountFromEmission = $t01304813174._3 | |
281 | 283 | $Tuple6(period, amountFromMatcher, amountFromEmission, userIdx, cfgArray, nextProcessedPeriod) | |
282 | 284 | } | |
283 | 285 | } | |
284 | 286 | ||
285 | 287 | ||
286 | 288 | @Callable(i) | |
287 | 289 | func processNextBatch (boostingContract,currentPeriod,currentUser,depth,totalWeight) = if ((i.caller != this)) | |
288 | 290 | then throw("Should be called by this script only") | |
289 | 291 | else { | |
290 | 292 | let tpl = processNextBatchInternal(boostingContract, currentPeriod, currentUser, depth, totalWeight) | |
291 | 293 | $Tuple2(tpl._1, $Tuple3(tpl._2, tpl._3, tpl._4)) | |
292 | 294 | } | |
293 | 295 | ||
294 | 296 | ||
295 | 297 | ||
296 | 298 | @Callable(i) | |
297 | 299 | func processPendingPeriodsAndUsers () = { | |
298 | 300 | let currentPeriod = getNumberByKey(keyNextProcessedPeriod()) | |
299 | 301 | if ((currentPeriod > getNumberByKey(keyLatestPeriod()))) | |
300 | 302 | then throw("Nothing to process") | |
301 | 303 | else { | |
302 | 304 | let cfgArray = readConfigArrayOrFail() | |
303 | 305 | let depth = parseIntValue(cfgArray[IdxCfgMaxDepth]) | |
304 | 306 | if ((depth > MAXDEPTH)) | |
305 | 307 | then throw("Depth exceeds MAXDEPTH") | |
306 | 308 | else { | |
307 | 309 | let boostingContract = fromBase58String(cfgArray[IdxCfgBoostingContract]) | |
308 | 310 | let currentUser = getNumberByKey(keyNextProcessedUser()) | |
309 | 311 | let totalWeight = getNumberByKey(keyTotalWeightForPeriod(currentPeriod)) | |
310 | 312 | let r = processNextBatchInternal(boostingContract, currentPeriod, currentUser, depth, totalWeight) | |
311 | 313 | ((r._1 :+ IntegerEntry(keyNextProcessedPeriod(), r._2)) :+ IntegerEntry(keyNextProcessedUser(), r._3)) | |
312 | 314 | } | |
313 | 315 | } | |
314 | 316 | } | |
315 | 317 | ||
316 | 318 | ||
317 | 319 | ||
318 | 320 | @Callable(i) | |
319 | 321 | func deposit () = { | |
320 | 322 | let cfgArray = readConfigArrayOrFail() | |
321 | 323 | if ((i.caller != Address(fromBase58String(cfgArray[IdxCfgPacemakerAddress])))) | |
322 | 324 | then throw("Wrong caller address") | |
323 | 325 | else { | |
324 | 326 | let assetId = value(value(i.payments[0]).assetId) | |
325 | 327 | if ((assetId != fromBase58String(cfgArray[IdxCfgAssetId]))) | |
326 | 328 | then throw("Wrong payment asset") | |
327 | 329 | else { | |
328 | 330 | let period = nextPeriod() | |
329 | 331 | let deltaH = (height - getNumberOrFail(keyGwxRewardEmissionStartHeight())) | |
330 | 332 | let emissionRate = valueOrErrorMessage(getInteger(emissionContract, keyRatePerBlockCurrent()), (("mandatory emission_contract." + keyRatePerBlockCurrent()) + " is not defined")) | |
331 | 333 | let weight = valueOrErrorMessage(getInteger(factoryContract, keyPoolWeightVirtual()), (("mandatory factory_contract." + keyPoolWeightVirtual()) + " is not defined")) | |
332 | - | let auxAmount = fraction((deltaH * | |
334 | + | let auxAmount = fraction((deltaH * weight), emissionRate, MULT8) | |
333 | 335 | let em = invoke(emissionContract, "emit", [auxAmount], nil) | |
334 | 336 | if ((em == em)) | |
335 | 337 | then { | |
336 | 338 | let matcherPart = value(i.payments[0]).amount | |
337 | 339 | let payoutInfo = PeriodPayoutInfo(period, matcherPart, auxAmount) | |
338 | 340 | [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)] | |
339 | 341 | } | |
340 | 342 | else throw("Strict value is not equal to itself.") | |
341 | 343 | } | |
342 | 344 | } | |
343 | 345 | } | |
344 | 346 | ||
345 | 347 | ||
346 | 348 | ||
347 | 349 | @Callable(i) | |
348 | 350 | func claimNextBatch (boostingContract,currentPeriod,currentUser,depth,totalFromMatcher,totalFromEmission) = if ((i.caller != this)) | |
349 | 351 | then throw("Should be called by this script only") | |
350 | 352 | else { | |
351 | 353 | let periodAndTotals = claimInternal(boostingContract, currentPeriod, currentUser, depth, totalFromMatcher, totalFromEmission) | |
352 | 354 | $Tuple2(nil, periodAndTotals) | |
353 | 355 | } | |
354 | 356 | ||
355 | 357 | ||
356 | 358 | ||
357 | 359 | @Callable(i) | |
358 | 360 | func claimReward () = { | |
359 | 361 | let address = toString(i.caller) | |
360 | - | let $ | |
361 | - | let period = $ | |
362 | - | let amountFromMatcher = $ | |
363 | - | let amountFromEmission = $ | |
364 | - | let userIdx = $ | |
365 | - | let cfgArray = $ | |
366 | - | let nextProcessedPeriod = $ | |
362 | + | let $t01746017580 = commonClaimReward(address) | |
363 | + | let period = $t01746017580._1 | |
364 | + | let amountFromMatcher = $t01746017580._2 | |
365 | + | let amountFromEmission = $t01746017580._3 | |
366 | + | let userIdx = $t01746017580._4 | |
367 | + | let cfgArray = $t01746017580._5 | |
368 | + | let nextProcessedPeriod = $t01746017580._6 | |
367 | 369 | $Tuple2([IntegerEntry(keyNextUnlaimedPeriodOfUser(userIdx), period), ScriptTransfer(i.caller, (amountFromMatcher + amountFromEmission), fromBase58String(cfgArray[IdxCfgAssetId])), HistoryEntry("claim", address, amountFromMatcher, amountFromEmission, period, nextProcessedPeriod, i)], [amountFromMatcher, amountFromEmission]) | |
368 | 370 | } | |
369 | 371 | ||
370 | 372 | ||
371 | 373 | ||
372 | 374 | @Callable(i) | |
373 | 375 | func claimRewardREADONLY (address) = { | |
374 | 376 | let claimResults = commonClaimReward(address) | |
375 | 377 | let amount = (claimResults._2 + claimResults._3) | |
376 | 378 | $Tuple2(nil, amount) | |
377 | 379 | } | |
378 | 380 | ||
379 | 381 | ||
380 | 382 | ||
381 | 383 | @Callable(i) | |
382 | 384 | func claimRewardDetailedREADONLY (address) = { | |
383 | - | let $ | |
384 | - | let ignored = $ | |
385 | - | let fromMatcher = $ | |
386 | - | let fromEmission = $ | |
385 | + | let $t01832218391 = commonClaimReward(address) | |
386 | + | let ignored = $t01832218391._1 | |
387 | + | let fromMatcher = $t01832218391._2 | |
388 | + | let fromEmission = $t01832218391._3 | |
387 | 389 | $Tuple2(nil, makeString(["%d%d%d", toString((fromMatcher + fromEmission)), toString(fromMatcher), toString(fromEmission)], SEP)) | |
388 | 390 | } | |
389 | 391 | ||
390 | 392 | ||
391 | 393 | ||
392 | 394 | @Callable(i) | |
393 | 395 | func latestFinalizedPeriodREADONLY (address) = $Tuple2(nil, valueOrElse(getInteger(this, keyLatestPeriod()), -1)) | |
394 | 396 | ||
395 | 397 | ||
396 | 398 | ||
397 | 399 | @Callable(i) | |
398 | 400 | func latestFinalizedPeriodInfoREADONLY (address) = $Tuple2(nil, getStringByKey(keyLastPayoutInfo())) | |
399 | 401 | ||
400 | 402 | ||
401 | 403 | ||
402 | 404 | @Callable(i) | |
403 | 405 | func calcGwxParamsREADONLY (gwxAmountStart,lockStartHeight,lockDurationBlocks) = { | |
404 | 406 | let lockEndHeight = (lockStartHeight + lockDurationBlocks) | |
405 | 407 | let scale8ParamK = -(fraction(gwxAmountStart, SCALE, lockDurationBlocks)) | |
406 | 408 | let scale8ParamB = (fraction(gwxAmountStart, SCALE, lockDurationBlocks) * lockEndHeight) | |
407 | 409 | $Tuple2(nil, [scale8ParamK, scale8ParamB, nextPeriod()]) | |
408 | 410 | } | |
409 | 411 | ||
410 | 412 | ||
411 | 413 | ||
412 | 414 | @Callable(i) | |
413 | 415 | func calcGwxAmountStartREADONLY (wxLockAmount,lockDuration,maxLockDuration) = { | |
414 | 416 | let coeffX8 = fraction(lockDuration, MULT8, maxLockDuration) | |
415 | 417 | let gWxAmountStart = fraction(wxLockAmount, coeffX8, MULT8) | |
416 | 418 | $Tuple2(nil, [gWxAmountStart]) | |
417 | 419 | } | |
418 | 420 | ||
419 | 421 | ||
420 | 422 | ||
421 | 423 | @Callable(i) | |
422 | 424 | func constructor (wxAssetIdStr,matcherPacemakerAddressStr,boostingContractAddressStr,maxDepth) = if ((this != i.caller)) | |
423 | 425 | then throw("not authorized") | |
424 | 426 | else [StringEntry(keyConfig(), formatConfig(wxAssetIdStr, matcherPacemakerAddressStr, boostingContractAddressStr, maxDepth))] | |
425 | 427 | ||
426 | 428 | ||
427 | 429 | ||
428 | 430 | @Callable(i) | |
429 | 431 | func constructorV2 (factoryAddress) = if ((this != i.caller)) | |
430 | 432 | then throw("not authorized") | |
431 | 433 | else [StringEntry(keyFactoryAddress(), factoryAddress)] | |
432 | 434 | ||
433 | 435 | ||
434 | 436 | ||
435 | 437 | @Callable(i) | |
436 | 438 | func constructorV3 (emissionAddress) = if ((this != i.caller)) | |
437 | 439 | then throw("not authorized") | |
438 | 440 | else { | |
439 | 441 | let initLatestPeriod = if (isDefined(getInteger(this, keyLatestPeriod()))) | |
440 | 442 | then nil | |
441 | 443 | else [IntegerEntry(keyLatestPeriod(), -1)] | |
442 | 444 | (initLatestPeriod :+ StringEntry(keyEmissionAddress(), emissionAddress)) | |
443 | 445 | } | |
444 | 446 | ||
445 | 447 | ||
446 | 448 | ||
447 | 449 | @Callable(i) | |
448 | 450 | func onEmissionForGwxStart () = if ((i.caller != factoryContract)) | |
449 | 451 | then throw("permissions denied") | |
450 | 452 | else [IntegerEntry(keyGwxRewardEmissionStartHeight(), height)] | |
451 | 453 | ||
452 | 454 | ||
453 | 455 | ||
454 | 456 | @Callable(i) | |
455 | 457 | func latestPeriodEmissionRewardsREADONLY (address) = { | |
456 | 458 | let period = nextPeriod() | |
457 | 459 | $Tuple2(nil, [getNumberByKey(keyAuxEmissionRewardForPeriod(period))]) | |
458 | 460 | } | |
459 | 461 | ||
460 | 462 | ||
461 | 463 | ||
462 | 464 | @Callable(i) | |
463 | 465 | func calcD (x1BigIntStr,x2BigIntStr,ampBigIntStr,aPrecisionBigIntStr,targetPrecisionBigIntStr) = { | |
464 | 466 | let nCoins = toBigInt(2) | |
465 | 467 | let aPrecision = parseBigIntValue(aPrecisionBigIntStr) | |
466 | 468 | let targetPrecision = parseBigIntValue(targetPrecisionBigIntStr) | |
467 | 469 | let x1 = parseBigIntValue(x1BigIntStr) | |
468 | 470 | let x2 = parseBigIntValue(x2BigIntStr) | |
469 | 471 | let amp = (parseBigIntValue(ampBigIntStr) * aPrecision) | |
470 | 472 | let s = (x1 + x2) | |
471 | 473 | if ((s == zeroBigInt)) | |
472 | 474 | then $Tuple2(nil, toString(zeroBigInt)) | |
473 | 475 | else { | |
474 | 476 | let ann = (amp * nCoins) | |
475 | 477 | let arr = [1, 2, 3, 4, 5, 6, 7] | |
476 | 478 | func calc (acc,cur) = { | |
477 | - | let $ | |
478 | - | let d = $ | |
479 | - | let dPrev = $ | |
479 | + | let $t02187022059 = acc | |
480 | + | let d = $t02187022059._1 | |
481 | + | let dPrev = $t02187022059._2 | |
480 | 482 | let dp = (((d * d) * d) / (((x1 * x2) * nCoins) * nCoins)) | |
481 | 483 | let dNext = (((((ann * s) / aPrecision) + (dp * nCoins)) * d) / ((((ann - aPrecision) * d) / aPrecision) + ((nCoins + toBigInt(1)) * dp))) | |
482 | 484 | $Tuple2(dNext, d) | |
483 | 485 | } | |
484 | 486 | ||
485 | - | let $ | |
487 | + | let $t02227222322 = { | |
486 | 488 | let $l = arr | |
487 | 489 | let $s = size($l) | |
488 | 490 | let $acc0 = $Tuple2(s, unit) | |
489 | 491 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
490 | 492 | then $a | |
491 | 493 | else calc($a, $l[$i]) | |
492 | 494 | ||
493 | 495 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
494 | 496 | then $a | |
495 | 497 | else throw("List size exceeds 7") | |
496 | 498 | ||
497 | 499 | $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) | |
498 | 500 | } | |
499 | - | let dNext = $ | |
500 | - | let dPrev = $ | |
501 | + | let dNext = $t02227222322._1 | |
502 | + | let dPrev = $t02227222322._2 | |
501 | 503 | let dDiff = abs((dNext - value(dPrev))) | |
502 | 504 | if ((targetPrecision >= dDiff)) | |
503 | 505 | then $Tuple2(nil, toString(dNext)) | |
504 | 506 | else throw(("D calculation error, dDiff = " + toString(dDiff))) | |
505 | 507 | } | |
506 | 508 | } | |
507 | 509 | ||
508 | 510 |
github/deemru/w8io/169f3d6 102.84 ms ◑