tx · HysWtk6dUsvdzxkuVcGbWUjnrSxBno7eeyrT6GxNJx4E

3Mp5kisFrqESzrXxAMEPk2k69zpeF41czEE:  -0.01800000 Waves

2022.11.01 13:52 [2297955] smart account 3Mp5kisFrqESzrXxAMEPk2k69zpeF41czEE > SELF 0.00000000 Waves

{ "type": 13, "id": "HysWtk6dUsvdzxkuVcGbWUjnrSxBno7eeyrT6GxNJx4E", "fee": 1800000, "feeAssetId": null, "timestamp": 1667299960515, "version": 1, "sender": "3Mp5kisFrqESzrXxAMEPk2k69zpeF41czEE", "senderPublicKey": "G349Uq3FTox7dRNLeAfAQeoACvwZ9iEnVSaHcEYn6j8J", "proofs": [ "2BoUXM6bPRt98vFPU8HXfExPQJN3XXugmgnLwbpPzfaP7LjnQmdmTjsVm7f1QhBgHH9shSQRsuL7DnyJZMQ8utU" ], "script": "base64:BgKPGQgCEgQKAggBEgASAwoBARIAEgASABIDCgEIEgMKAQgSAwoBCBIFCgMBAQESBQoDAQEBEgASAwoBCBIHCgUICAgICBIDCgEIEgAiA1NFUCIFU0NBTEUiBU1VTFQ4Igp6ZXJvQmlnSW50IhRwcm9jZXNzaW5nU3RhZ2VUb3RhbCIVcHJvY2Vzc2luZ1N0YWdlU2hhcmVzIg5nZXROdW1iZXJCeUtleSIDa2V5Ig9nZXROdW1iZXJPckZhaWwiDmdldFN0cmluZ0J5S2V5Ig9nZXRTdHJpbmdPckZhaWwiA2FicyIDdmFsIglhYnNCaWdJbnQiC2tleU1heERlcHRoIg9tYXhEZXB0aERlZmF1bHQiCG1heERlcHRoIhFrZXlGYWN0b3J5QWRkcmVzcyIRZmFjdG9yeUFkZHJlc3NTdHIiD2ZhY3RvcnlDb250cmFjdCISa2V5RW1pc3Npb25BZGRyZXNzIhNrZXlOdW1Ub1VzZXJNYXBwaW5nIgNudW0iFmtleVJlZmVycmFsUHJvZ3JhbU5hbWUiGnJlZmVycmFsUHJvZ3JhbU5hbWVEZWZhdWx0IhNyZWZlcnJhbFByb2dyYW1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YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECZGEBAmRiAAQCZGMEAmFPCQECYU4AAwkAAQIFAmFPAgpCeXRlVmVjdG9yBAJhVAUCYU8FAmFUAwkAAQIFAmFPAgRVbml0CAUCZGEPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAmRhCWJvZHlCeXRlcwkAkQMCCAUCZGEGcHJvb2ZzAAAFAmRj6gXGCA==", "chainId": 84, "height": 2297955, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GrLmd7bKQYGCb8yZmXvR7LpSZhDYTzKhApTdEmqdk2Ar Next: FWL2HwD6oRFLzo6F455UKyxYYhaPwpX4iTJF1DskdgTa Diff:
OldNewDifferences
2525 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (("mandatory this." + key) + " is not defined"))
2626
2727
28-func abs (val) = if ((zeroBigInt > val))
28+func abs (val) = if ((0 > val))
29+ then -(val)
30+ else val
31+
32+
33+func absBigInt (val) = if ((zeroBigInt > val))
2934 then -(val)
3035 else val
3136
325330 then $Tuple2(nil, false)
326331 else if ((processingStage == processingStageTotal))
327332 then {
328- let $t01202312139 = calcUserWeight(boostingContractOrFail(), heightForPeriod, currentPeriod, currentUser)
329- let userWeight = $t01202312139._1
330- let userActions = $t01202312139._2
333+ let $t01208212198 = calcUserWeight(boostingContractOrFail(), heightForPeriod, currentPeriod, currentUser)
334+ let userWeight = $t01208212198._1
335+ let userActions = $t01208212198._2
331336 let totalWeightNew = (totalWeight + userWeight)
332337 let processingActions = if (((usersCount - 1) > currentUser))
333338 then [IntegerEntry(keyNextProcessedUser(), (currentUser + 1))]
433438 func claimReward () = {
434439 let cfgArray = readConfigArrayOrFail()
435440 let address = toString(i.caller)
436- let $t01748117531 = commonClaimReward(address)
437- let amount = $t01748117531._1
438- let actions = $t01748117531._2
441+ let $t01754017590 = commonClaimReward(address)
442+ let amount = $t01754017590._1
443+ let actions = $t01754017590._2
439444 let checkAmount = if ((amount > 0))
440445 then true
441446 else throw("Nothing to claim")
458463
459464 @Callable(i)
460465 func claimRewardREADONLY (address) = {
461- let $t01810418154 = commonClaimReward(address)
462- let amount = $t01810418154._1
463- let actions = $t01810418154._2
466+ let $t01816318213 = commonClaimReward(address)
467+ let amount = $t01816318213._1
468+ let actions = $t01816318213._2
464469 let referralUnclaimed = valueOrElse(getInteger(referralsContractAddressOrFail, keyUnclaimedReferral(referralProgramName, address)), 0)
465470 let totalAmount = (amount + referralUnclaimed)
466471 $Tuple2(nil, totalAmount)
525530 then $Tuple2(nil, toString(zeroBigInt))
526531 else {
527532 let ann = (amp * nCoins)
528- let arr = [1, 2, 3, 4, 5, 6, 7]
533+ let arr = [0, 1, 2, 3, 4, 5, 6]
529534 func calc (acc,cur) = {
530- let $t02077720966 = acc
531- let d = $t02077720966._1
532- let dPrev = $t02077720966._2
533- let dp = (((d * d) * d) / (((x1 * x2) * nCoins) * nCoins))
534- let dNext = (((((ann * s) / aPrecision) + (dp * nCoins)) * d) / ((((ann - aPrecision) * d) / aPrecision) + ((nCoins + toBigInt(1)) * dp)))
535- $Tuple2(dNext, d)
535+ let $t02084620873 = acc
536+ let d = $t02084620873._1
537+ let dPrev = $t02084620873._2
538+ let found = $t02084620873._3
539+ if ((found != unit))
540+ then acc
541+ else {
542+ let dp = (((d * d) * d) / (((x1 * x2) * nCoins) * nCoins))
543+ let dNext = (((((ann * s) / aPrecision) + (dp * nCoins)) * d) / ((((ann - aPrecision) * d) / aPrecision) + ((nCoins + toBigInt(1)) * dp)))
544+ let dDiff = absBigInt((dNext - value(d)))
545+ if ((targetPrecision >= dDiff))
546+ then $Tuple3(dNext, d, cur)
547+ else $Tuple3(dNext, d, unit)
548+ }
536549 }
537550
538- let $t02117921229 = {
551+ let $t02147121534 = {
539552 let $l = arr
540553 let $s = size($l)
541- let $acc0 = $Tuple2(s, unit)
554+ let $acc0 = $Tuple3(s, unit, unit)
542555 func $f0_1 ($a,$i) = if (($i >= $s))
543556 then $a
544557 else calc($a, $l[$i])
549562
550563 $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)
551564 }
552- let dNext = $t02117921229._1
553- let dPrev = $t02117921229._2
554- let dDiff = abs((dNext - value(dPrev)))
555- if ((targetPrecision >= dDiff))
565+ let dNext = $t02147121534._1
566+ let dPrev = $t02147121534._2
567+ let found = $t02147121534._3
568+ if ((found != unit))
556569 then $Tuple2(nil, toString(dNext))
557- else throw(("D calculation error, dDiff = " + toString(dDiff)))
570+ else {
571+ let dDiff = absBigInt((dNext - value(dPrev)))
572+ throw(("D calculation error, dDiff = " + toString(dDiff)))
573+ }
558574 }
559575 }
560576
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 let SCALE = 1000
77
88 let MULT8 = 100000000
99
1010 let zeroBigInt = toBigInt(0)
1111
1212 let processingStageTotal = 0
1313
1414 let processingStageShares = 1
1515
1616 func getNumberByKey (key) = valueOrElse(getInteger(this, key), 0)
1717
1818
1919 func getNumberOrFail (key) = valueOrErrorMessage(getInteger(this, key), (("mandatory this." + key) + " is not defined"))
2020
2121
2222 func getStringByKey (key) = valueOrElse(getString(this, key), "")
2323
2424
2525 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (("mandatory this." + key) + " is not defined"))
2626
2727
28-func abs (val) = if ((zeroBigInt > val))
28+func abs (val) = if ((0 > val))
29+ then -(val)
30+ else val
31+
32+
33+func absBigInt (val) = if ((zeroBigInt > val))
2934 then -(val)
3035 else val
3136
3237
3338 let keyMaxDepth = "%s__maxDepth"
3439
3540 let maxDepthDefault = 30
3641
3742 let maxDepth = valueOrElse(getInteger(this, keyMaxDepth), maxDepthDefault)
3843
3944 func keyFactoryAddress () = "%s%s__config__factoryAddress"
4045
4146
4247 let factoryAddressStr = getStringOrFail(keyFactoryAddress())
4348
4449 let factoryContract = addressFromStringValue(factoryAddressStr)
4550
4651 func keyEmissionAddress () = "%s%s__config__emissionAddress"
4752
4853
4954 func keyNumToUserMapping (num) = makeString(["%s%s%s", "mapping", "num2user", toString(num)], SEP)
5055
5156
5257 let keyReferralProgramName = makeString(["%s%s", "referral", "programName"], SEP)
5358
5459 let referralProgramNameDefault = "wxlock"
5560
5661 let referralProgramName = valueOrElse(getString(this, keyReferralProgramName), referralProgramNameDefault)
5762
5863 let keyReferralMinGWxAmount = makeString(["%s%s", "referral", "minGWxAmount"], SEP)
5964
6065 let referralMinGWxAmountDefault = (500 * MULT8)
6166
6267 let referralMinGWxAmount = valueOrElse(getInteger(this, keyReferralMinGWxAmount), referralMinGWxAmountDefault)
6368
6469 let keyReferrerRewardPermille = makeString(["%s%s", "referral", "referrerRewardPermille"], SEP)
6570
6671 let referrerRewardPermilleDefault = 50
6772
6873 let referrerRewardPermille = valueOrElse(getInteger(this, keyReferrerRewardPermille), referrerRewardPermilleDefault)
6974
7075 let keyReferralRewardPermille = makeString(["%s%s", "referral", "referralRewardPermille"], SEP)
7176
7277 let referralRewardPermilleDefault = 50
7378
7479 let referralRewardPermille = valueOrElse(getInteger(this, keyReferralRewardPermille), referralRewardPermilleDefault)
7580
7681 func keyReferrer (referralAddress) = makeString(["%s%s%s", "referrer", referralProgramName, referralAddress], SEP)
7782
7883
7984 func keyUnclaimedReferral (programName,claimerAddress) = makeString(["%s%s%s", "unclaimedReferral", programName, claimerAddress], SEP)
8085
8186
8287 let emissionAddressStr = getStringOrFail(keyEmissionAddress())
8388
8489 let emissionContract = addressFromStringValue(emissionAddressStr)
8590
8691 let IdxCfgAssetId = 1
8792
8893 let IdxCfgPacemakerAddress = 2
8994
9095 let IdxCfgBoostingContract = 3
9196
9297 let IdxCfgMaxDepth = 4
9398
9499 func keyConfig () = "%s__config"
95100
96101
97102 func readConfigArrayOrFail () = split(getStringOrFail(keyConfig()), SEP)
98103
99104
100105 func formatConfig (wxAssetIdStr,matcherPacemakerAddressStr,boostingContractAddressStr,maxDepth) = makeString(["%s%s%s%d", wxAssetIdStr, matcherPacemakerAddressStr, boostingContractAddressStr, toString(maxDepth)], SEP)
101106
102107
103108 func boostingContractOrFail () = {
104109 let cfgArray = readConfigArrayOrFail()
105110 valueOrErrorMessage(addressFromString(cfgArray[IdxCfgBoostingContract]), "boosting contract address is not defined")
106111 }
107112
108113
109114 func keyGwxRewardEmissionStartHeight () = "%s%s__gwxRewardEmissionPart__startHeight"
110115
111116
112117 func keyUsersCount () = "%s__nextUserNum"
113118
114119
115120 func keyRatePerBlockCurrent () = "%s%s__ratePerBlock__current"
116121
117122
118123 func keyPoolWeightVirtual () = "%s%s__poolWeight__GWXvirtualPOOL"
119124
120125
121126 func keyNextProcessedUser () = "%s__nextProcessedUser"
122127
123128
124129 func keyLatestPeriod () = "%s__latestPeriod"
125130
126131
127132 func keyNextPeriod () = "%s__nextPeriod"
128133
129134
130135 func keyProcessingStage () = "%s__processingStage"
131136
132137
133138 func keyNextProcessedPeriod () = "%s__nextProcessedPeriod"
134139
135140
136141 func keyUserUnclaimed (userIndex) = makeString(["%s%d", "userUnclaimed", toString(userIndex)], SEP)
137142
138143
139144 func keyNextUnlaimedPeriodOfUser (userIndex) = makeString(["%s%d__nextClaimedPeriod", toString(userIndex)], SEP)
140145
141146
142147 func keyLastProcessedPeriodOfUser (userIndex) = makeString(["%s%d__lastProcessedPeriod", toString(userIndex)], SEP)
143148
144149
145150 func keyHeightForPeriod (period) = makeString(["%s%d__startHeightForPeriod", toString(period)], SEP)
146151
147152
148153 func keyAuxEmissionRewardForPeriod (period) = makeString(["%s%d__auxEmissionReward", toString(period)], SEP)
149154
150155
151156 func keyTotalAmountForPeriod (period) = makeString(["%s%d__totalAmountForPeriod", toString(period)], SEP)
152157
153158
154159 func keyLastPayoutInfo () = "%s__lastPayoutInfo"
155160
156161
157162 func PeriodPayoutInfo (period,matcherReward,emissionReward) = makeString(["%d%d%d", toString(period), toString(matcherReward), toString(emissionReward)], SEP)
158163
159164
160165 func keyPayoutHistoryInfo (period) = makeString(["%s%s%d__payouts__history", toString(period)], SEP)
161166
162167
163168 func keyTotalWeightForPeriod (period) = makeString(["%s%d__totalWeightForPeriod", toString(period)], SEP)
164169
165170
166171 func keyUserKValueForPeriod (period,userIndex) = makeString(["%s%d%s%d__paramByPeriod", toString(userIndex), "k", toString(period)], SEP)
167172
168173
169174 func keyUserBValueForPeriod (period,userIndex) = makeString(["%s%d%s%d__paramByPeriod", toString(userIndex), "b", toString(period)], SEP)
170175
171176
172177 func keyUserWeightForPeriod (period,userIndex) = makeString(["%s%d%s%d__paramByPeriod", toString(userIndex), "weight", toString(period)], SEP)
173178
174179
175180 func keyReferralsContractAddress () = makeString(["%s%s", "config", "referralsContractAddress"], SEP)
176181
177182
178183 let referralsContractAddressOrFail = addressFromStringValue(getStringOrFail(keyReferralsContractAddress()))
179184
180185 func HistoryEntry (type,user,amount,i) = {
181186 let historyKEY = makeString(["%s%s%s%s__history", type, user, toBase58String(i.transactionId)], SEP)
182187 let historyDATA = makeString(["%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(amount)], SEP)
183188 StringEntry(historyKEY, historyDATA)
184189 }
185190
186191
187192 func keyManagerPublicKey () = "%s__managerPublicKey"
188193
189194
190195 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
191196
192197
193198 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
194199 case s: String =>
195200 fromBase58String(s)
196201 case _: Unit =>
197202 unit
198203 case _ =>
199204 throw("Match error")
200205 }
201206
202207
203208 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
204209 case s: String =>
205210 fromBase58String(s)
206211 case _: Unit =>
207212 unit
208213 case _ =>
209214 throw("Match error")
210215 }
211216
212217
213218 func mustManager (i) = {
214219 let pd = throw("Permission denied")
215220 match managerPublicKeyOrUnit() {
216221 case pk: ByteVector =>
217222 if ((i.callerPublicKey == pk))
218223 then true
219224 else pd
220225 case _: Unit =>
221226 if ((i.caller == this))
222227 then true
223228 else pd
224229 case _ =>
225230 throw("Match error")
226231 }
227232 }
228233
229234
230235 func calcUserWeight (boostingContractAddress,heightForPeriod,period,userIndex) = {
231236 let kLast = keyLastProcessedPeriodOfUser(userIndex)
232237 let kKey = keyUserKValueForPeriod(period, userIndex)
233238 let kRaw = getInteger(boostingContractAddress, kKey)
234239 let kUserWeight = keyUserWeightForPeriod(period, userIndex)
235240 if (isDefined(kRaw))
236241 then {
237242 let k = value(kRaw)
238243 let b = value(getInteger(boostingContractAddress, keyUserBValueForPeriod(period, userIndex)))
239244 let w = ((k * heightForPeriod) + b)
240245 if ((w > 0))
241246 then $Tuple2((w / SCALE), [IntegerEntry(kLast, period), IntegerEntry(kUserWeight, w)])
242247 else $Tuple2(0, nil)
243248 }
244249 else {
245250 let p = getInteger(this, kLast)
246251 if (if (isDefined(p))
247252 then (period >= value(p))
248253 else false)
249254 then {
250255 let pv = value(p)
251256 let k = value(getInteger(boostingContractAddress, keyUserKValueForPeriod(pv, userIndex)))
252257 let b = value(getInteger(boostingContractAddress, keyUserBValueForPeriod(pv, userIndex)))
253258 let w = ((k * heightForPeriod) + b)
254259 if ((w > 0))
255260 then $Tuple2((w / SCALE), [IntegerEntry(kUserWeight, w)])
256261 else $Tuple2(0, nil)
257262 }
258263 else $Tuple2(0, nil)
259264 }
260265 }
261266
262267
263268 func calcUserWeightForClaim (boostingContractAddress,heightForPeriod,period,userIndex) = {
264269 let kUserWeight = keyUserWeightForPeriod(period, userIndex)
265270 let userWeightOrUnit = getInteger(kUserWeight)
266271 match userWeightOrUnit {
267272 case _: Unit =>
268273 0
269274 case w: Int =>
270275 (w / SCALE)
271276 case _ =>
272277 throw("Match error")
273278 }
274279 }
275280
276281
277282 func getUserIndexByAddress (boostingContractAddressStr,userAddress) = {
278283 let key = makeString(["%s%s%s", "mapping", "user2num", userAddress], SEP)
279284 parseIntValue(valueOrErrorMessage(getString(Address(fromBase58String(boostingContractAddressStr)), key), ((("User address " + userAddress) + " is not found in boosting contract data, key=") + key)))
280285 }
281286
282287
283288 func nextPeriod () = getNumberByKey(keyNextPeriod())
284289
285290
286291 func commonClaimReward (userAddress) = {
287292 let cfgArray = readConfigArrayOrFail()
288293 let userIdx = getUserIndexByAddress(cfgArray[IdxCfgBoostingContract], userAddress)
289294 let userUnclaimedOption = getInteger(keyUserUnclaimed(userIdx))
290295 match userUnclaimedOption {
291296 case _: Unit =>
292297 $Tuple2(0, nil)
293298 case u: Int =>
294299 $Tuple2(u, [IntegerEntry(keyUserUnclaimed(userIdx), 0)])
295300 case _ =>
296301 throw("Match error")
297302 }
298303 }
299304
300305
301306 @Callable(i)
302307 func updateReferralActivity (userAddress,gWxAmountStart) = {
303308 let referrer = getString(referralsContractAddressOrFail, keyReferrer(userAddress))
304309 let activeReferralInv = if ((referrer == unit))
305310 then unit
306311 else invoke(referralsContractAddressOrFail, "updateReferralActivity", [referralProgramName, userAddress, (gWxAmountStart >= referralMinGWxAmount)], nil)
307312 if ((activeReferralInv == activeReferralInv))
308313 then $Tuple2(nil, unit)
309314 else throw("Strict value is not equal to itself.")
310315 }
311316
312317
313318
314319 @Callable(i)
315320 func finalizeHelper () = {
316321 let processingStage = valueOrElse(getInteger(keyProcessingStage()), processingStageTotal)
317322 let currentPeriod = getNumberByKey(keyNextProcessedPeriod())
318323 let currentUser = getNumberByKey(keyNextProcessedUser())
319324 let latestPeriod = getNumberByKey(keyLatestPeriod())
320325 let usersCount = valueOrElse(getInteger(boostingContractOrFail(), keyUsersCount()), 0)
321326 let totalWeightKey = keyTotalWeightForPeriod(currentPeriod)
322327 let totalWeight = getNumberByKey(keyTotalWeightForPeriod(currentPeriod))
323328 let heightForPeriod = getNumberByKey(keyHeightForPeriod(currentPeriod))
324329 if ((currentPeriod > latestPeriod))
325330 then $Tuple2(nil, false)
326331 else if ((processingStage == processingStageTotal))
327332 then {
328- let $t01202312139 = calcUserWeight(boostingContractOrFail(), heightForPeriod, currentPeriod, currentUser)
329- let userWeight = $t01202312139._1
330- let userActions = $t01202312139._2
333+ let $t01208212198 = calcUserWeight(boostingContractOrFail(), heightForPeriod, currentPeriod, currentUser)
334+ let userWeight = $t01208212198._1
335+ let userActions = $t01208212198._2
331336 let totalWeightNew = (totalWeight + userWeight)
332337 let processingActions = if (((usersCount - 1) > currentUser))
333338 then [IntegerEntry(keyNextProcessedUser(), (currentUser + 1))]
334339 else [IntegerEntry(keyProcessingStage(), processingStageShares), IntegerEntry(keyNextProcessedUser(), 0)]
335340 $Tuple2((([IntegerEntry(totalWeightKey, totalWeightNew)] ++ processingActions) ++ userActions), true)
336341 }
337342 else if ((processingStage == processingStageShares))
338343 then {
339344 let userWeight = calcUserWeightForClaim(boostingContractOrFail(), heightForPeriod, currentPeriod, currentUser)
340345 let userAmountMatcherForPeriod = fraction(getNumberByKey(keyTotalAmountForPeriod(currentPeriod)), userWeight, totalWeight)
341346 let userAmountEmissionForPeriod = fraction(getNumberByKey(keyAuxEmissionRewardForPeriod(currentPeriod)), userWeight, totalWeight)
342347 let userTotalAmount = (userAmountEmissionForPeriod + userAmountMatcherForPeriod)
343348 let userUnclaimedOption = getInteger(keyUserUnclaimed(currentUser))
344349 let userAddress = getStringValue(boostingContractOrFail(), keyNumToUserMapping(currentUser))
345350 let referrer = getString(referralsContractAddressOrFail, keyReferrer(userAddress))
346351 let activeReferralInv = if ((referrer == unit))
347352 then unit
348353 else invoke(referralsContractAddressOrFail, "updateReferralActivity", [referralProgramName, userAddress, (userWeight >= referralMinGWxAmount)], nil)
349354 if ((activeReferralInv == activeReferralInv))
350355 then {
351356 let referralInv = if (if ((referrer == unit))
352357 then true
353358 else (referralMinGWxAmount > userWeight))
354359 then unit
355360 else {
356361 let referrerReward = fraction(userTotalAmount, referrerRewardPermille, SCALE)
357362 let referralReward = fraction(userTotalAmount, referralRewardPermille, SCALE)
358363 invoke(referralsContractAddressOrFail, "incUnclaimed", [referralProgramName, userAddress, referrerReward, referralReward], nil)
359364 }
360365 if ((referralInv == referralInv))
361366 then {
362367 let unclaimedActions = [IntegerEntry(keyUserUnclaimed(currentUser), (valueOrElse(userUnclaimedOption, 0) + userTotalAmount))]
363368 let processingActions = if (((usersCount - 1) > currentUser))
364369 then [IntegerEntry(keyNextProcessedUser(), (currentUser + 1))]
365370 else [IntegerEntry(keyNextProcessedPeriod(), (currentPeriod + 1)), IntegerEntry(keyNextProcessedUser(), 0), DeleteEntry(keyProcessingStage())]
366371 $Tuple2((unclaimedActions ++ processingActions), true)
367372 }
368373 else throw("Strict value is not equal to itself.")
369374 }
370375 else throw("Strict value is not equal to itself.")
371376 }
372377 else throw("invalid processing stage")
373378 }
374379
375380
376381
377382 @Callable(i)
378383 func finalizeWrapper (counter) = {
379384 let result = {
380385 let @ = invoke(this, "finalizeHelper", nil, nil)
381386 if ($isInstanceOf(@, "Boolean"))
382387 then @
383388 else throw(($getType(@) + " couldn't be cast to Boolean"))
384389 }
385390 if ((result == result))
386391 then if (!(result))
387392 then if ((counter == maxDepth))
388393 then throw("Nothing to process")
389394 else $Tuple2(nil, unit)
390395 else if ((counter > 0))
391396 then $Tuple2(nil, invoke(this, "finalizeWrapper", [(counter - 1)], nil))
392397 else $Tuple2(nil, unit)
393398 else throw("Strict value is not equal to itself.")
394399 }
395400
396401
397402
398403 @Callable(i)
399404 func processPendingPeriodsAndUsers () = $Tuple2(nil, invoke(this, "finalizeWrapper", [maxDepth], nil))
400405
401406
402407
403408 @Callable(i)
404409 func deposit () = {
405410 let cfgArray = readConfigArrayOrFail()
406411 if ((i.caller != Address(fromBase58String(cfgArray[IdxCfgPacemakerAddress]))))
407412 then throw("Wrong caller address")
408413 else {
409414 let assetId = value(value(i.payments[0]).assetId)
410415 if ((assetId != fromBase58String(cfgArray[IdxCfgAssetId])))
411416 then throw("Wrong payment asset")
412417 else {
413418 let period = nextPeriod()
414419 let deltaH = (height - getNumberOrFail(keyGwxRewardEmissionStartHeight()))
415420 let emissionRate = valueOrErrorMessage(getInteger(emissionContract, keyRatePerBlockCurrent()), (("mandatory emission_contract." + keyRatePerBlockCurrent()) + " is not defined"))
416421 let weight = valueOrErrorMessage(getInteger(factoryContract, keyPoolWeightVirtual()), (("mandatory factory_contract." + keyPoolWeightVirtual()) + " is not defined"))
417422 let auxAmount = fraction((deltaH * weight), emissionRate, MULT8)
418423 let em = invoke(emissionContract, "emit", [auxAmount], nil)
419424 if ((em == em))
420425 then {
421426 let matcherPart = value(i.payments[0]).amount
422427 let payoutInfo = PeriodPayoutInfo(period, matcherPart, auxAmount)
423428 [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)]
424429 }
425430 else throw("Strict value is not equal to itself.")
426431 }
427432 }
428433 }
429434
430435
431436
432437 @Callable(i)
433438 func claimReward () = {
434439 let cfgArray = readConfigArrayOrFail()
435440 let address = toString(i.caller)
436- let $t01748117531 = commonClaimReward(address)
437- let amount = $t01748117531._1
438- let actions = $t01748117531._2
441+ let $t01754017590 = commonClaimReward(address)
442+ let amount = $t01754017590._1
443+ let actions = $t01754017590._2
439444 let checkAmount = if ((amount > 0))
440445 then true
441446 else throw("Nothing to claim")
442447 if ((checkAmount == checkAmount))
443448 then {
444449 let amountFromEmission = 0
445450 let claimedReferral = {
446451 let @ = invoke(referralsContractAddressOrFail, "claim", [referralProgramName], nil)
447452 if ($isInstanceOf(@, "Int"))
448453 then @
449454 else throw(($getType(@) + " couldn't be cast to Int"))
450455 }
451456 let totalAmount = (amount + claimedReferral)
452457 $Tuple2(([ScriptTransfer(i.caller, totalAmount, fromBase58String(cfgArray[IdxCfgAssetId])), HistoryEntry("claim", address, amount, i)] ++ actions), [totalAmount, amountFromEmission])
453458 }
454459 else throw("Strict value is not equal to itself.")
455460 }
456461
457462
458463
459464 @Callable(i)
460465 func claimRewardREADONLY (address) = {
461- let $t01810418154 = commonClaimReward(address)
462- let amount = $t01810418154._1
463- let actions = $t01810418154._2
466+ let $t01816318213 = commonClaimReward(address)
467+ let amount = $t01816318213._1
468+ let actions = $t01816318213._2
464469 let referralUnclaimed = valueOrElse(getInteger(referralsContractAddressOrFail, keyUnclaimedReferral(referralProgramName, address)), 0)
465470 let totalAmount = (amount + referralUnclaimed)
466471 $Tuple2(nil, totalAmount)
467472 }
468473
469474
470475
471476 @Callable(i)
472477 func latestFinalizedPeriodREADONLY (address) = $Tuple2(nil, valueOrElse(getInteger(this, keyLatestPeriod()), -1))
473478
474479
475480
476481 @Callable(i)
477482 func latestFinalizedPeriodInfoREADONLY (address) = $Tuple2(nil, getStringByKey(keyLastPayoutInfo()))
478483
479484
480485
481486 @Callable(i)
482487 func calcGwxParamsREADONLY (gwxAmountStart,lockStartHeight,lockDurationBlocks) = {
483488 let lockEndHeight = (lockStartHeight + lockDurationBlocks)
484489 let scale8ParamK = -(fraction(gwxAmountStart, SCALE, lockDurationBlocks))
485490 let scale8ParamB = (fraction(gwxAmountStart, SCALE, lockDurationBlocks) * lockEndHeight)
486491 $Tuple2(nil, [scale8ParamK, scale8ParamB, nextPeriod()])
487492 }
488493
489494
490495
491496 @Callable(i)
492497 func calcGwxAmountStartREADONLY (wxLockAmount,lockDuration,maxLockDuration) = {
493498 let coeffX8 = fraction(lockDuration, MULT8, maxLockDuration)
494499 let gWxAmountStart = fraction(wxLockAmount, coeffX8, MULT8)
495500 $Tuple2(nil, [gWxAmountStart])
496501 }
497502
498503
499504
500505 @Callable(i)
501506 func onEmissionForGwxStart () = if ((i.caller != factoryContract))
502507 then throw("permissions denied")
503508 else [IntegerEntry(keyGwxRewardEmissionStartHeight(), height)]
504509
505510
506511
507512 @Callable(i)
508513 func latestPeriodEmissionRewardsREADONLY (address) = {
509514 let period = nextPeriod()
510515 $Tuple2(nil, [getNumberByKey(keyAuxEmissionRewardForPeriod(period))])
511516 }
512517
513518
514519
515520 @Callable(i)
516521 func calcD (x1BigIntStr,x2BigIntStr,ampBigIntStr,aPrecisionBigIntStr,targetPrecisionBigIntStr) = {
517522 let nCoins = toBigInt(2)
518523 let aPrecision = parseBigIntValue(aPrecisionBigIntStr)
519524 let targetPrecision = parseBigIntValue(targetPrecisionBigIntStr)
520525 let x1 = parseBigIntValue(x1BigIntStr)
521526 let x2 = parseBigIntValue(x2BigIntStr)
522527 let amp = (parseBigIntValue(ampBigIntStr) * aPrecision)
523528 let s = (x1 + x2)
524529 if ((s == zeroBigInt))
525530 then $Tuple2(nil, toString(zeroBigInt))
526531 else {
527532 let ann = (amp * nCoins)
528- let arr = [1, 2, 3, 4, 5, 6, 7]
533+ let arr = [0, 1, 2, 3, 4, 5, 6]
529534 func calc (acc,cur) = {
530- let $t02077720966 = acc
531- let d = $t02077720966._1
532- let dPrev = $t02077720966._2
533- let dp = (((d * d) * d) / (((x1 * x2) * nCoins) * nCoins))
534- let dNext = (((((ann * s) / aPrecision) + (dp * nCoins)) * d) / ((((ann - aPrecision) * d) / aPrecision) + ((nCoins + toBigInt(1)) * dp)))
535- $Tuple2(dNext, d)
535+ let $t02084620873 = acc
536+ let d = $t02084620873._1
537+ let dPrev = $t02084620873._2
538+ let found = $t02084620873._3
539+ if ((found != unit))
540+ then acc
541+ else {
542+ let dp = (((d * d) * d) / (((x1 * x2) * nCoins) * nCoins))
543+ let dNext = (((((ann * s) / aPrecision) + (dp * nCoins)) * d) / ((((ann - aPrecision) * d) / aPrecision) + ((nCoins + toBigInt(1)) * dp)))
544+ let dDiff = absBigInt((dNext - value(d)))
545+ if ((targetPrecision >= dDiff))
546+ then $Tuple3(dNext, d, cur)
547+ else $Tuple3(dNext, d, unit)
548+ }
536549 }
537550
538- let $t02117921229 = {
551+ let $t02147121534 = {
539552 let $l = arr
540553 let $s = size($l)
541- let $acc0 = $Tuple2(s, unit)
554+ let $acc0 = $Tuple3(s, unit, unit)
542555 func $f0_1 ($a,$i) = if (($i >= $s))
543556 then $a
544557 else calc($a, $l[$i])
545558
546559 func $f0_2 ($a,$i) = if (($i >= $s))
547560 then $a
548561 else throw("List size exceeds 7")
549562
550563 $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)
551564 }
552- let dNext = $t02117921229._1
553- let dPrev = $t02117921229._2
554- let dDiff = abs((dNext - value(dPrev)))
555- if ((targetPrecision >= dDiff))
565+ let dNext = $t02147121534._1
566+ let dPrev = $t02147121534._2
567+ let found = $t02147121534._3
568+ if ((found != unit))
556569 then $Tuple2(nil, toString(dNext))
557- else throw(("D calculation error, dDiff = " + toString(dDiff)))
570+ else {
571+ let dDiff = absBigInt((dNext - value(dPrev)))
572+ throw(("D calculation error, dDiff = " + toString(dDiff)))
573+ }
558574 }
559575 }
560576
561577
562578
563579 @Callable(i)
564580 func setManager (pendingManagerPublicKey) = {
565581 let checkCaller = mustManager(i)
566582 if ((checkCaller == checkCaller))
567583 then {
568584 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
569585 if ((checkManagerPublicKey == checkManagerPublicKey))
570586 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
571587 else throw("Strict value is not equal to itself.")
572588 }
573589 else throw("Strict value is not equal to itself.")
574590 }
575591
576592
577593
578594 @Callable(i)
579595 func confirmManager () = {
580596 let pm = pendingManagerPublicKeyOrUnit()
581597 let hasPM = if (isDefined(pm))
582598 then true
583599 else throw("No pending manager")
584600 if ((hasPM == hasPM))
585601 then {
586602 let checkPM = if ((i.callerPublicKey == value(pm)))
587603 then true
588604 else throw("You are not pending manager")
589605 if ((checkPM == checkPM))
590606 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
591607 else throw("Strict value is not equal to itself.")
592608 }
593609 else throw("Strict value is not equal to itself.")
594610 }
595611
596612
597613 @Verifier(tx)
598614 func verify () = {
599615 let targetPublicKey = match managerPublicKeyOrUnit() {
600616 case pk: ByteVector =>
601617 pk
602618 case _: Unit =>
603619 tx.senderPublicKey
604620 case _ =>
605621 throw("Match error")
606622 }
607623 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
608624 }
609625

github/deemru/w8io/026f985 
73.16 ms