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