tx · GKDAgiqcoXDDhesSaVU28Xn1gsSCgpMhmRopUXVJQSzU 3N4QFkEYPsR9D54c1pHRQzqRARjubXcbGuA: -0.02500000 Waves 2023.07.06 11:04 [2653785] smart account 3N4QFkEYPsR9D54c1pHRQzqRARjubXcbGuA > SELF 0.00000000 Waves
{ "type": 13, "id": "GKDAgiqcoXDDhesSaVU28Xn1gsSCgpMhmRopUXVJQSzU", "fee": 2500000, "feeAssetId": null, "timestamp": 1688630696235, "version": 1, "sender": "3N4QFkEYPsR9D54c1pHRQzqRARjubXcbGuA", "senderPublicKey": "8nr9XxGKmrRg6E6Zss6YPynBYEFbCf39Z2D9WvVuUgzY", "proofs": [ "2e4mr7RfLMs8LnnQiRpoC4cQntmZ2hkEXY63xY3c3wGSK6qSb2xhuErBRZwkXqN1Hk6XxzrEdEFCWerWZRPunFmC" ], "script": "base64:BwIqCAISAwoBAhIGCgQCAQEBEgMKAQISAwoBAhIECgICAhIECgICAhIDCgECKwADU0VQAgJfXwANQ09OVFJBQ1RfTkFNRQIPY2FsY3VsYXRvci5yaWRlAAZTQ0FMRTgAgMLXLwAHUEVORElORwIHUEVORElORwAIRklOSVNIRUQCCEZJTklTSEVEAAVXQVZFUwIFV0FWRVMBB3dyYXBFcnIBAXMJAKwCAgkArAICBQ1DT05UUkFDVF9OQU1FAgI6IAUBcwEIdGhyb3dFcnIBAXMJAAIBCQEHd3JhcEVycgEFAXMBD2Fzc2V0SWRUb1N0cmluZwEHYXNzZXRJZAQHJG1hdGNoMAUHYXNzZXRJZAMJAAECBQckbWF0Y2gwAgpCeXRlVmVjdG9yBAFiBQckbWF0Y2gwCQDYBAEFAWIDCQABAgUHJG1hdGNoMAIEVW5pdAUFV0FWRVMJAAIBAgtNYXRjaCBlcnJvcgEDYWJzAQFuAwkAZgIAAAUBbgkBAS0BBQFuBQFuARFrZXlGYWN0b3J5QWRkcmVzcwAJALkJAgkAzAgCAgIlcwkAzAgCAgdmYWN0b3J5BQNuaWwFA1NFUAETa2V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WFuYWdlclB1YmxpY0tleU9yVW5pdAADCQABAgUHJG1hdGNoMAIKQnl0ZVZlY3RvcgQDcHViBQckbWF0Y2gwBQNwdWIIBQJ0eA9zZW5kZXJQdWJsaWNLZXkJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFCXB1YmxpY0tleYpN6uU=", "chainId": 84, "height": 2653785, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DZYiVb1nMQ2pJKqCDRp2LPatLbdkTKBQfZLMcZxya4wv Next: 2LTc4ktSWPxw6eYsLdCjMxgkDVmckBbHiHUA9qVpt7jh Diff:
Old | New | Differences | |
---|---|---|---|
68 | 68 | ||
69 | 69 | ||
70 | 70 | func keyStartHeight (period) = makeString(["%s%d", "startHeight", toString(period)], SEP) | |
71 | + | ||
72 | + | ||
73 | + | func keyPowerManagerBonus (period) = makeString(["%s%d", "powerManagerBonus", toString(period)], SEP) | |
71 | 74 | ||
72 | 75 | ||
73 | 76 | func keyPeriodLength () = "%s__periodLength" | |
203 | 206 | ||
204 | 207 | func rewardForOption (rewards,target) = { | |
205 | 208 | let s = size(rewards) | |
206 | - | let $ | |
207 | - | let a0 = $ | |
208 | - | let r0 = $ | |
209 | - | let $ | |
210 | - | let a1 = $ | |
211 | - | let r1 = $ | |
212 | - | let $ | |
213 | - | let a2 = $ | |
214 | - | let r2 = $ | |
209 | + | let $t047354760 = rewards[0] | |
210 | + | let a0 = $t047354760._1 | |
211 | + | let r0 = $t047354760._2 | |
212 | + | let $t047634788 = rewards[1] | |
213 | + | let a1 = $t047634788._1 | |
214 | + | let r1 = $t047634788._2 | |
215 | + | let $t047914816 = rewards[2] | |
216 | + | let a2 = $t047914816._1 | |
217 | + | let r2 = $t047914816._2 | |
215 | 218 | if (if ((s > 0)) | |
216 | 219 | then (a0 == target) | |
217 | 220 | else false) | |
280 | 283 | then (profitRaw >= pwrManagersBonusInWaves) | |
281 | 284 | else false) | |
282 | 285 | then pwrManagersBonusInWaves | |
283 | - | else | |
286 | + | else throwErr("power bonus is more than profit") | |
284 | 287 | let profit = (profitRaw - pwrManagersBonusAmount) | |
285 | 288 | let donationPart = if ((currentTreasuryVolumeInWaves > 0)) | |
286 | 289 | then fraction(donatedWavesAmount, SCALE8, currentTreasuryVolumeInWaves) | |
331 | 334 | let actions = if ((paymentOption != unit)) | |
332 | 335 | then [ScriptTransfer(factoryAddressOrFail, paymentAmount, paymentAssetId)] | |
333 | 336 | else nil | |
334 | - | let factoryActions = [invoke(factoryAddressOrFail, "integerEntry", [keyCurrentPeriod(), newPeriod], nil), invoke(factoryAddressOrFail, "integerEntry", [keyPriceForPeriod(newPeriod), newPrice], nil), invoke(factoryAddressOrFail, "integerEntry", [keyStartHeight(newPeriod), (periodEndHeight + 1)], nil), invoke(factoryAddressOrFail, "burn", [lpAssetAmountToBurn], nil), invoke(factoryAddressOrFail, "integerEntry", [keyWithdrawal(), 0], nil), invoke(factoryAddressOrFail, "integerEntry", [keyInvested(unit), (investedWavesAmountNew - paymentAmountMin)], nil), invoke(factoryAddressOrFail, "integerEntry", [keyDonated(unit), donatedWavesAmountNew], nil)] | |
337 | + | let factoryActions = [invoke(factoryAddressOrFail, "integerEntry", [keyPowerManagerBonus(currentPeriodOrFail), pwrManagersBonusAmount], nil), invoke(factoryAddressOrFail, "integerEntry", [keyCurrentPeriod(), newPeriod], nil), invoke(factoryAddressOrFail, "integerEntry", [keyPriceForPeriod(newPeriod), newPrice], nil), invoke(factoryAddressOrFail, "integerEntry", [keyStartHeight(newPeriod), (periodEndHeight + 1)], nil), invoke(factoryAddressOrFail, "burn", [lpAssetAmountToBurn], nil), invoke(factoryAddressOrFail, "integerEntry", [keyWithdrawal(), 0], nil), invoke(factoryAddressOrFail, "integerEntry", [keyInvested(unit), (investedWavesAmountNew - paymentAmountMin)], nil), invoke(factoryAddressOrFail, "integerEntry", [keyDonated(unit), donatedWavesAmountNew], nil)] | |
335 | 338 | $Tuple2(actions, factoryActions) | |
336 | 339 | } | |
337 | 340 | else throw("Strict value is not equal to itself.") | |
356 | 359 | let payment = if ((size(i.payments) == 1)) | |
357 | 360 | then i.payments[0] | |
358 | 361 | else throwErr("invalid payments") | |
359 | - | let $ | |
362 | + | let $t01199712174 = if (if ((payment.assetId == unit)) | |
360 | 363 | then (payment.amount > 0) | |
361 | 364 | else false) | |
362 | 365 | then $Tuple2(payment.amount, payment.assetId) | |
363 | 366 | else throwErr("invalid payment amount") | |
364 | - | let paymentAmount = $ | |
365 | - | let paymentAssetId = $ | |
367 | + | let paymentAmount = $t01199712174._1 | |
368 | + | let paymentAssetId = $t01199712174._2 | |
366 | 369 | let lpAssetAmount = if ((currentPriceOrFail > 0)) | |
367 | 370 | then fraction(paymentAmount, SCALE8, currentPriceOrFail) | |
368 | 371 | else 0 | |
412 | 415 | let userAddress = Address(userAddressBytes) | |
413 | 416 | let withdrawalRequestOption = valueOrErrorMessage(getString(factoryAddressOrFail, keyWithdrawalRequest(userAddress, txId)), wrapErr("invalid withdrawal request")) | |
414 | 417 | let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period")) | |
415 | - | let $ | |
416 | - | let status = $ | |
417 | - | let lpAssetAmount = $ | |
418 | - | let targetPeriod = $ | |
419 | - | let claimTxId = $ | |
418 | + | let $t01458114694 = parseWithdrawalRequestValueOrFail(withdrawalRequestOption) | |
419 | + | let status = $t01458114694._1 | |
420 | + | let lpAssetAmount = $t01458114694._2 | |
421 | + | let targetPeriod = $t01458114694._3 | |
422 | + | let claimTxId = $t01458114694._4 | |
420 | 423 | let checks = [if ((status == PENDING)) | |
421 | 424 | then true | |
422 | 425 | else throwErr("invalid withdrawal request status"), if ((targetPeriod > currentPeriodOrFail)) | |
447 | 450 | let userAddress = Address(userAddressBytes) | |
448 | 451 | let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period")) | |
449 | 452 | let withdrawalRequestOption = valueOrErrorMessage(getString(factoryAddressOrFail, keyWithdrawalRequest(userAddress, txId)), wrapErr("invalid withdrawal request")) | |
450 | - | let $ | |
451 | - | let status = $ | |
452 | - | let lpAssetAmount = $ | |
453 | - | let targetPeriod = $ | |
454 | - | let claimTxId = $ | |
453 | + | let $t01602616139 = parseWithdrawalRequestValueOrFail(withdrawalRequestOption) | |
454 | + | let status = $t01602616139._1 | |
455 | + | let lpAssetAmount = $t01602616139._2 | |
456 | + | let targetPeriod = $t01602616139._3 | |
457 | + | let claimTxId = $t01602616139._4 | |
455 | 458 | if ((status == FINISHED)) | |
456 | 459 | then throwErr("invalid withdrawal request status") | |
457 | 460 | else if ((targetPeriod > currentPeriodOrFail)) | |
512 | 515 | let factoryActionsSingle = [invoke(factoryAddressOrFail, "stringEntry", [keyBlockProcessed(targetBlockHeight), makeString([toBase58String(i.transactionId), toString(currentPeriodOrFail), toString(generator), toBase58String(userAddressBytes), toString(treasuryRewardOrFail), toString(callerReward), toString(lpAssetAmount)], SEP)], nil), invoke(factoryAddressOrFail, "integerEntry", [keyAvailable(generator), (available + lpAssetAmount)], nil)] | |
513 | 516 | if ((factoryActionsSingle == factoryActionsSingle)) | |
514 | 517 | then { | |
515 | - | let $ | |
516 | - | let lpAssetAcc = $ | |
517 | - | let rewardAcc = $ | |
518 | + | let $t02037520408 = acc | |
519 | + | let lpAssetAcc = $t02037520408._1 | |
520 | + | let rewardAcc = $t02037520408._2 | |
518 | 521 | $Tuple2((lpAssetAcc + lpAssetAmount), (rewardAcc + treasuryRewardOrFail)) | |
519 | 522 | } | |
520 | 523 | else throw("Strict value is not equal to itself.") | |
521 | 524 | } | |
522 | 525 | ||
523 | 526 | let list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] | |
524 | - | let $ | |
527 | + | let $t02067520751 = { | |
525 | 528 | let $l = list | |
526 | 529 | let $s = size($l) | |
527 | 530 | let $acc0 = $Tuple2(0, 0) | |
535 | 538 | ||
536 | 539 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40) | |
537 | 540 | } | |
538 | - | if (($ | |
541 | + | if (($t02067520751 == $t02067520751)) | |
539 | 542 | then { | |
540 | - | let rewardAmountTotal = $ | |
541 | - | let lpAssetAmountTotal = $ | |
543 | + | let rewardAmountTotal = $t02067520751._2 | |
544 | + | let lpAssetAmountTotal = $t02067520751._1 | |
542 | 545 | let rewardToMainTreasuryAmount = (rewardAmountTotal - blockProcessingReward) | |
543 | 546 | let invested = valueOrElse(getInteger(factoryAddressOrFail, keyInvested(unit)), 0) | |
544 | 547 | let actions = [invoke(factoryAddressOrFail, "reissue", [lpAssetAmountTotal], nil), invoke(factoryAddressOrFail, "integerEntry", [keyNextBlockToProcess(), (nextBlockToProcess + blocksProcessingBatchSize)], nil), invoke(factoryAddressOrFail, "transferFromProxyTreasury", [mainTreasuryAddressOrFail.bytes, rewardToMainTreasuryAmount], nil), invoke(factoryAddressOrFail, "transferFromProxyTreasury", [userAddressBytes, blockProcessingReward], nil), invoke(factoryAddressOrFail, "integerEntry", [keyInvested(unit), (invested + rewardToMainTreasuryAmount)], nil)] |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 7 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | let CONTRACT_NAME = "calculator.ride" | |
7 | 7 | ||
8 | 8 | let SCALE8 = 100000000 | |
9 | 9 | ||
10 | 10 | let PENDING = "PENDING" | |
11 | 11 | ||
12 | 12 | let FINISHED = "FINISHED" | |
13 | 13 | ||
14 | 14 | let WAVES = "WAVES" | |
15 | 15 | ||
16 | 16 | func wrapErr (s) = ((CONTRACT_NAME + ": ") + s) | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func throwErr (s) = throw(wrapErr(s)) | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func assetIdToString (assetId) = match assetId { | |
23 | 23 | case b: ByteVector => | |
24 | 24 | toBase58String(b) | |
25 | 25 | case _: Unit => | |
26 | 26 | WAVES | |
27 | 27 | case _ => | |
28 | 28 | throw("Match error") | |
29 | 29 | } | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func abs (n) = if ((0 > n)) | |
33 | 33 | then -(n) | |
34 | 34 | else n | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | func keyFactoryAddress () = makeString(["%s", "factory"], SEP) | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func keyManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP) | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func keyLpAssetId () = makeString(["%s", "lpAssetId"], SEP) | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func keyProxyTreasuryAddress () = makeString(["%s", "proxyTreasury"], SEP) | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func keyMainTreasuryAddress () = makeString(["%s", "mainTreasury"], SEP) | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func keyInvested (assetId) = makeString(["%s%s", "invested", assetIdToString(assetId)], SEP) | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func keyDonated (assetId) = makeString(["%s%s", "donated", assetIdToString(assetId)], SEP) | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func keyAvailable (userAddress) = makeString(["%s%s", "available", toString(userAddress)], SEP) | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func keyClaimed (userAddress) = makeString(["%s%s", "claimed", toString(userAddress)], SEP) | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func keyCurrentPeriod () = makeString(["%s", "currentPeriod"], SEP) | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func keyPriceForPeriod (period) = makeString(["%s%d", "price", toString(period)], SEP) | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func keyStartHeight (period) = makeString(["%s%d", "startHeight", toString(period)], SEP) | |
71 | + | ||
72 | + | ||
73 | + | func keyPowerManagerBonus (period) = makeString(["%s%d", "powerManagerBonus", toString(period)], SEP) | |
71 | 74 | ||
72 | 75 | ||
73 | 76 | func keyPeriodLength () = "%s__periodLength" | |
74 | 77 | ||
75 | 78 | ||
76 | 79 | func keyBlockProcessingReward () = "%s__blockProcessingReward" | |
77 | 80 | ||
78 | 81 | ||
79 | 82 | func keyNextBlockToProcess () = "%s__nextBlockToProcess" | |
80 | 83 | ||
81 | 84 | ||
82 | 85 | func keyBlockProcessed (height) = makeString(["%s%d", "blockProcessed", toString(height)], SEP) | |
83 | 86 | ||
84 | 87 | ||
85 | 88 | func keyWithdrawal () = "%s__withdrawal" | |
86 | 89 | ||
87 | 90 | ||
88 | 91 | func keyWithdrawalRequest (userAddress,txId) = makeString(["%s%s%s", "withdrawal", toString(userAddress), toBase58String(txId)], SEP) | |
89 | 92 | ||
90 | 93 | ||
91 | 94 | func valueWithdrawalRequest (status,lpAssetAmount,targetPeriod,claimTxId) = { | |
92 | 95 | let claimTxIdStr = match claimTxId { | |
93 | 96 | case b: ByteVector => | |
94 | 97 | toBase58String(b) | |
95 | 98 | case _: Unit => | |
96 | 99 | "SOON" | |
97 | 100 | case _ => | |
98 | 101 | throw("Match error") | |
99 | 102 | } | |
100 | 103 | makeString(["%s%d%d%s", status, toString(lpAssetAmount), toString(targetPeriod), claimTxIdStr], SEP) | |
101 | 104 | } | |
102 | 105 | ||
103 | 106 | ||
104 | 107 | func parseWithdrawalRequestValueOrFail (s) = { | |
105 | 108 | let parts = split(s, SEP) | |
106 | 109 | if ((size(parts) == 5)) | |
107 | 110 | then { | |
108 | 111 | let status = parts[1] | |
109 | 112 | let lpAssetAmount = valueOrErrorMessage(parseInt(parts[2]), wrapErr("invalid lpAssetAmount")) | |
110 | 113 | let targetPeriod = valueOrErrorMessage(parseInt(parts[3]), wrapErr("invalid targetPeriod")) | |
111 | 114 | let claimTxId = parts[4] | |
112 | 115 | $Tuple4(status, lpAssetAmount, targetPeriod, claimTxId) | |
113 | 116 | } | |
114 | 117 | else throwErr("invalid withdrawal request value") | |
115 | 118 | } | |
116 | 119 | ||
117 | 120 | ||
118 | 121 | let factoryAddressOption = match getString(this, keyFactoryAddress()) { | |
119 | 122 | case s: String => | |
120 | 123 | addressFromString(s) | |
121 | 124 | case _: Unit => | |
122 | 125 | unit | |
123 | 126 | case _ => | |
124 | 127 | throw("Match error") | |
125 | 128 | } | |
126 | 129 | ||
127 | 130 | let factoryAddressOrFail = valueOrErrorMessage(factoryAddressOption, wrapErr("invalid factory address")) | |
128 | 131 | ||
129 | 132 | let lpAssetIdOption = match factoryAddressOption { | |
130 | 133 | case a: Address => | |
131 | 134 | match getString(a, keyLpAssetId()) { | |
132 | 135 | case s: String => | |
133 | 136 | fromBase58String(s) | |
134 | 137 | case _: Unit => | |
135 | 138 | unit | |
136 | 139 | case _ => | |
137 | 140 | throw("Match error") | |
138 | 141 | } | |
139 | 142 | case _: Unit => | |
140 | 143 | unit | |
141 | 144 | case _ => | |
142 | 145 | throw("Match error") | |
143 | 146 | } | |
144 | 147 | ||
145 | 148 | let lpAssetIdOrFail = valueOrErrorMessage(lpAssetIdOption, wrapErr("invalid lpAssetId")) | |
146 | 149 | ||
147 | 150 | let proxyTreasuryAddressOption = match factoryAddressOption { | |
148 | 151 | case a: Address => | |
149 | 152 | match getString(a, keyProxyTreasuryAddress()) { | |
150 | 153 | case s: String => | |
151 | 154 | addressFromString(s) | |
152 | 155 | case _: Unit => | |
153 | 156 | unit | |
154 | 157 | case _ => | |
155 | 158 | throw("Match error") | |
156 | 159 | } | |
157 | 160 | case _: Unit => | |
158 | 161 | unit | |
159 | 162 | case _ => | |
160 | 163 | throw("Match error") | |
161 | 164 | } | |
162 | 165 | ||
163 | 166 | let proxyTreasuryAddressOrFail = valueOrErrorMessage(proxyTreasuryAddressOption, wrapErr("invalid proxy treasury address")) | |
164 | 167 | ||
165 | 168 | let mainTreasuryAddressOption = match factoryAddressOption { | |
166 | 169 | case a: Address => | |
167 | 170 | match getString(a, keyMainTreasuryAddress()) { | |
168 | 171 | case s: String => | |
169 | 172 | addressFromString(s) | |
170 | 173 | case _: Unit => | |
171 | 174 | unit | |
172 | 175 | case _ => | |
173 | 176 | throw("Match error") | |
174 | 177 | } | |
175 | 178 | case _: Unit => | |
176 | 179 | unit | |
177 | 180 | case _ => | |
178 | 181 | throw("Match error") | |
179 | 182 | } | |
180 | 183 | ||
181 | 184 | let mainTreasuryAddressOrFail = valueOrErrorMessage(mainTreasuryAddressOption, wrapErr("invalid main treasury address")) | |
182 | 185 | ||
183 | 186 | func getManagerPublicKeyOrUnit () = match factoryAddressOption { | |
184 | 187 | case fa: Address => | |
185 | 188 | match getString(fa, keyManagerPublicKey()) { | |
186 | 189 | case pub: String => | |
187 | 190 | fromBase58String(pub) | |
188 | 191 | case _ => | |
189 | 192 | unit | |
190 | 193 | } | |
191 | 194 | case _ => | |
192 | 195 | unit | |
193 | 196 | } | |
194 | 197 | ||
195 | 198 | ||
196 | 199 | func onlyAddress (i,address) = if ((i.caller == address)) | |
197 | 200 | then true | |
198 | 201 | else throwErr("permission denied") | |
199 | 202 | ||
200 | 203 | ||
201 | 204 | func onlyFactory (i) = onlyAddress(i, factoryAddressOrFail) | |
202 | 205 | ||
203 | 206 | ||
204 | 207 | func rewardForOption (rewards,target) = { | |
205 | 208 | let s = size(rewards) | |
206 | - | let $ | |
207 | - | let a0 = $ | |
208 | - | let r0 = $ | |
209 | - | let $ | |
210 | - | let a1 = $ | |
211 | - | let r1 = $ | |
212 | - | let $ | |
213 | - | let a2 = $ | |
214 | - | let r2 = $ | |
209 | + | let $t047354760 = rewards[0] | |
210 | + | let a0 = $t047354760._1 | |
211 | + | let r0 = $t047354760._2 | |
212 | + | let $t047634788 = rewards[1] | |
213 | + | let a1 = $t047634788._1 | |
214 | + | let r1 = $t047634788._2 | |
215 | + | let $t047914816 = rewards[2] | |
216 | + | let a2 = $t047914816._1 | |
217 | + | let r2 = $t047914816._2 | |
215 | 218 | if (if ((s > 0)) | |
216 | 219 | then (a0 == target) | |
217 | 220 | else false) | |
218 | 221 | then r0 | |
219 | 222 | else if (if ((s > 1)) | |
220 | 223 | then (a1 == target) | |
221 | 224 | else false) | |
222 | 225 | then r1 | |
223 | 226 | else if (if ((s > 2)) | |
224 | 227 | then (a2 == target) | |
225 | 228 | else false) | |
226 | 229 | then r2 | |
227 | 230 | else unit | |
228 | 231 | } | |
229 | 232 | ||
230 | 233 | ||
231 | 234 | @Callable(i) | |
232 | 235 | func claimLP (userAddressBytes) = { | |
233 | 236 | let checkCaller = onlyFactory(i) | |
234 | 237 | if ((checkCaller == checkCaller)) | |
235 | 238 | then { | |
236 | 239 | let userAddress = Address(userAddressBytes) | |
237 | 240 | let available = valueOrElse(getInteger(factoryAddressOrFail, keyAvailable(userAddress)), 0) | |
238 | 241 | let claimed = valueOrElse(getInteger(factoryAddressOrFail, keyClaimed(userAddress)), 0) | |
239 | 242 | let factoryActions = if ((available > 0)) | |
240 | 243 | then [invoke(factoryAddressOrFail, "transferAsset", [userAddressBytes, available, lpAssetIdOrFail], nil), invoke(factoryAddressOrFail, "integerEntry", [keyAvailable(userAddress), 0], nil), invoke(factoryAddressOrFail, "integerEntry", [keyClaimed(userAddress), (claimed + available)], nil)] | |
241 | 244 | else throwErr("nothing to claim") | |
242 | 245 | $Tuple2(nil, factoryActions) | |
243 | 246 | } | |
244 | 247 | else throw("Strict value is not equal to itself.") | |
245 | 248 | } | |
246 | 249 | ||
247 | 250 | ||
248 | 251 | ||
249 | 252 | @Callable(i) | |
250 | 253 | func finalize (userAddressBytes,newTreasuryVolumeInWaves,pwrManagersBonusInWaves,treasuryVolumeDiffAllocationCoef) = { | |
251 | 254 | let checkCaller = onlyFactory(i) | |
252 | 255 | if ((checkCaller == checkCaller)) | |
253 | 256 | then { | |
254 | 257 | let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period")) | |
255 | 258 | let periodLength = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPeriodLength()), wrapErr("invalid period length")) | |
256 | 259 | let currentStartHeight = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyStartHeight(currentPeriodOrFail)), wrapErr("invalid start height")) | |
257 | 260 | let currentPriceOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPriceForPeriod(currentPeriodOrFail)), wrapErr("invalid price")) | |
258 | 261 | let nextBlockToProcess = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyNextBlockToProcess()), wrapErr("invalid next block to process")) | |
259 | 262 | let periodEndHeight = ((currentStartHeight + periodLength) - 1) | |
260 | 263 | let checks = [if ((i.originCaller == mainTreasuryAddressOrFail)) | |
261 | 264 | then true | |
262 | 265 | else throwErr("permission denied"), if ((nextBlockToProcess > periodEndHeight)) | |
263 | 266 | then true | |
264 | 267 | else throwErr("unprocessed blocks"), if ((newTreasuryVolumeInWaves >= 0)) | |
265 | 268 | then true | |
266 | 269 | else throwErr("invalid new treasury volume"), if ((pwrManagersBonusInWaves >= 0)) | |
267 | 270 | then true | |
268 | 271 | else throwErr("invalid PWR managers bonus"), if (if ((treasuryVolumeDiffAllocationCoef >= -(SCALE8))) | |
269 | 272 | then (SCALE8 >= treasuryVolumeDiffAllocationCoef) | |
270 | 273 | else false) | |
271 | 274 | then true | |
272 | 275 | else throwErr("invalid treasury volume diff allocation coefficient")] | |
273 | 276 | if ((checks == checks)) | |
274 | 277 | then { | |
275 | 278 | let donatedWavesAmount = valueOrElse(getInteger(factoryAddressOrFail, keyDonated(unit)), 0) | |
276 | 279 | let investedWavesAmount = valueOrElse(getInteger(factoryAddressOrFail, keyInvested(unit)), 0) | |
277 | 280 | let currentTreasuryVolumeInWaves = (donatedWavesAmount + investedWavesAmount) | |
278 | 281 | let profitRaw = (newTreasuryVolumeInWaves - currentTreasuryVolumeInWaves) | |
279 | 282 | let pwrManagersBonusAmount = if (if ((profitRaw > 0)) | |
280 | 283 | then (profitRaw >= pwrManagersBonusInWaves) | |
281 | 284 | else false) | |
282 | 285 | then pwrManagersBonusInWaves | |
283 | - | else | |
286 | + | else throwErr("power bonus is more than profit") | |
284 | 287 | let profit = (profitRaw - pwrManagersBonusAmount) | |
285 | 288 | let donationPart = if ((currentTreasuryVolumeInWaves > 0)) | |
286 | 289 | then fraction(donatedWavesAmount, SCALE8, currentTreasuryVolumeInWaves) | |
287 | 290 | else 0 | |
288 | 291 | let donationProfitPartRaw = fraction(profit, donationPart, SCALE8) | |
289 | 292 | let investmentProfitPartRaw = (profit - donationProfitPartRaw) | |
290 | 293 | let treasuryVolumeDiffAllocationCoefAbs = abs(treasuryVolumeDiffAllocationCoef) | |
291 | 294 | let amountToDonation = fraction(investmentProfitPartRaw, if ((0 > treasuryVolumeDiffAllocationCoef)) | |
292 | 295 | then treasuryVolumeDiffAllocationCoefAbs | |
293 | 296 | else 0, SCALE8) | |
294 | 297 | let amountToInvestment = fraction(donationProfitPartRaw, if ((treasuryVolumeDiffAllocationCoef > 0)) | |
295 | 298 | then treasuryVolumeDiffAllocationCoefAbs | |
296 | 299 | else 0, SCALE8) | |
297 | 300 | let donationProfitPart = ((donationProfitPartRaw - amountToInvestment) + amountToDonation) | |
298 | 301 | let investmentProfitPart = ((investmentProfitPartRaw - amountToDonation) + amountToInvestment) | |
299 | 302 | let donatedWavesAmountNewRaw = (donatedWavesAmount + donationProfitPart) | |
300 | 303 | let investedWavesAmountNewRaw = (investedWavesAmount + investmentProfitPart) | |
301 | 304 | let donatedPartDebt = min([0, donatedWavesAmountNewRaw]) | |
302 | 305 | let investedPartDebt = min([0, investedWavesAmountNewRaw]) | |
303 | 306 | let donatedWavesAmountNew = (max([0, donatedWavesAmountNewRaw]) + investedPartDebt) | |
304 | 307 | let investedWavesAmountNew = (max([0, investedWavesAmountNewRaw]) + donatedPartDebt) | |
305 | 308 | let newPeriod = (currentPeriodOrFail + 1) | |
306 | 309 | let lpAssetQuantity = valueOrErrorMessage(assetInfo(lpAssetIdOrFail), wrapErr("invalid lpAsset info")).quantity | |
307 | 310 | let newPrice = fraction(investedWavesAmountNew, SCALE8, lpAssetQuantity) | |
308 | 311 | let checkIfPriceNotZero = if ((newPrice != 0)) | |
309 | 312 | then true | |
310 | 313 | else throwErr("LP price cannot be 0") | |
311 | 314 | if ((checkIfPriceNotZero == checkIfPriceNotZero)) | |
312 | 315 | then { | |
313 | 316 | let lpAssetAmountToBurn = valueOrElse(getInteger(factoryAddressOrFail, keyWithdrawal()), 0) | |
314 | 317 | let paymentAmountMin = max([0, fraction(lpAssetAmountToBurn, newPrice, SCALE8)]) | |
315 | 318 | let paymentOption = if ((size(i.payments) > 0)) | |
316 | 319 | then i.payments[0] | |
317 | 320 | else unit | |
318 | 321 | let paymentAmount = value(paymentOption).amount | |
319 | 322 | let paymentAssetId = value(paymentOption).assetId | |
320 | 323 | let checkPayment = if (if ((paymentAmountMin == 0)) | |
321 | 324 | then true | |
322 | 325 | else if (if ((paymentOption != unit)) | |
323 | 326 | then (paymentAssetId == unit) | |
324 | 327 | else false) | |
325 | 328 | then (paymentAmount >= paymentAmountMin) | |
326 | 329 | else false) | |
327 | 330 | then true | |
328 | 331 | else throwErr(("invalid payments, payment amount min: " + toString(paymentAmountMin))) | |
329 | 332 | if ((checkPayment == checkPayment)) | |
330 | 333 | then { | |
331 | 334 | let actions = if ((paymentOption != unit)) | |
332 | 335 | then [ScriptTransfer(factoryAddressOrFail, paymentAmount, paymentAssetId)] | |
333 | 336 | else nil | |
334 | - | let factoryActions = [invoke(factoryAddressOrFail, "integerEntry", [keyCurrentPeriod(), newPeriod], nil), invoke(factoryAddressOrFail, "integerEntry", [keyPriceForPeriod(newPeriod), newPrice], nil), invoke(factoryAddressOrFail, "integerEntry", [keyStartHeight(newPeriod), (periodEndHeight + 1)], nil), invoke(factoryAddressOrFail, "burn", [lpAssetAmountToBurn], nil), invoke(factoryAddressOrFail, "integerEntry", [keyWithdrawal(), 0], nil), invoke(factoryAddressOrFail, "integerEntry", [keyInvested(unit), (investedWavesAmountNew - paymentAmountMin)], nil), invoke(factoryAddressOrFail, "integerEntry", [keyDonated(unit), donatedWavesAmountNew], nil)] | |
337 | + | let factoryActions = [invoke(factoryAddressOrFail, "integerEntry", [keyPowerManagerBonus(currentPeriodOrFail), pwrManagersBonusAmount], nil), invoke(factoryAddressOrFail, "integerEntry", [keyCurrentPeriod(), newPeriod], nil), invoke(factoryAddressOrFail, "integerEntry", [keyPriceForPeriod(newPeriod), newPrice], nil), invoke(factoryAddressOrFail, "integerEntry", [keyStartHeight(newPeriod), (periodEndHeight + 1)], nil), invoke(factoryAddressOrFail, "burn", [lpAssetAmountToBurn], nil), invoke(factoryAddressOrFail, "integerEntry", [keyWithdrawal(), 0], nil), invoke(factoryAddressOrFail, "integerEntry", [keyInvested(unit), (investedWavesAmountNew - paymentAmountMin)], nil), invoke(factoryAddressOrFail, "integerEntry", [keyDonated(unit), donatedWavesAmountNew], nil)] | |
335 | 338 | $Tuple2(actions, factoryActions) | |
336 | 339 | } | |
337 | 340 | else throw("Strict value is not equal to itself.") | |
338 | 341 | } | |
339 | 342 | else throw("Strict value is not equal to itself.") | |
340 | 343 | } | |
341 | 344 | else throw("Strict value is not equal to itself.") | |
342 | 345 | } | |
343 | 346 | else throw("Strict value is not equal to itself.") | |
344 | 347 | } | |
345 | 348 | ||
346 | 349 | ||
347 | 350 | ||
348 | 351 | @Callable(i) | |
349 | 352 | func invest (userAddressBytes) = { | |
350 | 353 | let checkCaller = onlyFactory(i) | |
351 | 354 | if ((checkCaller == checkCaller)) | |
352 | 355 | then { | |
353 | 356 | let userAddress = Address(userAddressBytes) | |
354 | 357 | let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period")) | |
355 | 358 | let currentPriceOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPriceForPeriod(currentPeriodOrFail)), wrapErr("invalid price")) | |
356 | 359 | let payment = if ((size(i.payments) == 1)) | |
357 | 360 | then i.payments[0] | |
358 | 361 | else throwErr("invalid payments") | |
359 | - | let $ | |
362 | + | let $t01199712174 = if (if ((payment.assetId == unit)) | |
360 | 363 | then (payment.amount > 0) | |
361 | 364 | else false) | |
362 | 365 | then $Tuple2(payment.amount, payment.assetId) | |
363 | 366 | else throwErr("invalid payment amount") | |
364 | - | let paymentAmount = $ | |
365 | - | let paymentAssetId = $ | |
367 | + | let paymentAmount = $t01199712174._1 | |
368 | + | let paymentAssetId = $t01199712174._2 | |
366 | 369 | let lpAssetAmount = if ((currentPriceOrFail > 0)) | |
367 | 370 | then fraction(paymentAmount, SCALE8, currentPriceOrFail) | |
368 | 371 | else 0 | |
369 | 372 | let invested = valueOrElse(getInteger(factoryAddressOrFail, keyInvested(unit)), 0) | |
370 | 373 | let actions = [ScriptTransfer(mainTreasuryAddressOrFail, paymentAmount, paymentAssetId)] | |
371 | 374 | let factoryActions = [invoke(factoryAddressOrFail, "integerEntry", [keyInvested(unit), (invested + paymentAmount)], nil), invoke(factoryAddressOrFail, "reissue", [lpAssetAmount], nil), invoke(factoryAddressOrFail, "transferAsset", [userAddressBytes, lpAssetAmount, lpAssetIdOrFail], nil)] | |
372 | 375 | $Tuple2(actions, factoryActions) | |
373 | 376 | } | |
374 | 377 | else throw("Strict value is not equal to itself.") | |
375 | 378 | } | |
376 | 379 | ||
377 | 380 | ||
378 | 381 | ||
379 | 382 | @Callable(i) | |
380 | 383 | func withdraw (userAddressBytes) = { | |
381 | 384 | let checkCaller = onlyFactory(i) | |
382 | 385 | if ((checkCaller == checkCaller)) | |
383 | 386 | then { | |
384 | 387 | let userAddress = Address(userAddressBytes) | |
385 | 388 | let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period")) | |
386 | 389 | let payment = if ((size(i.payments) == 1)) | |
387 | 390 | then i.payments[0] | |
388 | 391 | else throwErr(wrapErr("invalid payments")) | |
389 | 392 | let paymentAssetId = if ((payment.assetId == lpAssetIdOrFail)) | |
390 | 393 | then lpAssetIdOrFail | |
391 | 394 | else throwErr("invalid payment asset") | |
392 | 395 | let paymentAmount = if ((payment.amount > 0)) | |
393 | 396 | then payment.amount | |
394 | 397 | else throwErr("invalid payment amount") | |
395 | 398 | let withdrawal = valueOrElse(getInteger(factoryAddressOrFail, keyWithdrawal()), 0) | |
396 | 399 | let actions = [ScriptTransfer(factoryAddressOrFail, paymentAmount, paymentAssetId)] | |
397 | 400 | let factoryActions = [invoke(factoryAddressOrFail, "integerEntry", [keyWithdrawal(), (withdrawal + paymentAmount)], nil), invoke(factoryAddressOrFail, "stringEntry", [keyWithdrawalRequest(userAddress, i.transactionId), valueWithdrawalRequest(PENDING, paymentAmount, (currentPeriodOrFail + 1), unit)], nil)] | |
398 | 401 | if ((factoryActions == factoryActions)) | |
399 | 402 | then $Tuple2(actions, factoryActions) | |
400 | 403 | else throw("Strict value is not equal to itself.") | |
401 | 404 | } | |
402 | 405 | else throw("Strict value is not equal to itself.") | |
403 | 406 | } | |
404 | 407 | ||
405 | 408 | ||
406 | 409 | ||
407 | 410 | @Callable(i) | |
408 | 411 | func cancelWithdraw (userAddressBytes,txId) = { | |
409 | 412 | let checkCaller = onlyFactory(i) | |
410 | 413 | if ((checkCaller == checkCaller)) | |
411 | 414 | then { | |
412 | 415 | let userAddress = Address(userAddressBytes) | |
413 | 416 | let withdrawalRequestOption = valueOrErrorMessage(getString(factoryAddressOrFail, keyWithdrawalRequest(userAddress, txId)), wrapErr("invalid withdrawal request")) | |
414 | 417 | let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period")) | |
415 | - | let $ | |
416 | - | let status = $ | |
417 | - | let lpAssetAmount = $ | |
418 | - | let targetPeriod = $ | |
419 | - | let claimTxId = $ | |
418 | + | let $t01458114694 = parseWithdrawalRequestValueOrFail(withdrawalRequestOption) | |
419 | + | let status = $t01458114694._1 | |
420 | + | let lpAssetAmount = $t01458114694._2 | |
421 | + | let targetPeriod = $t01458114694._3 | |
422 | + | let claimTxId = $t01458114694._4 | |
420 | 423 | let checks = [if ((status == PENDING)) | |
421 | 424 | then true | |
422 | 425 | else throwErr("invalid withdrawal request status"), if ((targetPeriod > currentPeriodOrFail)) | |
423 | 426 | then true | |
424 | 427 | else throwErr("invalid withdrawal request period")] | |
425 | 428 | if ((checks == checks)) | |
426 | 429 | then { | |
427 | 430 | let withdrawal = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyWithdrawal()), wrapErr("invalid total withdrawal amount")) | |
428 | 431 | let factoryActions = [invoke(factoryAddressOrFail, "integerEntry", [keyWithdrawal(), if ((withdrawal >= lpAssetAmount)) | |
429 | 432 | then (withdrawal - lpAssetAmount) | |
430 | 433 | else throwErr("invalid withdrawal amount")], nil), invoke(factoryAddressOrFail, "deleteEntry", [keyWithdrawalRequest(userAddress, txId)], nil), invoke(factoryAddressOrFail, "transferAsset", [userAddressBytes, lpAssetAmount, lpAssetIdOrFail], nil)] | |
431 | 434 | if ((factoryActions == factoryActions)) | |
432 | 435 | then $Tuple2(nil, factoryActions) | |
433 | 436 | else throw("Strict value is not equal to itself.") | |
434 | 437 | } | |
435 | 438 | else throw("Strict value is not equal to itself.") | |
436 | 439 | } | |
437 | 440 | else throw("Strict value is not equal to itself.") | |
438 | 441 | } | |
439 | 442 | ||
440 | 443 | ||
441 | 444 | ||
442 | 445 | @Callable(i) | |
443 | 446 | func claimWaves (userAddressBytes,txId) = { | |
444 | 447 | let checkCaller = onlyFactory(i) | |
445 | 448 | if ((checkCaller == checkCaller)) | |
446 | 449 | then { | |
447 | 450 | let userAddress = Address(userAddressBytes) | |
448 | 451 | let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period")) | |
449 | 452 | let withdrawalRequestOption = valueOrErrorMessage(getString(factoryAddressOrFail, keyWithdrawalRequest(userAddress, txId)), wrapErr("invalid withdrawal request")) | |
450 | - | let $ | |
451 | - | let status = $ | |
452 | - | let lpAssetAmount = $ | |
453 | - | let targetPeriod = $ | |
454 | - | let claimTxId = $ | |
453 | + | let $t01602616139 = parseWithdrawalRequestValueOrFail(withdrawalRequestOption) | |
454 | + | let status = $t01602616139._1 | |
455 | + | let lpAssetAmount = $t01602616139._2 | |
456 | + | let targetPeriod = $t01602616139._3 | |
457 | + | let claimTxId = $t01602616139._4 | |
455 | 458 | if ((status == FINISHED)) | |
456 | 459 | then throwErr("invalid withdrawal request status") | |
457 | 460 | else if ((targetPeriod > currentPeriodOrFail)) | |
458 | 461 | then throwErr("invalid withdrawal request period") | |
459 | 462 | else { | |
460 | 463 | let priceOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPriceForPeriod(targetPeriod)), wrapErr("invalid price")) | |
461 | 464 | let amount = if ((priceOrFail > 0)) | |
462 | 465 | then fraction(lpAssetAmount, priceOrFail, SCALE8) | |
463 | 466 | else 0 | |
464 | 467 | let factoryActions = [invoke(factoryAddressOrFail, "stringEntry", [keyWithdrawalRequest(userAddress, txId), valueWithdrawalRequest(FINISHED, lpAssetAmount, targetPeriod, i.transactionId)], nil), invoke(factoryAddressOrFail, "transferWaves", [userAddressBytes, amount], nil)] | |
465 | 468 | $Tuple2(nil, factoryActions) | |
466 | 469 | } | |
467 | 470 | } | |
468 | 471 | else throw("Strict value is not equal to itself.") | |
469 | 472 | } | |
470 | 473 | ||
471 | 474 | ||
472 | 475 | ||
473 | 476 | @Callable(i) | |
474 | 477 | func processBlocks (userAddressBytes) = { | |
475 | 478 | let checkCaller = onlyFactory(i) | |
476 | 479 | if ((checkCaller == checkCaller)) | |
477 | 480 | then { | |
478 | 481 | let userAddress = Address(userAddressBytes) | |
479 | 482 | let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period")) | |
480 | 483 | let periodLength = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPeriodLength()), wrapErr("invalid period length")) | |
481 | 484 | let currentStartHeight = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyStartHeight(currentPeriodOrFail)), wrapErr("invalid start height")) | |
482 | 485 | let currentPriceOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPriceForPeriod(currentPeriodOrFail)), wrapErr("invalid price")) | |
483 | 486 | let nextBlockToProcess = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyNextBlockToProcess()), wrapErr("invalid next block to process")) | |
484 | 487 | let periodEndHeight = ((currentStartHeight + periodLength) - 1) | |
485 | 488 | let blocksProcessingBatchSizeMax = 40 | |
486 | 489 | let blocksProcessingBatchSize = if (if (if ((height >= nextBlockToProcess)) | |
487 | 490 | then if ((nextBlockToProcess >= currentStartHeight)) | |
488 | 491 | then true | |
489 | 492 | else (currentPeriodOrFail == 0) | |
490 | 493 | else false) | |
491 | 494 | then (periodEndHeight >= nextBlockToProcess) | |
492 | 495 | else false) | |
493 | 496 | then min([((periodEndHeight - nextBlockToProcess) + 1), blocksProcessingBatchSizeMax]) | |
494 | 497 | else throwErr(wrapErr("invalid target block")) | |
495 | 498 | let blockProcessingReward = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyBlockProcessingReward()), wrapErr("invalid block processing reward")) | |
496 | 499 | let blockProcessingRewardByGenerator = (blockProcessingReward / blocksProcessingBatchSize) | |
497 | 500 | let blockProcessingRewardByGeneratorRemainder = (blockProcessingReward - (blockProcessingRewardByGenerator * blocksProcessingBatchSize)) | |
498 | 501 | func map (acc,inc) = if ((inc >= blocksProcessingBatchSize)) | |
499 | 502 | then acc | |
500 | 503 | else { | |
501 | 504 | let targetBlockHeight = (nextBlockToProcess + inc) | |
502 | 505 | let targetBlockInfo = valueOrErrorMessage(blockInfoByHeight(targetBlockHeight), wrapErr("invalid block info")) | |
503 | 506 | let treasuryRewardOrFail = valueOrErrorMessage(rewardForOption(targetBlockInfo.rewards, proxyTreasuryAddressOrFail), wrapErr(("invalid treasury reward for height " + toString(targetBlockHeight)))) | |
504 | 507 | let generator = targetBlockInfo.generator | |
505 | 508 | let available = valueOrElse(getInteger(factoryAddressOrFail, keyAvailable(generator)), 0) | |
506 | 509 | let callerReward = if ((inc == (blocksProcessingBatchSize - 1))) | |
507 | 510 | then (blockProcessingRewardByGenerator + blockProcessingRewardByGeneratorRemainder) | |
508 | 511 | else blockProcessingRewardByGenerator | |
509 | 512 | let lpAssetAmount = if ((currentPriceOrFail > 0)) | |
510 | 513 | then fraction((treasuryRewardOrFail - callerReward), SCALE8, currentPriceOrFail) | |
511 | 514 | else 0 | |
512 | 515 | let factoryActionsSingle = [invoke(factoryAddressOrFail, "stringEntry", [keyBlockProcessed(targetBlockHeight), makeString([toBase58String(i.transactionId), toString(currentPeriodOrFail), toString(generator), toBase58String(userAddressBytes), toString(treasuryRewardOrFail), toString(callerReward), toString(lpAssetAmount)], SEP)], nil), invoke(factoryAddressOrFail, "integerEntry", [keyAvailable(generator), (available + lpAssetAmount)], nil)] | |
513 | 516 | if ((factoryActionsSingle == factoryActionsSingle)) | |
514 | 517 | then { | |
515 | - | let $ | |
516 | - | let lpAssetAcc = $ | |
517 | - | let rewardAcc = $ | |
518 | + | let $t02037520408 = acc | |
519 | + | let lpAssetAcc = $t02037520408._1 | |
520 | + | let rewardAcc = $t02037520408._2 | |
518 | 521 | $Tuple2((lpAssetAcc + lpAssetAmount), (rewardAcc + treasuryRewardOrFail)) | |
519 | 522 | } | |
520 | 523 | else throw("Strict value is not equal to itself.") | |
521 | 524 | } | |
522 | 525 | ||
523 | 526 | let list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39] | |
524 | - | let $ | |
527 | + | let $t02067520751 = { | |
525 | 528 | let $l = list | |
526 | 529 | let $s = size($l) | |
527 | 530 | let $acc0 = $Tuple2(0, 0) | |
528 | 531 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
529 | 532 | then $a | |
530 | 533 | else map($a, $l[$i]) | |
531 | 534 | ||
532 | 535 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
533 | 536 | then $a | |
534 | 537 | else throw("List size exceeds 40") | |
535 | 538 | ||
536 | 539 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40) | |
537 | 540 | } | |
538 | - | if (($ | |
541 | + | if (($t02067520751 == $t02067520751)) | |
539 | 542 | then { | |
540 | - | let rewardAmountTotal = $ | |
541 | - | let lpAssetAmountTotal = $ | |
543 | + | let rewardAmountTotal = $t02067520751._2 | |
544 | + | let lpAssetAmountTotal = $t02067520751._1 | |
542 | 545 | let rewardToMainTreasuryAmount = (rewardAmountTotal - blockProcessingReward) | |
543 | 546 | let invested = valueOrElse(getInteger(factoryAddressOrFail, keyInvested(unit)), 0) | |
544 | 547 | let actions = [invoke(factoryAddressOrFail, "reissue", [lpAssetAmountTotal], nil), invoke(factoryAddressOrFail, "integerEntry", [keyNextBlockToProcess(), (nextBlockToProcess + blocksProcessingBatchSize)], nil), invoke(factoryAddressOrFail, "transferFromProxyTreasury", [mainTreasuryAddressOrFail.bytes, rewardToMainTreasuryAmount], nil), invoke(factoryAddressOrFail, "transferFromProxyTreasury", [userAddressBytes, blockProcessingReward], nil), invoke(factoryAddressOrFail, "integerEntry", [keyInvested(unit), (invested + rewardToMainTreasuryAmount)], nil)] | |
545 | 548 | if ((actions == actions)) | |
546 | 549 | then $Tuple2(nil, unit) | |
547 | 550 | else throw("Strict value is not equal to itself.") | |
548 | 551 | } | |
549 | 552 | else throw("Strict value is not equal to itself.") | |
550 | 553 | } | |
551 | 554 | else throw("Strict value is not equal to itself.") | |
552 | 555 | } | |
553 | 556 | ||
554 | 557 | ||
555 | 558 | @Verifier(tx) | |
556 | 559 | func verify () = { | |
557 | 560 | let publicKey = match getManagerPublicKeyOrUnit() { | |
558 | 561 | case pub: ByteVector => | |
559 | 562 | pub | |
560 | 563 | case _ => | |
561 | 564 | tx.senderPublicKey | |
562 | 565 | } | |
563 | 566 | sigVerify(tx.bodyBytes, tx.proofs[0], publicKey) | |
564 | 567 | } | |
565 | 568 |
github/deemru/w8io/169f3d6 118.11 ms ◑