tx · FtF2bR4vkEcAYznJEojvHBjTbdtSXf3GPcjJujzzRHMA

3N6HSS7Toat1RhyEsyqVGgVSRzH19W1FTbP:  -0.01200000 Waves

2023.06.09 12:14 [2614940] smart account 3N6HSS7Toat1RhyEsyqVGgVSRzH19W1FTbP > SELF 0.00000000 Waves

{ "type": 13, "id": "FtF2bR4vkEcAYznJEojvHBjTbdtSXf3GPcjJujzzRHMA", "fee": 1200000, "feeAssetId": null, "timestamp": 1686302085126, "version": 2, "chainId": 84, "sender": "3N6HSS7Toat1RhyEsyqVGgVSRzH19W1FTbP", "senderPublicKey": "AoKo4segKHU4DeJnxXQYJj2u7J6XJeux6r8KLW52cd2Q", "proofs": [ "51UobAr2Gp8BAqhAJM3HX1YAfYXXyHbZWxCygwXDE2WU5NzWkhCpjAsBWBRMqdzgb5G1dPtn8L6zEpFeEoAfbY4j" ], "script": "base64:BwIqCAISAwoBAhIGCgQBAQEBEgMKAQISAwoBAhIECgICAhIECgICAhIDCgECHgADU0VQAgJfXwANQ09OVFJBQ1RfTkFNRQIPY2FsY3VsYXRvci5yaWRlAAZTQ0FMRTgAgMLXLwAHUEVORElORwIHUEVORElORwAIRklOSVNIRUQCCEZJTklTSEVEAQd3cmFwRXJyAQFzCQCsAgIJAKwCAgUNQ09OVFJBQ1RfTkFNRQICOiAFAXMBCHRocm93RXJyAQFzCQACAQkBB3dyYXBFcnIBBQFzARFrZXlGYWN0b3J5QWRkcmVzcwAJALkJAgkAzAgCAgIlcwkAzAgCAgdmYWN0b3J5BQNuaWwFA1NFUAEMa2V5THBBc3NldElkAAkAuQkCCQDMCAICAiVzCQDMCAICCWxwQXNzZXRJZAUDbmlsBQNTRVABEmtleVRyZWFzdXJ5QWRkcmVzcwAJALkJAgkAzAgCAgIlcwkAzAgCAgh0cmVhc3VyeQUDbmlsBQNTRVABDGtleUF2YWlsYWJsZQELdXNlckFkZHJlc3MJALkJAgkAzAgCAgQlcyVzCQDMCAICCWF2YWlsYWJsZQkAzAgCCQClC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lBdmFpbGFibGUBBQlnZW5lcmF0b3IJAMwIAgkAZAIFCWF2YWlsYWJsZQUNbHBBc3NldEFtb3VudAUDbmlsBQNuaWwJAMwIAgkA/AcEBRRmYWN0b3J5QWRkcmVzc09yRmFpbAINdHJhbnNmZXJXYXZlcwkAzAgCBRB1c2VyQWRkcmVzc0J5dGVzCQDMCAIFG2Jsb2NrUHJvY2Vzc2luZ1Jld2FyZE9yRmFpbAUDbmlsBQNuaWwFA25pbAkAlAoCBQNuaWwFDmZhY3RvcnlBY3Rpb25zCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleajqA08=", "height": 2614940, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7JXzeDFWqgY2daX9NLoh4A2HbXQ7nigjVxcbGUFQU3Vh Next: G3AFXw36cGdNo4g61Ds1njQrrZrhGSA1VScd5uaThvJF Diff:
OldNewDifferences
172172 let claimed = valueOrElse(getInteger(factoryAddressOrFail, keyClaimed(userAddress)), 0)
173173 let factoryActions = if ((available > 0))
174174 then [invoke(factoryAddressOrFail, "transferAsset", [userAddressBytes, available, lpAssetIdOrFail], nil), invoke(factoryAddressOrFail, "integerEntry", [keyAvailable(userAddress), 0], nil), invoke(factoryAddressOrFail, "stringEntry", [keyClaimed(userAddress), (claimed + available)], nil)]
175- else nil
175+ else throwErr("nothing to claim")
176176 $Tuple2(nil, factoryActions)
177177 }
178178 else throw("Strict value is not equal to itself.")
271271 then {
272272 let userAddress = Address(userAddressBytes)
273273 let withdrawalRequestOption = valueOrErrorMessage(getString(factoryAddressOrFail, keyWithdrawalRequest(userAddress, txId)), wrapErr("invalid withdrawal request"))
274- let $t085798692 = parseWithdrawalRequestValueOrFail(withdrawalRequestOption)
275- let status = $t085798692._1
276- let lpAssetAmount = $t085798692._2
277- let targetPeriod = $t085798692._3
278- let claimTxId = $t085798692._4
274+ let $t086058718 = parseWithdrawalRequestValueOrFail(withdrawalRequestOption)
275+ let status = $t086058718._1
276+ let lpAssetAmount = $t086058718._2
277+ let targetPeriod = $t086058718._3
278+ let claimTxId = $t086058718._4
279279 if ((status == PENDING))
280280 then {
281281 let factoryActions = [invoke(factoryAddressOrFail, "deleteEntry", [keyWithdrawalRequest(userAddress, txId)], nil), invoke(factoryAddressOrFail, "transferAsset", [userAddressBytes, lpAssetAmount, lpAssetIdOrFail], nil)]
298298 let userAddress = Address(userAddressBytes)
299299 let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period"))
300300 let withdrawalRequestOption = valueOrErrorMessage(getString(factoryAddressOrFail, keyWithdrawalRequest(userAddress, txId)), wrapErr("invalid withdrawal request"))
301- let $t095639676 = parseWithdrawalRequestValueOrFail(withdrawalRequestOption)
302- let status = $t095639676._1
303- let lpAssetAmount = $t095639676._2
304- let targetPeriod = $t095639676._3
305- let claimTxId = $t095639676._4
301+ let $t095899702 = parseWithdrawalRequestValueOrFail(withdrawalRequestOption)
302+ let status = $t095899702._1
303+ let lpAssetAmount = $t095899702._2
304+ let targetPeriod = $t095899702._3
305+ let claimTxId = $t095899702._4
306306 if ((status == FINISHED))
307307 then throwErr("invalid withdrawal request status")
308308 else if ((targetPeriod > currentPeriodOrFail))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 7 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 let CONTRACT_NAME = "calculator.ride"
77
88 let SCALE8 = 100000000
99
1010 let PENDING = "PENDING"
1111
1212 let FINISHED = "FINISHED"
1313
1414 func wrapErr (s) = ((CONTRACT_NAME + ": ") + s)
1515
1616
1717 func throwErr (s) = throw(wrapErr(s))
1818
1919
2020 func keyFactoryAddress () = makeString(["%s", "factory"], SEP)
2121
2222
2323 func keyLpAssetId () = makeString(["%s", "lpAssetId"], SEP)
2424
2525
2626 func keyTreasuryAddress () = makeString(["%s", "treasury"], SEP)
2727
2828
2929 func keyAvailable (userAddress) = makeString(["%s%s", "available", toString(userAddress)], SEP)
3030
3131
3232 func keyClaimed (userAddress) = makeString(["%s%s", "claimed", toString(userAddress)], SEP)
3333
3434
3535 func keyCurrentPeriod () = makeString(["%s", "currentPeriod"], SEP)
3636
3737
3838 func keyPriceForPeriod (period) = makeString(["%s%d", "price", toString(period)], SEP)
3939
4040
4141 func keyStartHeight (period) = makeString(["%s%d", "startHeight", toString(period)], SEP)
4242
4343
4444 func keyPeriodLength () = "%s__periodLength"
4545
4646
4747 func keyBlockProcessingReward () = "%s__blockProcessingReward"
4848
4949
5050 func keyNextBlockToProcess () = "%s__nextBlockToProcess"
5151
5252
5353 func keyWithdrawalRequest (userAddress,txId) = makeString(["%s%s%s", "withdrawal", toString(userAddress), toBase58String(txId)], SEP)
5454
5555
5656 func valueWithdrawalRequest (status,lpAssetAmount,targetPeriod,claimTxId) = {
5757 let claimTxIdStr = match claimTxId {
5858 case b: ByteVector =>
5959 toBase58String(b)
6060 case _: Unit =>
6161 "SOON"
6262 case _ =>
6363 throw("Match error")
6464 }
6565 makeString(["%s%d%d%s", status, toString(lpAssetAmount), toString(targetPeriod), claimTxIdStr], SEP)
6666 }
6767
6868
6969 func parseWithdrawalRequestValueOrFail (s) = {
7070 let parts = split(s, SEP)
7171 if ((size(parts) == 5))
7272 then {
7373 let status = parts[1]
7474 let lpAssetAmount = valueOrErrorMessage(parseInt(parts[2]), wrapErr("invalid lpAssetAmount"))
7575 let targetPeriod = valueOrErrorMessage(parseInt(parts[3]), wrapErr("invalid targetPeriod"))
7676 let claimTxId = parts[4]
7777 $Tuple4(status, lpAssetAmount, targetPeriod, claimTxId)
7878 }
7979 else throwErr("invalid withdrawal request value")
8080 }
8181
8282
8383 let factoryAddressOption = match getString(this, keyFactoryAddress()) {
8484 case s: String =>
8585 addressFromString(s)
8686 case _: Unit =>
8787 unit
8888 case _ =>
8989 throw("Match error")
9090 }
9191
9292 let factoryAddressOrFail = valueOrErrorMessage(factoryAddressOption, wrapErr("invalid factory address"))
9393
9494 let lpAssetIdOption = match factoryAddressOption {
9595 case a: Address =>
9696 match getString(a, keyLpAssetId()) {
9797 case s: String =>
9898 fromBase58String(s)
9999 case _: Unit =>
100100 unit
101101 case _ =>
102102 throw("Match error")
103103 }
104104 case _: Unit =>
105105 unit
106106 case _ =>
107107 throw("Match error")
108108 }
109109
110110 let lpAssetIdOrFail = valueOrErrorMessage(lpAssetIdOption, wrapErr("invalid lpAssetId"))
111111
112112 let treasuryAddressOption = match factoryAddressOption {
113113 case a: Address =>
114114 match getString(a, keyTreasuryAddress()) {
115115 case s: String =>
116116 addressFromString(s)
117117 case _: Unit =>
118118 unit
119119 case _ =>
120120 throw("Match error")
121121 }
122122 case _: Unit =>
123123 unit
124124 case _ =>
125125 throw("Match error")
126126 }
127127
128128 let treasuryAddressOrFail = valueOrErrorMessage(treasuryAddressOption, wrapErr("invalid treasury address"))
129129
130130 func onlyAddress (i,address) = if ((i.caller == address))
131131 then true
132132 else throwErr("permission denied")
133133
134134
135135 func onlyFactory (i) = onlyAddress(i, factoryAddressOrFail)
136136
137137
138138 func rewardForOption (rewards,target) = {
139139 let s = size(rewards)
140140 let $t032473272 = rewards[0]
141141 let a0 = $t032473272._1
142142 let r0 = $t032473272._2
143143 let $t032753300 = rewards[1]
144144 let a1 = $t032753300._1
145145 let r1 = $t032753300._2
146146 let $t033033328 = rewards[2]
147147 let a2 = $t033033328._1
148148 let r2 = $t033033328._2
149149 if (if ((s > 0))
150150 then (a0 == target)
151151 else false)
152152 then r0
153153 else if (if ((s > 1))
154154 then (a1 == target)
155155 else false)
156156 then r1
157157 else if (if ((s > 2))
158158 then (a2 == target)
159159 else false)
160160 then r2
161161 else unit
162162 }
163163
164164
165165 @Callable(i)
166166 func claimLP (userAddressBytes) = {
167167 let checkCaller = onlyFactory(i)
168168 if ((checkCaller == checkCaller))
169169 then {
170170 let userAddress = Address(userAddressBytes)
171171 let available = valueOrElse(getInteger(factoryAddressOrFail, keyAvailable(userAddress)), 0)
172172 let claimed = valueOrElse(getInteger(factoryAddressOrFail, keyClaimed(userAddress)), 0)
173173 let factoryActions = if ((available > 0))
174174 then [invoke(factoryAddressOrFail, "transferAsset", [userAddressBytes, available, lpAssetIdOrFail], nil), invoke(factoryAddressOrFail, "integerEntry", [keyAvailable(userAddress), 0], nil), invoke(factoryAddressOrFail, "stringEntry", [keyClaimed(userAddress), (claimed + available)], nil)]
175- else nil
175+ else throwErr("nothing to claim")
176176 $Tuple2(nil, factoryActions)
177177 }
178178 else throw("Strict value is not equal to itself.")
179179 }
180180
181181
182182
183183 @Callable(i)
184184 func finalize (newTreasuryVolumeInWaves,xtnPrice,pwrManagersBonus,treasuryVolumeDiffAllocationCoef) = {
185185 let checks = [if ((i.originCaller == factoryAddressOrFail))
186186 then true
187187 else throwErr("permission denied"), if ((newTreasuryVolumeInWaves >= 0))
188188 then true
189189 else throwErr("invalid new treasury volume"), if ((xtnPrice >= 0))
190190 then true
191191 else throwErr("invalid XTN price"), if (if ((pwrManagersBonus >= 0))
192192 then (SCALE8 >= pwrManagersBonus)
193193 else false)
194194 then true
195195 else throwErr("invalid PWR managers bonus"), if (if ((treasuryVolumeDiffAllocationCoef >= -(SCALE8)))
196196 then (SCALE8 >= treasuryVolumeDiffAllocationCoef)
197197 else false)
198198 then true
199199 else throwErr("invalid treasury volume diff allocation coefficient")]
200200 if ((checks == checks))
201201 then {
202202 let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period"))
203203 let newPeriod = (currentPeriodOrFail + 1)
204204 let newPrice = SCALE8
205205 let lpAssetAmountToBurn = 0
206206 let factoryActions = [invoke(factoryAddressOrFail, "integerEntry", [keyCurrentPeriod(), newPeriod], nil), invoke(factoryAddressOrFail, "integerEntry", [keyPriceForPeriod(newPeriod), newPrice], nil), invoke(factoryAddressOrFail, "burn", [lpAssetAmountToBurn], nil)]
207207 $Tuple2(nil, factoryActions)
208208 }
209209 else throw("Strict value is not equal to itself.")
210210 }
211211
212212
213213
214214 @Callable(i)
215215 func invest (userAddressBytes) = {
216216 let checkCaller = onlyFactory(i)
217217 if ((checkCaller == checkCaller))
218218 then {
219219 let userAddress = Address(userAddressBytes)
220220 let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period"))
221221 let currentPriceOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPriceForPeriod(currentPeriodOrFail)), wrapErr("invalid price"))
222222 let payment = if ((size(i.payments) == 1))
223223 then i.payments[0]
224224 else throwErr("invalid payments")
225225 let paymentAmount = if (if ((payment.assetId == unit))
226226 then (payment.amount > 0)
227227 else false)
228228 then payment.amount
229229 else throwErr("invalid payment amount")
230230 let lpAssetAmount = if ((currentPriceOrFail > 0))
231231 then fraction(paymentAmount, SCALE8, currentPriceOrFail)
232232 else 0
233233 let factoryActions = [invoke(factoryAddressOrFail, "integerEntry", ["invested__WAVES", 0], nil), invoke(factoryAddressOrFail, "reissue", [lpAssetAmount], nil), invoke(factoryAddressOrFail, "transferAsset", [userAddressBytes, lpAssetAmount, lpAssetIdOrFail], nil), invoke(factoryAddressOrFail, "transferWaves", [treasuryAddressOrFail.bytes, paymentAmount], [AttachedPayment(unit, paymentAmount)])]
234234 $Tuple2(nil, factoryActions)
235235 }
236236 else throw("Strict value is not equal to itself.")
237237 }
238238
239239
240240
241241 @Callable(i)
242242 func withdraw (userAddressBytes) = {
243243 let checkCaller = onlyFactory(i)
244244 if ((checkCaller == checkCaller))
245245 then {
246246 let userAddress = Address(userAddressBytes)
247247 let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period"))
248248 let payment = if ((size(i.payments) == 1))
249249 then i.payments[0]
250250 else throwErr(wrapErr("invalid payments"))
251251 let paymentAssetId = if ((payment.assetId == lpAssetIdOrFail))
252252 then lpAssetIdOrFail
253253 else throwErr("invalid payment asset")
254254 let paymentAmount = if ((payment.amount > 0))
255255 then payment.amount
256256 else throwErr("invalid payment amount")
257257 let factoryActions = [invoke(factoryAddressOrFail, "stringEntry", [keyWithdrawalRequest(userAddress, i.transactionId), valueWithdrawalRequest(PENDING, paymentAmount, (currentPeriodOrFail + 1), unit)], nil)]
258258 if ((factoryActions == factoryActions))
259259 then $Tuple2([ScriptTransfer(factoryAddressOrFail, paymentAmount, paymentAssetId)], factoryActions)
260260 else throw("Strict value is not equal to itself.")
261261 }
262262 else throw("Strict value is not equal to itself.")
263263 }
264264
265265
266266
267267 @Callable(i)
268268 func cancelWithdraw (userAddressBytes,txId) = {
269269 let checkCaller = onlyFactory(i)
270270 if ((checkCaller == checkCaller))
271271 then {
272272 let userAddress = Address(userAddressBytes)
273273 let withdrawalRequestOption = valueOrErrorMessage(getString(factoryAddressOrFail, keyWithdrawalRequest(userAddress, txId)), wrapErr("invalid withdrawal request"))
274- let $t085798692 = parseWithdrawalRequestValueOrFail(withdrawalRequestOption)
275- let status = $t085798692._1
276- let lpAssetAmount = $t085798692._2
277- let targetPeriod = $t085798692._3
278- let claimTxId = $t085798692._4
274+ let $t086058718 = parseWithdrawalRequestValueOrFail(withdrawalRequestOption)
275+ let status = $t086058718._1
276+ let lpAssetAmount = $t086058718._2
277+ let targetPeriod = $t086058718._3
278+ let claimTxId = $t086058718._4
279279 if ((status == PENDING))
280280 then {
281281 let factoryActions = [invoke(factoryAddressOrFail, "deleteEntry", [keyWithdrawalRequest(userAddress, txId)], nil), invoke(factoryAddressOrFail, "transferAsset", [userAddressBytes, lpAssetAmount, lpAssetIdOrFail], nil)]
282282 if ((factoryActions == factoryActions))
283283 then $Tuple2(nil, factoryActions)
284284 else throw("Strict value is not equal to itself.")
285285 }
286286 else throwErr("invalid withdrawal request status")
287287 }
288288 else throw("Strict value is not equal to itself.")
289289 }
290290
291291
292292
293293 @Callable(i)
294294 func claimWaves (userAddressBytes,txId) = {
295295 let checkCaller = onlyFactory(i)
296296 if ((checkCaller == checkCaller))
297297 then {
298298 let userAddress = Address(userAddressBytes)
299299 let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period"))
300300 let withdrawalRequestOption = valueOrErrorMessage(getString(factoryAddressOrFail, keyWithdrawalRequest(userAddress, txId)), wrapErr("invalid withdrawal request"))
301- let $t095639676 = parseWithdrawalRequestValueOrFail(withdrawalRequestOption)
302- let status = $t095639676._1
303- let lpAssetAmount = $t095639676._2
304- let targetPeriod = $t095639676._3
305- let claimTxId = $t095639676._4
301+ let $t095899702 = parseWithdrawalRequestValueOrFail(withdrawalRequestOption)
302+ let status = $t095899702._1
303+ let lpAssetAmount = $t095899702._2
304+ let targetPeriod = $t095899702._3
305+ let claimTxId = $t095899702._4
306306 if ((status == FINISHED))
307307 then throwErr("invalid withdrawal request status")
308308 else if ((targetPeriod > currentPeriodOrFail))
309309 then throwErr("invalid withdrawal request period")
310310 else {
311311 let currentPriceOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPriceForPeriod(currentPeriodOrFail)), wrapErr("invalid price"))
312312 let amount = if ((currentPriceOrFail > 0))
313313 then fraction(lpAssetAmount, currentPriceOrFail, SCALE8)
314314 else 0
315315 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)]
316316 $Tuple2(nil, factoryActions)
317317 }
318318 }
319319 else throw("Strict value is not equal to itself.")
320320 }
321321
322322
323323
324324 @Callable(i)
325325 func processBlocks (userAddressBytes) = {
326326 let checkCaller = onlyFactory(i)
327327 if ((checkCaller == checkCaller))
328328 then {
329329 let userAddress = Address(userAddressBytes)
330330 let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period"))
331331 let periodLength = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPeriodLength()), wrapErr("invalid period length"))
332332 let currentStartHeight = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyStartHeight(currentPeriodOrFail)), wrapErr("invalid start height"))
333333 let currentPriceOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPriceForPeriod(currentPeriodOrFail)), wrapErr("invalid price"))
334334 let nextBlockToProcess = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyNextBlockToProcess()), wrapErr("invalid next block to process"))
335335 let targetBlockInfo = if (if (if ((height >= nextBlockToProcess))
336336 then if ((nextBlockToProcess >= currentStartHeight))
337337 then true
338338 else (currentPeriodOrFail == 0)
339339 else false)
340340 then ((currentStartHeight + periodLength) > nextBlockToProcess)
341341 else false)
342342 then valueOrErrorMessage(blockInfoByHeight(nextBlockToProcess), wrapErr("invalid block info"))
343343 else throwErr(wrapErr("invalid target block"))
344344 let treasuryRewardOrFail = valueOrErrorMessage(rewardForOption(targetBlockInfo.rewards, treasuryAddressOrFail), wrapErr("invalid treasury reward"))
345345 let generator = targetBlockInfo.generator
346346 let blockProcessingRewardOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyBlockProcessingReward()), wrapErr("invalid block processing reward"))
347347 let available = valueOrElse(getInteger(factoryAddressOrFail, keyAvailable(generator)), 0)
348348 let lpAssetAmount = if ((currentPriceOrFail > 0))
349349 then fraction((treasuryRewardOrFail - blockProcessingRewardOrFail), SCALE8, currentPriceOrFail)
350350 else 0
351351 let factoryActions = [invoke(factoryAddressOrFail, "integerEntry", [keyNextBlockToProcess(), (nextBlockToProcess + 1)], nil), invoke(factoryAddressOrFail, "integerEntry", [keyAvailable(generator), (available + lpAssetAmount)], nil), invoke(factoryAddressOrFail, "transferWaves", [userAddressBytes, blockProcessingRewardOrFail], nil)]
352352 $Tuple2(nil, factoryActions)
353353 }
354354 else throw("Strict value is not equal to itself.")
355355 }
356356
357357
358358 @Verifier(tx)
359359 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
360360

github/deemru/w8io/169f3d6 
64.44 ms