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