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