tx · GGfNRyb2Jq2rjishgH4p2bBw8zubDfr5KvzLeZwqvnQm

3N6HSS7Toat1RhyEsyqVGgVSRzH19W1FTbP:  -0.00500000 Waves

2023.12.07 09:54 [2875896] smart account 3N6HSS7Toat1RhyEsyqVGgVSRzH19W1FTbP > SELF 0.00000000 Waves

{ "type": 13, "id": "GGfNRyb2Jq2rjishgH4p2bBw8zubDfr5KvzLeZwqvnQm", "fee": 500000, "feeAssetId": null, "timestamp": 1701932101310, "version": 1, "sender": "3N6HSS7Toat1RhyEsyqVGgVSRzH19W1FTbP", "senderPublicKey": "AoKo4segKHU4DeJnxXQYJj2u7J6XJeux6r8KLW52cd2Q", "proofs": [ "3VaJCh49F28o4ZGF4PQLj3VNLVjdhwGcDYuYS71tapWi2WPHaxttKausztpLgDNVpkS8uhM6AfYJqes6JqStYkBJ" ], "script": "base64:AAIFAAAAAAAAAAQIAhIAAAAAAAAAAAEAAAABaQEAAAAEY2FsbAAAAAAEAAAABWFzc2V0CQAEQwAAAAcCAAAABUFzc2V0AgAAAAAAAAAAAAAAAAEAAAAAAAAAAAAGBQAAAAR1bml0AAAAAAAAAAAABAAAAAdhc3NldElkCQAEOAAAAAEFAAAABWFzc2V0CQAETAAAAAIJAQAAAAtCaW5hcnlFbnRyeQAAAAICAAAAA2JpbgEAAAAACQAETAAAAAIJAQAAAAxCb29sZWFuRW50cnkAAAACAgAAAARib29sBgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAADaW50AAAAAAAAAAABCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAAA3N0cgIAAAAACQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAECAAAAA3N0cgkABEwAAAACBQAAAAVhc3NldAkABEwAAAACCQEAAAAHUmVpc3N1ZQAAAAMFAAAAB2Fzc2V0SWQAAAAAAAAAAAEHCQAETAAAAAIJAQAAAARCdXJuAAAAAgUAAAAHYXNzZXRJZAAAAAAAAAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIAAAAAAAAAAAEFAAAAB2Fzc2V0SWQFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5ZN0QxA==", "chainId": 84, "height": 2875896, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3g5NWKChUxZLhL17CbHBmZMnV1BRvXJFmTcYPsH2vsiT Next: BBCfTzyhhaeei8fNmciGaKXhJi6c3sy5cF1UhirxUSpd Full:
OldNewDifferences
1-{-# STDLIB_VERSION 7 #-}
1+{-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let SEP = "__"
5-
6-let CONTRACT_NAME = "calculator.ride"
7-
8-let SCALE8 = 100000000
9-
10-let PENDING = "PENDING"
11-
12-let WAVES = "WAVES"
13-
14-let blocksProcessingBatchSizeMax = 10
15-
16-func wrapErr (s) = ((CONTRACT_NAME + ": ") + s)
17-
18-
19-func throwErr (s) = throw(wrapErr(s))
20-
21-
22-func assetIdToString (assetId) = match assetId {
23- case b: ByteVector =>
24- toBase58String(b)
25- case _: Unit =>
26- WAVES
27- case _ =>
28- throw("Match error")
29-}
30-
31-
32-func stringToAssetId (s) = if ((s == WAVES))
33- then unit
34- else fromBase58String(s)
35-
36-
37-func abs (n) = if ((0 > n))
38- then -(n)
39- else n
40-
41-
42-func keyFactoryAddress () = makeString(["%s", "factory"], SEP)
43-
44-
45-func keyManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP)
46-
47-
48-func keyLpAssetId () = makeString(["%s", "lpAssetId"], SEP)
49-
50-
51-func keyProxyTreasuryAddress () = makeString(["%s", "proxyTreasury"], SEP)
52-
53-
54-func keyMainTreasuryAddress () = makeString(["%s", "mainTreasury"], SEP)
55-
56-
57-func keyBusinessTreasuryAddress () = makeString(["%s", "businessTreasury"], SEP)
58-
59-
60-func keyBusinessTreasuryPart () = makeString(["%s", "businessTreasuryPart"], SEP)
61-
62-
63-func keyPowerContractAddress () = makeString(["%s", "powerContract"], SEP)
64-
65-
66-func keyPowerShareRatio () = makeString(["%s", "powerShareRatio"], SEP)
67-
68-
69-func keyPowerAssetId () = makeString(["%s", "powerAssetId"], SEP)
70-
71-
72-func keyInvested (assetId) = makeString(["%s%s", "invested", assetIdToString(assetId)], SEP)
73-
74-
75-func keyDonated (assetId) = makeString(["%s%s", "donated", assetIdToString(assetId)], SEP)
76-
77-
78-func keyAvailable (userAddress) = makeString(["%s%s", "available", toString(userAddress)], SEP)
79-
80-
81-func keyClaimed (userAddress) = makeString(["%s%s", "claimed", toString(userAddress)], SEP)
82-
83-
84-func keyCurrentPeriod () = makeString(["%s", "currentPeriod"], SEP)
85-
86-
87-func keyPriceForPeriod (period) = makeString(["%s%d", "price", toString(period)], SEP)
88-
89-
90-func keyStartHeight (period) = makeString(["%s%d", "startHeight", toString(period)], SEP)
91-
92-
93-func keyPowerManagerBonus (period) = makeString(["%s%d", "powerManagerBonus", toString(period)], SEP)
94-
95-
96-func keyClaimWavesAmount (period) = makeString(["%s%d", "claimWavesAmount", toString(period)], SEP)
97-
98-
99-func keyPeriodLength () = "%s__periodLength"
100-
101-
102-func keyInvestPeriodLength () = "%s__investPeriodLength"
103-
104-
105-func keyBlockProcessingReward () = "%s__blockProcessingReward"
106-
107-
108-func keyNextBlockToProcess () = "%s__nextBlockToProcess"
109-
110-
111-func keyBlockProcessed (height) = makeString(["%s%d", "blockProcessed", toString(height)], SEP)
112-
113-
114-func keyWithdrawal () = "%s__withdrawal"
115-
116-
117-func keyWithdrawalPeriod (period) = makeString(["%s%d", "withdrawalPeriod", toString(period)], SEP)
118-
119-
120-func keyWithdrawalRequest (userAddress,txId) = makeString(["%s%s%s", "withdrawal", toString(userAddress), toBase58String(txId)], SEP)
121-
122-
123-func valueWithdrawalRequest (status,lpAssetAmount,targetPeriod,claimTxId) = {
124- let claimTxIdStr = match claimTxId {
125- case b: ByteVector =>
126- toBase58String(b)
127- case _: Unit =>
128- "SOON"
129- case _ =>
130- throw("Match error")
131- }
132- makeString(["%s%d%d%s", status, toString(lpAssetAmount), toString(targetPeriod), claimTxIdStr], SEP)
133- }
134-
135-
136-func keyWithdrawalHistory (userAddress,txId) = makeString(["%s%s%s", "withdrawalHistory", toString(userAddress), toBase58String(txId)], SEP)
137-
138-
139-func keyPeriodWithdrawalAssetIds (period) = makeString(["%s%d", "periodReward", toString(period)], SEP)
140-
141-
142-func keyPeriodWithdrawalAmounts (period) = makeString(["%s%d", "periodRewardAmount", toString(period)], SEP)
143-
144-
145-func parseWithdrawalRequestValueOrFail (s) = {
146- let parts = split(s, SEP)
147- if ((size(parts) == 5))
148- then {
149- let status = parts[1]
150- let lpAssetAmount = valueOrErrorMessage(parseInt(parts[2]), wrapErr("invalid lpAssetAmount"))
151- let targetPeriod = valueOrErrorMessage(parseInt(parts[3]), wrapErr("invalid targetPeriod"))
152- let claimTxId = parts[4]
153- $Tuple4(status, lpAssetAmount, targetPeriod, claimTxId)
154- }
155- else throwErr("invalid withdrawal request value")
156- }
157-
158-
159-let factoryAddressOption = match getString(this, keyFactoryAddress()) {
160- case s: String =>
161- addressFromString(s)
162- case _: Unit =>
163- unit
164- case _ =>
165- throw("Match error")
166-}
167-
168-let factoryAddressOrFail = valueOrErrorMessage(factoryAddressOption, wrapErr("invalid factory address"))
169-
170-let lpAssetIdOption = match factoryAddressOption {
171- case a: Address =>
172- match getString(a, keyLpAssetId()) {
173- case s: String =>
174- fromBase58String(s)
175- case _: Unit =>
176- unit
177- case _ =>
178- throw("Match error")
179- }
180- case _: Unit =>
181- unit
182- case _ =>
183- throw("Match error")
184-}
185-
186-let lpAssetIdOrFail = valueOrErrorMessage(lpAssetIdOption, wrapErr("invalid lpAssetId"))
187-
188-let proxyTreasuryAddressOption = match factoryAddressOption {
189- case a: Address =>
190- match getString(a, keyProxyTreasuryAddress()) {
191- case s: String =>
192- addressFromString(s)
193- case _: Unit =>
194- unit
195- case _ =>
196- throw("Match error")
197- }
198- case _: Unit =>
199- unit
200- case _ =>
201- throw("Match error")
202-}
203-
204-let proxyTreasuryAddressOrFail = valueOrErrorMessage(proxyTreasuryAddressOption, wrapErr("invalid proxy treasury address"))
205-
206-let mainTreasuryAddressOption = match factoryAddressOption {
207- case a: Address =>
208- match getString(a, keyMainTreasuryAddress()) {
209- case s: String =>
210- addressFromString(s)
211- case _: Unit =>
212- unit
213- case _ =>
214- throw("Match error")
215- }
216- case _: Unit =>
217- unit
218- case _ =>
219- throw("Match error")
220-}
221-
222-let businessTreasuryAddressOption = match factoryAddressOption {
223- case a: Address =>
224- match getString(a, keyBusinessTreasuryAddress()) {
225- case s: String =>
226- addressFromString(s)
227- case _: Unit =>
228- unit
229- case _ =>
230- throw("Match error")
231- }
232- case _: Unit =>
233- unit
234- case _ =>
235- throw("Match error")
236-}
237-
238-let mainTreasuryAddressOrFail = valueOrErrorMessage(mainTreasuryAddressOption, wrapErr("invalid main treasury address"))
239-
240-let businessTreasuryAddressOrFail = valueOrErrorMessage(businessTreasuryAddressOption, wrapErr("invalid business treasury address"))
241-
242-let powerContractAddressOption = match factoryAddressOption {
243- case a: Address =>
244- match getString(a, keyPowerContractAddress()) {
245- case s: String =>
246- addressFromString(s)
247- case _: Unit =>
248- unit
249- case _ =>
250- throw("Match error")
251- }
252- case _: Unit =>
253- unit
254- case _ =>
255- throw("Match error")
256-}
257-
258-let powerContractAddressOrFail = valueOrErrorMessage(powerContractAddressOption, wrapErr("invalid power contract address"))
259-
260-let powerAssetIdStringOrFail = valueOrErrorMessage(getString(factoryAddressOrFail, keyPowerAssetId()), wrapErr("power asset id not found"))
261-
262-func getManagerPublicKeyOrUnit () = match factoryAddressOption {
263- case fa: Address =>
264- match getString(fa, keyManagerPublicKey()) {
265- case pub: String =>
266- fromBase58String(pub)
267- case _ =>
268- unit
269- }
270- case _ =>
271- unit
272-}
273-
274-
275-func onlyAddress (i,address) = if ((i.caller == address))
276- then true
277- else throwErr("permission denied")
278-
279-
280-func onlyFactory (i) = onlyAddress(i, factoryAddressOrFail)
281-
282-
283-func rewardForOption (rewards,target) = {
284- let s = size(rewards)
285- let $t067736798 = rewards[0]
286- let a0 = $t067736798._1
287- let r0 = $t067736798._2
288- let $t068016826 = rewards[1]
289- let a1 = $t068016826._1
290- let r1 = $t068016826._2
291- let $t068296854 = rewards[2]
292- let a2 = $t068296854._1
293- let r2 = $t068296854._2
294- if (if ((s > 0))
295- then (a0 == target)
296- else false)
297- then r0
298- else if (if ((s > 1))
299- then (a1 == target)
300- else false)
301- then r1
302- else if (if ((s > 2))
303- then (a2 == target)
304- else false)
305- then r2
306- else unit
307- }
308-
309-
310-func calculatePrice (lpPartInWaves) = {
311- let lpAssetAmountToBurn = valueOrElse(getInteger(factoryAddressOrFail, keyWithdrawal()), 0)
312- let lpAssetQuantity = valueOrErrorMessage(assetInfo(lpAssetIdOrFail), wrapErr("invalid lpAsset info")).quantity
313- let newPrice = fraction(lpPartInWaves, SCALE8, (lpAssetQuantity - lpAssetAmountToBurn))
314- let checkIfPriceNotZero = if ((newPrice != 0))
315- then true
316- else throwErr("LP price cannot be 0")
317- if ((checkIfPriceNotZero == checkIfPriceNotZero))
318- then {
319- let lpAssetFinalQuantity = (lpAssetQuantity - lpAssetAmountToBurn)
320- $Tuple3(newPrice, lpAssetAmountToBurn, lpAssetFinalQuantity)
321- }
322- else throw("Strict value is not equal to itself.")
323- }
324-
325-
326-func claimCollateralINTERNAL (userAddressBytes,txId) = {
327- let userAddress = Address(userAddressBytes)
328- let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period"))
329- let withdrawalRequestOption = valueOrErrorMessage(getString(factoryAddressOrFail, keyWithdrawalRequest(userAddress, txId)), wrapErr("invalid withdrawal request"))
330- let $t080218134 = parseWithdrawalRequestValueOrFail(withdrawalRequestOption)
331- let status = $t080218134._1
332- let lpAssetAmount = $t080218134._2
333- let unlockPeriod = $t080218134._3
334- let claimTxId = $t080218134._4
335- if ((unlockPeriod > currentPeriodOrFail))
336- then throwErr("invalid withdrawal request period")
337- else {
338- let priceOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPriceForPeriod(unlockPeriod)), wrapErr("invalid price"))
339- let wavesAmount = if ((priceOrFail > 0))
340- then fraction(lpAssetAmount, priceOrFail, SCALE8)
341- else 0
342- let targetPeriod = (unlockPeriod - 1)
343- let assetsString = getStringValue(factoryAddressOrFail, keyPeriodWithdrawalAssetIds(targetPeriod))
344- let amountsString = getStringValue(factoryAddressOrFail, keyPeriodWithdrawalAmounts(targetPeriod))
345- let totalLpAmountInPeriod = valueOrElse(getInteger(factoryAddressOrFail, keyWithdrawalPeriod(targetPeriod)), 0)
346- let userPartSCALE8 = if ((totalLpAmountInPeriod == 0))
347- then 0
348- else fraction(lpAssetAmount, SCALE8, totalLpAmountInPeriod)
349- func getUserPartAmounts (currentState,amount) = {
350- let userPartAmount = fraction(parseIntValue(amount), userPartSCALE8, SCALE8)
351- (currentState :+ toString(userPartAmount))
352- }
353-
354- let amountsList = split_51C(amountsString, SEP)
355- let amountsPrefix = value(amountsList[0])
356- let amountsListWithoutPrefix = removeByIndex(split_51C(amountsString, SEP), 0)
357- let userPartAmounts = {
358- let $l = amountsListWithoutPrefix
359- let $s = size($l)
360- let $acc0 = nil
361- func $f0_1 ($a,$i) = if (($i >= $s))
362- then $a
363- else getUserPartAmounts($a, $l[$i])
364-
365- func $f0_2 ($a,$i) = if (($i >= $s))
366- then $a
367- else throw("List size exceeds 10")
368-
369- $f0_2($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)
370- }
371- let userPartAmountsString = makeString([amountsPrefix, makeString(userPartAmounts, SEP)], SEP)
372- $Tuple6(userAddress, lpAssetAmount, targetPeriod, wavesAmount, assetsString, userPartAmountsString)
373- }
374- }
375-
376-
377-func claimCollateralREADONLYStringResponse (userAddressBytes,txId) = {
378- let $t098239989 = claimCollateralINTERNAL(userAddressBytes, txId)
379- let userAddress = $t098239989._1
380- let lpAssetAmount = $t098239989._2
381- let targetPeriod = $t098239989._3
382- let wavesAmount = $t098239989._4
383- let assetsString = $t098239989._5
384- let amountsString = $t098239989._6
385- let assets = makeString(removeByIndex(split_51C(assetsString, SEP), 0), ":")
386- let amounts = makeString(removeByIndex(split_51C(amountsString, SEP), 0), ":")
387- makeString(["%d%s%s", toString(wavesAmount), assets, amounts], SEP)
388- }
389-
390-
391-func getRewardSplit (generatorRewardAmount) = {
392- let powerShareRatio = max([0, min([valueOrElse(getInteger(factoryAddressOrFail, keyPowerShareRatio()), 0), SCALE8])])
393- let businessPartRatio = max([0, min([valueOrElse(getInteger(factoryAddressOrFail, keyBusinessTreasuryPart()), 0), SCALE8])])
394- let amountToPowerPart = fraction(generatorRewardAmount, powerShareRatio, SCALE8)
395- let businessTreasuryAmountPart = fraction(generatorRewardAmount, businessPartRatio, SCALE8)
396- let rewardRemainder = ((generatorRewardAmount - amountToPowerPart) - businessTreasuryAmountPart)
397- if ((rewardRemainder > 0))
398- then $Tuple3(amountToPowerPart, businessTreasuryAmountPart, rewardRemainder)
399- else throwErr("amount to main treasury cannot be negative")
400- }
401-
402-
403-func calcRewardSplitForAmount (amount) = {
404- let $t01108811181 = getRewardSplit(amount)
405- let amountToPowerPart = $t01108811181._1
406- let businessTreasuryAmountPart = $t01108811181._2
407- let rewardRemainder = $t01108811181._3
408- let blockProcessingReward = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyBlockProcessingReward()), wrapErr("invalid block processing reward"))
409- let blockProcessingRewardByGenerator = (blockProcessingReward / blocksProcessingBatchSizeMax)
410- let toLpAmount = (rewardRemainder - blockProcessingReward)
411- $Tuple5(amountToPowerPart, businessTreasuryAmountPart, blockProcessingReward, toLpAmount, amount)
412- }
4134
4145
4156 @Callable(i)
416-func rewardSplitREADONLY () = {
417- let targetBlockHeight = (height - 1)
418- let targetBlockInfo = valueOrErrorMessage(blockInfoByHeight(targetBlockHeight), wrapErr("invalid block info"))
419- let treasuryRewardOrFail = valueOrErrorMessage(rewardForOption(targetBlockInfo.rewards, proxyTreasuryAddressOrFail), wrapErr(("invalid treasury reward for height " + toString(targetBlockHeight))))
420- $Tuple2(nil, calcRewardSplitForAmount(treasuryRewardOrFail))
421- }
422-
423-
424-
425-@Callable(i)
426-func claimLP (userAddressBytes) = {
427- let checkCaller = onlyFactory(i)
428- if ((checkCaller == checkCaller))
429- then {
430- let userAddress = Address(userAddressBytes)
431- let available = valueOrElse(getInteger(factoryAddressOrFail, keyAvailable(userAddress)), 0)
432- let claimed = valueOrElse(getInteger(factoryAddressOrFail, keyClaimed(userAddress)), 0)
433- let factoryActions = if ((available > 0))
434- then [invoke(factoryAddressOrFail, "transferAsset", [userAddressBytes, available, lpAssetIdOrFail], nil), invoke(factoryAddressOrFail, "integerEntry", [keyAvailable(userAddress), 0], nil), invoke(factoryAddressOrFail, "integerEntry", [keyClaimed(userAddress), (claimed + available)], nil)]
435- else throwErr("nothing to claim")
436- $Tuple2(nil, factoryActions)
437- }
438- else throw("Strict value is not equal to itself.")
439- }
440-
441-
442-
443-@Callable(i)
444-func finalize (userAddressBytes,donationPartInWaves,lpPartInWaves,claimPartInWaves,powerStakePartInWaves) = {
445- let checkCaller = onlyFactory(i)
446- if ((checkCaller == checkCaller))
447- then {
448- let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period"))
449- let periodLength = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPeriodLength()), wrapErr("invalid period length"))
450- let currentStartHeight = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyStartHeight(currentPeriodOrFail)), wrapErr("invalid start height"))
451- let currentPriceOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPriceForPeriod(currentPeriodOrFail)), wrapErr("invalid price"))
452- let nextBlockToProcess = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyNextBlockToProcess()), wrapErr("invalid next block to process"))
453- let periodEndHeight = ((currentStartHeight + periodLength) - 1)
454- let checks = [if ((i.originCaller == mainTreasuryAddressOrFail))
455- then true
456- else throwErr("permission denied"), if ((nextBlockToProcess > periodEndHeight))
457- then true
458- else throwErr("unprocessed blocks"), if ((donationPartInWaves >= 0))
459- then true
460- else throwErr("invalid donation part"), if ((lpPartInWaves >= 0))
461- then true
462- else throwErr("invalid lp part"), if ((claimPartInWaves >= 0))
463- then true
464- else throwErr("invalid claim part"), if ((powerStakePartInWaves >= 0))
465- then true
466- else throwErr("invalid PWR stake part")]
467- if ((checks == checks))
468- then {
469- let $t01451914624 = calculatePrice(lpPartInWaves)
470- let newPrice = $t01451914624._1
471- let lpAssetAmountToBurn = $t01451914624._2
472- let lpAssetFinalQuantity = $t01451914624._3
473- let newPeriod = (currentPeriodOrFail + 1)
474- func addNewAction (actions,payment) = {
475- let $t01477214834 = actions
476- let scriptTransfers = $t01477214834._1
477- let assetIdsString = $t01477214834._2
478- let amountsString = $t01477214834._3
479- let paymentAmount = payment.amount
480- let paymentAssetId = payment.assetId
481- let newAssetIdsString = ("%s" + makeString([assetIdsString, assetIdToString(paymentAssetId)], SEP))
482- let newAmountsString = ("%d" + makeString([amountsString, toString(paymentAmount)], SEP))
483- let newScriptTransfer = ScriptTransfer(factoryAddressOrFail, paymentAmount, paymentAssetId)
484- $Tuple3((scriptTransfers :+ newScriptTransfer), newAssetIdsString, newAmountsString)
485- }
486-
487- let $t01529415385 = {
488- let $l = i.payments
489- let $s = size($l)
490- let $acc0 = $Tuple3(nil, "", "")
491- func $f0_1 ($a,$i) = if (($i >= $s))
492- then $a
493- else addNewAction($a, $l[$i])
494-
495- func $f0_2 ($a,$i) = if (($i >= $s))
496- then $a
497- else throw("List size exceeds 10")
498-
499- $f0_2($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)
500- }
501- let scriptTransfers = $t01529415385._1
502- let AssetIds = $t01529415385._2
503- let Amounts = $t01529415385._3
504- let factoryActions = [invoke(factoryAddressOrFail, "integerEntry", [keyPowerManagerBonus(currentPeriodOrFail), powerStakePartInWaves], nil), invoke(factoryAddressOrFail, "integerEntry", [keyClaimWavesAmount(currentPeriodOrFail), claimPartInWaves], nil), 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", [keyWithdrawalPeriod(currentPeriodOrFail), lpAssetAmountToBurn], nil), invoke(factoryAddressOrFail, "integerEntry", [keyInvested(unit), lpPartInWaves], nil), invoke(factoryAddressOrFail, "integerEntry", [keyDonated(unit), donationPartInWaves], nil), invoke(factoryAddressOrFail, "stringEntry", [keyPeriodWithdrawalAssetIds(currentPeriodOrFail), AssetIds], nil), invoke(factoryAddressOrFail, "stringEntry", [keyPeriodWithdrawalAmounts(currentPeriodOrFail), Amounts], nil)]
505- $Tuple2(scriptTransfers, factoryActions)
506- }
507- else throw("Strict value is not equal to itself.")
508- }
509- else throw("Strict value is not equal to itself.")
510- }
511-
512-
513-
514-@Callable(i)
515-func finalizeREADONLY (donationPartInWaves,lpPartInWaves,claimPartInWaves,powerStakePartInWaves) = {
516- let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period"))
517- let periodLength = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPeriodLength()), wrapErr("invalid period length"))
518- let currentStartHeight = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyStartHeight(currentPeriodOrFail)), wrapErr("invalid start height"))
519- let currentPriceOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPriceForPeriod(currentPeriodOrFail)), wrapErr("invalid price"))
520- let nextBlockToProcess = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyNextBlockToProcess()), wrapErr("invalid next block to process"))
521- let periodEndHeight = ((currentStartHeight + periodLength) - 1)
522- let checks = [if ((nextBlockToProcess > periodEndHeight))
523- then true
524- else throwErr("unprocessed blocks"), if ((donationPartInWaves >= 0))
525- then true
526- else throwErr("invalid donation part"), if ((lpPartInWaves >= 0))
527- then true
528- else throwErr("invalid lp part"), if ((claimPartInWaves >= 0))
529- then true
530- else throwErr("invalid claim part"), if ((powerStakePartInWaves >= 0))
531- then true
532- else throwErr("invalid PWR stake part")]
533- if ((checks == checks))
534- then {
535- let $t01840218507 = calculatePrice(lpPartInWaves)
536- let newPrice = $t01840218507._1
537- let lpAssetAmountToBurn = $t01840218507._2
538- let lpAssetFinalQuantity = $t01840218507._3
539- $Tuple2(nil, $Tuple6(claimPartInWaves, lpPartInWaves, donationPartInWaves, newPrice, lpAssetAmountToBurn, lpAssetFinalQuantity))
540- }
541- else throw("Strict value is not equal to itself.")
542- }
543-
544-
545-
546-@Callable(i)
547-func invest (userAddressBytes) = {
548- let checkCaller = onlyFactory(i)
549- if ((checkCaller == checkCaller))
550- then {
551- let userAddress = Address(userAddressBytes)
552- let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period"))
553- let currentStartHeight = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyStartHeight(currentPeriodOrFail)), wrapErr("invalid start height"))
554- let investPeriodLength = getIntegerValue(factoryAddressOrFail, keyInvestPeriodLength())
555- let heightCheck = if (((currentStartHeight + investPeriodLength) > height))
556- then true
557- else throwErr("too late to invest in this period")
558- if ((heightCheck == heightCheck))
559- then {
560- let currentPriceOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPriceForPeriod(currentPeriodOrFail)), wrapErr("invalid price"))
561- let payment = if ((size(i.payments) == 1))
562- then i.payments[0]
563- else throwErr("invalid payments")
564- let $t01961619793 = if (if ((payment.assetId == unit))
565- then (payment.amount > 0)
566- else false)
567- then $Tuple2(payment.amount, payment.assetId)
568- else throwErr("invalid payment amount")
569- let paymentAmount = $t01961619793._1
570- let paymentAssetId = $t01961619793._2
571- let treasuryPart = valueOrElse(getInteger(factoryAddressOrFail, keyBusinessTreasuryPart()), 0)
572- let paymentsWithoutTreasuryPart = fraction(paymentAmount, (SCALE8 - treasuryPart), SCALE8)
573- let lpAssetAmount = if ((currentPriceOrFail > 0))
574- then fraction(paymentsWithoutTreasuryPart, SCALE8, currentPriceOrFail)
575- else 0
576- let invested = valueOrElse(getInteger(factoryAddressOrFail, keyInvested(unit)), 0)
577- let actions = [ScriptTransfer(mainTreasuryAddressOrFail, paymentsWithoutTreasuryPart, paymentAssetId), ScriptTransfer(businessTreasuryAddressOrFail, treasuryPart, paymentAssetId)]
578- let factoryActions = [invoke(factoryAddressOrFail, "integerEntry", [keyInvested(unit), (invested + paymentsWithoutTreasuryPart)], nil), invoke(factoryAddressOrFail, "reissue", [lpAssetAmount], nil), invoke(factoryAddressOrFail, "transferAsset", [userAddressBytes, lpAssetAmount, lpAssetIdOrFail], nil)]
579- $Tuple2(actions, factoryActions)
580- }
581- else throw("Strict value is not equal to itself.")
582- }
583- else throw("Strict value is not equal to itself.")
584- }
585-
586-
587-
588-@Callable(i)
589-func withdraw (userAddressBytes) = {
590- let checkCaller = onlyFactory(i)
591- if ((checkCaller == checkCaller))
592- then {
593- let userAddress = Address(userAddressBytes)
594- let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period"))
595- let periodLength = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPeriodLength()), wrapErr("invalid period length"))
596- let currentStartHeight = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyStartHeight(currentPeriodOrFail)), wrapErr("invalid start height"))
597- let heightCheck = if (((currentStartHeight + periodLength) > height))
598- then true
599- else throwErr("too late to withdraw in this period")
600- if ((heightCheck == heightCheck))
601- then {
602- let payment = if ((size(i.payments) == 1))
603- then i.payments[0]
604- else throwErr(wrapErr("invalid payments"))
605- let paymentAssetId = if ((payment.assetId == lpAssetIdOrFail))
606- then lpAssetIdOrFail
607- else throwErr("invalid payment asset")
608- let paymentAmount = if ((payment.amount > 0))
609- then payment.amount
610- else throwErr("invalid payment amount")
611- let withdrawal = valueOrElse(getInteger(factoryAddressOrFail, keyWithdrawal()), 0)
612- let actions = [ScriptTransfer(factoryAddressOrFail, paymentAmount, paymentAssetId)]
613- let factoryActions = [invoke(factoryAddressOrFail, "integerEntry", [keyWithdrawal(), (withdrawal + paymentAmount)], nil), invoke(factoryAddressOrFail, "stringEntry", [keyWithdrawalRequest(userAddress, i.transactionId), valueWithdrawalRequest(PENDING, paymentAmount, (currentPeriodOrFail + 1), unit)], nil)]
614- if ((factoryActions == factoryActions))
615- then $Tuple2(actions, factoryActions)
616- else throw("Strict value is not equal to itself.")
617- }
618- else throw("Strict value is not equal to itself.")
619- }
620- else throw("Strict value is not equal to itself.")
621- }
622-
623-
624-
625-@Callable(i)
626-func cancelWithdraw (userAddressBytes,txId) = {
627- let checkCaller = onlyFactory(i)
628- if ((checkCaller == checkCaller))
629- then throwErr("cancelWithdraw is deprecated")
630- else throw("Strict value is not equal to itself.")
631- }
632-
633-
634-
635-@Callable(i)
636-func claimCollateral (userAddressBytes,txId) = {
637- let checkCaller = onlyFactory(i)
638- if ((checkCaller == checkCaller))
639- then {
640- let $t02276022945 = claimCollateralINTERNAL(userAddressBytes, fromBase58String(txId))
641- let userAddress = $t02276022945._1
642- let lpAssetAmount = $t02276022945._2
643- let targetPeriod = $t02276022945._3
644- let wavesAmount = $t02276022945._4
645- let assetsString = $t02276022945._5
646- let amountsString = $t02276022945._6
647- let assetsList = removeByIndex(split_51C(assetsString, SEP), 0)
648- let amountsList = removeByIndex(split_51C(amountsString, SEP), 0)
649- let factoryActions = [invoke(factoryAddressOrFail, "deleteEntry", [keyWithdrawalRequest(userAddress, fromBase58String(txId))], nil), invoke(factoryAddressOrFail, "integerEntry", [keyWithdrawalHistory(userAddress, fromBase58String(txId)), lpAssetAmount], nil), invoke(factoryAddressOrFail, "transferAssets", [userAddressBytes, assetsList, amountsList], nil)]
650- $Tuple2(nil, factoryActions)
651- }
652- else throw("Strict value is not equal to itself.")
653- }
654-
655-
656-
657-@Callable(i)
658-func claimCollateralBulk (userAddressBytes,txIds) = {
659- let checkCaller = onlyFactory(i)
660- if ((checkCaller == checkCaller))
661- then {
662- func addNewAction (state,txId) = {
663- let $t02370323902 = claimCollateralINTERNAL(userAddressBytes, fromBase58String(txId))
664- let userAddress = $t02370323902._1
665- let lpAssetAmount = $t02370323902._2
666- let targetPeriod = $t02370323902._3
667- let wavesAmount = $t02370323902._4
668- let assetsString = $t02370323902._5
669- let amountsString = $t02370323902._6
670- let assetsList = removeByIndex(split_51C(assetsString, SEP), 0)
671- let amountsList = removeByIndex(split_51C(amountsString, SEP), 0)
672- let newActions = [invoke(factoryAddressOrFail, "deleteEntry", [keyWithdrawalRequest(userAddress, fromBase58String(txId))], nil), invoke(factoryAddressOrFail, "integerEntry", [keyWithdrawalHistory(userAddress, fromBase58String(txId)), lpAssetAmount], nil), invoke(factoryAddressOrFail, "transferAssets", [userAddressBytes, assetsList, amountsList], nil)]
673- (state ++ newActions)
674- }
675-
676- let allFactoryActions = {
677- let $l = txIds
678- let $s = size($l)
679- let $acc0 = nil
680- func $f0_1 ($a,$i) = if (($i >= $s))
681- then $a
682- else addNewAction($a, $l[$i])
683-
684- func $f0_2 ($a,$i) = if (($i >= $s))
685- then $a
686- else throw("List size exceeds 10")
687-
688- $f0_2($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)
689- }
690- $Tuple2(nil, allFactoryActions)
691- }
692- else throw("Strict value is not equal to itself.")
693- }
694-
695-
696-
697-@Callable(i)
698-func claimCollateralREADONLY (userAddressBytes,txId) = {
699- let response = claimCollateralREADONLYStringResponse(userAddressBytes, fromBase58String(txId))
700- $Tuple2(nil, response)
701- }
702-
703-
704-
705-@Callable(i)
706-func claimCollateralBulkREADONLY (userAddressBytes,txIds) = {
707- func processTxId (state,txId) = {
708- let response = claimCollateralREADONLYStringResponse(userAddressBytes, fromBase58String(txId))
709- (state :+ response)
710- }
711-
712- let allResponses = {
713- let $l = txIds
714- let $s = size($l)
715- let $acc0 = nil
716- func $f0_1 ($a,$i) = if (($i >= $s))
717- then $a
718- else processTxId($a, $l[$i])
719-
720- func $f0_2 ($a,$i) = if (($i >= $s))
721- then $a
722- else throw("List size exceeds 10")
723-
724- $f0_2($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)
725- }
726- $Tuple2(nil, allResponses)
727- }
728-
729-
730-
731-@Callable(i)
732-func processBlocks (userAddressBytes) = {
733- let checkCaller = onlyFactory(i)
734- if ((checkCaller == checkCaller))
735- then {
736- let userAddress = Address(userAddressBytes)
737- let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period"))
738- let periodLength = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPeriodLength()), wrapErr("invalid period length"))
739- let currentStartHeight = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyStartHeight(currentPeriodOrFail)), wrapErr("invalid start height"))
740- let currentPriceOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPriceForPeriod(currentPeriodOrFail)), wrapErr("invalid price"))
741- let nextBlockToProcess = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyNextBlockToProcess()), wrapErr("invalid next block to process"))
742- let periodEndHeight = ((currentStartHeight + periodLength) - 1)
743- let blocksProcessingBatchSize = if (if (if ((height >= nextBlockToProcess))
744- then if ((nextBlockToProcess >= currentStartHeight))
745- then true
746- else (currentPeriodOrFail == 0)
747- else false)
748- then (periodEndHeight >= nextBlockToProcess)
749- else false)
750- then min([((periodEndHeight - nextBlockToProcess) + 1), blocksProcessingBatchSizeMax])
751- else throwErr(wrapErr("invalid target block"))
752- let blockProcessingReward = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyBlockProcessingReward()), wrapErr("invalid block processing reward"))
753- let blockProcessingRewardByGenerator = (blockProcessingReward / blocksProcessingBatchSize)
754- let blockProcessingRewardByGeneratorRemainder = (blockProcessingReward - (blockProcessingRewardByGenerator * blocksProcessingBatchSize))
755- func map (acc,inc) = if ((inc >= blocksProcessingBatchSize))
756- then acc
757- else {
758- let targetBlockHeight = (nextBlockToProcess + inc)
759- let targetBlockInfo = valueOrErrorMessage(blockInfoByHeight(targetBlockHeight), wrapErr("invalid block info"))
760- let treasuryRewardOrFail = valueOrErrorMessage(rewardForOption(targetBlockInfo.rewards, proxyTreasuryAddressOrFail), wrapErr(("invalid treasury reward for height " + toString(targetBlockHeight))))
761- let generator = targetBlockInfo.generator
762- let available = valueOrElse(getInteger(factoryAddressOrFail, keyAvailable(generator)), 0)
763- let callerReward = if ((inc == (blocksProcessingBatchSize - 1)))
764- then (blockProcessingRewardByGenerator + blockProcessingRewardByGeneratorRemainder)
765- else blockProcessingRewardByGenerator
766- let $t02780227910 = getRewardSplit(treasuryRewardOrFail)
767- let shareAmountToPower = $t02780227910._1
768- let businessTreasuryAmountPart = $t02780227910._2
769- let rewardRemainder = $t02780227910._3
770- let lpAssetAmount = if ((currentPriceOrFail > 0))
771- then fraction((rewardRemainder - callerReward), SCALE8, currentPriceOrFail)
772- else 0
773- let factoryActionsSingle = [invoke(factoryAddressOrFail, "stringEntry", [keyBlockProcessed(targetBlockHeight), makeString([toBase58String(i.transactionId), toString(currentPeriodOrFail), toString(generator), toBase58String(userAddressBytes), toString(treasuryRewardOrFail), toString(callerReward), toString(lpAssetAmount), toString(shareAmountToPower)], SEP)], nil), invoke(factoryAddressOrFail, "integerEntry", [keyAvailable(generator), (available + lpAssetAmount)], nil)]
774- if ((factoryActionsSingle == factoryActionsSingle))
775- then {
776- let $t02875828833 = acc
777- let lpAssetAcc = $t02875828833._1
778- let rewardAcc = $t02875828833._2
779- let businessTreasuryAcc = $t02875828833._3
780- let powerShareDataTuple = $t02875828833._4
781- let $t02884028906 = powerShareDataTuple
782- let powerShareAcc = $t02884028906._1
783- let generatorPowerShareList = $t02884028906._2
784- let newGeneratorPowerShareList = (generatorPowerShareList :+ $Tuple2(toString(generator), shareAmountToPower))
785- $Tuple4((lpAssetAcc + lpAssetAmount), (rewardAcc + treasuryRewardOrFail), (businessTreasuryAcc + businessTreasuryAmountPart), $Tuple2((powerShareAcc + shareAmountToPower), newGeneratorPowerShareList))
786- }
787- else throw("Strict value is not equal to itself.")
788- }
789-
790- let list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
791- let $t02935429516 = {
792- let $l = list
793- let $s = size($l)
794- let $acc0 = $Tuple4(0, 0, 0, $Tuple2(0, nil))
795- func $f0_1 ($a,$i) = if (($i >= $s))
796- then $a
797- else map($a, $l[$i])
798-
799- func $f0_2 ($a,$i) = if (($i >= $s))
800- then $a
801- else throw("List size exceeds 20")
802-
803- $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($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20)
804- }
805- if (($t02935429516 == $t02935429516))
806- then {
807- let powerShareDataTuple = $t02935429516._4
808- let rewardToBusinessTreasuryAmount = $t02935429516._3
809- let rewardAmountTotal = $t02935429516._2
810- let lpAssetAmountTotal = $t02935429516._1
811- let $t02952029589 = powerShareDataTuple
812- let amountToPowerTotal = $t02952029589._1
813- let powerShareAmountsList = $t02952029589._2
814- let rewardToMainTreasuryAmount = (((rewardAmountTotal - rewardToBusinessTreasuryAmount) - blockProcessingReward) - amountToPowerTotal)
815- let invested = valueOrElse(getInteger(factoryAddressOrFail, keyInvested(unit)), 0)
816- let powerShareActions = if ((amountToPowerTotal > 0))
817- then {
818- let transferAction = [invoke(factoryAddressOrFail, "transferFromProxyTreasury", [factoryAddressOrFail.bytes, amountToPowerTotal], nil)]
819- if ((transferAction == transferAction))
820- then {
821- let totalPowerAmount = invoke(factoryAddressOrFail, "swap", [powerAssetIdStringOrFail, WAVES, amountToPowerTotal], nil)
822- if ((totalPowerAmount == totalPowerAmount))
823- then {
824- let totalPowerAmountInt = match totalPowerAmount {
825- case pAmount: Int =>
826- pAmount
827- case _ =>
828- 0
829- }
830- func stakePowerInvoke (acc,next) = {
831- let $t03046330498 = next
832- let generator = $t03046330498._1
833- let shareAmount = $t03046330498._2
834- if ((amountToPowerTotal > 0))
835- then {
836- let powerAmount = fraction(shareAmount, totalPowerAmountInt, amountToPowerTotal)
837- let inv = invoke(factoryAddressOrFail, "powerStake", [fromBase58String(generator), fromBase58String(powerAssetIdStringOrFail), powerAmount], nil)
838- if ((inv == inv))
839- then nil
840- else throw("Strict value is not equal to itself.")
841- }
842- else nil
843- }
844-
845- let powerStakesActions = {
846- let $l = powerShareAmountsList
847- let $s = size($l)
848- let $acc0 = 0
849- func $f1_1 ($a,$i) = if (($i >= $s))
850- then $a
851- else stakePowerInvoke($a, $l[$i])
852-
853- func $f1_2 ($a,$i) = if (($i >= $s))
854- then $a
855- else throw("List size exceeds 20")
856-
857- $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20)
858- }
859- if ((powerStakesActions == powerStakesActions))
860- then nil
861- else throw("Strict value is not equal to itself.")
862- }
863- else throw("Strict value is not equal to itself.")
864- }
865- else throw("Strict value is not equal to itself.")
866- }
867- else nil
868- if ((powerShareActions == powerShareActions))
869- then {
870- 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, "transferFromProxyTreasury", [businessTreasuryAddressOrFail.bytes, rewardToBusinessTreasuryAmount], nil), invoke(factoryAddressOrFail, "integerEntry", [keyInvested(unit), (invested + rewardToMainTreasuryAmount)], nil)]
871- if ((actions == actions))
872- then $Tuple2(nil, unit)
873- else throw("Strict value is not equal to itself.")
874- }
875- else throw("Strict value is not equal to itself.")
876- }
877- else throw("Strict value is not equal to itself.")
878- }
879- else throw("Strict value is not equal to itself.")
7+func call () = {
8+ let asset = Issue("Asset", "", 1, 0, true, unit, 0)
9+ let assetId = calculateAssetId(asset)
10+[BinaryEntry("bin", base58''), BooleanEntry("bool", true), IntegerEntry("int", 1), StringEntry("str", ""), DeleteEntry("str"), asset, Reissue(assetId, 1, false), Burn(assetId, 1), ScriptTransfer(i.caller, 1, assetId)]
88011 }
88112
88213
88314 @Verifier(tx)
884-func verify () = {
885- let publicKey = match getManagerPublicKeyOrUnit() {
886- case pub: ByteVector =>
887- pub
888- case _ =>
889- tx.senderPublicKey
890- }
891- sigVerify(tx.bodyBytes, tx.proofs[0], publicKey)
892- }
15+func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
89316

github/deemru/w8io/169f3d6 
57.55 ms