tx · 121KLAoDzyHyfc45Y69acyfxP1nJKnQE1VHsU4juyXwD

3Mp5kisFrqESzrXxAMEPk2k69zpeF41czEE:  -0.01700000 Waves

2023.05.10 13:07 [2571648] smart account 3Mp5kisFrqESzrXxAMEPk2k69zpeF41czEE > SELF 0.00000000 Waves

{ "type": 13, "id": "121KLAoDzyHyfc45Y69acyfxP1nJKnQE1VHsU4juyXwD", "fee": 1700000, "feeAssetId": null, "timestamp": 1683713298310, "version": 2, "chainId": 84, "sender": "3Mp5kisFrqESzrXxAMEPk2k69zpeF41czEE", "senderPublicKey": "G349Uq3FTox7dRNLeAfAQeoACvwZ9iEnVSaHcEYn6j8J", "proofs": [ "5wwo4ZZpkrUHVidRwUfD97ivYshgw17ZREUtBmfpmGXEydZijE5FBGyjAffsZgdzPhe5LBCYNDAiLxrqb9mJt8xG" ], "script": "base64:BgLHGAgCEgQKAggBEgASAwoBARIAEgASABIDCgEIEgMKAQgSAwoBCBIFCgMBAQESBQoDAQEBEgASAwoBCBIHCgUICAgICCIDU0VQIgVTQ0FMRSIFTVVMVDgiCnplcm9CaWdJbnQiFHByb2Nlc3NpbmdTdGFnZVRvdGFsIhVwcm9jZXNzaW5nU3RhZ2VTaGFyZXMiDmdldE51bWJlckJ5S2V5IgNrZXkiD2dldE51bWJlck9yRmFpbCIOZ2V0U3RyaW5nQnlLZXkiD2dldFN0cmluZ09yRmFpbCIDYWJzIgN2YWwiCWFic0JpZ0ludCILa2V5TWF4RGVwdGgiD21heERlcHRoRGVmYXVsdCIIbWF4RGVwdGgiEWtleUZhY3RvcnlBZGRyZXNzIhFmYWN0b3J5QWRkcmVzc1N0ciIPZmFjdG9yeUNvbnRyYWN0IhJrZXlFbWlzc2lvbkFkZHJlc3MiE2tleU51bVRvVXNlck1hcHBpbmciA251bSIWa2V5UmVmZXJyYWxQcm9ncmFtTmFtZSIacmVmZXJyYWxQcm9ncmFtTmFtZURlZmF1bHQiE3JlZmVycmFsUHJvZ3JhbU5hbWUiF2tleVJ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NwkBAmNVAgkBAmNSAgkBAmNSAgkBAmNSAgkBAmNSAgkBAmNSAgkBAmNSAgkBAmNSAgUCY1EAAAABAAIAAwAEAAUABgAHBAJjTAgFAmNOAl8xBAJjSQgFAmNOAl8yBAJjSggFAmNOAl8zAwkBAiE9AgUCY0oFBHVuaXQJAJQKAgUDbmlsCQCmAwEFAmNMBAJjTQkBAW4BCQC4AgIFAmNMCQEFdmFsdWUBBQJjSQkAAgEJAKwCAgIdRCBjYWxjdWxhdGlvbiBlcnJvciwgZERpZmYgPSAJAKYDAQUCY00BAmNWAQJjVwAEAmNYBAJhTwkBAmFRAAMJAAECBQJhTwIKQnl0ZVZlY3RvcgQCYVUFAmFPBQJhVQMJAAECBQJhTwIEVW5pdAgFAmNWD3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yCQD0AwMIBQJjVglib2R5Qnl0ZXMJAJEDAggFAmNWBnByb29mcwAABQJjWJ/Ybmg=", "height": 2571648, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 958jHzAm97nACCBdSrVUWCfUuN6RBimQU8Rf2Q2Wjz3k Next: NiNbdY9WuBDMMPg76CeFVimKAJMj73kmkz2e7J1sDT9 Diff:
OldNewDifferences
192192 func keyManagerPublicKey () = "%s__managerPublicKey"
193193
194194
195-func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
195+func keyManagerVaultAddress () = "%s__managerVaultAddress"
196196
197197
198-func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
198+func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
199199 case s: String =>
200- fromBase58String(s)
201- case _: Unit =>
202- unit
200+ addressFromStringValue(s)
203201 case _ =>
204- throw("Match error")
202+ this
205203 }
206204
207205
208-func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
209- case s: String =>
210- fromBase58String(s)
211- case _: Unit =>
212- unit
213- case _ =>
214- throw("Match error")
215-}
206+func managerPublicKeyOrUnit () = {
207+ let managerVaultAddress = getManagerVaultAddressOrThis()
208+ match getString(managerVaultAddress, keyManagerPublicKey()) {
209+ case s: String =>
210+ fromBase58String(s)
211+ case _: Unit =>
212+ unit
213+ case _ =>
214+ throw("Match error")
215+ }
216+ }
216217
217218
218219 func mustManager (i) = {
330331 then $Tuple2(nil, false)
331332 else if ((processingStage == processingStageTotal))
332333 then {
333- let $t01208212198 = calcUserWeight(boostingContractOrFail(), heightForPeriod, currentPeriod, currentUser)
334- let userWeight = $t01208212198._1
335- let userActions = $t01208212198._2
334+ let $t01216712283 = calcUserWeight(boostingContractOrFail(), heightForPeriod, currentPeriod, currentUser)
335+ let userWeight = $t01216712283._1
336+ let userActions = $t01216712283._2
336337 let totalWeightNew = (totalWeight + userWeight)
337338 let processingActions = if (((usersCount - 1) > currentUser))
338339 then [IntegerEntry(keyNextProcessedUser(), (currentUser + 1))]
438439 func claimReward () = {
439440 let cfgArray = readConfigArrayOrFail()
440441 let address = toString(i.caller)
441- let $t01754017590 = commonClaimReward(address)
442- let amount = $t01754017590._1
443- let actions = $t01754017590._2
442+ let $t01762517675 = commonClaimReward(address)
443+ let amount = $t01762517675._1
444+ let actions = $t01762517675._2
444445 let checkAmount = if ((amount > 0))
445446 then true
446447 else throw("Nothing to claim")
463464
464465 @Callable(i)
465466 func claimRewardREADONLY (address) = {
466- let $t01816318213 = commonClaimReward(address)
467- let amount = $t01816318213._1
468- let actions = $t01816318213._2
467+ let $t01824818298 = commonClaimReward(address)
468+ let amount = $t01824818298._1
469+ let actions = $t01824818298._2
469470 let referralUnclaimed = valueOrElse(getInteger(referralsContractAddressOrFail, keyUnclaimedReferral(referralProgramName, address)), 0)
470471 let totalAmount = (amount + referralUnclaimed)
471472 $Tuple2(nil, totalAmount)
532533 let ann = (amp * nCoins)
533534 let arr = [0, 1, 2, 3, 4, 5, 6]
534535 func calc (acc,cur) = {
535- let $t02084620873 = acc
536- let d = $t02084620873._1
537- let dPrev = $t02084620873._2
538- let found = $t02084620873._3
536+ let $t02093120958 = acc
537+ let d = $t02093120958._1
538+ let dPrev = $t02093120958._2
539+ let found = $t02093120958._3
539540 if ((found != unit))
540541 then acc
541542 else {
548549 }
549550 }
550551
551- let $t02147121534 = {
552+ let $t02155621619 = {
552553 let $l = arr
553554 let $s = size($l)
554555 let $acc0 = $Tuple3(s, unit, unit)
562563
563564 $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)
564565 }
565- let dNext = $t02147121534._1
566- let dPrev = $t02147121534._2
567- let found = $t02147121534._3
566+ let dNext = $t02155621619._1
567+ let dPrev = $t02155621619._2
568+ let found = $t02155621619._3
568569 if ((found != unit))
569570 then $Tuple2(nil, toString(dNext))
570571 else {
572573 throw(("D calculation error, dDiff = " + toString(dDiff)))
573574 }
574575 }
575- }
576-
577-
578-
579-@Callable(i)
580-func setManager (pendingManagerPublicKey) = {
581- let checkCaller = mustManager(i)
582- if ((checkCaller == checkCaller))
583- then {
584- let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
585- if ((checkManagerPublicKey == checkManagerPublicKey))
586- then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
587- else throw("Strict value is not equal to itself.")
588- }
589- else throw("Strict value is not equal to itself.")
590- }
591-
592-
593-
594-@Callable(i)
595-func confirmManager () = {
596- let pm = pendingManagerPublicKeyOrUnit()
597- let hasPM = if (isDefined(pm))
598- then true
599- else throw("No pending manager")
600- if ((hasPM == hasPM))
601- then {
602- let checkPM = if ((i.callerPublicKey == value(pm)))
603- then true
604- else throw("You are not pending manager")
605- if ((checkPM == checkPM))
606- then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
607- else throw("Strict value is not equal to itself.")
608- }
609- else throw("Strict value is not equal to itself.")
610576 }
611577
612578
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
2828 func abs (val) = if ((0 > val))
2929 then -(val)
3030 else val
3131
3232
3333 func absBigInt (val) = if ((zeroBigInt > val))
3434 then -(val)
3535 else val
3636
3737
3838 let keyMaxDepth = "%s__maxDepth"
3939
4040 let maxDepthDefault = 30
4141
4242 let maxDepth = valueOrElse(getInteger(this, keyMaxDepth), maxDepthDefault)
4343
4444 func keyFactoryAddress () = "%s%s__config__factoryAddress"
4545
4646
4747 let factoryAddressStr = getStringOrFail(keyFactoryAddress())
4848
4949 let factoryContract = addressFromStringValue(factoryAddressStr)
5050
5151 func keyEmissionAddress () = "%s%s__config__emissionAddress"
5252
5353
5454 func keyNumToUserMapping (num) = makeString(["%s%s%s", "mapping", "num2user", toString(num)], SEP)
5555
5656
5757 let keyReferralProgramName = makeString(["%s%s", "referral", "programName"], SEP)
5858
5959 let referralProgramNameDefault = "wxlock"
6060
6161 let referralProgramName = valueOrElse(getString(this, keyReferralProgramName), referralProgramNameDefault)
6262
6363 let keyReferralMinGWxAmount = makeString(["%s%s", "referral", "minGWxAmount"], SEP)
6464
6565 let referralMinGWxAmountDefault = (500 * MULT8)
6666
6767 let referralMinGWxAmount = valueOrElse(getInteger(this, keyReferralMinGWxAmount), referralMinGWxAmountDefault)
6868
6969 let keyReferrerRewardPermille = makeString(["%s%s", "referral", "referrerRewardPermille"], SEP)
7070
7171 let referrerRewardPermilleDefault = 50
7272
7373 let referrerRewardPermille = valueOrElse(getInteger(this, keyReferrerRewardPermille), referrerRewardPermilleDefault)
7474
7575 let keyReferralRewardPermille = makeString(["%s%s", "referral", "referralRewardPermille"], SEP)
7676
7777 let referralRewardPermilleDefault = 50
7878
7979 let referralRewardPermille = valueOrElse(getInteger(this, keyReferralRewardPermille), referralRewardPermilleDefault)
8080
8181 func keyReferrer (referralAddress) = makeString(["%s%s%s", "referrer", referralProgramName, referralAddress], SEP)
8282
8383
8484 func keyUnclaimedReferral (programName,claimerAddress) = makeString(["%s%s%s", "unclaimedReferral", programName, claimerAddress], SEP)
8585
8686
8787 let emissionAddressStr = getStringOrFail(keyEmissionAddress())
8888
8989 let emissionContract = addressFromStringValue(emissionAddressStr)
9090
9191 let IdxCfgAssetId = 1
9292
9393 let IdxCfgPacemakerAddress = 2
9494
9595 let IdxCfgBoostingContract = 3
9696
9797 let IdxCfgMaxDepth = 4
9898
9999 func keyConfig () = "%s__config"
100100
101101
102102 func readConfigArrayOrFail () = split(getStringOrFail(keyConfig()), SEP)
103103
104104
105105 func formatConfig (wxAssetIdStr,matcherPacemakerAddressStr,boostingContractAddressStr,maxDepth) = makeString(["%s%s%s%d", wxAssetIdStr, matcherPacemakerAddressStr, boostingContractAddressStr, toString(maxDepth)], SEP)
106106
107107
108108 func boostingContractOrFail () = {
109109 let cfgArray = readConfigArrayOrFail()
110110 valueOrErrorMessage(addressFromString(cfgArray[IdxCfgBoostingContract]), "boosting contract address is not defined")
111111 }
112112
113113
114114 func keyGwxRewardEmissionStartHeight () = "%s%s__gwxRewardEmissionPart__startHeight"
115115
116116
117117 func keyUsersCount () = "%s__nextUserNum"
118118
119119
120120 func keyRatePerBlockCurrent () = "%s%s__ratePerBlock__current"
121121
122122
123123 func keyPoolWeightVirtual () = "%s%s__poolWeight__GWXvirtualPOOL"
124124
125125
126126 func keyNextProcessedUser () = "%s__nextProcessedUser"
127127
128128
129129 func keyLatestPeriod () = "%s__latestPeriod"
130130
131131
132132 func keyNextPeriod () = "%s__nextPeriod"
133133
134134
135135 func keyProcessingStage () = "%s__processingStage"
136136
137137
138138 func keyNextProcessedPeriod () = "%s__nextProcessedPeriod"
139139
140140
141141 func keyUserUnclaimed (userIndex) = makeString(["%s%d", "userUnclaimed", toString(userIndex)], SEP)
142142
143143
144144 func keyNextUnlaimedPeriodOfUser (userIndex) = makeString(["%s%d__nextClaimedPeriod", toString(userIndex)], SEP)
145145
146146
147147 func keyLastProcessedPeriodOfUser (userIndex) = makeString(["%s%d__lastProcessedPeriod", toString(userIndex)], SEP)
148148
149149
150150 func keyHeightForPeriod (period) = makeString(["%s%d__startHeightForPeriod", toString(period)], SEP)
151151
152152
153153 func keyAuxEmissionRewardForPeriod (period) = makeString(["%s%d__auxEmissionReward", toString(period)], SEP)
154154
155155
156156 func keyTotalAmountForPeriod (period) = makeString(["%s%d__totalAmountForPeriod", toString(period)], SEP)
157157
158158
159159 func keyLastPayoutInfo () = "%s__lastPayoutInfo"
160160
161161
162162 func PeriodPayoutInfo (period,matcherReward,emissionReward) = makeString(["%d%d%d", toString(period), toString(matcherReward), toString(emissionReward)], SEP)
163163
164164
165165 func keyPayoutHistoryInfo (period) = makeString(["%s%s%d__payouts__history", toString(period)], SEP)
166166
167167
168168 func keyTotalWeightForPeriod (period) = makeString(["%s%d__totalWeightForPeriod", toString(period)], SEP)
169169
170170
171171 func keyUserKValueForPeriod (period,userIndex) = makeString(["%s%d%s%d__paramByPeriod", toString(userIndex), "k", toString(period)], SEP)
172172
173173
174174 func keyUserBValueForPeriod (period,userIndex) = makeString(["%s%d%s%d__paramByPeriod", toString(userIndex), "b", toString(period)], SEP)
175175
176176
177177 func keyUserWeightForPeriod (period,userIndex) = makeString(["%s%d%s%d__paramByPeriod", toString(userIndex), "weight", toString(period)], SEP)
178178
179179
180180 func keyReferralsContractAddress () = makeString(["%s%s", "config", "referralsContractAddress"], SEP)
181181
182182
183183 let referralsContractAddressOrFail = addressFromStringValue(getStringOrFail(keyReferralsContractAddress()))
184184
185185 func HistoryEntry (type,user,amount,i) = {
186186 let historyKEY = makeString(["%s%s%s%s__history", type, user, toBase58String(i.transactionId)], SEP)
187187 let historyDATA = makeString(["%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(amount)], SEP)
188188 StringEntry(historyKEY, historyDATA)
189189 }
190190
191191
192192 func keyManagerPublicKey () = "%s__managerPublicKey"
193193
194194
195-func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
195+func keyManagerVaultAddress () = "%s__managerVaultAddress"
196196
197197
198-func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
198+func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
199199 case s: String =>
200- fromBase58String(s)
201- case _: Unit =>
202- unit
200+ addressFromStringValue(s)
203201 case _ =>
204- throw("Match error")
202+ this
205203 }
206204
207205
208-func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
209- case s: String =>
210- fromBase58String(s)
211- case _: Unit =>
212- unit
213- case _ =>
214- throw("Match error")
215-}
206+func managerPublicKeyOrUnit () = {
207+ let managerVaultAddress = getManagerVaultAddressOrThis()
208+ match getString(managerVaultAddress, keyManagerPublicKey()) {
209+ case s: String =>
210+ fromBase58String(s)
211+ case _: Unit =>
212+ unit
213+ case _ =>
214+ throw("Match error")
215+ }
216+ }
216217
217218
218219 func mustManager (i) = {
219220 let pd = throw("Permission denied")
220221 match managerPublicKeyOrUnit() {
221222 case pk: ByteVector =>
222223 if ((i.callerPublicKey == pk))
223224 then true
224225 else pd
225226 case _: Unit =>
226227 if ((i.caller == this))
227228 then true
228229 else pd
229230 case _ =>
230231 throw("Match error")
231232 }
232233 }
233234
234235
235236 func calcUserWeight (boostingContractAddress,heightForPeriod,period,userIndex) = {
236237 let kLast = keyLastProcessedPeriodOfUser(userIndex)
237238 let kKey = keyUserKValueForPeriod(period, userIndex)
238239 let kRaw = getInteger(boostingContractAddress, kKey)
239240 let kUserWeight = keyUserWeightForPeriod(period, userIndex)
240241 if (isDefined(kRaw))
241242 then {
242243 let k = value(kRaw)
243244 let b = value(getInteger(boostingContractAddress, keyUserBValueForPeriod(period, userIndex)))
244245 let w = ((k * heightForPeriod) + b)
245246 if ((w > 0))
246247 then $Tuple2((w / SCALE), [IntegerEntry(kLast, period), IntegerEntry(kUserWeight, w)])
247248 else $Tuple2(0, nil)
248249 }
249250 else {
250251 let p = getInteger(this, kLast)
251252 if (if (isDefined(p))
252253 then (period >= value(p))
253254 else false)
254255 then {
255256 let pv = value(p)
256257 let k = value(getInteger(boostingContractAddress, keyUserKValueForPeriod(pv, userIndex)))
257258 let b = value(getInteger(boostingContractAddress, keyUserBValueForPeriod(pv, userIndex)))
258259 let w = ((k * heightForPeriod) + b)
259260 if ((w > 0))
260261 then $Tuple2((w / SCALE), [IntegerEntry(kUserWeight, w)])
261262 else $Tuple2(0, nil)
262263 }
263264 else $Tuple2(0, nil)
264265 }
265266 }
266267
267268
268269 func calcUserWeightForClaim (boostingContractAddress,heightForPeriod,period,userIndex) = {
269270 let kUserWeight = keyUserWeightForPeriod(period, userIndex)
270271 let userWeightOrUnit = getInteger(kUserWeight)
271272 match userWeightOrUnit {
272273 case _: Unit =>
273274 0
274275 case w: Int =>
275276 (w / SCALE)
276277 case _ =>
277278 throw("Match error")
278279 }
279280 }
280281
281282
282283 func getUserIndexByAddress (boostingContractAddressStr,userAddress) = {
283284 let key = makeString(["%s%s%s", "mapping", "user2num", userAddress], SEP)
284285 parseIntValue(valueOrErrorMessage(getString(Address(fromBase58String(boostingContractAddressStr)), key), ((("User address " + userAddress) + " is not found in boosting contract data, key=") + key)))
285286 }
286287
287288
288289 func nextPeriod () = getNumberByKey(keyNextPeriod())
289290
290291
291292 func commonClaimReward (userAddress) = {
292293 let cfgArray = readConfigArrayOrFail()
293294 let userIdx = getUserIndexByAddress(cfgArray[IdxCfgBoostingContract], userAddress)
294295 let userUnclaimedOption = getInteger(keyUserUnclaimed(userIdx))
295296 match userUnclaimedOption {
296297 case _: Unit =>
297298 $Tuple2(0, nil)
298299 case u: Int =>
299300 $Tuple2(u, [IntegerEntry(keyUserUnclaimed(userIdx), 0)])
300301 case _ =>
301302 throw("Match error")
302303 }
303304 }
304305
305306
306307 @Callable(i)
307308 func updateReferralActivity (userAddress,gWxAmountStart) = {
308309 let referrer = getString(referralsContractAddressOrFail, keyReferrer(userAddress))
309310 let activeReferralInv = if ((referrer == unit))
310311 then unit
311312 else invoke(referralsContractAddressOrFail, "updateReferralActivity", [referralProgramName, userAddress, (gWxAmountStart >= referralMinGWxAmount)], nil)
312313 if ((activeReferralInv == activeReferralInv))
313314 then $Tuple2(nil, unit)
314315 else throw("Strict value is not equal to itself.")
315316 }
316317
317318
318319
319320 @Callable(i)
320321 func finalizeHelper () = {
321322 let processingStage = valueOrElse(getInteger(keyProcessingStage()), processingStageTotal)
322323 let currentPeriod = getNumberByKey(keyNextProcessedPeriod())
323324 let currentUser = getNumberByKey(keyNextProcessedUser())
324325 let latestPeriod = getNumberByKey(keyLatestPeriod())
325326 let usersCount = valueOrElse(getInteger(boostingContractOrFail(), keyUsersCount()), 0)
326327 let totalWeightKey = keyTotalWeightForPeriod(currentPeriod)
327328 let totalWeight = getNumberByKey(keyTotalWeightForPeriod(currentPeriod))
328329 let heightForPeriod = getNumberByKey(keyHeightForPeriod(currentPeriod))
329330 if ((currentPeriod > latestPeriod))
330331 then $Tuple2(nil, false)
331332 else if ((processingStage == processingStageTotal))
332333 then {
333- let $t01208212198 = calcUserWeight(boostingContractOrFail(), heightForPeriod, currentPeriod, currentUser)
334- let userWeight = $t01208212198._1
335- let userActions = $t01208212198._2
334+ let $t01216712283 = calcUserWeight(boostingContractOrFail(), heightForPeriod, currentPeriod, currentUser)
335+ let userWeight = $t01216712283._1
336+ let userActions = $t01216712283._2
336337 let totalWeightNew = (totalWeight + userWeight)
337338 let processingActions = if (((usersCount - 1) > currentUser))
338339 then [IntegerEntry(keyNextProcessedUser(), (currentUser + 1))]
339340 else [IntegerEntry(keyProcessingStage(), processingStageShares), IntegerEntry(keyNextProcessedUser(), 0)]
340341 $Tuple2((([IntegerEntry(totalWeightKey, totalWeightNew)] ++ processingActions) ++ userActions), true)
341342 }
342343 else if ((processingStage == processingStageShares))
343344 then {
344345 let userWeight = calcUserWeightForClaim(boostingContractOrFail(), heightForPeriod, currentPeriod, currentUser)
345346 let userAmountMatcherForPeriod = fraction(getNumberByKey(keyTotalAmountForPeriod(currentPeriod)), userWeight, totalWeight)
346347 let userAmountEmissionForPeriod = fraction(getNumberByKey(keyAuxEmissionRewardForPeriod(currentPeriod)), userWeight, totalWeight)
347348 let userTotalAmount = (userAmountEmissionForPeriod + userAmountMatcherForPeriod)
348349 let userUnclaimedOption = getInteger(keyUserUnclaimed(currentUser))
349350 let userAddress = getStringValue(boostingContractOrFail(), keyNumToUserMapping(currentUser))
350351 let referrer = getString(referralsContractAddressOrFail, keyReferrer(userAddress))
351352 let activeReferralInv = if ((referrer == unit))
352353 then unit
353354 else invoke(referralsContractAddressOrFail, "updateReferralActivity", [referralProgramName, userAddress, (userWeight >= referralMinGWxAmount)], nil)
354355 if ((activeReferralInv == activeReferralInv))
355356 then {
356357 let referralInv = if (if ((referrer == unit))
357358 then true
358359 else (referralMinGWxAmount > userWeight))
359360 then unit
360361 else {
361362 let referrerReward = fraction(userTotalAmount, referrerRewardPermille, SCALE)
362363 let referralReward = fraction(userTotalAmount, referralRewardPermille, SCALE)
363364 invoke(referralsContractAddressOrFail, "incUnclaimed", [referralProgramName, userAddress, referrerReward, referralReward], nil)
364365 }
365366 if ((referralInv == referralInv))
366367 then {
367368 let unclaimedActions = [IntegerEntry(keyUserUnclaimed(currentUser), (valueOrElse(userUnclaimedOption, 0) + userTotalAmount))]
368369 let processingActions = if (((usersCount - 1) > currentUser))
369370 then [IntegerEntry(keyNextProcessedUser(), (currentUser + 1))]
370371 else [IntegerEntry(keyNextProcessedPeriod(), (currentPeriod + 1)), IntegerEntry(keyNextProcessedUser(), 0), DeleteEntry(keyProcessingStage())]
371372 $Tuple2((unclaimedActions ++ processingActions), true)
372373 }
373374 else throw("Strict value is not equal to itself.")
374375 }
375376 else throw("Strict value is not equal to itself.")
376377 }
377378 else throw("invalid processing stage")
378379 }
379380
380381
381382
382383 @Callable(i)
383384 func finalizeWrapper (counter) = {
384385 let result = {
385386 let @ = invoke(this, "finalizeHelper", nil, nil)
386387 if ($isInstanceOf(@, "Boolean"))
387388 then @
388389 else throw(($getType(@) + " couldn't be cast to Boolean"))
389390 }
390391 if ((result == result))
391392 then if (!(result))
392393 then if ((counter == maxDepth))
393394 then throw("Nothing to process")
394395 else $Tuple2(nil, unit)
395396 else if ((counter > 0))
396397 then $Tuple2(nil, invoke(this, "finalizeWrapper", [(counter - 1)], nil))
397398 else $Tuple2(nil, unit)
398399 else throw("Strict value is not equal to itself.")
399400 }
400401
401402
402403
403404 @Callable(i)
404405 func processPendingPeriodsAndUsers () = $Tuple2(nil, invoke(this, "finalizeWrapper", [maxDepth], nil))
405406
406407
407408
408409 @Callable(i)
409410 func deposit () = {
410411 let cfgArray = readConfigArrayOrFail()
411412 if ((i.caller != Address(fromBase58String(cfgArray[IdxCfgPacemakerAddress]))))
412413 then throw("Wrong caller address")
413414 else {
414415 let assetId = value(value(i.payments[0]).assetId)
415416 if ((assetId != fromBase58String(cfgArray[IdxCfgAssetId])))
416417 then throw("Wrong payment asset")
417418 else {
418419 let period = nextPeriod()
419420 let deltaH = (height - getNumberOrFail(keyGwxRewardEmissionStartHeight()))
420421 let emissionRate = valueOrErrorMessage(getInteger(emissionContract, keyRatePerBlockCurrent()), (("mandatory emission_contract." + keyRatePerBlockCurrent()) + " is not defined"))
421422 let weight = valueOrErrorMessage(getInteger(factoryContract, keyPoolWeightVirtual()), (("mandatory factory_contract." + keyPoolWeightVirtual()) + " is not defined"))
422423 let auxAmount = fraction((deltaH * weight), emissionRate, MULT8)
423424 let em = invoke(emissionContract, "emit", [auxAmount], nil)
424425 if ((em == em))
425426 then {
426427 let matcherPart = value(i.payments[0]).amount
427428 let payoutInfo = PeriodPayoutInfo(period, matcherPart, auxAmount)
428429 [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)]
429430 }
430431 else throw("Strict value is not equal to itself.")
431432 }
432433 }
433434 }
434435
435436
436437
437438 @Callable(i)
438439 func claimReward () = {
439440 let cfgArray = readConfigArrayOrFail()
440441 let address = toString(i.caller)
441- let $t01754017590 = commonClaimReward(address)
442- let amount = $t01754017590._1
443- let actions = $t01754017590._2
442+ let $t01762517675 = commonClaimReward(address)
443+ let amount = $t01762517675._1
444+ let actions = $t01762517675._2
444445 let checkAmount = if ((amount > 0))
445446 then true
446447 else throw("Nothing to claim")
447448 if ((checkAmount == checkAmount))
448449 then {
449450 let amountFromEmission = 0
450451 let claimedReferral = {
451452 let @ = invoke(referralsContractAddressOrFail, "claim", [referralProgramName], nil)
452453 if ($isInstanceOf(@, "Int"))
453454 then @
454455 else throw(($getType(@) + " couldn't be cast to Int"))
455456 }
456457 let totalAmount = (amount + claimedReferral)
457458 $Tuple2(([ScriptTransfer(i.caller, totalAmount, fromBase58String(cfgArray[IdxCfgAssetId])), HistoryEntry("claim", address, amount, i)] ++ actions), [totalAmount, amountFromEmission])
458459 }
459460 else throw("Strict value is not equal to itself.")
460461 }
461462
462463
463464
464465 @Callable(i)
465466 func claimRewardREADONLY (address) = {
466- let $t01816318213 = commonClaimReward(address)
467- let amount = $t01816318213._1
468- let actions = $t01816318213._2
467+ let $t01824818298 = commonClaimReward(address)
468+ let amount = $t01824818298._1
469+ let actions = $t01824818298._2
469470 let referralUnclaimed = valueOrElse(getInteger(referralsContractAddressOrFail, keyUnclaimedReferral(referralProgramName, address)), 0)
470471 let totalAmount = (amount + referralUnclaimed)
471472 $Tuple2(nil, totalAmount)
472473 }
473474
474475
475476
476477 @Callable(i)
477478 func latestFinalizedPeriodREADONLY (address) = $Tuple2(nil, valueOrElse(getInteger(this, keyLatestPeriod()), -1))
478479
479480
480481
481482 @Callable(i)
482483 func latestFinalizedPeriodInfoREADONLY (address) = $Tuple2(nil, getStringByKey(keyLastPayoutInfo()))
483484
484485
485486
486487 @Callable(i)
487488 func calcGwxParamsREADONLY (gwxAmountStart,lockStartHeight,lockDurationBlocks) = {
488489 let lockEndHeight = (lockStartHeight + lockDurationBlocks)
489490 let scale8ParamK = -(fraction(gwxAmountStart, SCALE, lockDurationBlocks))
490491 let scale8ParamB = (fraction(gwxAmountStart, SCALE, lockDurationBlocks) * lockEndHeight)
491492 $Tuple2(nil, [scale8ParamK, scale8ParamB, nextPeriod()])
492493 }
493494
494495
495496
496497 @Callable(i)
497498 func calcGwxAmountStartREADONLY (wxLockAmount,lockDuration,maxLockDuration) = {
498499 let coeffX8 = fraction(lockDuration, MULT8, maxLockDuration)
499500 let gWxAmountStart = fraction(wxLockAmount, coeffX8, MULT8)
500501 $Tuple2(nil, [gWxAmountStart])
501502 }
502503
503504
504505
505506 @Callable(i)
506507 func onEmissionForGwxStart () = if ((i.caller != factoryContract))
507508 then throw("permissions denied")
508509 else [IntegerEntry(keyGwxRewardEmissionStartHeight(), height)]
509510
510511
511512
512513 @Callable(i)
513514 func latestPeriodEmissionRewardsREADONLY (address) = {
514515 let period = nextPeriod()
515516 $Tuple2(nil, [getNumberByKey(keyAuxEmissionRewardForPeriod(period))])
516517 }
517518
518519
519520
520521 @Callable(i)
521522 func calcD (x1BigIntStr,x2BigIntStr,ampBigIntStr,aPrecisionBigIntStr,targetPrecisionBigIntStr) = {
522523 let nCoins = toBigInt(2)
523524 let aPrecision = parseBigIntValue(aPrecisionBigIntStr)
524525 let targetPrecision = parseBigIntValue(targetPrecisionBigIntStr)
525526 let x1 = parseBigIntValue(x1BigIntStr)
526527 let x2 = parseBigIntValue(x2BigIntStr)
527528 let amp = (parseBigIntValue(ampBigIntStr) * aPrecision)
528529 let s = (x1 + x2)
529530 if ((s == zeroBigInt))
530531 then $Tuple2(nil, toString(zeroBigInt))
531532 else {
532533 let ann = (amp * nCoins)
533534 let arr = [0, 1, 2, 3, 4, 5, 6]
534535 func calc (acc,cur) = {
535- let $t02084620873 = acc
536- let d = $t02084620873._1
537- let dPrev = $t02084620873._2
538- let found = $t02084620873._3
536+ let $t02093120958 = acc
537+ let d = $t02093120958._1
538+ let dPrev = $t02093120958._2
539+ let found = $t02093120958._3
539540 if ((found != unit))
540541 then acc
541542 else {
542543 let dp = (((d * d) * d) / (((x1 * x2) * nCoins) * nCoins))
543544 let dNext = (((((ann * s) / aPrecision) + (dp * nCoins)) * d) / ((((ann - aPrecision) * d) / aPrecision) + ((nCoins + toBigInt(1)) * dp)))
544545 let dDiff = absBigInt((dNext - value(d)))
545546 if ((targetPrecision >= dDiff))
546547 then $Tuple3(dNext, d, cur)
547548 else $Tuple3(dNext, d, unit)
548549 }
549550 }
550551
551- let $t02147121534 = {
552+ let $t02155621619 = {
552553 let $l = arr
553554 let $s = size($l)
554555 let $acc0 = $Tuple3(s, unit, unit)
555556 func $f0_1 ($a,$i) = if (($i >= $s))
556557 then $a
557558 else calc($a, $l[$i])
558559
559560 func $f0_2 ($a,$i) = if (($i >= $s))
560561 then $a
561562 else throw("List size exceeds 7")
562563
563564 $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)
564565 }
565- let dNext = $t02147121534._1
566- let dPrev = $t02147121534._2
567- let found = $t02147121534._3
566+ let dNext = $t02155621619._1
567+ let dPrev = $t02155621619._2
568+ let found = $t02155621619._3
568569 if ((found != unit))
569570 then $Tuple2(nil, toString(dNext))
570571 else {
571572 let dDiff = absBigInt((dNext - value(dPrev)))
572573 throw(("D calculation error, dDiff = " + toString(dDiff)))
573574 }
574575 }
575- }
576-
577-
578-
579-@Callable(i)
580-func setManager (pendingManagerPublicKey) = {
581- let checkCaller = mustManager(i)
582- if ((checkCaller == checkCaller))
583- then {
584- let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
585- if ((checkManagerPublicKey == checkManagerPublicKey))
586- then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
587- else throw("Strict value is not equal to itself.")
588- }
589- else throw("Strict value is not equal to itself.")
590- }
591-
592-
593-
594-@Callable(i)
595-func confirmManager () = {
596- let pm = pendingManagerPublicKeyOrUnit()
597- let hasPM = if (isDefined(pm))
598- then true
599- else throw("No pending manager")
600- if ((hasPM == hasPM))
601- then {
602- let checkPM = if ((i.callerPublicKey == value(pm)))
603- then true
604- else throw("You are not pending manager")
605- if ((checkPM == checkPM))
606- then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
607- else throw("Strict value is not equal to itself.")
608- }
609- else throw("Strict value is not equal to itself.")
610576 }
611577
612578
613579 @Verifier(tx)
614580 func verify () = {
615581 let targetPublicKey = match managerPublicKeyOrUnit() {
616582 case pk: ByteVector =>
617583 pk
618584 case _: Unit =>
619585 tx.senderPublicKey
620586 case _ =>
621587 throw("Match error")
622588 }
623589 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
624590 }
625591

github/deemru/w8io/169f3d6 
73.45 ms