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