tx · DZYiVb1nMQ2pJKqCDRp2LPatLbdkTKBQfZLMcZxya4wv 3N4QFkEYPsR9D54c1pHRQzqRARjubXcbGuA: -0.02500000 Waves 2023.07.05 16:15 [2652661] smart account 3N4QFkEYPsR9D54c1pHRQzqRARjubXcbGuA > SELF 0.00000000 Waves
{ "type": 13, "id": "DZYiVb1nMQ2pJKqCDRp2LPatLbdkTKBQfZLMcZxya4wv", "fee": 2500000, "feeAssetId": null, "timestamp": 1688562969265, "version": 1, "sender": "3N4QFkEYPsR9D54c1pHRQzqRARjubXcbGuA", "senderPublicKey": "8nr9XxGKmrRg6E6Zss6YPynBYEFbCf39Z2D9WvVuUgzY", "proofs": [ "5yVBiAFtspnkgXoqo46Fwf49zZ45E8xM2joHFJTJA1umEnDddDA28a4oyYxojP3qdnJXvhK9Yy7u6DjYhb2LfskA" ], "script": "base64:BwIqCAISAwoBAhIGCgQCAQEBEgMKAQISAwoBAhIECgICAhIECgICAhIDCgECKgADU0VQAgJfXwANQ09OVFJBQ1RfTkFNRQIPY2FsY3VsYXRvci5yaWRlAAZTQ0FMRTgAgMLXLwAHUEVORElORwIHUEVORElORwAIRklOSVNIRUQCCEZJTklTSEVEAAVXQVZFUwIFV0FWRVMBB3dyYXBFcnIBAXMJAKwCAgkArAICBQ1DT05UUkFDVF9OQU1FAgI6IAUBcwEIdGhyb3dFcnIBAXMJAAIBCQEHd3JhcEVycgEFAXMBD2Fzc2V0SWRUb1N0cmluZwEHYXNzZXRJZAQHJG1hdGNoMAUHYXNzZXRJZAMJAAECBQckbWF0Y2gwAgpCeXRlVmVjdG9yBAFiBQckbWF0Y2gwCQDYBAEFAWIDCQABAgUHJG1hdGNoMAIEVW5pdAUFV0FWRVMJAAIBAgtNYXRjaCBlcnJvcgEDYWJzAQFuAwkAZgIAAAUBbgkBAS0BBQFuBQFuARFrZXlGYWN0b3J5QWRkcmVzcwAJALkJAgkAzAgCAgIlcwkAzAgCAgdmYWN0b3J5BQNuaWwFA1NFUAETa2V5T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:
Old | New | Differences | |
---|---|---|---|
305 | 305 | let newPeriod = (currentPeriodOrFail + 1) | |
306 | 306 | let lpAssetQuantity = valueOrErrorMessage(assetInfo(lpAssetIdOrFail), wrapErr("invalid lpAsset info")).quantity | |
307 | 307 | let newPrice = fraction(investedWavesAmountNew, SCALE8, lpAssetQuantity) | |
308 | - | let lpAssetAmountToBurn = valueOrElse(getInteger(factoryAddressOrFail, keyWithdrawal()), 0) | |
309 | - | let paymentAmountMin = max([0, fraction(lpAssetAmountToBurn, newPrice, SCALE8)]) | |
310 | - | let paymentOption = if ((size(i.payments) > 0)) | |
311 | - | then i.payments[0] | |
312 | - | else unit | |
313 | - | let paymentAmount = value(paymentOption).amount | |
314 | - | let paymentAssetId = value(paymentOption).assetId | |
315 | - | let checkPayment = if (if ((paymentAmountMin == 0)) | |
308 | + | let checkIfPriceNotZero = if ((newPrice != 0)) | |
316 | 309 | then true | |
317 | - | else if (if ((paymentOption != unit)) | |
318 | - | then (paymentAssetId == unit) | |
319 | - | else false) | |
320 | - | then (paymentAmount >= paymentAmountMin) | |
321 | - | else false) | |
322 | - | then true | |
323 | - | else throwErr(("invalid payments, payment amount min: " + toString(paymentAmountMin))) | |
324 | - | if ((checkPayment == checkPayment)) | |
310 | + | else throwErr("LP price cannot be 0") | |
311 | + | if ((checkIfPriceNotZero == checkIfPriceNotZero)) | |
325 | 312 | then { | |
326 | - | let checkIfPriceNotZero = if ((newPrice != 0)) | |
313 | + | let lpAssetAmountToBurn = valueOrElse(getInteger(factoryAddressOrFail, keyWithdrawal()), 0) | |
314 | + | let paymentAmountMin = max([0, fraction(lpAssetAmountToBurn, newPrice, SCALE8)]) | |
315 | + | let paymentOption = if ((size(i.payments) > 0)) | |
316 | + | then i.payments[0] | |
317 | + | else unit | |
318 | + | let paymentAmount = value(paymentOption).amount | |
319 | + | let paymentAssetId = value(paymentOption).assetId | |
320 | + | let checkPayment = if (if ((paymentAmountMin == 0)) | |
327 | 321 | then true | |
328 | - | else throwErr("LP price cannot be 0") | |
329 | - | if ((checkIfPriceNotZero == checkIfPriceNotZero)) | |
322 | + | else if (if ((paymentOption != unit)) | |
323 | + | then (paymentAssetId == unit) | |
324 | + | else false) | |
325 | + | then (paymentAmount >= paymentAmountMin) | |
326 | + | else false) | |
327 | + | then true | |
328 | + | else throwErr(("invalid payments, payment amount min: " + toString(paymentAmountMin))) | |
329 | + | if ((checkPayment == checkPayment)) | |
330 | 330 | then { | |
331 | 331 | let actions = if ((paymentOption != unit)) | |
332 | 332 | then [ScriptTransfer(factoryAddressOrFail, paymentAmount, paymentAssetId)] | |
333 | 333 | 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], nil), invoke(factoryAddressOrFail, "integerEntry", [keyDonated(unit), donatedWavesAmountNew], 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)] | |
335 | 335 | $Tuple2(actions, factoryActions) | |
336 | 336 | } | |
337 | 337 | else throw("Strict value is not equal to itself.") | |
356 | 356 | let payment = if ((size(i.payments) == 1)) | |
357 | 357 | then i.payments[0] | |
358 | 358 | else throwErr("invalid payments") | |
359 | - | let $ | |
359 | + | let $t01169511872 = if (if ((payment.assetId == unit)) | |
360 | 360 | then (payment.amount > 0) | |
361 | 361 | else false) | |
362 | 362 | then $Tuple2(payment.amount, payment.assetId) | |
363 | 363 | else throwErr("invalid payment amount") | |
364 | - | let paymentAmount = $ | |
365 | - | let paymentAssetId = $ | |
364 | + | let paymentAmount = $t01169511872._1 | |
365 | + | let paymentAssetId = $t01169511872._2 | |
366 | 366 | let lpAssetAmount = if ((currentPriceOrFail > 0)) | |
367 | 367 | then fraction(paymentAmount, SCALE8, currentPriceOrFail) | |
368 | 368 | else 0 | |
412 | 412 | let userAddress = Address(userAddressBytes) | |
413 | 413 | let withdrawalRequestOption = valueOrErrorMessage(getString(factoryAddressOrFail, keyWithdrawalRequest(userAddress, txId)), wrapErr("invalid withdrawal request")) | |
414 | 414 | let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period")) | |
415 | - | let $ | |
416 | - | let status = $ | |
417 | - | let lpAssetAmount = $ | |
418 | - | let targetPeriod = $ | |
419 | - | let claimTxId = $ | |
415 | + | let $t01427914392 = parseWithdrawalRequestValueOrFail(withdrawalRequestOption) | |
416 | + | let status = $t01427914392._1 | |
417 | + | let lpAssetAmount = $t01427914392._2 | |
418 | + | let targetPeriod = $t01427914392._3 | |
419 | + | let claimTxId = $t01427914392._4 | |
420 | 420 | let checks = [if ((status == PENDING)) | |
421 | 421 | then true | |
422 | 422 | else throwErr("invalid withdrawal request status"), if ((targetPeriod > currentPeriodOrFail)) | |
447 | 447 | let userAddress = Address(userAddressBytes) | |
448 | 448 | let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period")) | |
449 | 449 | 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 = $ | |
450 | + | let $t01572415837 = parseWithdrawalRequestValueOrFail(withdrawalRequestOption) | |
451 | + | let status = $t01572415837._1 | |
452 | + | let lpAssetAmount = $t01572415837._2 | |
453 | + | let targetPeriod = $t01572415837._3 | |
454 | + | let claimTxId = $t01572415837._4 | |
455 | 455 | if ((status == FINISHED)) | |
456 | 456 | then throwErr("invalid withdrawal request status") | |
457 | 457 | else if ((targetPeriod > currentPeriodOrFail)) | |
512 | 512 | 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 | 513 | if ((factoryActionsSingle == factoryActionsSingle)) | |
514 | 514 | then { | |
515 | - | let $ | |
516 | - | let lpAssetAcc = $ | |
517 | - | let rewardAcc = $ | |
515 | + | let $t02007320106 = acc | |
516 | + | let lpAssetAcc = $t02007320106._1 | |
517 | + | let rewardAcc = $t02007320106._2 | |
518 | 518 | $Tuple2((lpAssetAcc + lpAssetAmount), (rewardAcc + treasuryRewardOrFail)) | |
519 | 519 | } | |
520 | 520 | else throw("Strict value is not equal to itself.") | |
521 | 521 | } | |
522 | 522 | ||
523 | 523 | 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 $ | |
524 | + | let $t02037320449 = { | |
525 | 525 | let $l = list | |
526 | 526 | let $s = size($l) | |
527 | 527 | let $acc0 = $Tuple2(0, 0) | |
535 | 535 | ||
536 | 536 | $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 | 537 | } | |
538 | - | if (($ | |
538 | + | if (($t02037320449 == $t02037320449)) | |
539 | 539 | then { | |
540 | - | let rewardAmountTotal = $ | |
541 | - | let lpAssetAmountTotal = $ | |
540 | + | let rewardAmountTotal = $t02037320449._2 | |
541 | + | let lpAssetAmountTotal = $t02037320449._1 | |
542 | 542 | let rewardToMainTreasuryAmount = (rewardAmountTotal - blockProcessingReward) | |
543 | 543 | let invested = valueOrElse(getInteger(factoryAddressOrFail, keyInvested(unit)), 0) | |
544 | 544 | 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 donatedWavesAmountNewRaw = (donatedWavesAmount + donationProfitPart) | |
300 | 300 | let investedWavesAmountNewRaw = (investedWavesAmount + investmentProfitPart) | |
301 | 301 | let donatedPartDebt = min([0, donatedWavesAmountNewRaw]) | |
302 | 302 | let investedPartDebt = min([0, investedWavesAmountNewRaw]) | |
303 | 303 | let donatedWavesAmountNew = (max([0, donatedWavesAmountNewRaw]) + investedPartDebt) | |
304 | 304 | let investedWavesAmountNew = (max([0, investedWavesAmountNewRaw]) + donatedPartDebt) | |
305 | 305 | let newPeriod = (currentPeriodOrFail + 1) | |
306 | 306 | let lpAssetQuantity = valueOrErrorMessage(assetInfo(lpAssetIdOrFail), wrapErr("invalid lpAsset info")).quantity | |
307 | 307 | let newPrice = fraction(investedWavesAmountNew, SCALE8, lpAssetQuantity) | |
308 | - | let lpAssetAmountToBurn = valueOrElse(getInteger(factoryAddressOrFail, keyWithdrawal()), 0) | |
309 | - | let paymentAmountMin = max([0, fraction(lpAssetAmountToBurn, newPrice, SCALE8)]) | |
310 | - | let paymentOption = if ((size(i.payments) > 0)) | |
311 | - | then i.payments[0] | |
312 | - | else unit | |
313 | - | let paymentAmount = value(paymentOption).amount | |
314 | - | let paymentAssetId = value(paymentOption).assetId | |
315 | - | let checkPayment = if (if ((paymentAmountMin == 0)) | |
308 | + | let checkIfPriceNotZero = if ((newPrice != 0)) | |
316 | 309 | then true | |
317 | - | else if (if ((paymentOption != unit)) | |
318 | - | then (paymentAssetId == unit) | |
319 | - | else false) | |
320 | - | then (paymentAmount >= paymentAmountMin) | |
321 | - | else false) | |
322 | - | then true | |
323 | - | else throwErr(("invalid payments, payment amount min: " + toString(paymentAmountMin))) | |
324 | - | if ((checkPayment == checkPayment)) | |
310 | + | else throwErr("LP price cannot be 0") | |
311 | + | if ((checkIfPriceNotZero == checkIfPriceNotZero)) | |
325 | 312 | then { | |
326 | - | let checkIfPriceNotZero = if ((newPrice != 0)) | |
313 | + | let lpAssetAmountToBurn = valueOrElse(getInteger(factoryAddressOrFail, keyWithdrawal()), 0) | |
314 | + | let paymentAmountMin = max([0, fraction(lpAssetAmountToBurn, newPrice, SCALE8)]) | |
315 | + | let paymentOption = if ((size(i.payments) > 0)) | |
316 | + | then i.payments[0] | |
317 | + | else unit | |
318 | + | let paymentAmount = value(paymentOption).amount | |
319 | + | let paymentAssetId = value(paymentOption).assetId | |
320 | + | let checkPayment = if (if ((paymentAmountMin == 0)) | |
327 | 321 | then true | |
328 | - | else throwErr("LP price cannot be 0") | |
329 | - | if ((checkIfPriceNotZero == checkIfPriceNotZero)) | |
322 | + | else if (if ((paymentOption != unit)) | |
323 | + | then (paymentAssetId == unit) | |
324 | + | else false) | |
325 | + | then (paymentAmount >= paymentAmountMin) | |
326 | + | else false) | |
327 | + | then true | |
328 | + | else throwErr(("invalid payments, payment amount min: " + toString(paymentAmountMin))) | |
329 | + | if ((checkPayment == checkPayment)) | |
330 | 330 | then { | |
331 | 331 | let actions = if ((paymentOption != unit)) | |
332 | 332 | then [ScriptTransfer(factoryAddressOrFail, paymentAmount, paymentAssetId)] | |
333 | 333 | 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], nil), invoke(factoryAddressOrFail, "integerEntry", [keyDonated(unit), donatedWavesAmountNew], 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)] | |
335 | 335 | $Tuple2(actions, factoryActions) | |
336 | 336 | } | |
337 | 337 | else throw("Strict value is not equal to itself.") | |
338 | 338 | } | |
339 | 339 | else throw("Strict value is not equal to itself.") | |
340 | 340 | } | |
341 | 341 | else throw("Strict value is not equal to itself.") | |
342 | 342 | } | |
343 | 343 | else throw("Strict value is not equal to itself.") | |
344 | 344 | } | |
345 | 345 | ||
346 | 346 | ||
347 | 347 | ||
348 | 348 | @Callable(i) | |
349 | 349 | func invest (userAddressBytes) = { | |
350 | 350 | let checkCaller = onlyFactory(i) | |
351 | 351 | if ((checkCaller == checkCaller)) | |
352 | 352 | then { | |
353 | 353 | let userAddress = Address(userAddressBytes) | |
354 | 354 | let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period")) | |
355 | 355 | let currentPriceOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPriceForPeriod(currentPeriodOrFail)), wrapErr("invalid price")) | |
356 | 356 | let payment = if ((size(i.payments) == 1)) | |
357 | 357 | then i.payments[0] | |
358 | 358 | else throwErr("invalid payments") | |
359 | - | let $ | |
359 | + | let $t01169511872 = if (if ((payment.assetId == unit)) | |
360 | 360 | then (payment.amount > 0) | |
361 | 361 | else false) | |
362 | 362 | then $Tuple2(payment.amount, payment.assetId) | |
363 | 363 | else throwErr("invalid payment amount") | |
364 | - | let paymentAmount = $ | |
365 | - | let paymentAssetId = $ | |
364 | + | let paymentAmount = $t01169511872._1 | |
365 | + | let paymentAssetId = $t01169511872._2 | |
366 | 366 | let lpAssetAmount = if ((currentPriceOrFail > 0)) | |
367 | 367 | then fraction(paymentAmount, SCALE8, currentPriceOrFail) | |
368 | 368 | else 0 | |
369 | 369 | let invested = valueOrElse(getInteger(factoryAddressOrFail, keyInvested(unit)), 0) | |
370 | 370 | let actions = [ScriptTransfer(mainTreasuryAddressOrFail, paymentAmount, paymentAssetId)] | |
371 | 371 | let factoryActions = [invoke(factoryAddressOrFail, "integerEntry", [keyInvested(unit), (invested + paymentAmount)], nil), invoke(factoryAddressOrFail, "reissue", [lpAssetAmount], nil), invoke(factoryAddressOrFail, "transferAsset", [userAddressBytes, lpAssetAmount, lpAssetIdOrFail], nil)] | |
372 | 372 | $Tuple2(actions, factoryActions) | |
373 | 373 | } | |
374 | 374 | else throw("Strict value is not equal to itself.") | |
375 | 375 | } | |
376 | 376 | ||
377 | 377 | ||
378 | 378 | ||
379 | 379 | @Callable(i) | |
380 | 380 | func withdraw (userAddressBytes) = { | |
381 | 381 | let checkCaller = onlyFactory(i) | |
382 | 382 | if ((checkCaller == checkCaller)) | |
383 | 383 | then { | |
384 | 384 | let userAddress = Address(userAddressBytes) | |
385 | 385 | let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period")) | |
386 | 386 | let payment = if ((size(i.payments) == 1)) | |
387 | 387 | then i.payments[0] | |
388 | 388 | else throwErr(wrapErr("invalid payments")) | |
389 | 389 | let paymentAssetId = if ((payment.assetId == lpAssetIdOrFail)) | |
390 | 390 | then lpAssetIdOrFail | |
391 | 391 | else throwErr("invalid payment asset") | |
392 | 392 | let paymentAmount = if ((payment.amount > 0)) | |
393 | 393 | then payment.amount | |
394 | 394 | else throwErr("invalid payment amount") | |
395 | 395 | let withdrawal = valueOrElse(getInteger(factoryAddressOrFail, keyWithdrawal()), 0) | |
396 | 396 | let actions = [ScriptTransfer(factoryAddressOrFail, paymentAmount, paymentAssetId)] | |
397 | 397 | let factoryActions = [invoke(factoryAddressOrFail, "integerEntry", [keyWithdrawal(), (withdrawal + paymentAmount)], nil), invoke(factoryAddressOrFail, "stringEntry", [keyWithdrawalRequest(userAddress, i.transactionId), valueWithdrawalRequest(PENDING, paymentAmount, (currentPeriodOrFail + 1), unit)], nil)] | |
398 | 398 | if ((factoryActions == factoryActions)) | |
399 | 399 | then $Tuple2(actions, factoryActions) | |
400 | 400 | else throw("Strict value is not equal to itself.") | |
401 | 401 | } | |
402 | 402 | else throw("Strict value is not equal to itself.") | |
403 | 403 | } | |
404 | 404 | ||
405 | 405 | ||
406 | 406 | ||
407 | 407 | @Callable(i) | |
408 | 408 | func cancelWithdraw (userAddressBytes,txId) = { | |
409 | 409 | let checkCaller = onlyFactory(i) | |
410 | 410 | if ((checkCaller == checkCaller)) | |
411 | 411 | then { | |
412 | 412 | let userAddress = Address(userAddressBytes) | |
413 | 413 | let withdrawalRequestOption = valueOrErrorMessage(getString(factoryAddressOrFail, keyWithdrawalRequest(userAddress, txId)), wrapErr("invalid withdrawal request")) | |
414 | 414 | let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period")) | |
415 | - | let $ | |
416 | - | let status = $ | |
417 | - | let lpAssetAmount = $ | |
418 | - | let targetPeriod = $ | |
419 | - | let claimTxId = $ | |
415 | + | let $t01427914392 = parseWithdrawalRequestValueOrFail(withdrawalRequestOption) | |
416 | + | let status = $t01427914392._1 | |
417 | + | let lpAssetAmount = $t01427914392._2 | |
418 | + | let targetPeriod = $t01427914392._3 | |
419 | + | let claimTxId = $t01427914392._4 | |
420 | 420 | let checks = [if ((status == PENDING)) | |
421 | 421 | then true | |
422 | 422 | else throwErr("invalid withdrawal request status"), if ((targetPeriod > currentPeriodOrFail)) | |
423 | 423 | then true | |
424 | 424 | else throwErr("invalid withdrawal request period")] | |
425 | 425 | if ((checks == checks)) | |
426 | 426 | then { | |
427 | 427 | let withdrawal = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyWithdrawal()), wrapErr("invalid total withdrawal amount")) | |
428 | 428 | let factoryActions = [invoke(factoryAddressOrFail, "integerEntry", [keyWithdrawal(), if ((withdrawal >= lpAssetAmount)) | |
429 | 429 | then (withdrawal - lpAssetAmount) | |
430 | 430 | else throwErr("invalid withdrawal amount")], nil), invoke(factoryAddressOrFail, "deleteEntry", [keyWithdrawalRequest(userAddress, txId)], nil), invoke(factoryAddressOrFail, "transferAsset", [userAddressBytes, lpAssetAmount, lpAssetIdOrFail], nil)] | |
431 | 431 | if ((factoryActions == factoryActions)) | |
432 | 432 | then $Tuple2(nil, factoryActions) | |
433 | 433 | else throw("Strict value is not equal to itself.") | |
434 | 434 | } | |
435 | 435 | else throw("Strict value is not equal to itself.") | |
436 | 436 | } | |
437 | 437 | else throw("Strict value is not equal to itself.") | |
438 | 438 | } | |
439 | 439 | ||
440 | 440 | ||
441 | 441 | ||
442 | 442 | @Callable(i) | |
443 | 443 | func claimWaves (userAddressBytes,txId) = { | |
444 | 444 | let checkCaller = onlyFactory(i) | |
445 | 445 | if ((checkCaller == checkCaller)) | |
446 | 446 | then { | |
447 | 447 | let userAddress = Address(userAddressBytes) | |
448 | 448 | let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period")) | |
449 | 449 | 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 = $ | |
450 | + | let $t01572415837 = parseWithdrawalRequestValueOrFail(withdrawalRequestOption) | |
451 | + | let status = $t01572415837._1 | |
452 | + | let lpAssetAmount = $t01572415837._2 | |
453 | + | let targetPeriod = $t01572415837._3 | |
454 | + | let claimTxId = $t01572415837._4 | |
455 | 455 | if ((status == FINISHED)) | |
456 | 456 | then throwErr("invalid withdrawal request status") | |
457 | 457 | else if ((targetPeriod > currentPeriodOrFail)) | |
458 | 458 | then throwErr("invalid withdrawal request period") | |
459 | 459 | else { | |
460 | 460 | let priceOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPriceForPeriod(targetPeriod)), wrapErr("invalid price")) | |
461 | 461 | let amount = if ((priceOrFail > 0)) | |
462 | 462 | then fraction(lpAssetAmount, priceOrFail, SCALE8) | |
463 | 463 | else 0 | |
464 | 464 | let factoryActions = [invoke(factoryAddressOrFail, "stringEntry", [keyWithdrawalRequest(userAddress, txId), valueWithdrawalRequest(FINISHED, lpAssetAmount, targetPeriod, i.transactionId)], nil), invoke(factoryAddressOrFail, "transferWaves", [userAddressBytes, amount], nil)] | |
465 | 465 | $Tuple2(nil, factoryActions) | |
466 | 466 | } | |
467 | 467 | } | |
468 | 468 | else throw("Strict value is not equal to itself.") | |
469 | 469 | } | |
470 | 470 | ||
471 | 471 | ||
472 | 472 | ||
473 | 473 | @Callable(i) | |
474 | 474 | func processBlocks (userAddressBytes) = { | |
475 | 475 | let checkCaller = onlyFactory(i) | |
476 | 476 | if ((checkCaller == checkCaller)) | |
477 | 477 | then { | |
478 | 478 | let userAddress = Address(userAddressBytes) | |
479 | 479 | let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period")) | |
480 | 480 | let periodLength = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPeriodLength()), wrapErr("invalid period length")) | |
481 | 481 | let currentStartHeight = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyStartHeight(currentPeriodOrFail)), wrapErr("invalid start height")) | |
482 | 482 | let currentPriceOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPriceForPeriod(currentPeriodOrFail)), wrapErr("invalid price")) | |
483 | 483 | let nextBlockToProcess = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyNextBlockToProcess()), wrapErr("invalid next block to process")) | |
484 | 484 | let periodEndHeight = ((currentStartHeight + periodLength) - 1) | |
485 | 485 | let blocksProcessingBatchSizeMax = 40 | |
486 | 486 | let blocksProcessingBatchSize = if (if (if ((height >= nextBlockToProcess)) | |
487 | 487 | then if ((nextBlockToProcess >= currentStartHeight)) | |
488 | 488 | then true | |
489 | 489 | else (currentPeriodOrFail == 0) | |
490 | 490 | else false) | |
491 | 491 | then (periodEndHeight >= nextBlockToProcess) | |
492 | 492 | else false) | |
493 | 493 | then min([((periodEndHeight - nextBlockToProcess) + 1), blocksProcessingBatchSizeMax]) | |
494 | 494 | else throwErr(wrapErr("invalid target block")) | |
495 | 495 | let blockProcessingReward = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyBlockProcessingReward()), wrapErr("invalid block processing reward")) | |
496 | 496 | let blockProcessingRewardByGenerator = (blockProcessingReward / blocksProcessingBatchSize) | |
497 | 497 | let blockProcessingRewardByGeneratorRemainder = (blockProcessingReward - (blockProcessingRewardByGenerator * blocksProcessingBatchSize)) | |
498 | 498 | func map (acc,inc) = if ((inc >= blocksProcessingBatchSize)) | |
499 | 499 | then acc | |
500 | 500 | else { | |
501 | 501 | let targetBlockHeight = (nextBlockToProcess + inc) | |
502 | 502 | let targetBlockInfo = valueOrErrorMessage(blockInfoByHeight(targetBlockHeight), wrapErr("invalid block info")) | |
503 | 503 | let treasuryRewardOrFail = valueOrErrorMessage(rewardForOption(targetBlockInfo.rewards, proxyTreasuryAddressOrFail), wrapErr(("invalid treasury reward for height " + toString(targetBlockHeight)))) | |
504 | 504 | let generator = targetBlockInfo.generator | |
505 | 505 | let available = valueOrElse(getInteger(factoryAddressOrFail, keyAvailable(generator)), 0) | |
506 | 506 | let callerReward = if ((inc == (blocksProcessingBatchSize - 1))) | |
507 | 507 | then (blockProcessingRewardByGenerator + blockProcessingRewardByGeneratorRemainder) | |
508 | 508 | else blockProcessingRewardByGenerator | |
509 | 509 | let lpAssetAmount = if ((currentPriceOrFail > 0)) | |
510 | 510 | then fraction((treasuryRewardOrFail - callerReward), SCALE8, currentPriceOrFail) | |
511 | 511 | else 0 | |
512 | 512 | 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 | 513 | if ((factoryActionsSingle == factoryActionsSingle)) | |
514 | 514 | then { | |
515 | - | let $ | |
516 | - | let lpAssetAcc = $ | |
517 | - | let rewardAcc = $ | |
515 | + | let $t02007320106 = acc | |
516 | + | let lpAssetAcc = $t02007320106._1 | |
517 | + | let rewardAcc = $t02007320106._2 | |
518 | 518 | $Tuple2((lpAssetAcc + lpAssetAmount), (rewardAcc + treasuryRewardOrFail)) | |
519 | 519 | } | |
520 | 520 | else throw("Strict value is not equal to itself.") | |
521 | 521 | } | |
522 | 522 | ||
523 | 523 | 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 $ | |
524 | + | let $t02037320449 = { | |
525 | 525 | let $l = list | |
526 | 526 | let $s = size($l) | |
527 | 527 | let $acc0 = $Tuple2(0, 0) | |
528 | 528 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
529 | 529 | then $a | |
530 | 530 | else map($a, $l[$i]) | |
531 | 531 | ||
532 | 532 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
533 | 533 | then $a | |
534 | 534 | else throw("List size exceeds 40") | |
535 | 535 | ||
536 | 536 | $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 | 537 | } | |
538 | - | if (($ | |
538 | + | if (($t02037320449 == $t02037320449)) | |
539 | 539 | then { | |
540 | - | let rewardAmountTotal = $ | |
541 | - | let lpAssetAmountTotal = $ | |
540 | + | let rewardAmountTotal = $t02037320449._2 | |
541 | + | let lpAssetAmountTotal = $t02037320449._1 | |
542 | 542 | let rewardToMainTreasuryAmount = (rewardAmountTotal - blockProcessingReward) | |
543 | 543 | let invested = valueOrElse(getInteger(factoryAddressOrFail, keyInvested(unit)), 0) | |
544 | 544 | 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 | 545 | if ((actions == actions)) | |
546 | 546 | then $Tuple2(nil, unit) | |
547 | 547 | else throw("Strict value is not equal to itself.") | |
548 | 548 | } | |
549 | 549 | else throw("Strict value is not equal to itself.") | |
550 | 550 | } | |
551 | 551 | else throw("Strict value is not equal to itself.") | |
552 | 552 | } | |
553 | 553 | ||
554 | 554 | ||
555 | 555 | @Verifier(tx) | |
556 | 556 | func verify () = { | |
557 | 557 | let publicKey = match getManagerPublicKeyOrUnit() { | |
558 | 558 | case pub: ByteVector => | |
559 | 559 | pub | |
560 | 560 | case _ => | |
561 | 561 | tx.senderPublicKey | |
562 | 562 | } | |
563 | 563 | sigVerify(tx.bodyBytes, tx.proofs[0], publicKey) | |
564 | 564 | } | |
565 | 565 |
github/deemru/w8io/026f985 81.86 ms ◑