tx · HvuQNpjYC9Qz1tyJoRiELRgvoLz6WfWdHj5AR9ArzZa5

3N74cvawpTtuuCbAasBo7oMJYrohgZYFCTj:  -0.01400000 Waves

2021.11.18 19:47 [1796729] smart account 3N74cvawpTtuuCbAasBo7oMJYrohgZYFCTj > SELF 0.00000000 Waves

{ "type": 13, "id": "HvuQNpjYC9Qz1tyJoRiELRgvoLz6WfWdHj5AR9ArzZa5", "fee": 1400000, "feeAssetId": null, "timestamp": 1637254083260, "version": 1, "sender": "3N74cvawpTtuuCbAasBo7oMJYrohgZYFCTj", "senderPublicKey": "BgnyKECwUvFW1ThWpgKbmHMmJXJRgg5K56jKHZwVMbXL", "proofs": [ "5Jq5cdpQWXPpuZrYUFUb2uPPyskLzXdsXqN5U1Hrpx4vLKrii8Yb5CrePZPPic5y68NejSfoVAQFPfsZuRoXCZhT" ], "script": "base64:AAIFAAAAAAAAAC4IAhIHCgUCAQEBARIAEgASBwoFAgEBAQESABIDCgEIEgUKAwEBARIGCgQICAgBAAAAJQAAAAALcmV2aXNpb25OdW0CAAAAAAAAAAADU0VQAgAAAAJfXwAAAAAITUFYREVQVEgAAAAAAAAAABEAAAAACVVTRVJERVBUSAAAAAAAAAAAGgAAAAAFU0NBTEUAAAAAAAAAA+gBAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AAAAAAAAAAAAAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5CQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQIAAAAAAQAAAA9nZXRTdHJpbmdPckZhaWwAAAABAAAAA2tleQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEIgAAAAEFAAAAA2tleQkAASwAAAACCQABLAAAAAICAAAAD21hbmRhdG9yeSB0aGlzLgUAAAADa2V5AgAAAA8gaXMgbm90IG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3RpbmdDb250cmFjdEFkZHJlc3NTdHIAAAAIbWF4RGVwdGgDCQEAAAACIT0AAAACBQAAAAR0aGlzCAUAAAABaQAAAAZjYWxsZXIJAAACAAAAAQIAAAAObm90IGF1dGhvcml6ZWQJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkBAAAACWtleUNvbmZpZwAAAAAJAQAAAAxmb3JtYXRDb25maWcAAAAEBQAAAAx3eEFzc2V0SWRTdHIFAAAAGm1hdGNoZXJQYWNlbWFrZXJBZGRyZXNzU3RyBQAAABpib29zdGluZ0NvbnRyYWN0QWRkcmVzc1N0cgUAAAAIbWF4RGVwdGgFAAAAA25pbAAAAADiy0XY", "chainId": 84, "height": 1796729, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FsB89Pp8n6eSv2e2e2TKbPvR7MhkiF46SfS7yh7Tycor Next: D6GLY9gYQZkDJVecwJrXyrhsktQuPmBR1mzChqvVWbNM Diff:
OldNewDifferences
99
1010 let USERDEPTH = 26
1111
12-let SCALE6 = 1000000
12+let SCALE = 1000
1313
1414 func getNumberByKey (key) = valueOrElse(getInteger(this, key), 0)
1515
2626
2727 let IdxCfgBoostingContract = 3
2828
29+let IdxCfgMaxDepth = 4
30+
2931 func keyConfig () = "%s__config"
3032
3133
3234 func readConfigArrayOrFail () = split(getStringOrFail(keyConfig()), SEP)
3335
3436
35-func formatConfig (wxAssetIdStr,matcherPacemakerAddressStr,boostingContractAddressStr) = makeString(["%s%s%s", wxAssetIdStr, matcherPacemakerAddressStr, boostingContractAddressStr], SEP)
37+func formatConfig (wxAssetIdStr,matcherPacemakerAddressStr,boostingContractAddressStr,maxDepth) = makeString(["%s%s%s%d", wxAssetIdStr, matcherPacemakerAddressStr, boostingContractAddressStr, toString(maxDepth)], SEP)
3638
3739
38-func keyUsersCount () = makeString(["%s", "nextUserNum"], SEP)
40+func keyUsersCount () = "%s__nextUserNum"
3941
4042
41-func keyNextProcessedUser () = makeString(["%s", "nextProcessedUser"], SEP)
43+func keyNextProcessedUser () = "%s__nextProcessedUser"
4244
4345
44-func keyLatestPeriod () = makeString(["%s", "latestPeriod"], SEP)
46+func keyLatestPeriod () = "%s__latestPeriod"
4547
4648
47-func keyNextPeriod () = makeString(["%s", "nextPeriod"], SEP)
49+func keyNextPeriod () = "%s__nextPeriod"
4850
4951
50-func keyNextProcessedPeriod () = makeString(["%s", "nextProcessedPeriod"], SEP)
52+func keyNextProcessedPeriod () = "%s__nextProcessedPeriod"
5153
5254
53-func keyNextUnlaimedPeriodOfUser (userIndex) = makeString(["%s%d", "nextClaimedPeriod", toString(userIndex)], SEP)
55+func keyNextUnlaimedPeriodOfUser (userIndex) = makeString(["%s%d__nextClaimedPeriod", toString(userIndex)], SEP)
5456
5557
56-func keyLastProcessedPeriodOfUser (userIndex) = makeString(["%s%d", "lastProcessedPeriod", toString(userIndex)], SEP)
58+func keyLastProcessedPeriodOfUser (userIndex) = makeString(["%s%d__lastProcessedPeriod", toString(userIndex)], SEP)
5759
5860
59-func keyHeightForPeriod (period) = makeString(["%s%d", "startHeightForPeriod", toString(period)], SEP)
61+func keyHeightForPeriod (period) = makeString(["%s%d__startHeightForPeriod", toString(period)], SEP)
6062
6163
62-func keyTotalAmountForPeriod (period) = makeString(["%s%d", "totalAmountForPeriod", toString(period)], SEP)
64+func keyTotalAmountForPeriod (period) = makeString(["%s%d__totalAmountForPeriod", toString(period)], SEP)
6365
6466
65-func keyTotalWeightForPeriod (period) = makeString(["%s%d", "totalWeightForPeriod", toString(period)], SEP)
67+func keyTotalWeightForPeriod (period) = makeString(["%s%d__totalWeightForPeriod", toString(period)], SEP)
6668
6769
68-func keyUserKValueForPeriod (period,userIndex) = makeString(["%s%d%s%d", "paramByPeriod", toString(userIndex), "k", toString(period)], SEP)
70+func keyUserKValueForPeriod (period,userIndex) = makeString(["%s%d%s%d__paramByPeriod", toString(userIndex), "k", toString(period)], SEP)
6971
7072
71-func keyUserBValueForPeriod (period,userIndex) = makeString(["%s%d%s%d", "paramByPeriod", toString(userIndex), "b", toString(period)], SEP)
73+func keyUserBValueForPeriod (period,userIndex) = makeString(["%s%d%s%d__paramByPeriod", toString(userIndex), "b", toString(period)], SEP)
74+
75+
76+func HistoryEntry (type,user,amount,currentPeriod,latestPeriod,i) = {
77+ let historyKEY = makeString(["%s%s%s%s__history", type, user, toBase58String(i.transactionId)], SEP)
78+ let historyDATA = makeString(["%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(amount), toString(currentPeriod), toString(latestPeriod)], SEP)
79+ StringEntry(historyKEY, historyDATA)
80+ }
7281
7382
7483 func calcUserWeight (boostingContractAddress,heightForPeriod,period,userIndex) = {
8190 let b = value(getInteger(boostingContractAddress, keyUserBValueForPeriod(period, userIndex)))
8291 let w = ((k * heightForPeriod) + b)
8392 if ((w > 0))
84- then $Tuple2((w / SCALE6), [IntegerEntry(kLast, period)])
93+ then $Tuple2((w / SCALE), [IntegerEntry(kLast, period)])
8594 else $Tuple2(0, nil)
8695 }
8796 else {
93102 let b = value(getInteger(boostingContractAddress, keyUserBValueForPeriod(pv, userIndex)))
94103 let w = ((k * heightForPeriod) + b)
95104 if ((w > 0))
96- then $Tuple2((w / SCALE6), nil)
105+ then $Tuple2((w / SCALE), nil)
97106 else $Tuple2(0, nil)
98107 }
99108 else $Tuple2(0, nil)
110119 func nextPeriod () = getNumberByKey(keyNextPeriod())
111120
112121
113-func invokeProcess (boostingContract,period,user,depth,weight,actions) = {
122+func invokeProcess (boostingContract,period,user,depth,weight) = {
114123 let result = invoke(this, "processNextBatch", [boostingContract, period, user, depth, weight], nil)
115124 if ((result == result))
116125 then match result {
117126 case r: (Int, Int, Int) =>
118- $Tuple4(actions, r._1, r._2, r._3)
127+ r
119128 case _ =>
120129 throw("Incorrect invoke result")
121130 }
124133
125134
126135 func checkLastPartOfPeriod (boostingContract,currentPeriod,latestPeriod,depth,totalWeightKey,weight) = if ((latestPeriod >= (currentPeriod + 1)))
127- then invokeProcess(boostingContract, (currentPeriod + 1), 0, (depth - 1), 0, [IntegerEntry(totalWeightKey, weight)])
128- else $Tuple4([IntegerEntry(totalWeightKey, weight)], (currentPeriod + 1), 0, 0)
136+ then invokeProcess(boostingContract, (currentPeriod + 1), 0, (depth - 1), 0)
137+ else $Tuple3((currentPeriod + 1), 0, 0)
129138
130139
131140 func processNextBatchInternal (boostingContract,currentPeriod,currentUser,depth,totalWeight) = {
138147 then (latestPeriod >= currentPeriod)
139148 else false)
140149 then {
141- let $t060846186 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, currentUser)
142- let w0 = $t060846186._1
143- let save0 = $t060846186._2
144- let weight0 = (totalWeight + w0)
150+ let t0 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, currentUser)
151+ let weight0 = (totalWeight + t0._1)
145152 if ((usersCount > (currentUser + 1)))
146153 then {
147- let $t062736384 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, (currentUser + 1))
148- let weight1 = $t062736384._1
149- let save1 = $t062736384._2
154+ let t1 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, (currentUser + 1))
155+ let weight1 = (weight0 + t1._1)
150156 if ((usersCount > (currentUser + 2)))
151157 then {
152- let $t064406551 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, (currentUser + 2))
153- let weight2 = $t064406551._1
154- let save2 = $t064406551._2
158+ let t2 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, (currentUser + 2))
159+ let weight2 = (weight1 + t2._1)
155160 if ((usersCount > (currentUser + 3)))
156161 then {
157- let $t066116722 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, (currentUser + 3))
158- let weight3 = $t066116722._1
159- let save3 = $t066116722._2
162+ let t3 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, (currentUser + 3))
163+ let weight3 = (weight2 + t3._1)
160164 if ((usersCount > (currentUser + 4)))
161165 then {
162- let $t067866897 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, (currentUser + 4))
163- let weight4 = $t067866897._1
164- let save4 = $t067866897._2
166+ let t4 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, (currentUser + 4))
167+ let weight4 = (weight3 + t4._1)
165168 if ((usersCount > (currentUser + 5)))
166169 then {
167- let $t069657076 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, (currentUser + 5))
168- let weight5 = $t069657076._1
169- let save5 = $t069657076._2
170+ let t5 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, (currentUser + 5))
171+ let weight5 = (weight4 + t5._1)
170172 if ((usersCount > (currentUser + 6)))
171173 then {
172- let $t071957351 = invokeProcess(boostingContract, currentPeriod, (currentUser + 6), (depth - 1), (((((weight0 + weight1) + weight2) + weight3) + weight4) + weight5), nil)
173- let a = $t071957351._1
174- let p = $t071957351._2
175- let u = $t071957351._3
176- let w = $t071957351._4
177- $Tuple4(((((((a ++ save0) ++ save1) ++ save2) ++ save3) ++ save4) ++ save5), p, u, w)
174+ let r5 = invokeProcess(boostingContract, currentPeriod, (currentUser + 6), (depth - 1), weight5)
175+ $Tuple4((((((t0._2 ++ t1._2) ++ t2._2) ++ t3._2) ++ t4._2) ++ t5._2), r5._1, r5._2, r5._3)
178176 }
179177 else {
180- let $t075197688 = checkLastPartOfPeriod(boostingContract, currentPeriod, latestPeriod, depth, totalWeightKey, (((((weight0 + weight1) + weight2) + weight3) + weight4) + weight5))
181- let a = $t075197688._1
182- let p = $t075197688._2
183- let u = $t075197688._3
184- let w = $t075197688._4
185- $Tuple4(((((((a ++ save0) ++ save1) ++ save2) ++ save3) ++ save4) ++ save5), p, u, w)
178+ let r5 = checkLastPartOfPeriod(boostingContract, currentPeriod, latestPeriod, depth, totalWeightKey, weight5)
179+ $Tuple4((((((([IntegerEntry(totalWeightKey, weight5)] ++ t0._2) ++ t1._2) ++ t2._2) ++ t3._2) ++ t4._2) ++ t5._2), r5._1, r5._2, r5._3)
186180 }
187181 }
188182 else {
189- let $t078688027 = checkLastPartOfPeriod(boostingContract, currentPeriod, latestPeriod, depth, totalWeightKey, ((((weight0 + weight1) + weight2) + weight3) + weight4))
190- let a = $t078688027._1
191- let p = $t078688027._2
192- let u = $t078688027._3
193- let w = $t078688027._4
194- $Tuple4((((((a ++ save0) ++ save1) ++ save2) ++ save3) ++ save4), p, u, w)
183+ let r4 = checkLastPartOfPeriod(boostingContract, currentPeriod, latestPeriod, depth, totalWeightKey, weight4)
184+ $Tuple4(((((([IntegerEntry(totalWeightKey, weight4)] ++ t0._2) ++ t1._2) ++ t2._2) ++ t3._2) ++ t4._2), r4._1, r4._2, r4._3)
195185 }
196186 }
197187 else {
198- let $t081908339 = checkLastPartOfPeriod(boostingContract, currentPeriod, latestPeriod, depth, totalWeightKey, (((weight0 + weight1) + weight2) + weight3))
199- let a = $t081908339._1
200- let p = $t081908339._2
201- let u = $t081908339._3
202- let w = $t081908339._4
203- $Tuple4(((((a ++ save0) ++ save1) ++ save2) ++ save3), p, u, w)
188+ let r3 = checkLastPartOfPeriod(boostingContract, currentPeriod, latestPeriod, depth, totalWeightKey, weight3)
189+ $Tuple4((((([IntegerEntry(totalWeightKey, weight3)] ++ t0._2) ++ t1._2) ++ t2._2) ++ t3._2), r3._1, r3._2, r3._3)
204190 }
205191 }
206192 else {
207- let $t084858624 = checkLastPartOfPeriod(boostingContract, currentPeriod, latestPeriod, depth, totalWeightKey, ((weight0 + weight1) + weight2))
208- let a = $t084858624._1
209- let p = $t084858624._2
210- let u = $t084858624._3
211- let w = $t084858624._4
212- $Tuple4((((a ++ save0) ++ save1) ++ save2), p, u, w)
193+ let r2 = checkLastPartOfPeriod(boostingContract, currentPeriod, latestPeriod, depth, totalWeightKey, weight2)
194+ $Tuple4(((([IntegerEntry(totalWeightKey, weight2)] ++ t0._2) ++ t1._2) ++ t2._2), r2._1, r2._2, r2._3)
213195 }
214196 }
215197 else {
216- let $t087538882 = checkLastPartOfPeriod(boostingContract, currentPeriod, latestPeriod, depth, totalWeightKey, (weight0 + weight1))
217- let a = $t087538882._1
218- let p = $t087538882._2
219- let u = $t087538882._3
220- let w = $t087538882._4
221- $Tuple4(((a ++ save0) ++ save1), p, u, w)
198+ let r1 = checkLastPartOfPeriod(boostingContract, currentPeriod, latestPeriod, depth, totalWeightKey, weight1)
199+ $Tuple4((([IntegerEntry(totalWeightKey, weight1)] ++ t0._2) ++ t1._2), r1._1, r1._2, r1._3)
222200 }
223201 }
224202 else {
225- let $t090239142 = checkLastPartOfPeriod(boostingContract, currentPeriod, latestPeriod, depth, totalWeightKey, weight0)
226- let a = $t090239142._1
227- let p = $t090239142._2
228- let u = $t090239142._3
229- let w = $t090239142._4
230- $Tuple4((a ++ save0), p, u, w)
203+ let r0 = checkLastPartOfPeriod(boostingContract, currentPeriod, latestPeriod, depth, totalWeightKey, weight0)
204+ $Tuple4(([IntegerEntry(totalWeightKey, weight0)] ++ t0._2), r0._1, r0._2, r0._3)
231205 }
232206 }
233207 else if ((currentUser == 0))
254228 let latestPeriod = getNumberByKey(keyNextProcessedPeriod())
255229 let totalWeight = getNumberByKey(keyTotalWeightForPeriod(currentPeriod))
256230 let heightForPeriod = getNumberByKey(keyHeightForPeriod(currentPeriod))
257- let $t01022410336 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, currentUser)
258- let userWeight = $t01022410336._1
259- let ignored = $t01022410336._2
260- let userAmoundForPeriod = fraction(getNumberByKey(keyTotalAmountForPeriod(currentPeriod)), userWeight, totalWeight)
231+ let $t01069910811 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, currentUser)
232+ let userWeight = $t01069910811._1
233+ let ignored = $t01069910811._2
234+ let userAmountForPeriod = fraction(getNumberByKey(keyTotalAmountForPeriod(currentPeriod)), userWeight, totalWeight)
261235 if (if ((0 >= depth))
262236 then true
263237 else ((currentPeriod + 1) >= latestPeriod))
264- then $Tuple2((currentPeriod + 1), (userAccumulated + userAmoundForPeriod))
265- else invokeClaim(boostingContract, (currentPeriod + 1), currentUser, (depth - 1), (userAccumulated + userAmoundForPeriod))
238+ then $Tuple2((currentPeriod + 1), (userAccumulated + userAmountForPeriod))
239+ else invokeClaim(boostingContract, (currentPeriod + 1), currentUser, (depth - 1), (userAccumulated + userAmountForPeriod))
266240 }
267241
268242
270244 let cfgArray = readConfigArrayOrFail()
271245 let userIdx = getUserIndexByAddress(cfgArray[IdxCfgBoostingContract], userAddress)
272246 let currentPeriod = getNumberByKey(keyNextUnlaimedPeriodOfUser(userIdx))
273- if ((currentPeriod >= getNumberByKey(keyNextProcessedPeriod())))
247+ let latestPeriod = getNumberByKey(keyNextProcessedPeriod())
248+ if ((currentPeriod >= latestPeriod))
274249 then throw("Nothing to claim")
275250 else {
276251 let boostingContract = fromBase58String(cfgArray[IdxCfgBoostingContract])
277- $Tuple3(claimInternal(boostingContract, currentPeriod, userIdx, USERDEPTH, 0), userIdx, cfgArray)
252+ let $t01173211824 = claimInternal(boostingContract, currentPeriod, userIdx, USERDEPTH, 0)
253+ let period = $t01173211824._1
254+ let amount = $t01173211824._2
255+ $Tuple5(period, amount, userIdx, cfgArray, latestPeriod)
278256 }
279257 }
280258
290268
291269
292270 @Callable(i)
293-func processPendingPeriodsAndUsers (depth) = if ((depth > MAXDEPTH))
294- then throw("Depth exceeds MAXDEPTH")
295- else {
296- let currentPeriod = getNumberByKey(keyNextProcessedPeriod())
297- if ((currentPeriod > getNumberByKey(keyLatestPeriod())))
298- then throw("Nothing to process")
299- else {
300- let boostingContract = fromBase58String(readConfigArrayOrFail()[IdxCfgBoostingContract])
301- let currentUser = getNumberByKey(keyNextProcessedUser())
302- let totalWeight = getNumberByKey(keyTotalWeightForPeriod(currentPeriod))
303- let r = processNextBatchInternal(boostingContract, currentPeriod, currentUser, depth, totalWeight)
304- ((r._1 :+ IntegerEntry(keyNextProcessedPeriod(), r._2)) :+ IntegerEntry(keyNextProcessedUser(), r._3))
305- }
306- }
271+func processPendingPeriodsAndUsers () = {
272+ let currentPeriod = getNumberByKey(keyNextProcessedPeriod())
273+ if ((currentPeriod > getNumberByKey(keyLatestPeriod())))
274+ then throw("Nothing to process")
275+ else {
276+ let cfgArray = readConfigArrayOrFail()
277+ let depth = parseIntValue(cfgArray[IdxCfgMaxDepth])
278+ if ((depth > MAXDEPTH))
279+ then throw("Depth exceeds MAXDEPTH")
280+ else {
281+ let boostingContract = fromBase58String(cfgArray[IdxCfgBoostingContract])
282+ let currentUser = getNumberByKey(keyNextProcessedUser())
283+ let totalWeight = getNumberByKey(keyTotalWeightForPeriod(currentPeriod))
284+ let r = processNextBatchInternal(boostingContract, currentPeriod, currentUser, depth, totalWeight)
285+ ((r._1 :+ IntegerEntry(keyNextProcessedPeriod(), r._2)) :+ IntegerEntry(keyNextProcessedUser(), r._3))
286+ }
287+ }
288+ }
307289
308290
309291
310292 @Callable(i)
311293 func deposit () = {
312294 let cfgArray = readConfigArrayOrFail()
313- let assetId = value(value(i.payments[0]).assetId)
314- if ((assetId != fromBase58String(cfgArray[IdxCfgAssetId])))
315- then throw("Wrong payment asset")
295+ if ((i.caller != Address(fromBase58String(cfgArray[IdxCfgPacemakerAddress]))))
296+ then throw("Wrong caller address")
316297 else {
317- let period = nextPeriod()
298+ let assetId = value(value(i.payments[0]).assetId)
299+ if ((assetId != fromBase58String(cfgArray[IdxCfgAssetId])))
300+ then throw("Wrong payment asset")
301+ else {
302+ let period = nextPeriod()
318303 [IntegerEntry(keyLatestPeriod(), period), IntegerEntry(keyHeightForPeriod(period), height), IntegerEntry(keyTotalAmountForPeriod(period), value(i.payments[0]).amount), IntegerEntry(keyNextPeriod(), (period + 1))]
304+ }
319305 }
320306 }
321307
334320 @Callable(i)
335321 func claimReward () = {
336322 let address = toString(i.caller)
337- let commonResults = commonClaimReward(address)
338- let r = commonResults._1
339- let userIdx = commonResults._2
340- let cfgArray = commonResults._3
341- $Tuple2([IntegerEntry(keyNextUnlaimedPeriodOfUser(userIdx), r._1), ScriptTransfer(i.caller, r._2, fromBase58String(cfgArray[IdxCfgAssetId]))], r._2)
323+ let claimResults = commonClaimReward(address)
324+ let period = claimResults._1
325+ let amount = claimResults._2
326+ let userIdx = claimResults._3
327+ let cfgArray = claimResults._4
328+ let latestPeriod = claimResults._5
329+ $Tuple2([IntegerEntry(keyNextUnlaimedPeriodOfUser(userIdx), period), ScriptTransfer(i.caller, amount, fromBase58String(cfgArray[IdxCfgAssetId])), HistoryEntry("claim", address, amount, period, latestPeriod, i)], amount)
342330 }
343331
344332
345333
346334 @Callable(i)
347-func claimRewardREADONLY (userAddress) = {
348- let commonResults = commonClaimReward(userAddress)
349- let r = commonResults._1
350- let userIdx = commonResults._2
351- let cfgArray = commonResults._3
352- $Tuple2(nil, r._2)
335+func claimRewardREADONLY (address) = {
336+ let claimResults = commonClaimReward(address)
337+ let amount = claimResults._2
338+ $Tuple2(nil, amount)
353339 }
354340
355341
357343 @Callable(i)
358344 func calcGwxParamsREADONLY (wxAmount,lockStartHeight,lockDurationBlocks) = {
359345 let lockEndHeight = (lockStartHeight + lockDurationBlocks)
360- let scale8ParamK = -(fraction(wxAmount, SCALE6, lockDurationBlocks))
361- let scale8ParamB = (fraction(wxAmount, SCALE6, lockDurationBlocks) * lockEndHeight)
346+ let scale8ParamK = -(fraction(wxAmount, SCALE, lockDurationBlocks))
347+ let scale8ParamB = (fraction(wxAmount, SCALE, lockDurationBlocks) * lockEndHeight)
362348 $Tuple2(nil, [scale8ParamK, scale8ParamB, nextPeriod()])
363349 }
364350
365351
366352
367353 @Callable(i)
368-func constructor (wxAssetIdStr,matcherPacemakerAddressStr,boostingContractAddressStr) = if ((this != i.caller))
354+func constructor (wxAssetIdStr,matcherPacemakerAddressStr,boostingContractAddressStr,maxDepth) = if ((this != i.caller))
369355 then throw("not authorized")
370- else [StringEntry(keyConfig(), formatConfig(wxAssetIdStr, matcherPacemakerAddressStr, boostingContractAddressStr))]
356+ else [StringEntry(keyConfig(), formatConfig(wxAssetIdStr, matcherPacemakerAddressStr, boostingContractAddressStr, maxDepth))]
371357
372358
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let revisionNum = ""
55
66 let SEP = "__"
77
88 let MAXDEPTH = 17
99
1010 let USERDEPTH = 26
1111
12-let SCALE6 = 1000000
12+let SCALE = 1000
1313
1414 func getNumberByKey (key) = valueOrElse(getInteger(this, key), 0)
1515
1616
1717 func getStringByKey (key) = valueOrElse(getString(this, key), "")
1818
1919
2020 func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined"))
2121
2222
2323 let IdxCfgAssetId = 1
2424
2525 let IdxCfgPacemakerAddress = 2
2626
2727 let IdxCfgBoostingContract = 3
2828
29+let IdxCfgMaxDepth = 4
30+
2931 func keyConfig () = "%s__config"
3032
3133
3234 func readConfigArrayOrFail () = split(getStringOrFail(keyConfig()), SEP)
3335
3436
35-func formatConfig (wxAssetIdStr,matcherPacemakerAddressStr,boostingContractAddressStr) = makeString(["%s%s%s", wxAssetIdStr, matcherPacemakerAddressStr, boostingContractAddressStr], SEP)
37+func formatConfig (wxAssetIdStr,matcherPacemakerAddressStr,boostingContractAddressStr,maxDepth) = makeString(["%s%s%s%d", wxAssetIdStr, matcherPacemakerAddressStr, boostingContractAddressStr, toString(maxDepth)], SEP)
3638
3739
38-func keyUsersCount () = makeString(["%s", "nextUserNum"], SEP)
40+func keyUsersCount () = "%s__nextUserNum"
3941
4042
41-func keyNextProcessedUser () = makeString(["%s", "nextProcessedUser"], SEP)
43+func keyNextProcessedUser () = "%s__nextProcessedUser"
4244
4345
44-func keyLatestPeriod () = makeString(["%s", "latestPeriod"], SEP)
46+func keyLatestPeriod () = "%s__latestPeriod"
4547
4648
47-func keyNextPeriod () = makeString(["%s", "nextPeriod"], SEP)
49+func keyNextPeriod () = "%s__nextPeriod"
4850
4951
50-func keyNextProcessedPeriod () = makeString(["%s", "nextProcessedPeriod"], SEP)
52+func keyNextProcessedPeriod () = "%s__nextProcessedPeriod"
5153
5254
53-func keyNextUnlaimedPeriodOfUser (userIndex) = makeString(["%s%d", "nextClaimedPeriod", toString(userIndex)], SEP)
55+func keyNextUnlaimedPeriodOfUser (userIndex) = makeString(["%s%d__nextClaimedPeriod", toString(userIndex)], SEP)
5456
5557
56-func keyLastProcessedPeriodOfUser (userIndex) = makeString(["%s%d", "lastProcessedPeriod", toString(userIndex)], SEP)
58+func keyLastProcessedPeriodOfUser (userIndex) = makeString(["%s%d__lastProcessedPeriod", toString(userIndex)], SEP)
5759
5860
59-func keyHeightForPeriod (period) = makeString(["%s%d", "startHeightForPeriod", toString(period)], SEP)
61+func keyHeightForPeriod (period) = makeString(["%s%d__startHeightForPeriod", toString(period)], SEP)
6062
6163
62-func keyTotalAmountForPeriod (period) = makeString(["%s%d", "totalAmountForPeriod", toString(period)], SEP)
64+func keyTotalAmountForPeriod (period) = makeString(["%s%d__totalAmountForPeriod", toString(period)], SEP)
6365
6466
65-func keyTotalWeightForPeriod (period) = makeString(["%s%d", "totalWeightForPeriod", toString(period)], SEP)
67+func keyTotalWeightForPeriod (period) = makeString(["%s%d__totalWeightForPeriod", toString(period)], SEP)
6668
6769
68-func keyUserKValueForPeriod (period,userIndex) = makeString(["%s%d%s%d", "paramByPeriod", toString(userIndex), "k", toString(period)], SEP)
70+func keyUserKValueForPeriod (period,userIndex) = makeString(["%s%d%s%d__paramByPeriod", toString(userIndex), "k", toString(period)], SEP)
6971
7072
71-func keyUserBValueForPeriod (period,userIndex) = makeString(["%s%d%s%d", "paramByPeriod", toString(userIndex), "b", toString(period)], SEP)
73+func keyUserBValueForPeriod (period,userIndex) = makeString(["%s%d%s%d__paramByPeriod", toString(userIndex), "b", toString(period)], SEP)
74+
75+
76+func HistoryEntry (type,user,amount,currentPeriod,latestPeriod,i) = {
77+ let historyKEY = makeString(["%s%s%s%s__history", type, user, toBase58String(i.transactionId)], SEP)
78+ let historyDATA = makeString(["%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(amount), toString(currentPeriod), toString(latestPeriod)], SEP)
79+ StringEntry(historyKEY, historyDATA)
80+ }
7281
7382
7483 func calcUserWeight (boostingContractAddress,heightForPeriod,period,userIndex) = {
7584 let kLast = keyLastProcessedPeriodOfUser(userIndex)
7685 let kKey = keyUserKValueForPeriod(period, userIndex)
7786 let kRaw = getInteger(boostingContractAddress, kKey)
7887 if (isDefined(kRaw))
7988 then {
8089 let k = value(kRaw)
8190 let b = value(getInteger(boostingContractAddress, keyUserBValueForPeriod(period, userIndex)))
8291 let w = ((k * heightForPeriod) + b)
8392 if ((w > 0))
84- then $Tuple2((w / SCALE6), [IntegerEntry(kLast, period)])
93+ then $Tuple2((w / SCALE), [IntegerEntry(kLast, period)])
8594 else $Tuple2(0, nil)
8695 }
8796 else {
8897 let p = getInteger(this, kLast)
8998 if (isDefined(p))
9099 then {
91100 let pv = value(p)
92101 let k = value(getInteger(boostingContractAddress, keyUserKValueForPeriod(pv, userIndex)))
93102 let b = value(getInteger(boostingContractAddress, keyUserBValueForPeriod(pv, userIndex)))
94103 let w = ((k * heightForPeriod) + b)
95104 if ((w > 0))
96- then $Tuple2((w / SCALE6), nil)
105+ then $Tuple2((w / SCALE), nil)
97106 else $Tuple2(0, nil)
98107 }
99108 else $Tuple2(0, nil)
100109 }
101110 }
102111
103112
104113 func getUserIndexByAddress (boostingContractAddressStr,userAddress) = {
105114 let key = makeString(["%s%s%s", "mapping", "user2num", userAddress], SEP)
106115 parseIntValue(valueOrErrorMessage(getString(Address(fromBase58String(boostingContractAddressStr)), key), ((("User address " + userAddress) + " is not found in boosting contract data, key=") + key)))
107116 }
108117
109118
110119 func nextPeriod () = getNumberByKey(keyNextPeriod())
111120
112121
113-func invokeProcess (boostingContract,period,user,depth,weight,actions) = {
122+func invokeProcess (boostingContract,period,user,depth,weight) = {
114123 let result = invoke(this, "processNextBatch", [boostingContract, period, user, depth, weight], nil)
115124 if ((result == result))
116125 then match result {
117126 case r: (Int, Int, Int) =>
118- $Tuple4(actions, r._1, r._2, r._3)
127+ r
119128 case _ =>
120129 throw("Incorrect invoke result")
121130 }
122131 else throw("Strict value is not equal to itself.")
123132 }
124133
125134
126135 func checkLastPartOfPeriod (boostingContract,currentPeriod,latestPeriod,depth,totalWeightKey,weight) = if ((latestPeriod >= (currentPeriod + 1)))
127- then invokeProcess(boostingContract, (currentPeriod + 1), 0, (depth - 1), 0, [IntegerEntry(totalWeightKey, weight)])
128- else $Tuple4([IntegerEntry(totalWeightKey, weight)], (currentPeriod + 1), 0, 0)
136+ then invokeProcess(boostingContract, (currentPeriod + 1), 0, (depth - 1), 0)
137+ else $Tuple3((currentPeriod + 1), 0, 0)
129138
130139
131140 func processNextBatchInternal (boostingContract,currentPeriod,currentUser,depth,totalWeight) = {
132141 let boostingContractAddress = Address(boostingContract)
133142 let latestPeriod = getNumberByKey(keyLatestPeriod())
134143 let usersCount = valueOrElse(getInteger(boostingContractAddress, keyUsersCount()), 0)
135144 let totalWeightKey = keyTotalWeightForPeriod(currentPeriod)
136145 let heightForPeriod = getNumberByKey(keyHeightForPeriod(currentPeriod))
137146 if (if ((depth > 0))
138147 then (latestPeriod >= currentPeriod)
139148 else false)
140149 then {
141- let $t060846186 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, currentUser)
142- let w0 = $t060846186._1
143- let save0 = $t060846186._2
144- let weight0 = (totalWeight + w0)
150+ let t0 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, currentUser)
151+ let weight0 = (totalWeight + t0._1)
145152 if ((usersCount > (currentUser + 1)))
146153 then {
147- let $t062736384 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, (currentUser + 1))
148- let weight1 = $t062736384._1
149- let save1 = $t062736384._2
154+ let t1 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, (currentUser + 1))
155+ let weight1 = (weight0 + t1._1)
150156 if ((usersCount > (currentUser + 2)))
151157 then {
152- let $t064406551 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, (currentUser + 2))
153- let weight2 = $t064406551._1
154- let save2 = $t064406551._2
158+ let t2 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, (currentUser + 2))
159+ let weight2 = (weight1 + t2._1)
155160 if ((usersCount > (currentUser + 3)))
156161 then {
157- let $t066116722 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, (currentUser + 3))
158- let weight3 = $t066116722._1
159- let save3 = $t066116722._2
162+ let t3 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, (currentUser + 3))
163+ let weight3 = (weight2 + t3._1)
160164 if ((usersCount > (currentUser + 4)))
161165 then {
162- let $t067866897 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, (currentUser + 4))
163- let weight4 = $t067866897._1
164- let save4 = $t067866897._2
166+ let t4 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, (currentUser + 4))
167+ let weight4 = (weight3 + t4._1)
165168 if ((usersCount > (currentUser + 5)))
166169 then {
167- let $t069657076 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, (currentUser + 5))
168- let weight5 = $t069657076._1
169- let save5 = $t069657076._2
170+ let t5 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, (currentUser + 5))
171+ let weight5 = (weight4 + t5._1)
170172 if ((usersCount > (currentUser + 6)))
171173 then {
172- let $t071957351 = invokeProcess(boostingContract, currentPeriod, (currentUser + 6), (depth - 1), (((((weight0 + weight1) + weight2) + weight3) + weight4) + weight5), nil)
173- let a = $t071957351._1
174- let p = $t071957351._2
175- let u = $t071957351._3
176- let w = $t071957351._4
177- $Tuple4(((((((a ++ save0) ++ save1) ++ save2) ++ save3) ++ save4) ++ save5), p, u, w)
174+ let r5 = invokeProcess(boostingContract, currentPeriod, (currentUser + 6), (depth - 1), weight5)
175+ $Tuple4((((((t0._2 ++ t1._2) ++ t2._2) ++ t3._2) ++ t4._2) ++ t5._2), r5._1, r5._2, r5._3)
178176 }
179177 else {
180- let $t075197688 = checkLastPartOfPeriod(boostingContract, currentPeriod, latestPeriod, depth, totalWeightKey, (((((weight0 + weight1) + weight2) + weight3) + weight4) + weight5))
181- let a = $t075197688._1
182- let p = $t075197688._2
183- let u = $t075197688._3
184- let w = $t075197688._4
185- $Tuple4(((((((a ++ save0) ++ save1) ++ save2) ++ save3) ++ save4) ++ save5), p, u, w)
178+ let r5 = checkLastPartOfPeriod(boostingContract, currentPeriod, latestPeriod, depth, totalWeightKey, weight5)
179+ $Tuple4((((((([IntegerEntry(totalWeightKey, weight5)] ++ t0._2) ++ t1._2) ++ t2._2) ++ t3._2) ++ t4._2) ++ t5._2), r5._1, r5._2, r5._3)
186180 }
187181 }
188182 else {
189- let $t078688027 = checkLastPartOfPeriod(boostingContract, currentPeriod, latestPeriod, depth, totalWeightKey, ((((weight0 + weight1) + weight2) + weight3) + weight4))
190- let a = $t078688027._1
191- let p = $t078688027._2
192- let u = $t078688027._3
193- let w = $t078688027._4
194- $Tuple4((((((a ++ save0) ++ save1) ++ save2) ++ save3) ++ save4), p, u, w)
183+ let r4 = checkLastPartOfPeriod(boostingContract, currentPeriod, latestPeriod, depth, totalWeightKey, weight4)
184+ $Tuple4(((((([IntegerEntry(totalWeightKey, weight4)] ++ t0._2) ++ t1._2) ++ t2._2) ++ t3._2) ++ t4._2), r4._1, r4._2, r4._3)
195185 }
196186 }
197187 else {
198- let $t081908339 = checkLastPartOfPeriod(boostingContract, currentPeriod, latestPeriod, depth, totalWeightKey, (((weight0 + weight1) + weight2) + weight3))
199- let a = $t081908339._1
200- let p = $t081908339._2
201- let u = $t081908339._3
202- let w = $t081908339._4
203- $Tuple4(((((a ++ save0) ++ save1) ++ save2) ++ save3), p, u, w)
188+ let r3 = checkLastPartOfPeriod(boostingContract, currentPeriod, latestPeriod, depth, totalWeightKey, weight3)
189+ $Tuple4((((([IntegerEntry(totalWeightKey, weight3)] ++ t0._2) ++ t1._2) ++ t2._2) ++ t3._2), r3._1, r3._2, r3._3)
204190 }
205191 }
206192 else {
207- let $t084858624 = checkLastPartOfPeriod(boostingContract, currentPeriod, latestPeriod, depth, totalWeightKey, ((weight0 + weight1) + weight2))
208- let a = $t084858624._1
209- let p = $t084858624._2
210- let u = $t084858624._3
211- let w = $t084858624._4
212- $Tuple4((((a ++ save0) ++ save1) ++ save2), p, u, w)
193+ let r2 = checkLastPartOfPeriod(boostingContract, currentPeriod, latestPeriod, depth, totalWeightKey, weight2)
194+ $Tuple4(((([IntegerEntry(totalWeightKey, weight2)] ++ t0._2) ++ t1._2) ++ t2._2), r2._1, r2._2, r2._3)
213195 }
214196 }
215197 else {
216- let $t087538882 = checkLastPartOfPeriod(boostingContract, currentPeriod, latestPeriod, depth, totalWeightKey, (weight0 + weight1))
217- let a = $t087538882._1
218- let p = $t087538882._2
219- let u = $t087538882._3
220- let w = $t087538882._4
221- $Tuple4(((a ++ save0) ++ save1), p, u, w)
198+ let r1 = checkLastPartOfPeriod(boostingContract, currentPeriod, latestPeriod, depth, totalWeightKey, weight1)
199+ $Tuple4((([IntegerEntry(totalWeightKey, weight1)] ++ t0._2) ++ t1._2), r1._1, r1._2, r1._3)
222200 }
223201 }
224202 else {
225- let $t090239142 = checkLastPartOfPeriod(boostingContract, currentPeriod, latestPeriod, depth, totalWeightKey, weight0)
226- let a = $t090239142._1
227- let p = $t090239142._2
228- let u = $t090239142._3
229- let w = $t090239142._4
230- $Tuple4((a ++ save0), p, u, w)
203+ let r0 = checkLastPartOfPeriod(boostingContract, currentPeriod, latestPeriod, depth, totalWeightKey, weight0)
204+ $Tuple4(([IntegerEntry(totalWeightKey, weight0)] ++ t0._2), r0._1, r0._2, r0._3)
231205 }
232206 }
233207 else if ((currentUser == 0))
234208 then $Tuple4(nil, currentPeriod, 0, 0)
235209 else $Tuple4([IntegerEntry(totalWeightKey, totalWeight)], currentPeriod, currentUser, 0)
236210 }
237211
238212
239213 func invokeClaim (boostingContract,period,user,depth,total) = {
240214 let result = invoke(this, "claimNextBatch", [boostingContract, period, user, depth, total], nil)
241215 if ((result == result))
242216 then match result {
243217 case r: (Int, Int) =>
244218 r
245219 case _ =>
246220 throw("Incorrect invoke result")
247221 }
248222 else throw("Strict value is not equal to itself.")
249223 }
250224
251225
252226 func claimInternal (boostingContract,currentPeriod,currentUser,depth,userAccumulated) = {
253227 let boostingContractAddress = Address(boostingContract)
254228 let latestPeriod = getNumberByKey(keyNextProcessedPeriod())
255229 let totalWeight = getNumberByKey(keyTotalWeightForPeriod(currentPeriod))
256230 let heightForPeriod = getNumberByKey(keyHeightForPeriod(currentPeriod))
257- let $t01022410336 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, currentUser)
258- let userWeight = $t01022410336._1
259- let ignored = $t01022410336._2
260- let userAmoundForPeriod = fraction(getNumberByKey(keyTotalAmountForPeriod(currentPeriod)), userWeight, totalWeight)
231+ let $t01069910811 = calcUserWeight(boostingContractAddress, heightForPeriod, currentPeriod, currentUser)
232+ let userWeight = $t01069910811._1
233+ let ignored = $t01069910811._2
234+ let userAmountForPeriod = fraction(getNumberByKey(keyTotalAmountForPeriod(currentPeriod)), userWeight, totalWeight)
261235 if (if ((0 >= depth))
262236 then true
263237 else ((currentPeriod + 1) >= latestPeriod))
264- then $Tuple2((currentPeriod + 1), (userAccumulated + userAmoundForPeriod))
265- else invokeClaim(boostingContract, (currentPeriod + 1), currentUser, (depth - 1), (userAccumulated + userAmoundForPeriod))
238+ then $Tuple2((currentPeriod + 1), (userAccumulated + userAmountForPeriod))
239+ else invokeClaim(boostingContract, (currentPeriod + 1), currentUser, (depth - 1), (userAccumulated + userAmountForPeriod))
266240 }
267241
268242
269243 func commonClaimReward (userAddress) = {
270244 let cfgArray = readConfigArrayOrFail()
271245 let userIdx = getUserIndexByAddress(cfgArray[IdxCfgBoostingContract], userAddress)
272246 let currentPeriod = getNumberByKey(keyNextUnlaimedPeriodOfUser(userIdx))
273- if ((currentPeriod >= getNumberByKey(keyNextProcessedPeriod())))
247+ let latestPeriod = getNumberByKey(keyNextProcessedPeriod())
248+ if ((currentPeriod >= latestPeriod))
274249 then throw("Nothing to claim")
275250 else {
276251 let boostingContract = fromBase58String(cfgArray[IdxCfgBoostingContract])
277- $Tuple3(claimInternal(boostingContract, currentPeriod, userIdx, USERDEPTH, 0), userIdx, cfgArray)
252+ let $t01173211824 = claimInternal(boostingContract, currentPeriod, userIdx, USERDEPTH, 0)
253+ let period = $t01173211824._1
254+ let amount = $t01173211824._2
255+ $Tuple5(period, amount, userIdx, cfgArray, latestPeriod)
278256 }
279257 }
280258
281259
282260 @Callable(i)
283261 func processNextBatch (boostingContract,currentPeriod,currentUser,depth,totalWeight) = if ((i.caller != this))
284262 then throw("Should be called by this script only")
285263 else {
286264 let tpl = processNextBatchInternal(boostingContract, currentPeriod, currentUser, depth, totalWeight)
287265 $Tuple2(tpl._1, $Tuple3(tpl._2, tpl._3, tpl._4))
288266 }
289267
290268
291269
292270 @Callable(i)
293-func processPendingPeriodsAndUsers (depth) = if ((depth > MAXDEPTH))
294- then throw("Depth exceeds MAXDEPTH")
295- else {
296- let currentPeriod = getNumberByKey(keyNextProcessedPeriod())
297- if ((currentPeriod > getNumberByKey(keyLatestPeriod())))
298- then throw("Nothing to process")
299- else {
300- let boostingContract = fromBase58String(readConfigArrayOrFail()[IdxCfgBoostingContract])
301- let currentUser = getNumberByKey(keyNextProcessedUser())
302- let totalWeight = getNumberByKey(keyTotalWeightForPeriod(currentPeriod))
303- let r = processNextBatchInternal(boostingContract, currentPeriod, currentUser, depth, totalWeight)
304- ((r._1 :+ IntegerEntry(keyNextProcessedPeriod(), r._2)) :+ IntegerEntry(keyNextProcessedUser(), r._3))
305- }
306- }
271+func processPendingPeriodsAndUsers () = {
272+ let currentPeriod = getNumberByKey(keyNextProcessedPeriod())
273+ if ((currentPeriod > getNumberByKey(keyLatestPeriod())))
274+ then throw("Nothing to process")
275+ else {
276+ let cfgArray = readConfigArrayOrFail()
277+ let depth = parseIntValue(cfgArray[IdxCfgMaxDepth])
278+ if ((depth > MAXDEPTH))
279+ then throw("Depth exceeds MAXDEPTH")
280+ else {
281+ let boostingContract = fromBase58String(cfgArray[IdxCfgBoostingContract])
282+ let currentUser = getNumberByKey(keyNextProcessedUser())
283+ let totalWeight = getNumberByKey(keyTotalWeightForPeriod(currentPeriod))
284+ let r = processNextBatchInternal(boostingContract, currentPeriod, currentUser, depth, totalWeight)
285+ ((r._1 :+ IntegerEntry(keyNextProcessedPeriod(), r._2)) :+ IntegerEntry(keyNextProcessedUser(), r._3))
286+ }
287+ }
288+ }
307289
308290
309291
310292 @Callable(i)
311293 func deposit () = {
312294 let cfgArray = readConfigArrayOrFail()
313- let assetId = value(value(i.payments[0]).assetId)
314- if ((assetId != fromBase58String(cfgArray[IdxCfgAssetId])))
315- then throw("Wrong payment asset")
295+ if ((i.caller != Address(fromBase58String(cfgArray[IdxCfgPacemakerAddress]))))
296+ then throw("Wrong caller address")
316297 else {
317- let period = nextPeriod()
298+ let assetId = value(value(i.payments[0]).assetId)
299+ if ((assetId != fromBase58String(cfgArray[IdxCfgAssetId])))
300+ then throw("Wrong payment asset")
301+ else {
302+ let period = nextPeriod()
318303 [IntegerEntry(keyLatestPeriod(), period), IntegerEntry(keyHeightForPeriod(period), height), IntegerEntry(keyTotalAmountForPeriod(period), value(i.payments[0]).amount), IntegerEntry(keyNextPeriod(), (period + 1))]
304+ }
319305 }
320306 }
321307
322308
323309
324310 @Callable(i)
325311 func claimNextBatch (boostingContract,currentPeriod,currentUser,depth,totalWeight) = if ((i.caller != this))
326312 then throw("Should be called by this script only")
327313 else {
328314 let periodAndTotal = claimInternal(boostingContract, currentPeriod, currentUser, depth, totalWeight)
329315 $Tuple2(nil, periodAndTotal)
330316 }
331317
332318
333319
334320 @Callable(i)
335321 func claimReward () = {
336322 let address = toString(i.caller)
337- let commonResults = commonClaimReward(address)
338- let r = commonResults._1
339- let userIdx = commonResults._2
340- let cfgArray = commonResults._3
341- $Tuple2([IntegerEntry(keyNextUnlaimedPeriodOfUser(userIdx), r._1), ScriptTransfer(i.caller, r._2, fromBase58String(cfgArray[IdxCfgAssetId]))], r._2)
323+ let claimResults = commonClaimReward(address)
324+ let period = claimResults._1
325+ let amount = claimResults._2
326+ let userIdx = claimResults._3
327+ let cfgArray = claimResults._4
328+ let latestPeriod = claimResults._5
329+ $Tuple2([IntegerEntry(keyNextUnlaimedPeriodOfUser(userIdx), period), ScriptTransfer(i.caller, amount, fromBase58String(cfgArray[IdxCfgAssetId])), HistoryEntry("claim", address, amount, period, latestPeriod, i)], amount)
342330 }
343331
344332
345333
346334 @Callable(i)
347-func claimRewardREADONLY (userAddress) = {
348- let commonResults = commonClaimReward(userAddress)
349- let r = commonResults._1
350- let userIdx = commonResults._2
351- let cfgArray = commonResults._3
352- $Tuple2(nil, r._2)
335+func claimRewardREADONLY (address) = {
336+ let claimResults = commonClaimReward(address)
337+ let amount = claimResults._2
338+ $Tuple2(nil, amount)
353339 }
354340
355341
356342
357343 @Callable(i)
358344 func calcGwxParamsREADONLY (wxAmount,lockStartHeight,lockDurationBlocks) = {
359345 let lockEndHeight = (lockStartHeight + lockDurationBlocks)
360- let scale8ParamK = -(fraction(wxAmount, SCALE6, lockDurationBlocks))
361- let scale8ParamB = (fraction(wxAmount, SCALE6, lockDurationBlocks) * lockEndHeight)
346+ let scale8ParamK = -(fraction(wxAmount, SCALE, lockDurationBlocks))
347+ let scale8ParamB = (fraction(wxAmount, SCALE, lockDurationBlocks) * lockEndHeight)
362348 $Tuple2(nil, [scale8ParamK, scale8ParamB, nextPeriod()])
363349 }
364350
365351
366352
367353 @Callable(i)
368-func constructor (wxAssetIdStr,matcherPacemakerAddressStr,boostingContractAddressStr) = if ((this != i.caller))
354+func constructor (wxAssetIdStr,matcherPacemakerAddressStr,boostingContractAddressStr,maxDepth) = if ((this != i.caller))
369355 then throw("not authorized")
370- else [StringEntry(keyConfig(), formatConfig(wxAssetIdStr, matcherPacemakerAddressStr, boostingContractAddressStr))]
356+ else [StringEntry(keyConfig(), formatConfig(wxAssetIdStr, matcherPacemakerAddressStr, boostingContractAddressStr, maxDepth))]
371357
372358

github/deemru/w8io/026f985 
60.95 ms