tx · NiNbdY9WuBDMMPg76CeFVimKAJMj73kmkz2e7J1sDT9 3Mp5kisFrqESzrXxAMEPk2k69zpeF41czEE: -0.02000000 Waves 2023.05.12 14:13 [2574647] smart account 3Mp5kisFrqESzrXxAMEPk2k69zpeF41czEE > SELF 0.00000000 Waves
{ "type": 13, "id": "NiNbdY9WuBDMMPg76CeFVimKAJMj73kmkz2e7J1sDT9", "fee": 2000000, "feeAssetId": null, "timestamp": 1683890073338, "version": 2, "chainId": 84, "sender": "3Mp5kisFrqESzrXxAMEPk2k69zpeF41czEE", "senderPublicKey": "G349Uq3FTox7dRNLeAfAQeoACvwZ9iEnVSaHcEYn6j8J", "proofs": [ "5jjf2HuzoT7jXMWSjBojzwd2jQ1GdT53j8CvF9MWidJAzMr6MX1VA8cUie9FoCNSu6SaNHk3SHSFu9nCuPNCpJzP" ], "script": "base64:BgL5HAgCEgYKBAEYEQESBAoCCAESABIDCgEBEgASABIAEgMKAQgSAwoBCBIDCgEIEgUKAwEBARIFCgMBAQESABIDCgEIEgcKBQgICAgIEgQKAhgREgASAwoBCCIDU0VQIgVTQ0FMRSIFTVVMVDgiCnplcm9CaWdJbnQiFHByb2Nlc3NpbmdTdGFnZVRvdGFsIhVwcm9jZXNzaW5nU3RhZ2VTaGFyZXMiC3dhdmVzU3RyaW5nIg5nZXROdW1iZXJCeUtleSIDa2V5Ig9nZXROdW1iZXJPckZhaWwiDmdldFN0cmluZ0J5S2V5Ig9nZXRTdHJpbmdPckZhaWwiDHBhcnNlQXNzZXRJZCIFaW5wdXQiB3dyYXBFcnIiA21zZyIIdGhyb3dFcnIiA2FicyIDdmFsIglhYnNCaWdJbnQiC2tleU1heERlcHRoIg9tYXhEZXB0aERlZmF1bHQiCG1heERlcHRoIhFrZXlGYWN0b3J5QWRkcmVzcyIRZmFjdG9yeUFkZHJlc3NTdHIiD2ZhY3RvcnlDb250cmFjdCISa2V5RW1pc3Npb25BZGRyZXNzIhlrZXlWb3RpbmdFbWlzc2lvbkNvb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QBnAgUCZHcJAJADAQUCYkkGCQEBcQECE1RvbyBtYW55IHJlY2lwaWVudHMJAMwIAgMFAmR2BgkBAXEBAhdBcmd1bWVudHMgc2l6ZSBtaXNtYXRjaAkAzAgCAwkAAAIFAmR5BQJhZwYJAQFxAQITV3JvbmcgYXNzZXQgcGF5bWVudAUDbmlsAwkAAAIFAmJMBQJiTAQCYk0JAPwHBAUEdGhpcwITdHJhZGVSZXdhcmRJbnRlcm5hbAkAzAgCBQJkegkAzAgCBQJiSQkAzAgCBQJiSgkAzAgCAAAFA25pbAUDbmlsAwkAAAIFAmJNBQJiTQkAlAoCBQNuaWwFAmJNCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAmFUARJjbGFpbVRyYWRpbmdSZXdhcmQABAJhVggFAmFUBmNhbGxlcgQCZEEJAQJiRwEJAKUIAQUCYVYDCQBmAgUCZEEAAAkAlAoCCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMFAmFWBQJkQQUCYWcFA25pbAUCZEEJAQFxAQIQbm90aGluZyB0byBjbGFpbQJhVAEaY2xhaW1UcmFkaW5nUmV3YXJkUkVBRE9OTFkBAmFWCQCUCgIFA25pbAkBAmJHAQUCYVYBAmRCAQJkQwAEAmREBAJiZgkBAmJoAAMJAAECBQJiZgIKQnl0ZVZlY3RvcgQCYmwFAmJmBQJibAMJAAECBQJiZgIEVW5pdAgFAmRCD3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yCQD0AwMIBQJkQglib2R5Qnl0ZXMJAJEDAggFAmRCBnByb29mcwAABQJkRI32qhc=", "height": 2574647, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 121KLAoDzyHyfc45Y69acyfxP1nJKnQE1VHsU4juyXwD Next: ENKWA3RNDcDLpEK28C5qzF375AxfNGdY1j7RmbTG5U3r Diff:
Old | New | Differences | |
---|---|---|---|
13 | 13 | ||
14 | 14 | let processingStageShares = 1 | |
15 | 15 | ||
16 | + | let wavesString = "WAVES" | |
17 | + | ||
16 | 18 | func getNumberByKey (key) = valueOrElse(getInteger(this, key), 0) | |
17 | 19 | ||
18 | 20 | ||
23 | 25 | ||
24 | 26 | ||
25 | 27 | func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (("mandatory this." + key) + " is not defined")) | |
28 | + | ||
29 | + | ||
30 | + | func parseAssetId (input) = if ((input == wavesString)) | |
31 | + | then unit | |
32 | + | else fromBase58String(input) | |
33 | + | ||
34 | + | ||
35 | + | func wrapErr (msg) = makeString(["gwx_reward.ride:", msg], " ") | |
36 | + | ||
37 | + | ||
38 | + | func throwErr (msg) = throw(wrapErr(msg)) | |
26 | 39 | ||
27 | 40 | ||
28 | 41 | func abs (val) = if ((0 > val)) | |
50 | 63 | ||
51 | 64 | func keyEmissionAddress () = "%s%s__config__emissionAddress" | |
52 | 65 | ||
66 | + | ||
67 | + | func keyVotingEmissionContract () = makeString(["%s", "votingEmissionContract"], SEP) | |
68 | + | ||
69 | + | ||
70 | + | let votingEmissionContract = addressFromStringValue(getStringValue(factoryContract, keyVotingEmissionContract())) | |
53 | 71 | ||
54 | 72 | func keyNumToUserMapping (num) = makeString(["%s%s%s", "mapping", "num2user", toString(num)], SEP) | |
55 | 73 | ||
99 | 117 | func keyConfig () = "%s__config" | |
100 | 118 | ||
101 | 119 | ||
120 | + | func getEmissionAddress () = addressFromStringValue(valueOrErrorMessage(getString(this, keyEmissionAddress()), (("mandatory this." + keyEmissionAddress()) + " is not defined"))) | |
121 | + | ||
122 | + | ||
123 | + | let emissionAddress = getEmissionAddress() | |
124 | + | ||
125 | + | let wxAssetIdStr = split(value(getString(emissionAddress, keyConfig())), SEP)[1] | |
126 | + | ||
127 | + | let wxAssetId = fromBase58String(wxAssetIdStr) | |
128 | + | ||
102 | 129 | func readConfigArrayOrFail () = split(getStringOrFail(keyConfig()), SEP) | |
103 | 130 | ||
104 | 131 | ||
118 | 145 | ||
119 | 146 | ||
120 | 147 | func keyRatePerBlockCurrent () = "%s%s__ratePerBlock__current" | |
148 | + | ||
149 | + | ||
150 | + | func keyGwxHoldersRewardCurrent () = "%s%s__gwxHoldersReward__current" | |
151 | + | ||
152 | + | ||
153 | + | func keyGwxHoldersRewardNext () = "%s%s__gwxHoldersReward__next" | |
121 | 154 | ||
122 | 155 | ||
123 | 156 | func keyPoolWeightVirtual () = "%s%s__poolWeight__GWXvirtualPOOL" | |
181 | 214 | ||
182 | 215 | ||
183 | 216 | let referralsContractAddressOrFail = addressFromStringValue(getStringOrFail(keyReferralsContractAddress())) | |
217 | + | ||
218 | + | func keyTradingRewardHistory (user,i) = makeString(["%s%s%s%s", "tradingReward", "history", user, toBase58String(i.transactionId)], SEP) | |
219 | + | ||
220 | + | ||
221 | + | func keyTradingReward (userAddress) = makeString(["%s%s", "tradingReward", userAddress], SEP) | |
222 | + | ||
223 | + | ||
224 | + | func keyMaxRecipients () = makeString(["%s", "maxRecipients"], SEP) | |
225 | + | ||
184 | 226 | ||
185 | 227 | func HistoryEntry (type,user,amount,i) = { | |
186 | 228 | let historyKEY = makeString(["%s%s%s%s__history", type, user, toBase58String(i.transactionId)], SEP) | |
304 | 346 | } | |
305 | 347 | ||
306 | 348 | ||
349 | + | func getTradingReward (userAddress) = valueOrElse(getInteger(this, keyTradingReward(userAddress)), 0) | |
350 | + | ||
351 | + | ||
352 | + | @Callable(i) | |
353 | + | func tradeRewardInternal (paymentAmountLeftOver,userAddresses,rewards,currentIter) = if ((currentIter == size(userAddresses))) | |
354 | + | then nil | |
355 | + | else { | |
356 | + | let checks = [if ((i.caller == this)) | |
357 | + | then true | |
358 | + | else throwErr("Permission denied"), if ((paymentAmountLeftOver >= rewards[currentIter])) | |
359 | + | then true | |
360 | + | else throwErr("insufficient payment assetId")] | |
361 | + | if ((checks == checks)) | |
362 | + | then { | |
363 | + | let tradeRewardInternal = invoke(this, "tradeRewardInternal", [(paymentAmountLeftOver - rewards[currentIter]), userAddresses, rewards, (currentIter + 1)], nil) | |
364 | + | if ((tradeRewardInternal == tradeRewardInternal)) | |
365 | + | then { | |
366 | + | let tradingRewardHistoryKey = keyTradingRewardHistory(userAddresses[currentIter], i) | |
367 | + | let userAddress = addressFromStringValue(userAddresses[currentIter]) | |
368 | + | $Tuple2([IntegerEntry(tradingRewardHistoryKey, rewards[currentIter]), IntegerEntry(keyTradingReward(userAddresses[currentIter]), rewards[currentIter])], tradeRewardInternal) | |
369 | + | } | |
370 | + | else throw("Strict value is not equal to itself.") | |
371 | + | } | |
372 | + | else throw("Strict value is not equal to itself.") | |
373 | + | } | |
374 | + | ||
375 | + | ||
376 | + | ||
307 | 377 | @Callable(i) | |
308 | 378 | func updateReferralActivity (userAddress,gWxAmountStart) = { | |
309 | 379 | let referrer = getString(referralsContractAddressOrFail, keyReferrer(userAddress)) | |
331 | 401 | then $Tuple2(nil, false) | |
332 | 402 | else if ((processingStage == processingStageTotal)) | |
333 | 403 | then { | |
334 | - | let $ | |
335 | - | let userWeight = $ | |
336 | - | let userActions = $ | |
404 | + | let $t01451014626 = calcUserWeight(boostingContractOrFail(), heightForPeriod, currentPeriod, currentUser) | |
405 | + | let userWeight = $t01451014626._1 | |
406 | + | let userActions = $t01451014626._2 | |
337 | 407 | let totalWeightNew = (totalWeight + userWeight) | |
338 | 408 | let processingActions = if (((usersCount - 1) > currentUser)) | |
339 | 409 | then [IntegerEntry(keyNextProcessedUser(), (currentUser + 1))] | |
408 | 478 | ||
409 | 479 | @Callable(i) | |
410 | 480 | func deposit () = { | |
411 | - | let cfgArray = readConfigArrayOrFail() | |
412 | - | if ((i.caller != Address(fromBase58String(cfgArray[IdxCfgPacemakerAddress])))) | |
413 | - | then throw("Wrong caller address") | |
414 | - | else { | |
415 | - | let assetId = value(value(i.payments[0]).assetId) | |
416 | - | if ((assetId != fromBase58String(cfgArray[IdxCfgAssetId]))) | |
417 | - | then throw("Wrong payment asset") | |
418 | - | else { | |
419 | - | let period = nextPeriod() | |
420 | - | let deltaH = (height - getNumberOrFail(keyGwxRewardEmissionStartHeight())) | |
421 | - | let emissionRate = valueOrErrorMessage(getInteger(emissionContract, keyRatePerBlockCurrent()), (("mandatory emission_contract." + keyRatePerBlockCurrent()) + " is not defined")) | |
422 | - | let weight = valueOrErrorMessage(getInteger(factoryContract, keyPoolWeightVirtual()), (("mandatory factory_contract." + keyPoolWeightVirtual()) + " is not defined")) | |
423 | - | let auxAmount = fraction((deltaH * weight), emissionRate, MULT8) | |
424 | - | let em = invoke(emissionContract, "emit", [auxAmount], nil) | |
481 | + | let checkCaller = if ((i.caller == votingEmissionContract)) | |
482 | + | then true | |
483 | + | else mustManager(i) | |
484 | + | if ((checkCaller == checkCaller)) | |
485 | + | then { | |
486 | + | let period = nextPeriod() | |
487 | + | let deltaH = (height - getNumberOrFail(keyGwxRewardEmissionStartHeight())) | |
488 | + | let emissionRate = valueOrErrorMessage(getInteger(emissionContract, keyRatePerBlockCurrent()), (("mandatory emission_contract." + keyRatePerBlockCurrent()) + " is not defined")) | |
489 | + | let gwxHoldersRewardCurrent = valueOrElse(getInteger(emissionContract, keyGwxHoldersRewardCurrent()), 0) | |
490 | + | if ((gwxHoldersRewardCurrent == gwxHoldersRewardCurrent)) | |
491 | + | then { | |
492 | + | let auxAmount = fraction((deltaH * gwxHoldersRewardCurrent), emissionRate, MULT8) | |
493 | + | let em = if ((auxAmount > 0)) | |
494 | + | then invoke(emissionContract, "emit", [auxAmount], nil) | |
495 | + | else unit | |
425 | 496 | if ((em == em)) | |
426 | 497 | then { | |
427 | - | let matcherPart = | |
498 | + | let matcherPart = 0 | |
428 | 499 | let payoutInfo = PeriodPayoutInfo(period, matcherPart, auxAmount) | |
429 | - | [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)] | |
500 | + | let gwxHoldersRewardUpdated = { | |
501 | + | let @ = invoke(emissionContract, "gwxHoldersRewardUpdate", nil, nil) | |
502 | + | if ($isInstanceOf(@, "Boolean")) | |
503 | + | then @ | |
504 | + | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
505 | + | } | |
506 | + | if ((gwxHoldersRewardUpdated == gwxHoldersRewardUpdated)) | |
507 | + | then { | |
508 | + | let totalReward = (matcherPart + auxAmount) | |
509 | + | let actions = if (if ((totalReward == 0)) | |
510 | + | then !(gwxHoldersRewardUpdated) | |
511 | + | else false) | |
512 | + | then nil | |
513 | + | else [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)] | |
514 | + | $Tuple2(actions, unit) | |
515 | + | } | |
516 | + | else throw("Strict value is not equal to itself.") | |
430 | 517 | } | |
431 | 518 | else throw("Strict value is not equal to itself.") | |
432 | 519 | } | |
520 | + | else throw("Strict value is not equal to itself.") | |
433 | 521 | } | |
522 | + | else throw("Strict value is not equal to itself.") | |
434 | 523 | } | |
435 | 524 | ||
436 | 525 | ||
439 | 528 | func claimReward () = { | |
440 | 529 | let cfgArray = readConfigArrayOrFail() | |
441 | 530 | let address = toString(i.caller) | |
442 | - | let $ | |
443 | - | let amount = $ | |
444 | - | let actions = $ | |
531 | + | let $t01981519865 = commonClaimReward(address) | |
532 | + | let amount = $t01981519865._1 | |
533 | + | let actions = $t01981519865._2 | |
445 | 534 | let checkAmount = if ((amount > 0)) | |
446 | 535 | then true | |
447 | 536 | else throw("Nothing to claim") | |
464 | 553 | ||
465 | 554 | @Callable(i) | |
466 | 555 | func claimRewardREADONLY (address) = { | |
467 | - | let $ | |
468 | - | let amount = $ | |
469 | - | let actions = $ | |
556 | + | let $t02043820488 = commonClaimReward(address) | |
557 | + | let amount = $t02043820488._1 | |
558 | + | let actions = $t02043820488._2 | |
470 | 559 | let referralUnclaimed = valueOrElse(getInteger(referralsContractAddressOrFail, keyUnclaimedReferral(referralProgramName, address)), 0) | |
471 | 560 | let totalAmount = (amount + referralUnclaimed) | |
472 | 561 | $Tuple2(nil, totalAmount) | |
533 | 622 | let ann = (amp * nCoins) | |
534 | 623 | let arr = [0, 1, 2, 3, 4, 5, 6] | |
535 | 624 | func calc (acc,cur) = { | |
536 | - | let $ | |
537 | - | let d = $ | |
538 | - | let dPrev = $ | |
539 | - | let found = $ | |
625 | + | let $t02312123148 = acc | |
626 | + | let d = $t02312123148._1 | |
627 | + | let dPrev = $t02312123148._2 | |
628 | + | let found = $t02312123148._3 | |
540 | 629 | if ((found != unit)) | |
541 | 630 | then acc | |
542 | 631 | else { | |
549 | 638 | } | |
550 | 639 | } | |
551 | 640 | ||
552 | - | let $ | |
641 | + | let $t02374623809 = { | |
553 | 642 | let $l = arr | |
554 | 643 | let $s = size($l) | |
555 | 644 | let $acc0 = $Tuple3(s, unit, unit) | |
563 | 652 | ||
564 | 653 | $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) | |
565 | 654 | } | |
566 | - | let dNext = $ | |
567 | - | let dPrev = $ | |
568 | - | let found = $ | |
655 | + | let dNext = $t02374623809._1 | |
656 | + | let dPrev = $t02374623809._2 | |
657 | + | let found = $t02374623809._3 | |
569 | 658 | if ((found != unit)) | |
570 | 659 | then $Tuple2(nil, toString(dNext)) | |
571 | 660 | else { | |
574 | 663 | } | |
575 | 664 | } | |
576 | 665 | } | |
666 | + | ||
667 | + | ||
668 | + | ||
669 | + | @Callable(i) | |
670 | + | func tradeReward (userAddresses,rewards) = { | |
671 | + | let argsComparison = (size(userAddresses) == size(rewards)) | |
672 | + | let maxRecipients = valueOrElse(getInteger(keyMaxRecipients()), 0) | |
673 | + | let payment = i.payments[0] | |
674 | + | let paymentAssetId = payment.assetId | |
675 | + | let paymentAmount = payment.amount | |
676 | + | let checks = [if ((maxRecipients >= size(userAddresses))) | |
677 | + | then true | |
678 | + | else throwErr("Too many recipients"), if (argsComparison) | |
679 | + | then true | |
680 | + | else throwErr("Arguments size mismatch"), if ((paymentAssetId == wxAssetId)) | |
681 | + | then true | |
682 | + | else throwErr("Wrong asset payment")] | |
683 | + | if ((checks == checks)) | |
684 | + | then { | |
685 | + | let tradeRewardInternal = invoke(this, "tradeRewardInternal", [paymentAmount, userAddresses, rewards, 0], nil) | |
686 | + | if ((tradeRewardInternal == tradeRewardInternal)) | |
687 | + | then $Tuple2(nil, tradeRewardInternal) | |
688 | + | else throw("Strict value is not equal to itself.") | |
689 | + | } | |
690 | + | else throw("Strict value is not equal to itself.") | |
691 | + | } | |
692 | + | ||
693 | + | ||
694 | + | ||
695 | + | @Callable(i) | |
696 | + | func claimTradingReward () = { | |
697 | + | let userAddress = i.caller | |
698 | + | let reward = getTradingReward(toString(userAddress)) | |
699 | + | if ((reward > 0)) | |
700 | + | then $Tuple2([ScriptTransfer(userAddress, reward, wxAssetId)], reward) | |
701 | + | else throwErr("nothing to claim") | |
702 | + | } | |
703 | + | ||
704 | + | ||
705 | + | ||
706 | + | @Callable(i) | |
707 | + | func claimTradingRewardREADONLY (userAddress) = $Tuple2(nil, getTradingReward(userAddress)) | |
577 | 708 | ||
578 | 709 | ||
579 | 710 | @Verifier(tx) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | let SCALE = 1000 | |
7 | 7 | ||
8 | 8 | let MULT8 = 100000000 | |
9 | 9 | ||
10 | 10 | let zeroBigInt = toBigInt(0) | |
11 | 11 | ||
12 | 12 | let processingStageTotal = 0 | |
13 | 13 | ||
14 | 14 | let processingStageShares = 1 | |
15 | 15 | ||
16 | + | let wavesString = "WAVES" | |
17 | + | ||
16 | 18 | func getNumberByKey (key) = valueOrElse(getInteger(this, key), 0) | |
17 | 19 | ||
18 | 20 | ||
19 | 21 | func getNumberOrFail (key) = valueOrErrorMessage(getInteger(this, key), (("mandatory this." + key) + " is not defined")) | |
20 | 22 | ||
21 | 23 | ||
22 | 24 | func getStringByKey (key) = valueOrElse(getString(this, key), "") | |
23 | 25 | ||
24 | 26 | ||
25 | 27 | func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (("mandatory this." + key) + " is not defined")) | |
28 | + | ||
29 | + | ||
30 | + | func parseAssetId (input) = if ((input == wavesString)) | |
31 | + | then unit | |
32 | + | else fromBase58String(input) | |
33 | + | ||
34 | + | ||
35 | + | func wrapErr (msg) = makeString(["gwx_reward.ride:", msg], " ") | |
36 | + | ||
37 | + | ||
38 | + | func throwErr (msg) = throw(wrapErr(msg)) | |
26 | 39 | ||
27 | 40 | ||
28 | 41 | func abs (val) = if ((0 > val)) | |
29 | 42 | then -(val) | |
30 | 43 | else val | |
31 | 44 | ||
32 | 45 | ||
33 | 46 | func absBigInt (val) = if ((zeroBigInt > val)) | |
34 | 47 | then -(val) | |
35 | 48 | else val | |
36 | 49 | ||
37 | 50 | ||
38 | 51 | let keyMaxDepth = "%s__maxDepth" | |
39 | 52 | ||
40 | 53 | let maxDepthDefault = 30 | |
41 | 54 | ||
42 | 55 | let maxDepth = valueOrElse(getInteger(this, keyMaxDepth), maxDepthDefault) | |
43 | 56 | ||
44 | 57 | func keyFactoryAddress () = "%s%s__config__factoryAddress" | |
45 | 58 | ||
46 | 59 | ||
47 | 60 | let factoryAddressStr = getStringOrFail(keyFactoryAddress()) | |
48 | 61 | ||
49 | 62 | let factoryContract = addressFromStringValue(factoryAddressStr) | |
50 | 63 | ||
51 | 64 | func keyEmissionAddress () = "%s%s__config__emissionAddress" | |
52 | 65 | ||
66 | + | ||
67 | + | func keyVotingEmissionContract () = makeString(["%s", "votingEmissionContract"], SEP) | |
68 | + | ||
69 | + | ||
70 | + | let votingEmissionContract = addressFromStringValue(getStringValue(factoryContract, keyVotingEmissionContract())) | |
53 | 71 | ||
54 | 72 | func keyNumToUserMapping (num) = makeString(["%s%s%s", "mapping", "num2user", toString(num)], SEP) | |
55 | 73 | ||
56 | 74 | ||
57 | 75 | let keyReferralProgramName = makeString(["%s%s", "referral", "programName"], SEP) | |
58 | 76 | ||
59 | 77 | let referralProgramNameDefault = "wxlock" | |
60 | 78 | ||
61 | 79 | let referralProgramName = valueOrElse(getString(this, keyReferralProgramName), referralProgramNameDefault) | |
62 | 80 | ||
63 | 81 | let keyReferralMinGWxAmount = makeString(["%s%s", "referral", "minGWxAmount"], SEP) | |
64 | 82 | ||
65 | 83 | let referralMinGWxAmountDefault = (500 * MULT8) | |
66 | 84 | ||
67 | 85 | let referralMinGWxAmount = valueOrElse(getInteger(this, keyReferralMinGWxAmount), referralMinGWxAmountDefault) | |
68 | 86 | ||
69 | 87 | let keyReferrerRewardPermille = makeString(["%s%s", "referral", "referrerRewardPermille"], SEP) | |
70 | 88 | ||
71 | 89 | let referrerRewardPermilleDefault = 50 | |
72 | 90 | ||
73 | 91 | let referrerRewardPermille = valueOrElse(getInteger(this, keyReferrerRewardPermille), referrerRewardPermilleDefault) | |
74 | 92 | ||
75 | 93 | let keyReferralRewardPermille = makeString(["%s%s", "referral", "referralRewardPermille"], SEP) | |
76 | 94 | ||
77 | 95 | let referralRewardPermilleDefault = 50 | |
78 | 96 | ||
79 | 97 | let referralRewardPermille = valueOrElse(getInteger(this, keyReferralRewardPermille), referralRewardPermilleDefault) | |
80 | 98 | ||
81 | 99 | func keyReferrer (referralAddress) = makeString(["%s%s%s", "referrer", referralProgramName, referralAddress], SEP) | |
82 | 100 | ||
83 | 101 | ||
84 | 102 | func keyUnclaimedReferral (programName,claimerAddress) = makeString(["%s%s%s", "unclaimedReferral", programName, claimerAddress], SEP) | |
85 | 103 | ||
86 | 104 | ||
87 | 105 | let emissionAddressStr = getStringOrFail(keyEmissionAddress()) | |
88 | 106 | ||
89 | 107 | let emissionContract = addressFromStringValue(emissionAddressStr) | |
90 | 108 | ||
91 | 109 | let IdxCfgAssetId = 1 | |
92 | 110 | ||
93 | 111 | let IdxCfgPacemakerAddress = 2 | |
94 | 112 | ||
95 | 113 | let IdxCfgBoostingContract = 3 | |
96 | 114 | ||
97 | 115 | let IdxCfgMaxDepth = 4 | |
98 | 116 | ||
99 | 117 | func keyConfig () = "%s__config" | |
100 | 118 | ||
101 | 119 | ||
120 | + | func getEmissionAddress () = addressFromStringValue(valueOrErrorMessage(getString(this, keyEmissionAddress()), (("mandatory this." + keyEmissionAddress()) + " is not defined"))) | |
121 | + | ||
122 | + | ||
123 | + | let emissionAddress = getEmissionAddress() | |
124 | + | ||
125 | + | let wxAssetIdStr = split(value(getString(emissionAddress, keyConfig())), SEP)[1] | |
126 | + | ||
127 | + | let wxAssetId = fromBase58String(wxAssetIdStr) | |
128 | + | ||
102 | 129 | func readConfigArrayOrFail () = split(getStringOrFail(keyConfig()), SEP) | |
103 | 130 | ||
104 | 131 | ||
105 | 132 | func formatConfig (wxAssetIdStr,matcherPacemakerAddressStr,boostingContractAddressStr,maxDepth) = makeString(["%s%s%s%d", wxAssetIdStr, matcherPacemakerAddressStr, boostingContractAddressStr, toString(maxDepth)], SEP) | |
106 | 133 | ||
107 | 134 | ||
108 | 135 | func boostingContractOrFail () = { | |
109 | 136 | let cfgArray = readConfigArrayOrFail() | |
110 | 137 | valueOrErrorMessage(addressFromString(cfgArray[IdxCfgBoostingContract]), "boosting contract address is not defined") | |
111 | 138 | } | |
112 | 139 | ||
113 | 140 | ||
114 | 141 | func keyGwxRewardEmissionStartHeight () = "%s%s__gwxRewardEmissionPart__startHeight" | |
115 | 142 | ||
116 | 143 | ||
117 | 144 | func keyUsersCount () = "%s__nextUserNum" | |
118 | 145 | ||
119 | 146 | ||
120 | 147 | func keyRatePerBlockCurrent () = "%s%s__ratePerBlock__current" | |
148 | + | ||
149 | + | ||
150 | + | func keyGwxHoldersRewardCurrent () = "%s%s__gwxHoldersReward__current" | |
151 | + | ||
152 | + | ||
153 | + | func keyGwxHoldersRewardNext () = "%s%s__gwxHoldersReward__next" | |
121 | 154 | ||
122 | 155 | ||
123 | 156 | func keyPoolWeightVirtual () = "%s%s__poolWeight__GWXvirtualPOOL" | |
124 | 157 | ||
125 | 158 | ||
126 | 159 | func keyNextProcessedUser () = "%s__nextProcessedUser" | |
127 | 160 | ||
128 | 161 | ||
129 | 162 | func keyLatestPeriod () = "%s__latestPeriod" | |
130 | 163 | ||
131 | 164 | ||
132 | 165 | func keyNextPeriod () = "%s__nextPeriod" | |
133 | 166 | ||
134 | 167 | ||
135 | 168 | func keyProcessingStage () = "%s__processingStage" | |
136 | 169 | ||
137 | 170 | ||
138 | 171 | func keyNextProcessedPeriod () = "%s__nextProcessedPeriod" | |
139 | 172 | ||
140 | 173 | ||
141 | 174 | func keyUserUnclaimed (userIndex) = makeString(["%s%d", "userUnclaimed", toString(userIndex)], SEP) | |
142 | 175 | ||
143 | 176 | ||
144 | 177 | func keyNextUnlaimedPeriodOfUser (userIndex) = makeString(["%s%d__nextClaimedPeriod", toString(userIndex)], SEP) | |
145 | 178 | ||
146 | 179 | ||
147 | 180 | func keyLastProcessedPeriodOfUser (userIndex) = makeString(["%s%d__lastProcessedPeriod", toString(userIndex)], SEP) | |
148 | 181 | ||
149 | 182 | ||
150 | 183 | func keyHeightForPeriod (period) = makeString(["%s%d__startHeightForPeriod", toString(period)], SEP) | |
151 | 184 | ||
152 | 185 | ||
153 | 186 | func keyAuxEmissionRewardForPeriod (period) = makeString(["%s%d__auxEmissionReward", toString(period)], SEP) | |
154 | 187 | ||
155 | 188 | ||
156 | 189 | func keyTotalAmountForPeriod (period) = makeString(["%s%d__totalAmountForPeriod", toString(period)], SEP) | |
157 | 190 | ||
158 | 191 | ||
159 | 192 | func keyLastPayoutInfo () = "%s__lastPayoutInfo" | |
160 | 193 | ||
161 | 194 | ||
162 | 195 | func PeriodPayoutInfo (period,matcherReward,emissionReward) = makeString(["%d%d%d", toString(period), toString(matcherReward), toString(emissionReward)], SEP) | |
163 | 196 | ||
164 | 197 | ||
165 | 198 | func keyPayoutHistoryInfo (period) = makeString(["%s%s%d__payouts__history", toString(period)], SEP) | |
166 | 199 | ||
167 | 200 | ||
168 | 201 | func keyTotalWeightForPeriod (period) = makeString(["%s%d__totalWeightForPeriod", toString(period)], SEP) | |
169 | 202 | ||
170 | 203 | ||
171 | 204 | func keyUserKValueForPeriod (period,userIndex) = makeString(["%s%d%s%d__paramByPeriod", toString(userIndex), "k", toString(period)], SEP) | |
172 | 205 | ||
173 | 206 | ||
174 | 207 | func keyUserBValueForPeriod (period,userIndex) = makeString(["%s%d%s%d__paramByPeriod", toString(userIndex), "b", toString(period)], SEP) | |
175 | 208 | ||
176 | 209 | ||
177 | 210 | func keyUserWeightForPeriod (period,userIndex) = makeString(["%s%d%s%d__paramByPeriod", toString(userIndex), "weight", toString(period)], SEP) | |
178 | 211 | ||
179 | 212 | ||
180 | 213 | func keyReferralsContractAddress () = makeString(["%s%s", "config", "referralsContractAddress"], SEP) | |
181 | 214 | ||
182 | 215 | ||
183 | 216 | let referralsContractAddressOrFail = addressFromStringValue(getStringOrFail(keyReferralsContractAddress())) | |
217 | + | ||
218 | + | func keyTradingRewardHistory (user,i) = makeString(["%s%s%s%s", "tradingReward", "history", user, toBase58String(i.transactionId)], SEP) | |
219 | + | ||
220 | + | ||
221 | + | func keyTradingReward (userAddress) = makeString(["%s%s", "tradingReward", userAddress], SEP) | |
222 | + | ||
223 | + | ||
224 | + | func keyMaxRecipients () = makeString(["%s", "maxRecipients"], SEP) | |
225 | + | ||
184 | 226 | ||
185 | 227 | func HistoryEntry (type,user,amount,i) = { | |
186 | 228 | let historyKEY = makeString(["%s%s%s%s__history", type, user, toBase58String(i.transactionId)], SEP) | |
187 | 229 | let historyDATA = makeString(["%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(amount)], SEP) | |
188 | 230 | StringEntry(historyKEY, historyDATA) | |
189 | 231 | } | |
190 | 232 | ||
191 | 233 | ||
192 | 234 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
193 | 235 | ||
194 | 236 | ||
195 | 237 | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
196 | 238 | ||
197 | 239 | ||
198 | 240 | func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) { | |
199 | 241 | case s: String => | |
200 | 242 | addressFromStringValue(s) | |
201 | 243 | case _ => | |
202 | 244 | this | |
203 | 245 | } | |
204 | 246 | ||
205 | 247 | ||
206 | 248 | func managerPublicKeyOrUnit () = { | |
207 | 249 | let managerVaultAddress = getManagerVaultAddressOrThis() | |
208 | 250 | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
209 | 251 | case s: String => | |
210 | 252 | fromBase58String(s) | |
211 | 253 | case _: Unit => | |
212 | 254 | unit | |
213 | 255 | case _ => | |
214 | 256 | throw("Match error") | |
215 | 257 | } | |
216 | 258 | } | |
217 | 259 | ||
218 | 260 | ||
219 | 261 | func mustManager (i) = { | |
220 | 262 | let pd = throw("Permission denied") | |
221 | 263 | match managerPublicKeyOrUnit() { | |
222 | 264 | case pk: ByteVector => | |
223 | 265 | if ((i.callerPublicKey == pk)) | |
224 | 266 | then true | |
225 | 267 | else pd | |
226 | 268 | case _: Unit => | |
227 | 269 | if ((i.caller == this)) | |
228 | 270 | then true | |
229 | 271 | else pd | |
230 | 272 | case _ => | |
231 | 273 | throw("Match error") | |
232 | 274 | } | |
233 | 275 | } | |
234 | 276 | ||
235 | 277 | ||
236 | 278 | func calcUserWeight (boostingContractAddress,heightForPeriod,period,userIndex) = { | |
237 | 279 | let kLast = keyLastProcessedPeriodOfUser(userIndex) | |
238 | 280 | let kKey = keyUserKValueForPeriod(period, userIndex) | |
239 | 281 | let kRaw = getInteger(boostingContractAddress, kKey) | |
240 | 282 | let kUserWeight = keyUserWeightForPeriod(period, userIndex) | |
241 | 283 | if (isDefined(kRaw)) | |
242 | 284 | then { | |
243 | 285 | let k = value(kRaw) | |
244 | 286 | let b = value(getInteger(boostingContractAddress, keyUserBValueForPeriod(period, userIndex))) | |
245 | 287 | let w = ((k * heightForPeriod) + b) | |
246 | 288 | if ((w > 0)) | |
247 | 289 | then $Tuple2((w / SCALE), [IntegerEntry(kLast, period), IntegerEntry(kUserWeight, w)]) | |
248 | 290 | else $Tuple2(0, nil) | |
249 | 291 | } | |
250 | 292 | else { | |
251 | 293 | let p = getInteger(this, kLast) | |
252 | 294 | if (if (isDefined(p)) | |
253 | 295 | then (period >= value(p)) | |
254 | 296 | else false) | |
255 | 297 | then { | |
256 | 298 | let pv = value(p) | |
257 | 299 | let k = value(getInteger(boostingContractAddress, keyUserKValueForPeriod(pv, userIndex))) | |
258 | 300 | let b = value(getInteger(boostingContractAddress, keyUserBValueForPeriod(pv, userIndex))) | |
259 | 301 | let w = ((k * heightForPeriod) + b) | |
260 | 302 | if ((w > 0)) | |
261 | 303 | then $Tuple2((w / SCALE), [IntegerEntry(kUserWeight, w)]) | |
262 | 304 | else $Tuple2(0, nil) | |
263 | 305 | } | |
264 | 306 | else $Tuple2(0, nil) | |
265 | 307 | } | |
266 | 308 | } | |
267 | 309 | ||
268 | 310 | ||
269 | 311 | func calcUserWeightForClaim (boostingContractAddress,heightForPeriod,period,userIndex) = { | |
270 | 312 | let kUserWeight = keyUserWeightForPeriod(period, userIndex) | |
271 | 313 | let userWeightOrUnit = getInteger(kUserWeight) | |
272 | 314 | match userWeightOrUnit { | |
273 | 315 | case _: Unit => | |
274 | 316 | 0 | |
275 | 317 | case w: Int => | |
276 | 318 | (w / SCALE) | |
277 | 319 | case _ => | |
278 | 320 | throw("Match error") | |
279 | 321 | } | |
280 | 322 | } | |
281 | 323 | ||
282 | 324 | ||
283 | 325 | func getUserIndexByAddress (boostingContractAddressStr,userAddress) = { | |
284 | 326 | let key = makeString(["%s%s%s", "mapping", "user2num", userAddress], SEP) | |
285 | 327 | parseIntValue(valueOrErrorMessage(getString(Address(fromBase58String(boostingContractAddressStr)), key), ((("User address " + userAddress) + " is not found in boosting contract data, key=") + key))) | |
286 | 328 | } | |
287 | 329 | ||
288 | 330 | ||
289 | 331 | func nextPeriod () = getNumberByKey(keyNextPeriod()) | |
290 | 332 | ||
291 | 333 | ||
292 | 334 | func commonClaimReward (userAddress) = { | |
293 | 335 | let cfgArray = readConfigArrayOrFail() | |
294 | 336 | let userIdx = getUserIndexByAddress(cfgArray[IdxCfgBoostingContract], userAddress) | |
295 | 337 | let userUnclaimedOption = getInteger(keyUserUnclaimed(userIdx)) | |
296 | 338 | match userUnclaimedOption { | |
297 | 339 | case _: Unit => | |
298 | 340 | $Tuple2(0, nil) | |
299 | 341 | case u: Int => | |
300 | 342 | $Tuple2(u, [IntegerEntry(keyUserUnclaimed(userIdx), 0)]) | |
301 | 343 | case _ => | |
302 | 344 | throw("Match error") | |
303 | 345 | } | |
304 | 346 | } | |
305 | 347 | ||
306 | 348 | ||
349 | + | func getTradingReward (userAddress) = valueOrElse(getInteger(this, keyTradingReward(userAddress)), 0) | |
350 | + | ||
351 | + | ||
352 | + | @Callable(i) | |
353 | + | func tradeRewardInternal (paymentAmountLeftOver,userAddresses,rewards,currentIter) = if ((currentIter == size(userAddresses))) | |
354 | + | then nil | |
355 | + | else { | |
356 | + | let checks = [if ((i.caller == this)) | |
357 | + | then true | |
358 | + | else throwErr("Permission denied"), if ((paymentAmountLeftOver >= rewards[currentIter])) | |
359 | + | then true | |
360 | + | else throwErr("insufficient payment assetId")] | |
361 | + | if ((checks == checks)) | |
362 | + | then { | |
363 | + | let tradeRewardInternal = invoke(this, "tradeRewardInternal", [(paymentAmountLeftOver - rewards[currentIter]), userAddresses, rewards, (currentIter + 1)], nil) | |
364 | + | if ((tradeRewardInternal == tradeRewardInternal)) | |
365 | + | then { | |
366 | + | let tradingRewardHistoryKey = keyTradingRewardHistory(userAddresses[currentIter], i) | |
367 | + | let userAddress = addressFromStringValue(userAddresses[currentIter]) | |
368 | + | $Tuple2([IntegerEntry(tradingRewardHistoryKey, rewards[currentIter]), IntegerEntry(keyTradingReward(userAddresses[currentIter]), rewards[currentIter])], tradeRewardInternal) | |
369 | + | } | |
370 | + | else throw("Strict value is not equal to itself.") | |
371 | + | } | |
372 | + | else throw("Strict value is not equal to itself.") | |
373 | + | } | |
374 | + | ||
375 | + | ||
376 | + | ||
307 | 377 | @Callable(i) | |
308 | 378 | func updateReferralActivity (userAddress,gWxAmountStart) = { | |
309 | 379 | let referrer = getString(referralsContractAddressOrFail, keyReferrer(userAddress)) | |
310 | 380 | let activeReferralInv = if ((referrer == unit)) | |
311 | 381 | then unit | |
312 | 382 | else invoke(referralsContractAddressOrFail, "updateReferralActivity", [referralProgramName, userAddress, (gWxAmountStart >= referralMinGWxAmount)], nil) | |
313 | 383 | if ((activeReferralInv == activeReferralInv)) | |
314 | 384 | then $Tuple2(nil, unit) | |
315 | 385 | else throw("Strict value is not equal to itself.") | |
316 | 386 | } | |
317 | 387 | ||
318 | 388 | ||
319 | 389 | ||
320 | 390 | @Callable(i) | |
321 | 391 | func finalizeHelper () = { | |
322 | 392 | let processingStage = valueOrElse(getInteger(keyProcessingStage()), processingStageTotal) | |
323 | 393 | let currentPeriod = getNumberByKey(keyNextProcessedPeriod()) | |
324 | 394 | let currentUser = getNumberByKey(keyNextProcessedUser()) | |
325 | 395 | let latestPeriod = getNumberByKey(keyLatestPeriod()) | |
326 | 396 | let usersCount = valueOrElse(getInteger(boostingContractOrFail(), keyUsersCount()), 0) | |
327 | 397 | let totalWeightKey = keyTotalWeightForPeriod(currentPeriod) | |
328 | 398 | let totalWeight = getNumberByKey(keyTotalWeightForPeriod(currentPeriod)) | |
329 | 399 | let heightForPeriod = getNumberByKey(keyHeightForPeriod(currentPeriod)) | |
330 | 400 | if ((currentPeriod > latestPeriod)) | |
331 | 401 | then $Tuple2(nil, false) | |
332 | 402 | else if ((processingStage == processingStageTotal)) | |
333 | 403 | then { | |
334 | - | let $ | |
335 | - | let userWeight = $ | |
336 | - | let userActions = $ | |
404 | + | let $t01451014626 = calcUserWeight(boostingContractOrFail(), heightForPeriod, currentPeriod, currentUser) | |
405 | + | let userWeight = $t01451014626._1 | |
406 | + | let userActions = $t01451014626._2 | |
337 | 407 | let totalWeightNew = (totalWeight + userWeight) | |
338 | 408 | let processingActions = if (((usersCount - 1) > currentUser)) | |
339 | 409 | then [IntegerEntry(keyNextProcessedUser(), (currentUser + 1))] | |
340 | 410 | else [IntegerEntry(keyProcessingStage(), processingStageShares), IntegerEntry(keyNextProcessedUser(), 0)] | |
341 | 411 | $Tuple2((([IntegerEntry(totalWeightKey, totalWeightNew)] ++ processingActions) ++ userActions), true) | |
342 | 412 | } | |
343 | 413 | else if ((processingStage == processingStageShares)) | |
344 | 414 | then { | |
345 | 415 | let userWeight = calcUserWeightForClaim(boostingContractOrFail(), heightForPeriod, currentPeriod, currentUser) | |
346 | 416 | let userAmountMatcherForPeriod = fraction(getNumberByKey(keyTotalAmountForPeriod(currentPeriod)), userWeight, totalWeight) | |
347 | 417 | let userAmountEmissionForPeriod = fraction(getNumberByKey(keyAuxEmissionRewardForPeriod(currentPeriod)), userWeight, totalWeight) | |
348 | 418 | let userTotalAmount = (userAmountEmissionForPeriod + userAmountMatcherForPeriod) | |
349 | 419 | let userUnclaimedOption = getInteger(keyUserUnclaimed(currentUser)) | |
350 | 420 | let userAddress = getStringValue(boostingContractOrFail(), keyNumToUserMapping(currentUser)) | |
351 | 421 | let referrer = getString(referralsContractAddressOrFail, keyReferrer(userAddress)) | |
352 | 422 | let activeReferralInv = if ((referrer == unit)) | |
353 | 423 | then unit | |
354 | 424 | else invoke(referralsContractAddressOrFail, "updateReferralActivity", [referralProgramName, userAddress, (userWeight >= referralMinGWxAmount)], nil) | |
355 | 425 | if ((activeReferralInv == activeReferralInv)) | |
356 | 426 | then { | |
357 | 427 | let referralInv = if (if ((referrer == unit)) | |
358 | 428 | then true | |
359 | 429 | else (referralMinGWxAmount > userWeight)) | |
360 | 430 | then unit | |
361 | 431 | else { | |
362 | 432 | let referrerReward = fraction(userTotalAmount, referrerRewardPermille, SCALE) | |
363 | 433 | let referralReward = fraction(userTotalAmount, referralRewardPermille, SCALE) | |
364 | 434 | invoke(referralsContractAddressOrFail, "incUnclaimed", [referralProgramName, userAddress, referrerReward, referralReward], nil) | |
365 | 435 | } | |
366 | 436 | if ((referralInv == referralInv)) | |
367 | 437 | then { | |
368 | 438 | let unclaimedActions = [IntegerEntry(keyUserUnclaimed(currentUser), (valueOrElse(userUnclaimedOption, 0) + userTotalAmount))] | |
369 | 439 | let processingActions = if (((usersCount - 1) > currentUser)) | |
370 | 440 | then [IntegerEntry(keyNextProcessedUser(), (currentUser + 1))] | |
371 | 441 | else [IntegerEntry(keyNextProcessedPeriod(), (currentPeriod + 1)), IntegerEntry(keyNextProcessedUser(), 0), DeleteEntry(keyProcessingStage())] | |
372 | 442 | $Tuple2((unclaimedActions ++ processingActions), true) | |
373 | 443 | } | |
374 | 444 | else throw("Strict value is not equal to itself.") | |
375 | 445 | } | |
376 | 446 | else throw("Strict value is not equal to itself.") | |
377 | 447 | } | |
378 | 448 | else throw("invalid processing stage") | |
379 | 449 | } | |
380 | 450 | ||
381 | 451 | ||
382 | 452 | ||
383 | 453 | @Callable(i) | |
384 | 454 | func finalizeWrapper (counter) = { | |
385 | 455 | let result = { | |
386 | 456 | let @ = invoke(this, "finalizeHelper", nil, nil) | |
387 | 457 | if ($isInstanceOf(@, "Boolean")) | |
388 | 458 | then @ | |
389 | 459 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
390 | 460 | } | |
391 | 461 | if ((result == result)) | |
392 | 462 | then if (!(result)) | |
393 | 463 | then if ((counter == maxDepth)) | |
394 | 464 | then throw("Nothing to process") | |
395 | 465 | else $Tuple2(nil, unit) | |
396 | 466 | else if ((counter > 0)) | |
397 | 467 | then $Tuple2(nil, invoke(this, "finalizeWrapper", [(counter - 1)], nil)) | |
398 | 468 | else $Tuple2(nil, unit) | |
399 | 469 | else throw("Strict value is not equal to itself.") | |
400 | 470 | } | |
401 | 471 | ||
402 | 472 | ||
403 | 473 | ||
404 | 474 | @Callable(i) | |
405 | 475 | func processPendingPeriodsAndUsers () = $Tuple2(nil, invoke(this, "finalizeWrapper", [maxDepth], nil)) | |
406 | 476 | ||
407 | 477 | ||
408 | 478 | ||
409 | 479 | @Callable(i) | |
410 | 480 | func deposit () = { | |
411 | - | let cfgArray = readConfigArrayOrFail() | |
412 | - | if ((i.caller != Address(fromBase58String(cfgArray[IdxCfgPacemakerAddress])))) | |
413 | - | then throw("Wrong caller address") | |
414 | - | else { | |
415 | - | let assetId = value(value(i.payments[0]).assetId) | |
416 | - | if ((assetId != fromBase58String(cfgArray[IdxCfgAssetId]))) | |
417 | - | then throw("Wrong payment asset") | |
418 | - | else { | |
419 | - | let period = nextPeriod() | |
420 | - | let deltaH = (height - getNumberOrFail(keyGwxRewardEmissionStartHeight())) | |
421 | - | let emissionRate = valueOrErrorMessage(getInteger(emissionContract, keyRatePerBlockCurrent()), (("mandatory emission_contract." + keyRatePerBlockCurrent()) + " is not defined")) | |
422 | - | let weight = valueOrErrorMessage(getInteger(factoryContract, keyPoolWeightVirtual()), (("mandatory factory_contract." + keyPoolWeightVirtual()) + " is not defined")) | |
423 | - | let auxAmount = fraction((deltaH * weight), emissionRate, MULT8) | |
424 | - | let em = invoke(emissionContract, "emit", [auxAmount], nil) | |
481 | + | let checkCaller = if ((i.caller == votingEmissionContract)) | |
482 | + | then true | |
483 | + | else mustManager(i) | |
484 | + | if ((checkCaller == checkCaller)) | |
485 | + | then { | |
486 | + | let period = nextPeriod() | |
487 | + | let deltaH = (height - getNumberOrFail(keyGwxRewardEmissionStartHeight())) | |
488 | + | let emissionRate = valueOrErrorMessage(getInteger(emissionContract, keyRatePerBlockCurrent()), (("mandatory emission_contract." + keyRatePerBlockCurrent()) + " is not defined")) | |
489 | + | let gwxHoldersRewardCurrent = valueOrElse(getInteger(emissionContract, keyGwxHoldersRewardCurrent()), 0) | |
490 | + | if ((gwxHoldersRewardCurrent == gwxHoldersRewardCurrent)) | |
491 | + | then { | |
492 | + | let auxAmount = fraction((deltaH * gwxHoldersRewardCurrent), emissionRate, MULT8) | |
493 | + | let em = if ((auxAmount > 0)) | |
494 | + | then invoke(emissionContract, "emit", [auxAmount], nil) | |
495 | + | else unit | |
425 | 496 | if ((em == em)) | |
426 | 497 | then { | |
427 | - | let matcherPart = | |
498 | + | let matcherPart = 0 | |
428 | 499 | let payoutInfo = PeriodPayoutInfo(period, matcherPart, auxAmount) | |
429 | - | [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)] | |
500 | + | let gwxHoldersRewardUpdated = { | |
501 | + | let @ = invoke(emissionContract, "gwxHoldersRewardUpdate", nil, nil) | |
502 | + | if ($isInstanceOf(@, "Boolean")) | |
503 | + | then @ | |
504 | + | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
505 | + | } | |
506 | + | if ((gwxHoldersRewardUpdated == gwxHoldersRewardUpdated)) | |
507 | + | then { | |
508 | + | let totalReward = (matcherPart + auxAmount) | |
509 | + | let actions = if (if ((totalReward == 0)) | |
510 | + | then !(gwxHoldersRewardUpdated) | |
511 | + | else false) | |
512 | + | then nil | |
513 | + | else [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)] | |
514 | + | $Tuple2(actions, unit) | |
515 | + | } | |
516 | + | else throw("Strict value is not equal to itself.") | |
430 | 517 | } | |
431 | 518 | else throw("Strict value is not equal to itself.") | |
432 | 519 | } | |
520 | + | else throw("Strict value is not equal to itself.") | |
433 | 521 | } | |
522 | + | else throw("Strict value is not equal to itself.") | |
434 | 523 | } | |
435 | 524 | ||
436 | 525 | ||
437 | 526 | ||
438 | 527 | @Callable(i) | |
439 | 528 | func claimReward () = { | |
440 | 529 | let cfgArray = readConfigArrayOrFail() | |
441 | 530 | let address = toString(i.caller) | |
442 | - | let $ | |
443 | - | let amount = $ | |
444 | - | let actions = $ | |
531 | + | let $t01981519865 = commonClaimReward(address) | |
532 | + | let amount = $t01981519865._1 | |
533 | + | let actions = $t01981519865._2 | |
445 | 534 | let checkAmount = if ((amount > 0)) | |
446 | 535 | then true | |
447 | 536 | else throw("Nothing to claim") | |
448 | 537 | if ((checkAmount == checkAmount)) | |
449 | 538 | then { | |
450 | 539 | let amountFromEmission = 0 | |
451 | 540 | let claimedReferral = { | |
452 | 541 | let @ = invoke(referralsContractAddressOrFail, "claim", [referralProgramName], nil) | |
453 | 542 | if ($isInstanceOf(@, "Int")) | |
454 | 543 | then @ | |
455 | 544 | else throw(($getType(@) + " couldn't be cast to Int")) | |
456 | 545 | } | |
457 | 546 | let totalAmount = (amount + claimedReferral) | |
458 | 547 | $Tuple2(([ScriptTransfer(i.caller, totalAmount, fromBase58String(cfgArray[IdxCfgAssetId])), HistoryEntry("claim", address, amount, i)] ++ actions), [totalAmount, amountFromEmission]) | |
459 | 548 | } | |
460 | 549 | else throw("Strict value is not equal to itself.") | |
461 | 550 | } | |
462 | 551 | ||
463 | 552 | ||
464 | 553 | ||
465 | 554 | @Callable(i) | |
466 | 555 | func claimRewardREADONLY (address) = { | |
467 | - | let $ | |
468 | - | let amount = $ | |
469 | - | let actions = $ | |
556 | + | let $t02043820488 = commonClaimReward(address) | |
557 | + | let amount = $t02043820488._1 | |
558 | + | let actions = $t02043820488._2 | |
470 | 559 | let referralUnclaimed = valueOrElse(getInteger(referralsContractAddressOrFail, keyUnclaimedReferral(referralProgramName, address)), 0) | |
471 | 560 | let totalAmount = (amount + referralUnclaimed) | |
472 | 561 | $Tuple2(nil, totalAmount) | |
473 | 562 | } | |
474 | 563 | ||
475 | 564 | ||
476 | 565 | ||
477 | 566 | @Callable(i) | |
478 | 567 | func latestFinalizedPeriodREADONLY (address) = $Tuple2(nil, valueOrElse(getInteger(this, keyLatestPeriod()), -1)) | |
479 | 568 | ||
480 | 569 | ||
481 | 570 | ||
482 | 571 | @Callable(i) | |
483 | 572 | func latestFinalizedPeriodInfoREADONLY (address) = $Tuple2(nil, getStringByKey(keyLastPayoutInfo())) | |
484 | 573 | ||
485 | 574 | ||
486 | 575 | ||
487 | 576 | @Callable(i) | |
488 | 577 | func calcGwxParamsREADONLY (gwxAmountStart,lockStartHeight,lockDurationBlocks) = { | |
489 | 578 | let lockEndHeight = (lockStartHeight + lockDurationBlocks) | |
490 | 579 | let scale8ParamK = -(fraction(gwxAmountStart, SCALE, lockDurationBlocks)) | |
491 | 580 | let scale8ParamB = (fraction(gwxAmountStart, SCALE, lockDurationBlocks) * lockEndHeight) | |
492 | 581 | $Tuple2(nil, [scale8ParamK, scale8ParamB, nextPeriod()]) | |
493 | 582 | } | |
494 | 583 | ||
495 | 584 | ||
496 | 585 | ||
497 | 586 | @Callable(i) | |
498 | 587 | func calcGwxAmountStartREADONLY (wxLockAmount,lockDuration,maxLockDuration) = { | |
499 | 588 | let coeffX8 = fraction(lockDuration, MULT8, maxLockDuration) | |
500 | 589 | let gWxAmountStart = fraction(wxLockAmount, coeffX8, MULT8) | |
501 | 590 | $Tuple2(nil, [gWxAmountStart]) | |
502 | 591 | } | |
503 | 592 | ||
504 | 593 | ||
505 | 594 | ||
506 | 595 | @Callable(i) | |
507 | 596 | func onEmissionForGwxStart () = if ((i.caller != factoryContract)) | |
508 | 597 | then throw("permissions denied") | |
509 | 598 | else [IntegerEntry(keyGwxRewardEmissionStartHeight(), height)] | |
510 | 599 | ||
511 | 600 | ||
512 | 601 | ||
513 | 602 | @Callable(i) | |
514 | 603 | func latestPeriodEmissionRewardsREADONLY (address) = { | |
515 | 604 | let period = nextPeriod() | |
516 | 605 | $Tuple2(nil, [getNumberByKey(keyAuxEmissionRewardForPeriod(period))]) | |
517 | 606 | } | |
518 | 607 | ||
519 | 608 | ||
520 | 609 | ||
521 | 610 | @Callable(i) | |
522 | 611 | func calcD (x1BigIntStr,x2BigIntStr,ampBigIntStr,aPrecisionBigIntStr,targetPrecisionBigIntStr) = { | |
523 | 612 | let nCoins = toBigInt(2) | |
524 | 613 | let aPrecision = parseBigIntValue(aPrecisionBigIntStr) | |
525 | 614 | let targetPrecision = parseBigIntValue(targetPrecisionBigIntStr) | |
526 | 615 | let x1 = parseBigIntValue(x1BigIntStr) | |
527 | 616 | let x2 = parseBigIntValue(x2BigIntStr) | |
528 | 617 | let amp = (parseBigIntValue(ampBigIntStr) * aPrecision) | |
529 | 618 | let s = (x1 + x2) | |
530 | 619 | if ((s == zeroBigInt)) | |
531 | 620 | then $Tuple2(nil, toString(zeroBigInt)) | |
532 | 621 | else { | |
533 | 622 | let ann = (amp * nCoins) | |
534 | 623 | let arr = [0, 1, 2, 3, 4, 5, 6] | |
535 | 624 | func calc (acc,cur) = { | |
536 | - | let $ | |
537 | - | let d = $ | |
538 | - | let dPrev = $ | |
539 | - | let found = $ | |
625 | + | let $t02312123148 = acc | |
626 | + | let d = $t02312123148._1 | |
627 | + | let dPrev = $t02312123148._2 | |
628 | + | let found = $t02312123148._3 | |
540 | 629 | if ((found != unit)) | |
541 | 630 | then acc | |
542 | 631 | else { | |
543 | 632 | let dp = (((d * d) * d) / (((x1 * x2) * nCoins) * nCoins)) | |
544 | 633 | let dNext = (((((ann * s) / aPrecision) + (dp * nCoins)) * d) / ((((ann - aPrecision) * d) / aPrecision) + ((nCoins + toBigInt(1)) * dp))) | |
545 | 634 | let dDiff = absBigInt((dNext - value(d))) | |
546 | 635 | if ((targetPrecision >= dDiff)) | |
547 | 636 | then $Tuple3(dNext, d, cur) | |
548 | 637 | else $Tuple3(dNext, d, unit) | |
549 | 638 | } | |
550 | 639 | } | |
551 | 640 | ||
552 | - | let $ | |
641 | + | let $t02374623809 = { | |
553 | 642 | let $l = arr | |
554 | 643 | let $s = size($l) | |
555 | 644 | let $acc0 = $Tuple3(s, unit, unit) | |
556 | 645 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
557 | 646 | then $a | |
558 | 647 | else calc($a, $l[$i]) | |
559 | 648 | ||
560 | 649 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
561 | 650 | then $a | |
562 | 651 | else throw("List size exceeds 7") | |
563 | 652 | ||
564 | 653 | $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) | |
565 | 654 | } | |
566 | - | let dNext = $ | |
567 | - | let dPrev = $ | |
568 | - | let found = $ | |
655 | + | let dNext = $t02374623809._1 | |
656 | + | let dPrev = $t02374623809._2 | |
657 | + | let found = $t02374623809._3 | |
569 | 658 | if ((found != unit)) | |
570 | 659 | then $Tuple2(nil, toString(dNext)) | |
571 | 660 | else { | |
572 | 661 | let dDiff = absBigInt((dNext - value(dPrev))) | |
573 | 662 | throw(("D calculation error, dDiff = " + toString(dDiff))) | |
574 | 663 | } | |
575 | 664 | } | |
576 | 665 | } | |
666 | + | ||
667 | + | ||
668 | + | ||
669 | + | @Callable(i) | |
670 | + | func tradeReward (userAddresses,rewards) = { | |
671 | + | let argsComparison = (size(userAddresses) == size(rewards)) | |
672 | + | let maxRecipients = valueOrElse(getInteger(keyMaxRecipients()), 0) | |
673 | + | let payment = i.payments[0] | |
674 | + | let paymentAssetId = payment.assetId | |
675 | + | let paymentAmount = payment.amount | |
676 | + | let checks = [if ((maxRecipients >= size(userAddresses))) | |
677 | + | then true | |
678 | + | else throwErr("Too many recipients"), if (argsComparison) | |
679 | + | then true | |
680 | + | else throwErr("Arguments size mismatch"), if ((paymentAssetId == wxAssetId)) | |
681 | + | then true | |
682 | + | else throwErr("Wrong asset payment")] | |
683 | + | if ((checks == checks)) | |
684 | + | then { | |
685 | + | let tradeRewardInternal = invoke(this, "tradeRewardInternal", [paymentAmount, userAddresses, rewards, 0], nil) | |
686 | + | if ((tradeRewardInternal == tradeRewardInternal)) | |
687 | + | then $Tuple2(nil, tradeRewardInternal) | |
688 | + | else throw("Strict value is not equal to itself.") | |
689 | + | } | |
690 | + | else throw("Strict value is not equal to itself.") | |
691 | + | } | |
692 | + | ||
693 | + | ||
694 | + | ||
695 | + | @Callable(i) | |
696 | + | func claimTradingReward () = { | |
697 | + | let userAddress = i.caller | |
698 | + | let reward = getTradingReward(toString(userAddress)) | |
699 | + | if ((reward > 0)) | |
700 | + | then $Tuple2([ScriptTransfer(userAddress, reward, wxAssetId)], reward) | |
701 | + | else throwErr("nothing to claim") | |
702 | + | } | |
703 | + | ||
704 | + | ||
705 | + | ||
706 | + | @Callable(i) | |
707 | + | func claimTradingRewardREADONLY (userAddress) = $Tuple2(nil, getTradingReward(userAddress)) | |
577 | 708 | ||
578 | 709 | ||
579 | 710 | @Verifier(tx) | |
580 | 711 | func verify () = { | |
581 | 712 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
582 | 713 | case pk: ByteVector => | |
583 | 714 | pk | |
584 | 715 | case _: Unit => | |
585 | 716 | tx.senderPublicKey | |
586 | 717 | case _ => | |
587 | 718 | throw("Match error") | |
588 | 719 | } | |
589 | 720 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
590 | 721 | } | |
591 | 722 |
github/deemru/w8io/169f3d6 100.50 ms ◑