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