tx · kQcGL3CeytmviVJDQ9f48c3bD3RPr6ZWVtuyYKk4cQ6

3Mp5kisFrqESzrXxAMEPk2k69zpeF41czEE:  -0.01800000 Waves

2022.10.20 11:14 [2280469] smart account 3Mp5kisFrqESzrXxAMEPk2k69zpeF41czEE > SELF 0.00000000 Waves

{ "type": 13, "id": "kQcGL3CeytmviVJDQ9f48c3bD3RPr6ZWVtuyYKk4cQ6", "fee": 1800000, "feeAssetId": null, "timestamp": 1666253673797, "version": 1, "sender": "3Mp5kisFrqESzrXxAMEPk2k69zpeF41czEE", "senderPublicKey": "G349Uq3FTox7dRNLeAfAQeoACvwZ9iEnVSaHcEYn6j8J", "proofs": [ "3PnRtEfDb4QVqXybCcqkhBCp66h84Rn5sgnHQnrhqDJBFsM3bL7tFrMsm3wGRMRQ7W1H3vC72NJvEtJCDdDnAxEU" ], "script": "base64:BgKPGQgCEgQKAggBEgASAwoBARIAEgASABIDCgEIEgMKAQgSAwoBCBIFCgMBAQESBQoDAQEBEgASAwoBCBIHCgUICAgICBIDCgEIEgAiA1NFUCIFU0NBTEUiBU1VTFQ4Igp6ZXJvQmlnSW50IhRwcm9jZXNzaW5nU3RhZ2VUb3RhbCIVcHJvY2Vzc2luZ1N0YWdlU2hhcmVzIg5nZXROdW1iZXJCeUtleSIDa2V5Ig9nZXROdW1iZXJPckZhaWwiDmdldFN0cmluZ0J5S2V5Ig9nZXRTdHJpbmdPckZhaWwiA2FicyIDdmFsIglhYnNCaWdJbnQiC2tleU1heERlcHRoIg9tYXhEZXB0aERlZmF1bHQiCG1heERlcHRoIhFrZXlGYWN0b3J5QWRkcmVzcyIRZmFjdG9yeUFkZHJlc3NTdHIiD2ZhY3RvcnlDb250cmFjdCISa2V5RW1pc3Npb25BZGRyZXNzIhNrZXlOdW1Ub1VzZXJNYXBwaW5nIgNudW0iFmtleVJlZmVycmFsUHJvZ3JhbU5hbWUiGnJlZmVycmFsUHJvZ3JhbU5hbWVEZWZhdWx0IhNyZWZlcnJhbFByb2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IkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAQJkYQECZGIABAJkYwQCYU8JAQJhTgADCQABAgUCYU8CCkJ5dGVWZWN0b3IEAmFUBQJhTwUCYVQDCQABAgUCYU8CBFVuaXQIBQJkYQ9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCZGEJYm9keUJ5dGVzCQCRAwIIBQJkYQZwcm9vZnMAAAUCZGMMyB3Z", "chainId": 84, "height": 2280469, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 27uMXZkX4LtCXmH2JfRfiYjYMDW3Ue1SAeuSqA12hKYU Next: Eb5EydP8iizpe7p9iZhoLrRsyNK4mzrWnWBTfNM7gLBr 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%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
195195 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
196196
197197
198198 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
199199 case s: String =>
200200 fromBase58String(s)
201201 case _: Unit =>
202202 unit
203203 case _ =>
204204 throw("Match error")
205205 }
206206
207207
208208 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
209209 case s: String =>
210210 fromBase58String(s)
211211 case _: Unit =>
212212 unit
213213 case _ =>
214214 throw("Match error")
215215 }
216216
217217
218218 func mustManager (i) = {
219219 let pd = throw("Permission denied")
220220 match managerPublicKeyOrUnit() {
221221 case pk: ByteVector =>
222222 if ((i.callerPublicKey == pk))
223223 then true
224224 else pd
225225 case _: Unit =>
226226 if ((i.caller == this))
227227 then true
228228 else pd
229229 case _ =>
230230 throw("Match error")
231231 }
232232 }
233233
234234
235235 func calcUserWeight (boostingContractAddress,heightForPeriod,period,userIndex) = {
236236 let kLast = keyLastProcessedPeriodOfUser(userIndex)
237237 let kKey = keyUserKValueForPeriod(period, userIndex)
238238 let kRaw = getInteger(boostingContractAddress, kKey)
239239 let kUserWeight = keyUserWeightForPeriod(period, userIndex)
240240 if (isDefined(kRaw))
241241 then {
242242 let k = value(kRaw)
243243 let b = value(getInteger(boostingContractAddress, keyUserBValueForPeriod(period, userIndex)))
244244 let w = ((k * heightForPeriod) + b)
245245 if ((w > 0))
246246 then $Tuple2((w / SCALE), [IntegerEntry(kLast, period), IntegerEntry(kUserWeight, w)])
247247 else $Tuple2(0, nil)
248248 }
249249 else {
250250 let p = getInteger(this, kLast)
251251 if (if (isDefined(p))
252252 then (period >= value(p))
253253 else false)
254254 then {
255255 let pv = value(p)
256256 let k = value(getInteger(boostingContractAddress, keyUserKValueForPeriod(pv, userIndex)))
257257 let b = value(getInteger(boostingContractAddress, keyUserBValueForPeriod(pv, userIndex)))
258258 let w = ((k * heightForPeriod) + b)
259259 if ((w > 0))
260260 then $Tuple2((w / SCALE), [IntegerEntry(kUserWeight, w)])
261261 else $Tuple2(0, nil)
262262 }
263263 else $Tuple2(0, nil)
264264 }
265265 }
266266
267267
268268 func calcUserWeightForClaim (boostingContractAddress,heightForPeriod,period,userIndex) = {
269269 let kUserWeight = keyUserWeightForPeriod(period, userIndex)
270270 let userWeightOrUnit = getInteger(kUserWeight)
271271 match userWeightOrUnit {
272272 case _: Unit =>
273273 0
274274 case w: Int =>
275275 (w / SCALE)
276276 case _ =>
277277 throw("Match error")
278278 }
279279 }
280280
281281
282282 func getUserIndexByAddress (boostingContractAddressStr,userAddress) = {
283283 let key = makeString(["%s%s%s", "mapping", "user2num", userAddress], SEP)
284284 parseIntValue(valueOrErrorMessage(getString(Address(fromBase58String(boostingContractAddressStr)), key), ((("User address " + userAddress) + " is not found in boosting contract data, key=") + key)))
285285 }
286286
287287
288288 func nextPeriod () = getNumberByKey(keyNextPeriod())
289289
290290
291291 func commonClaimReward (userAddress) = {
292292 let cfgArray = readConfigArrayOrFail()
293293 let userIdx = getUserIndexByAddress(cfgArray[IdxCfgBoostingContract], userAddress)
294294 let userUnclaimedOption = getInteger(keyUserUnclaimed(userIdx))
295295 match userUnclaimedOption {
296296 case _: Unit =>
297297 $Tuple2(0, nil)
298298 case u: Int =>
299299 $Tuple2(u, [IntegerEntry(keyUserUnclaimed(userIdx), 0)])
300300 case _ =>
301301 throw("Match error")
302302 }
303303 }
304304
305305
306306 @Callable(i)
307307 func updateReferralActivity (userAddress,gWxAmountStart) = {
308308 let referrer = getString(referralsContractAddressOrFail, keyReferrer(userAddress))
309309 let activeReferralInv = if ((referrer == unit))
310310 then unit
311311 else invoke(referralsContractAddressOrFail, "updateReferralActivity", [referralProgramName, userAddress, (gWxAmountStart >= referralMinGWxAmount)], nil)
312312 if ((activeReferralInv == activeReferralInv))
313313 then $Tuple2(nil, unit)
314314 else throw("Strict value is not equal to itself.")
315315 }
316316
317317
318318
319319 @Callable(i)
320320 func finalizeHelper () = {
321321 let processingStage = valueOrElse(getInteger(keyProcessingStage()), processingStageTotal)
322322 let currentPeriod = getNumberByKey(keyNextProcessedPeriod())
323323 let currentUser = getNumberByKey(keyNextProcessedUser())
324324 let latestPeriod = getNumberByKey(keyLatestPeriod())
325325 let usersCount = valueOrElse(getInteger(boostingContractOrFail(), keyUsersCount()), 0)
326326 let totalWeightKey = keyTotalWeightForPeriod(currentPeriod)
327327 let totalWeight = getNumberByKey(keyTotalWeightForPeriod(currentPeriod))
328328 let heightForPeriod = getNumberByKey(keyHeightForPeriod(currentPeriod))
329329 if ((currentPeriod > latestPeriod))
330330 then $Tuple2(nil, false)
331331 else if ((processingStage == processingStageTotal))
332332 then {
333333 let $t01208412200 = calcUserWeight(boostingContractOrFail(), heightForPeriod, currentPeriod, currentUser)
334334 let userWeight = $t01208412200._1
335335 let userActions = $t01208412200._2
336336 let totalWeightNew = (totalWeight + userWeight)
337337 let processingActions = if (((usersCount - 1) > currentUser))
338338 then [IntegerEntry(keyNextProcessedUser(), (currentUser + 1))]
339339 else [IntegerEntry(keyProcessingStage(), processingStageShares), IntegerEntry(keyNextProcessedUser(), 0)]
340340 $Tuple2((([IntegerEntry(totalWeightKey, totalWeightNew)] ++ processingActions) ++ userActions), true)
341341 }
342342 else if ((processingStage == processingStageShares))
343343 then {
344344 let userWeight = calcUserWeightForClaim(boostingContractOrFail(), heightForPeriod, currentPeriod, currentUser)
345345 let userAmountMatcherForPeriod = fraction(getNumberByKey(keyTotalAmountForPeriod(currentPeriod)), userWeight, totalWeight)
346346 let userAmountEmissionForPeriod = fraction(getNumberByKey(keyAuxEmissionRewardForPeriod(currentPeriod)), userWeight, totalWeight)
347347 let userTotalAmount = (userAmountEmissionForPeriod + userAmountMatcherForPeriod)
348348 let userUnclaimedOption = getInteger(keyUserUnclaimed(currentUser))
349349 let userAddress = getStringValue(boostingContractOrFail(), keyNumToUserMapping(currentUser))
350350 let referrer = getString(referralsContractAddressOrFail, keyReferrer(userAddress))
351351 let activeReferralInv = if ((referrer == unit))
352352 then unit
353353 else invoke(referralsContractAddressOrFail, "updateReferralActivity", [referralProgramName, userAddress, (userWeight >= referralMinGWxAmount)], nil)
354354 if ((activeReferralInv == activeReferralInv))
355355 then {
356356 let referralInv = if (if ((referrer == unit))
357357 then true
358358 else (referralMinGWxAmount > userWeight))
359359 then unit
360360 else {
361361 let referrerReward = fraction(userTotalAmount, referrerRewardPermille, SCALE)
362362 let referralReward = fraction(userTotalAmount, referralRewardPermille, SCALE)
363363 invoke(referralsContractAddressOrFail, "incUnclaimed", [referralProgramName, userAddress, referrerReward, referralReward], nil)
364364 }
365365 if ((referralInv == referralInv))
366366 then {
367367 let unclaimedActions = [IntegerEntry(keyUserUnclaimed(currentUser), (valueOrElse(userUnclaimedOption, 0) + userTotalAmount))]
368368 let processingActions = if (((usersCount - 1) > currentUser))
369369 then [IntegerEntry(keyNextProcessedUser(), (currentUser + 1))]
370370 else [IntegerEntry(keyNextProcessedPeriod(), (currentPeriod + 1)), IntegerEntry(keyNextProcessedUser(), 0), DeleteEntry(keyProcessingStage())]
371371 $Tuple2((unclaimedActions ++ processingActions), true)
372372 }
373373 else throw("Strict value is not equal to itself.")
374374 }
375375 else throw("Strict value is not equal to itself.")
376376 }
377377 else throw("invalid processing stage")
378378 }
379379
380380
381381
382382 @Callable(i)
383383 func finalizeWrapper (counter) = {
384384 let result = {
385385 let @ = invoke(this, "finalizeHelper", nil, nil)
386386 if ($isInstanceOf(@, "Boolean"))
387387 then @
388388 else throw(($getType(@) + " couldn't be cast to Boolean"))
389389 }
390390 if ((result == result))
391391 then if (!(result))
392392 then if ((counter == maxDepth))
393393 then throw("Nothing to process")
394394 else $Tuple2(nil, unit)
395395 else if ((counter > 0))
396396 then $Tuple2(nil, invoke(this, "finalizeWrapper", [(counter - 1)], nil))
397397 else $Tuple2(nil, unit)
398398 else throw("Strict value is not equal to itself.")
399399 }
400400
401401
402402
403403 @Callable(i)
404404 func processPendingPeriodsAndUsers () = $Tuple2(nil, invoke(this, "finalizeWrapper", [maxDepth], nil))
405405
406406
407407
408408 @Callable(i)
409409 func deposit () = {
410410 let cfgArray = readConfigArrayOrFail()
411411 if ((i.caller != Address(fromBase58String(cfgArray[IdxCfgPacemakerAddress]))))
412412 then throw("Wrong caller address")
413413 else {
414414 let assetId = value(value(i.payments[0]).assetId)
415415 if ((assetId != fromBase58String(cfgArray[IdxCfgAssetId])))
416416 then throw("Wrong payment asset")
417417 else {
418418 let period = nextPeriod()
419419 let deltaH = (height - getNumberOrFail(keyGwxRewardEmissionStartHeight()))
420420 let emissionRate = valueOrErrorMessage(getInteger(emissionContract, keyRatePerBlockCurrent()), (("mandatory emission_contract." + keyRatePerBlockCurrent()) + " is not defined"))
421421 let weight = valueOrErrorMessage(getInteger(factoryContract, keyPoolWeightVirtual()), (("mandatory factory_contract." + keyPoolWeightVirtual()) + " is not defined"))
422422 let auxAmount = fraction((deltaH * weight), emissionRate, MULT8)
423423 let em = invoke(emissionContract, "emit", [auxAmount], nil)
424424 if ((em == em))
425425 then {
426426 let matcherPart = value(i.payments[0]).amount
427427 let payoutInfo = PeriodPayoutInfo(period, matcherPart, auxAmount)
428428 [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)]
429429 }
430430 else throw("Strict value is not equal to itself.")
431431 }
432432 }
433433 }
434434
435435
436436
437437 @Callable(i)
438438 func claimReward () = {
439439 let cfgArray = readConfigArrayOrFail()
440440 let address = toString(i.caller)
441441 let $t01754217592 = commonClaimReward(address)
442442 let amount = $t01754217592._1
443443 let actions = $t01754217592._2
444444 let checkAmount = if ((amount > 0))
445445 then true
446446 else throw("Nothing to claim")
447447 if ((checkAmount == checkAmount))
448448 then {
449449 let amountFromEmission = 0
450450 let claimedReferral = {
451451 let @ = invoke(referralsContractAddressOrFail, "claim", [referralProgramName], nil)
452452 if ($isInstanceOf(@, "Int"))
453453 then @
454454 else throw(($getType(@) + " couldn't be cast to Int"))
455455 }
456456 let totalAmount = (amount + claimedReferral)
457457 $Tuple2(([ScriptTransfer(i.caller, totalAmount, fromBase58String(cfgArray[IdxCfgAssetId])), HistoryEntry("claim", address, amount, i)] ++ actions), [totalAmount, amountFromEmission])
458458 }
459459 else throw("Strict value is not equal to itself.")
460460 }
461461
462462
463463
464464 @Callable(i)
465465 func claimRewardREADONLY (address) = {
466466 let $t01816518215 = commonClaimReward(address)
467467 let amount = $t01816518215._1
468468 let actions = $t01816518215._2
469469 let referralUnclaimed = valueOrElse(getInteger(referralsContractAddressOrFail, keyUnclaimedReferral(referralProgramName, address)), 0)
470470 let totalAmount = (amount + referralUnclaimed)
471471 $Tuple2(nil, totalAmount)
472472 }
473473
474474
475475
476476 @Callable(i)
477477 func latestFinalizedPeriodREADONLY (address) = $Tuple2(nil, valueOrElse(getInteger(this, keyLatestPeriod()), -1))
478478
479479
480480
481481 @Callable(i)
482482 func latestFinalizedPeriodInfoREADONLY (address) = $Tuple2(nil, getStringByKey(keyLastPayoutInfo()))
483483
484484
485485
486486 @Callable(i)
487487 func calcGwxParamsREADONLY (gwxAmountStart,lockStartHeight,lockDurationBlocks) = {
488488 let lockEndHeight = (lockStartHeight + lockDurationBlocks)
489489 let scale8ParamK = -(fraction(gwxAmountStart, SCALE, lockDurationBlocks))
490490 let scale8ParamB = (fraction(gwxAmountStart, SCALE, lockDurationBlocks) * lockEndHeight)
491491 $Tuple2(nil, [scale8ParamK, scale8ParamB, nextPeriod()])
492492 }
493493
494494
495495
496496 @Callable(i)
497497 func calcGwxAmountStartREADONLY (wxLockAmount,lockDuration,maxLockDuration) = {
498498 let coeffX8 = fraction(lockDuration, MULT8, maxLockDuration)
499499 let gWxAmountStart = fraction(wxLockAmount, coeffX8, MULT8)
500500 $Tuple2(nil, [gWxAmountStart])
501501 }
502502
503503
504504
505505 @Callable(i)
506506 func onEmissionForGwxStart () = if ((i.caller != factoryContract))
507507 then throw("permissions denied")
508508 else [IntegerEntry(keyGwxRewardEmissionStartHeight(), height)]
509509
510510
511511
512512 @Callable(i)
513513 func latestPeriodEmissionRewardsREADONLY (address) = {
514514 let period = nextPeriod()
515515 $Tuple2(nil, [getNumberByKey(keyAuxEmissionRewardForPeriod(period))])
516516 }
517517
518518
519519
520520 @Callable(i)
521521 func calcD (x1BigIntStr,x2BigIntStr,ampBigIntStr,aPrecisionBigIntStr,targetPrecisionBigIntStr) = {
522522 let nCoins = toBigInt(2)
523523 let aPrecision = parseBigIntValue(aPrecisionBigIntStr)
524524 let targetPrecision = parseBigIntValue(targetPrecisionBigIntStr)
525525 let x1 = parseBigIntValue(x1BigIntStr)
526526 let x2 = parseBigIntValue(x2BigIntStr)
527527 let amp = (parseBigIntValue(ampBigIntStr) * aPrecision)
528528 let s = (x1 + x2)
529529 if ((s == zeroBigInt))
530530 then $Tuple2(nil, toString(zeroBigInt))
531531 else {
532532 let ann = (amp * nCoins)
533533 let arr = [0, 1, 2, 3, 4, 5, 6]
534534 func calc (acc,cur) = {
535535 let $t02084820875 = acc
536536 let d = $t02084820875._1
537537 let dPrev = $t02084820875._2
538538 let found = $t02084820875._3
539539 if ((found != unit))
540540 then acc
541541 else {
542542 let dp = (((d * d) * d) / (((x1 * x2) * nCoins) * nCoins))
543543 let dNext = (((((ann * s) / aPrecision) + (dp * nCoins)) * d) / ((((ann - aPrecision) * d) / aPrecision) + ((nCoins + toBigInt(1)) * dp)))
544544 let dDiff = absBigInt((dNext - value(d)))
545545 if ((targetPrecision >= dDiff))
546546 then $Tuple3(dNext, d, cur)
547547 else $Tuple3(dNext, d, unit)
548548 }
549549 }
550550
551551 let $t02147321536 = {
552552 let $l = arr
553553 let $s = size($l)
554554 let $acc0 = $Tuple3(s, unit, unit)
555555 func $f0_1 ($a,$i) = if (($i >= $s))
556556 then $a
557557 else calc($a, $l[$i])
558558
559559 func $f0_2 ($a,$i) = if (($i >= $s))
560560 then $a
561561 else throw("List size exceeds 7")
562562
563563 $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)
564564 }
565565 let dNext = $t02147321536._1
566566 let dPrev = $t02147321536._2
567567 let found = $t02147321536._3
568568 if ((found != unit))
569569 then $Tuple2(nil, toString(dNext))
570570 else {
571571 let dDiff = absBigInt((dNext - value(dPrev)))
572572 throw(("D calculation error, dDiff = " + toString(dDiff)))
573573 }
574574 }
575575 }
576576
577577
578578
579579 @Callable(i)
580580 func setManager (pendingManagerPublicKey) = {
581581 let checkCaller = mustManager(i)
582582 if ((checkCaller == checkCaller))
583583 then {
584584 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
585585 if ((checkManagerPublicKey == checkManagerPublicKey))
586586 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
587587 else throw("Strict value is not equal to itself.")
588588 }
589589 else throw("Strict value is not equal to itself.")
590590 }
591591
592592
593593
594594 @Callable(i)
595595 func confirmManager () = {
596596 let pm = pendingManagerPublicKeyOrUnit()
597597 let hasPM = if (isDefined(pm))
598598 then true
599599 else throw("No pending manager")
600600 if ((hasPM == hasPM))
601601 then {
602602 let checkPM = if ((i.callerPublicKey == value(pm)))
603603 then true
604604 else throw("You are not pending manager")
605605 if ((checkPM == checkPM))
606606 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
607607 else throw("Strict value is not equal to itself.")
608608 }
609609 else throw("Strict value is not equal to itself.")
610610 }
611611
612612
613613 @Verifier(tx)
614614 func verify () = {
615615 let targetPublicKey = match managerPublicKeyOrUnit() {
616616 case pk: ByteVector =>
617617 pk
618618 case _: Unit =>
619619 tx.senderPublicKey
620620 case _ =>
621621 throw("Match error")
622622 }
623623 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
624624 }
625625

github/deemru/w8io/fabc49c 
55.73 ms