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