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