tx · ELMGPbmq8Bk27E9DeTv38ndrSBJVdWMZ8Qp54rm374WL

3N6HSS7Toat1RhyEsyqVGgVSRzH19W1FTbP:  -0.03600000 Waves

2025.01.10 16:36 [3453128] smart account 3N6HSS7Toat1RhyEsyqVGgVSRzH19W1FTbP > SELF 0.00000000 Waves

{ "type": 13, "id": "ELMGPbmq8Bk27E9DeTv38ndrSBJVdWMZ8Qp54rm374WL", "fee": 3600000, "feeAssetId": null, "timestamp": 1736516274501, "version": 1, "sender": "3N6HSS7Toat1RhyEsyqVGgVSRzH19W1FTbP", "senderPublicKey": "AoKo4segKHU4DeJnxXQYJj2u7J6XJeux6r8KLW52cd2Q", "proofs": [ "4UHueM2XR1eZ3tZJeVEGnbu4ds7N71dMeTpG1NGkXiSCWx8AUnChEKehF1V8ViPZC495v2YNd6y239sPHYGwEVTe" ], "script": "base64:BwK9HwgCEgASAwoBAhIHCgUCAQEBARIGCgQBAQEBEgMKAQISAwoBAhIECgICAhIECgICCBIECgICGBIECgICCBIECgICGBIDCgECIgNTRVAiDUNPTlRSQUNUX05BTUUiBlNDQUxFOCIHUEVORElORyIFV0FWRVMiHGJsb2Nrc1Byb2Nlc3NpbmdCYXRjaFNpemVNYXgiB3dyYXBFcnIiAXMiCHRocm93RXJyIg9hc3NldElkVG9TdHJpbmciB2Fzc2V0SWQiByRtYXRjaDAiAWIiD3N0cmluZ1RvQXNzZXRJZCIDYWJzIgFuIhFrZXlGYWN0b3J5QWRkcmVzcyITa2V5TWFuYWdlclB1YmxpY0tleSIMa2V5THBBc3NldElkIhdrZXlQcm94eVRyZWFzdXJ5QWRkcmVzcyIWa2V5TWFpblRyZWFzdXJ5QWRkcmVzcyIaa2V5QnVzaW5lc3NUcmVhc3VyeUFkZHJlc3MiHWtleVRydXN0ZWRGaW5hbGl6ZUFkZHJlc3NMaXN0IhdrZXlCdXNpbmVzc1RyZWFzdXJ5UGFydCIXa2V5UG93ZXJDb250cmFjdEFkZHJlc3MiEmtleVBvd2VyU2hh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8fNmciGaKXhJi6c3sy5cF1UhirxUSpd Next: 9auSb7mq1i7KcWQ95rZhZbh39kdENqw3ofeUsHtcH5dm Diff:
OldNewDifferences
5555
5656
5757 func keyBusinessTreasuryAddress () = makeString(["%s", "businessTreasury"], SEP)
58+
59+
60+func keyTrustedFinalizeAddressList () = makeString(["%s", "trustedAddressList"], SEP)
5861
5962
6063 func keyBusinessTreasuryPart () = makeString(["%s", "businessTreasuryPart"], SEP)
306309 func onlyFactory (i) = onlyAddress(i, factoryAddressOrFail)
307310
308311
312+func isTrustedAddress (i) = {
313+ let listString = valueOrElse(getString(factoryAddressOrFail, keyTrustedFinalizeAddressList()), "")
314+ let addressList = split(listString, SEP)
315+ containsElement(addressList, toString(i.originCaller))
316+ }
317+
318+
309319 func rewardForOption (rewards,target) = {
310320 let s = size(rewards)
311- let $t073697394 = rewards[0]
312- let a0 = $t073697394._1
313- let r0 = $t073697394._2
314- let $t073977422 = rewards[1]
315- let a1 = $t073977422._1
316- let r1 = $t073977422._2
317- let $t074257450 = rewards[2]
318- let a2 = $t074257450._1
319- let r2 = $t074257450._2
321+ let $t077007725 = rewards[0]
322+ let a0 = $t077007725._1
323+ let r0 = $t077007725._2
324+ let $t077287753 = rewards[1]
325+ let a1 = $t077287753._1
326+ let r1 = $t077287753._2
327+ let $t077567781 = rewards[2]
328+ let a2 = $t077567781._1
329+ let r2 = $t077567781._2
320330 if (if ((s > 0))
321331 then (a0 == target)
322332 else false)
353363 let userAddress = Address(userAddressBytes)
354364 let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period"))
355365 let withdrawalRequestOption = valueOrErrorMessage(getString(factoryAddressOrFail, keyWithdrawalRequest(userAddress, txId)), wrapErr("invalid withdrawal request"))
356- let $t086178730 = parseWithdrawalRequestValueOrFail(withdrawalRequestOption)
357- let status = $t086178730._1
358- let lpAssetAmount = $t086178730._2
359- let unlockPeriod = $t086178730._3
360- let claimTxId = $t086178730._4
366+ let $t089489061 = parseWithdrawalRequestValueOrFail(withdrawalRequestOption)
367+ let status = $t089489061._1
368+ let lpAssetAmount = $t089489061._2
369+ let unlockPeriod = $t089489061._3
370+ let claimTxId = $t089489061._4
361371 if ((unlockPeriod > currentPeriodOrFail))
362372 then throwErr("invalid withdrawal request period")
363373 else {
401411
402412
403413 func claimCollateralREADONLYStringResponse (userAddressBytes,txId) = {
404- let $t01041910585 = claimCollateralINTERNAL(userAddressBytes, txId)
405- let userAddress = $t01041910585._1
406- let lpAssetAmount = $t01041910585._2
407- let targetPeriod = $t01041910585._3
408- let wavesAmount = $t01041910585._4
409- let assetsString = $t01041910585._5
410- let amountsString = $t01041910585._6
414+ let $t01075010916 = claimCollateralINTERNAL(userAddressBytes, txId)
415+ let userAddress = $t01075010916._1
416+ let lpAssetAmount = $t01075010916._2
417+ let targetPeriod = $t01075010916._3
418+ let wavesAmount = $t01075010916._4
419+ let assetsString = $t01075010916._5
420+ let amountsString = $t01075010916._6
411421 let assets = makeString(removeByIndex(split_51C(assetsString, SEP), 0), ":")
412422 let amounts = makeString(removeByIndex(split_51C(amountsString, SEP), 0), ":")
413423 makeString(["%d%s%s", toString(wavesAmount), assets, amounts], SEP)
427437
428438
429439 func calcRewardSplitForAmount (amount) = {
430- let $t01168411777 = getRewardSplit(amount)
431- let amountToPowerPart = $t01168411777._1
432- let businessTreasuryAmountPart = $t01168411777._2
433- let rewardRemainder = $t01168411777._3
440+ let $t01201512108 = getRewardSplit(amount)
441+ let amountToPowerPart = $t01201512108._1
442+ let businessTreasuryAmountPart = $t01201512108._2
443+ let rewardRemainder = $t01201512108._3
434444 let blockProcessingReward = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyBlockProcessingReward()), wrapErr("invalid block processing reward"))
435445 let blockProcessingRewardByGenerator = (blockProcessingReward / blocksProcessingBatchSizeMax)
436446 let toLpAmount = (rewardRemainder - blockProcessingReward)
477487 let currentPriceOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPriceForPeriod(currentPeriodOrFail)), wrapErr("invalid price"))
478488 let nextBlockToProcess = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyNextBlockToProcess()), wrapErr("invalid next block to process"))
479489 let periodEndHeight = ((currentStartHeight + periodLength) - 1)
480- let checks = [if ((i.originCaller == mainTreasuryAddressOrFail))
490+ let checks = [if (if (isTrustedAddress(i))
491+ then true
492+ else (i.originCaller == mainTreasuryAddressOrFail))
481493 then true
482494 else throwErr("permission denied"), if ((nextBlockToProcess > periodEndHeight))
483495 then true
492504 else throwErr("invalid PWR stake part")]
493505 if ((checks == checks))
494506 then {
495- let $t01511515220 = calculatePrice(lpPartInWaves)
496- let newPrice = $t01511515220._1
497- let lpAssetAmountToBurn = $t01511515220._2
498- let lpAssetFinalQuantity = $t01511515220._3
507+ let $t01547015575 = calculatePrice(lpPartInWaves)
508+ let newPrice = $t01547015575._1
509+ let lpAssetAmountToBurn = $t01547015575._2
510+ let lpAssetFinalQuantity = $t01547015575._3
499511 let newPeriod = (currentPeriodOrFail + 1)
500512 func addNewAction (actions,payment) = {
501- let $t01536815430 = actions
502- let scriptTransfers = $t01536815430._1
503- let assetIdsString = $t01536815430._2
504- let amountsString = $t01536815430._3
513+ let $t01572315785 = actions
514+ let scriptTransfers = $t01572315785._1
515+ let assetIdsString = $t01572315785._2
516+ let amountsString = $t01572315785._3
505517 let paymentAmount = payment.amount
506518 let paymentAssetId = payment.assetId
507519 if ((assetIdToString(paymentAssetId) == l2mpAssetIdStringOrFail))
517529 }
518530 }
519531
520- let $t01622416315 = {
532+ let $t01657916670 = {
521533 let $l = i.payments
522534 let $s = size($l)
523535 let $acc0 = $Tuple3(nil, "", "")
531543
532544 $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)
533545 }
534- let scriptTransfers = $t01622416315._1
535- let AssetIds = $t01622416315._2
536- let Amounts = $t01622416315._3
546+ let scriptTransfers = $t01657916670._1
547+ let AssetIds = $t01657916670._2
548+ let Amounts = $t01657916670._3
537549 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)]
538550 $Tuple2(scriptTransfers, factoryActions)
539551 }
565577 else throwErr("invalid PWR stake part")]
566578 if ((checks == checks))
567579 then {
568- let $t01933219437 = calculatePrice(lpPartInWaves)
569- let newPrice = $t01933219437._1
570- let lpAssetAmountToBurn = $t01933219437._2
571- let lpAssetFinalQuantity = $t01933219437._3
580+ let $t01968719792 = calculatePrice(lpPartInWaves)
581+ let newPrice = $t01968719792._1
582+ let lpAssetAmountToBurn = $t01968719792._2
583+ let lpAssetFinalQuantity = $t01968719792._3
572584 $Tuple2(nil, $Tuple6(claimPartInWaves, lpPartInWaves, donationPartInWaves, newPrice, lpAssetAmountToBurn, lpAssetFinalQuantity))
573585 }
574586 else throw("Strict value is not equal to itself.")
594606 let payment = if ((size(i.payments) == 1))
595607 then i.payments[0]
596608 else throwErr("invalid payments")
597- let $t02054620723 = if (if ((payment.assetId == unit))
609+ let $t02090121078 = if (if ((payment.assetId == unit))
598610 then (payment.amount > 0)
599611 else false)
600612 then $Tuple2(payment.amount, payment.assetId)
601613 else throwErr("invalid payment amount")
602- let paymentAmount = $t02054620723._1
603- let paymentAssetId = $t02054620723._2
614+ let paymentAmount = $t02090121078._1
615+ let paymentAssetId = $t02090121078._2
604616 let treasuryPart = valueOrElse(getInteger(factoryAddressOrFail, keyBusinessTreasuryPart()), 0)
605617 let paymentsWithoutTreasuryPart = fraction(paymentAmount, (SCALE8 - treasuryPart), SCALE8)
606618 let lpAssetAmount = if ((currentPriceOrFail > 0))
670682 let checkCaller = onlyFactory(i)
671683 if ((checkCaller == checkCaller))
672684 then {
673- let $t02369023875 = claimCollateralINTERNAL(userAddressBytes, fromBase58String(txId))
674- let userAddress = $t02369023875._1
675- let lpAssetAmount = $t02369023875._2
676- let targetPeriod = $t02369023875._3
677- let wavesAmount = $t02369023875._4
678- let assetsString = $t02369023875._5
679- let amountsString = $t02369023875._6
685+ let $t02404524230 = claimCollateralINTERNAL(userAddressBytes, fromBase58String(txId))
686+ let userAddress = $t02404524230._1
687+ let lpAssetAmount = $t02404524230._2
688+ let targetPeriod = $t02404524230._3
689+ let wavesAmount = $t02404524230._4
690+ let assetsString = $t02404524230._5
691+ let amountsString = $t02404524230._6
680692 let assetsList = removeByIndex(split_51C(assetsString, SEP), 0)
681693 let amountsList = removeByIndex(split_51C(amountsString, SEP), 0)
682694 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)]
693705 if ((checkCaller == checkCaller))
694706 then {
695707 func addNewAction (state,txId) = {
696- let $t02463124830 = claimCollateralINTERNAL(userAddressBytes, fromBase58String(txId))
697- let userAddress = $t02463124830._1
698- let lpAssetAmount = $t02463124830._2
699- let targetPeriod = $t02463124830._3
700- let wavesAmount = $t02463124830._4
701- let assetsString = $t02463124830._5
702- let amountsString = $t02463124830._6
708+ let $t02498625185 = claimCollateralINTERNAL(userAddressBytes, fromBase58String(txId))
709+ let userAddress = $t02498625185._1
710+ let lpAssetAmount = $t02498625185._2
711+ let targetPeriod = $t02498625185._3
712+ let wavesAmount = $t02498625185._4
713+ let assetsString = $t02498625185._5
714+ let amountsString = $t02498625185._6
703715 let assetsList = removeByIndex(split_51C(assetsString, SEP), 0)
704716 let amountsList = removeByIndex(split_51C(amountsString, SEP), 0)
705717 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)]
796808 let callerReward = if ((inc == (blocksProcessingBatchSize - 1)))
797809 then (blockProcessingRewardByGenerator + blockProcessingRewardByGeneratorRemainder)
798810 else blockProcessingRewardByGenerator
799- let $t02873028838 = getRewardSplit(treasuryRewardOrFail)
800- let shareAmountToPower = $t02873028838._1
801- let businessTreasuryAmountPart = $t02873028838._2
802- let rewardRemainder = $t02873028838._3
811+ let $t02908529193 = getRewardSplit(treasuryRewardOrFail)
812+ let shareAmountToPower = $t02908529193._1
813+ let businessTreasuryAmountPart = $t02908529193._2
814+ let rewardRemainder = $t02908529193._3
803815 let lpAssetAmount = if ((currentPriceOrFail > 0))
804816 then fraction((rewardRemainder - callerReward), SCALE8, currentPriceOrFail)
805817 else 0
806818 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)]
807819 if ((factoryActionsSingle == factoryActionsSingle))
808820 then {
809- let $t02968629761 = acc
810- let lpAssetAcc = $t02968629761._1
811- let rewardAcc = $t02968629761._2
812- let businessTreasuryAcc = $t02968629761._3
813- let powerShareDataTuple = $t02968629761._4
814- let $t02976829834 = powerShareDataTuple
815- let powerShareAcc = $t02976829834._1
816- let generatorPowerShareList = $t02976829834._2
821+ let $t03004130116 = acc
822+ let lpAssetAcc = $t03004130116._1
823+ let rewardAcc = $t03004130116._2
824+ let businessTreasuryAcc = $t03004130116._3
825+ let powerShareDataTuple = $t03004130116._4
826+ let $t03012330189 = powerShareDataTuple
827+ let powerShareAcc = $t03012330189._1
828+ let generatorPowerShareList = $t03012330189._2
817829 let newGeneratorPowerShareList = (generatorPowerShareList :+ $Tuple2(toString(generator), shareAmountToPower))
818830 $Tuple4((lpAssetAcc + lpAssetAmount), (rewardAcc + treasuryRewardOrFail), (businessTreasuryAcc + businessTreasuryAmountPart), $Tuple2((powerShareAcc + shareAmountToPower), newGeneratorPowerShareList))
819831 }
821833 }
822834
823835 let list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
824- let $t03028230444 = {
836+ let $t03063730799 = {
825837 let $l = list
826838 let $s = size($l)
827839 let $acc0 = $Tuple4(0, 0, 0, $Tuple2(0, nil))
835847
836848 $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)
837849 }
838- if (($t03028230444 == $t03028230444))
850+ if (($t03063730799 == $t03063730799))
839851 then {
840- let powerShareDataTuple = $t03028230444._4
841- let rewardToBusinessTreasuryAmount = $t03028230444._3
842- let rewardAmountTotal = $t03028230444._2
843- let lpAssetAmountTotal = $t03028230444._1
844- let $t03044830517 = powerShareDataTuple
845- let amountToPowerTotal = $t03044830517._1
846- let powerShareAmountsList = $t03044830517._2
852+ let powerShareDataTuple = $t03063730799._4
853+ let rewardToBusinessTreasuryAmount = $t03063730799._3
854+ let rewardAmountTotal = $t03063730799._2
855+ let lpAssetAmountTotal = $t03063730799._1
856+ let $t03080330872 = powerShareDataTuple
857+ let amountToPowerTotal = $t03080330872._1
858+ let powerShareAmountsList = $t03080330872._2
847859 let rewardToMainTreasuryAmount = (((rewardAmountTotal - rewardToBusinessTreasuryAmount) - blockProcessingReward) - amountToPowerTotal)
848860 let invested = valueOrElse(getInteger(factoryAddressOrFail, keyInvested(unit)), 0)
849861 let powerShareActions = if ((amountToPowerTotal > 0))
861873 0
862874 }
863875 func stakePowerInvoke (acc,next) = {
864- let $t03139131426 = next
865- let generator = $t03139131426._1
866- let shareAmount = $t03139131426._2
876+ let $t03174631781 = next
877+ let generator = $t03174631781._1
878+ let shareAmount = $t03174631781._2
867879 if ((amountToPowerTotal > 0))
868880 then {
869881 let powerAmount = fraction(shareAmount, totalPowerAmountInt, amountToPowerTotal)
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 WAVES = "WAVES"
1313
1414 let blocksProcessingBatchSizeMax = 10
1515
1616 func wrapErr (s) = ((CONTRACT_NAME + ": ") + s)
1717
1818
1919 func throwErr (s) = throw(wrapErr(s))
2020
2121
2222 func assetIdToString (assetId) = match assetId {
2323 case b: ByteVector =>
2424 toBase58String(b)
2525 case _: Unit =>
2626 WAVES
2727 case _ =>
2828 throw("Match error")
2929 }
3030
3131
3232 func stringToAssetId (s) = if ((s == WAVES))
3333 then unit
3434 else fromBase58String(s)
3535
3636
3737 func abs (n) = if ((0 > n))
3838 then -(n)
3939 else n
4040
4141
4242 func keyFactoryAddress () = makeString(["%s", "factory"], SEP)
4343
4444
4545 func keyManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP)
4646
4747
4848 func keyLpAssetId () = makeString(["%s", "lpAssetId"], SEP)
4949
5050
5151 func keyProxyTreasuryAddress () = makeString(["%s", "proxyTreasury"], SEP)
5252
5353
5454 func keyMainTreasuryAddress () = makeString(["%s", "mainTreasury"], SEP)
5555
5656
5757 func keyBusinessTreasuryAddress () = makeString(["%s", "businessTreasury"], SEP)
58+
59+
60+func keyTrustedFinalizeAddressList () = makeString(["%s", "trustedAddressList"], SEP)
5861
5962
6063 func keyBusinessTreasuryPart () = makeString(["%s", "businessTreasuryPart"], SEP)
6164
6265
6366 func keyPowerContractAddress () = makeString(["%s", "powerContract"], SEP)
6467
6568
6669 func keyPowerShareRatio () = makeString(["%s", "powerShareRatio"], SEP)
6770
6871
6972 func keyPowerAssetId () = makeString(["%s", "powerAssetId"], SEP)
7073
7174
7275 func keyL2mpAssetId () = makeString(["%s", "l2mpAssetId"], SEP)
7376
7477
7578 func keyL2mpProxyAddress () = makeString(["%s", "l2mpProxy"], SEP)
7679
7780
7881 func keyInvested (assetId) = makeString(["%s%s", "invested", assetIdToString(assetId)], SEP)
7982
8083
8184 func keyDonated (assetId) = makeString(["%s%s", "donated", assetIdToString(assetId)], SEP)
8285
8386
8487 func keyAvailable (userAddress) = makeString(["%s%s", "available", toString(userAddress)], SEP)
8588
8689
8790 func keyClaimed (userAddress) = makeString(["%s%s", "claimed", toString(userAddress)], SEP)
8891
8992
9093 func keyCurrentPeriod () = makeString(["%s", "currentPeriod"], SEP)
9194
9295
9396 func keyPriceForPeriod (period) = makeString(["%s%d", "price", toString(period)], SEP)
9497
9598
9699 func keyStartHeight (period) = makeString(["%s%d", "startHeight", toString(period)], SEP)
97100
98101
99102 func keyPowerManagerBonus (period) = makeString(["%s%d", "powerManagerBonus", toString(period)], SEP)
100103
101104
102105 func keyClaimWavesAmount (period) = makeString(["%s%d", "claimWavesAmount", toString(period)], SEP)
103106
104107
105108 func keyPeriodLength () = "%s__periodLength"
106109
107110
108111 func keyInvestPeriodLength () = "%s__investPeriodLength"
109112
110113
111114 func keyBlockProcessingReward () = "%s__blockProcessingReward"
112115
113116
114117 func keyNextBlockToProcess () = "%s__nextBlockToProcess"
115118
116119
117120 func keyBlockProcessed (height) = makeString(["%s%d", "blockProcessed", toString(height)], SEP)
118121
119122
120123 func keyWithdrawal () = "%s__withdrawal"
121124
122125
123126 func keyWithdrawalPeriod (period) = makeString(["%s%d", "withdrawalPeriod", toString(period)], SEP)
124127
125128
126129 func keyWithdrawalRequest (userAddress,txId) = makeString(["%s%s%s", "withdrawal", toString(userAddress), toBase58String(txId)], SEP)
127130
128131
129132 func valueWithdrawalRequest (status,lpAssetAmount,targetPeriod,claimTxId) = {
130133 let claimTxIdStr = match claimTxId {
131134 case b: ByteVector =>
132135 toBase58String(b)
133136 case _: Unit =>
134137 "SOON"
135138 case _ =>
136139 throw("Match error")
137140 }
138141 makeString(["%s%d%d%s", status, toString(lpAssetAmount), toString(targetPeriod), claimTxIdStr], SEP)
139142 }
140143
141144
142145 func keyWithdrawalHistory (userAddress,txId) = makeString(["%s%s%s", "withdrawalHistory", toString(userAddress), toBase58String(txId)], SEP)
143146
144147
145148 func keyPeriodWithdrawalAssetIds (period) = makeString(["%s%d", "periodReward", toString(period)], SEP)
146149
147150
148151 func keyPeriodWithdrawalAmounts (period) = makeString(["%s%d", "periodRewardAmount", toString(period)], SEP)
149152
150153
151154 func parseWithdrawalRequestValueOrFail (s) = {
152155 let parts = split(s, SEP)
153156 if ((size(parts) == 5))
154157 then {
155158 let status = parts[1]
156159 let lpAssetAmount = valueOrErrorMessage(parseInt(parts[2]), wrapErr("invalid lpAssetAmount"))
157160 let targetPeriod = valueOrErrorMessage(parseInt(parts[3]), wrapErr("invalid targetPeriod"))
158161 let claimTxId = parts[4]
159162 $Tuple4(status, lpAssetAmount, targetPeriod, claimTxId)
160163 }
161164 else throwErr("invalid withdrawal request value")
162165 }
163166
164167
165168 let factoryAddressOption = match getString(this, keyFactoryAddress()) {
166169 case s: String =>
167170 addressFromString(s)
168171 case _: Unit =>
169172 unit
170173 case _ =>
171174 throw("Match error")
172175 }
173176
174177 let factoryAddressOrFail = valueOrErrorMessage(factoryAddressOption, wrapErr("invalid factory address"))
175178
176179 let lpAssetIdOption = match factoryAddressOption {
177180 case a: Address =>
178181 match getString(a, keyLpAssetId()) {
179182 case s: String =>
180183 fromBase58String(s)
181184 case _: Unit =>
182185 unit
183186 case _ =>
184187 throw("Match error")
185188 }
186189 case _: Unit =>
187190 unit
188191 case _ =>
189192 throw("Match error")
190193 }
191194
192195 let lpAssetIdOrFail = valueOrErrorMessage(lpAssetIdOption, wrapErr("invalid lpAssetId"))
193196
194197 let proxyTreasuryAddressOption = match factoryAddressOption {
195198 case a: Address =>
196199 match getString(a, keyProxyTreasuryAddress()) {
197200 case s: String =>
198201 addressFromString(s)
199202 case _: Unit =>
200203 unit
201204 case _ =>
202205 throw("Match error")
203206 }
204207 case _: Unit =>
205208 unit
206209 case _ =>
207210 throw("Match error")
208211 }
209212
210213 let proxyTreasuryAddressOrFail = valueOrErrorMessage(proxyTreasuryAddressOption, wrapErr("invalid proxy treasury address"))
211214
212215 let mainTreasuryAddressOption = match factoryAddressOption {
213216 case a: Address =>
214217 match getString(a, keyMainTreasuryAddress()) {
215218 case s: String =>
216219 addressFromString(s)
217220 case _: Unit =>
218221 unit
219222 case _ =>
220223 throw("Match error")
221224 }
222225 case _: Unit =>
223226 unit
224227 case _ =>
225228 throw("Match error")
226229 }
227230
228231 let businessTreasuryAddressOption = match factoryAddressOption {
229232 case a: Address =>
230233 match getString(a, keyBusinessTreasuryAddress()) {
231234 case s: String =>
232235 addressFromString(s)
233236 case _: Unit =>
234237 unit
235238 case _ =>
236239 throw("Match error")
237240 }
238241 case _: Unit =>
239242 unit
240243 case _ =>
241244 throw("Match error")
242245 }
243246
244247 let mainTreasuryAddressOrFail = valueOrErrorMessage(mainTreasuryAddressOption, wrapErr("invalid main treasury address"))
245248
246249 let businessTreasuryAddressOrFail = valueOrErrorMessage(businessTreasuryAddressOption, wrapErr("invalid business treasury address"))
247250
248251 let powerContractAddressOption = match factoryAddressOption {
249252 case a: Address =>
250253 match getString(a, keyPowerContractAddress()) {
251254 case s: String =>
252255 addressFromString(s)
253256 case _: Unit =>
254257 unit
255258 case _ =>
256259 throw("Match error")
257260 }
258261 case _: Unit =>
259262 unit
260263 case _ =>
261264 throw("Match error")
262265 }
263266
264267 let powerContractAddressOrFail = valueOrErrorMessage(powerContractAddressOption, wrapErr("invalid power contract address"))
265268
266269 let powerAssetIdStringOrFail = valueOrErrorMessage(getString(factoryAddressOrFail, keyPowerAssetId()), wrapErr("power asset id not found"))
267270
268271 let l2mpProxyAddressOption = match factoryAddressOption {
269272 case a: Address =>
270273 match getString(a, keyL2mpProxyAddress()) {
271274 case s: String =>
272275 addressFromString(s)
273276 case _: Unit =>
274277 unit
275278 case _ =>
276279 throw("Match error")
277280 }
278281 case _: Unit =>
279282 unit
280283 case _ =>
281284 throw("Match error")
282285 }
283286
284287 let l2mpProxyAddressOrFail = valueOrErrorMessage(l2mpProxyAddressOption, wrapErr("invalid l2mp proxy address"))
285288
286289 let l2mpAssetIdStringOrFail = valueOrErrorMessage(getString(factoryAddressOrFail, keyL2mpAssetId()), wrapErr("l2mp asset id not found"))
287290
288291 func getManagerPublicKeyOrUnit () = match factoryAddressOption {
289292 case fa: Address =>
290293 match getString(fa, keyManagerPublicKey()) {
291294 case pub: String =>
292295 fromBase58String(pub)
293296 case _ =>
294297 unit
295298 }
296299 case _ =>
297300 unit
298301 }
299302
300303
301304 func onlyAddress (i,address) = if ((i.caller == address))
302305 then true
303306 else throwErr("permission denied")
304307
305308
306309 func onlyFactory (i) = onlyAddress(i, factoryAddressOrFail)
307310
308311
312+func isTrustedAddress (i) = {
313+ let listString = valueOrElse(getString(factoryAddressOrFail, keyTrustedFinalizeAddressList()), "")
314+ let addressList = split(listString, SEP)
315+ containsElement(addressList, toString(i.originCaller))
316+ }
317+
318+
309319 func rewardForOption (rewards,target) = {
310320 let s = size(rewards)
311- let $t073697394 = rewards[0]
312- let a0 = $t073697394._1
313- let r0 = $t073697394._2
314- let $t073977422 = rewards[1]
315- let a1 = $t073977422._1
316- let r1 = $t073977422._2
317- let $t074257450 = rewards[2]
318- let a2 = $t074257450._1
319- let r2 = $t074257450._2
321+ let $t077007725 = rewards[0]
322+ let a0 = $t077007725._1
323+ let r0 = $t077007725._2
324+ let $t077287753 = rewards[1]
325+ let a1 = $t077287753._1
326+ let r1 = $t077287753._2
327+ let $t077567781 = rewards[2]
328+ let a2 = $t077567781._1
329+ let r2 = $t077567781._2
320330 if (if ((s > 0))
321331 then (a0 == target)
322332 else false)
323333 then r0
324334 else if (if ((s > 1))
325335 then (a1 == target)
326336 else false)
327337 then r1
328338 else if (if ((s > 2))
329339 then (a2 == target)
330340 else false)
331341 then r2
332342 else unit
333343 }
334344
335345
336346 func calculatePrice (lpPartInWaves) = {
337347 let lpAssetAmountToBurn = valueOrElse(getInteger(factoryAddressOrFail, keyWithdrawal()), 0)
338348 let lpAssetQuantity = valueOrErrorMessage(assetInfo(lpAssetIdOrFail), wrapErr("invalid lpAsset info")).quantity
339349 let newPrice = fraction(lpPartInWaves, SCALE8, (lpAssetQuantity - lpAssetAmountToBurn))
340350 let checkIfPriceNotZero = if ((newPrice != 0))
341351 then true
342352 else throwErr("LP price cannot be 0")
343353 if ((checkIfPriceNotZero == checkIfPriceNotZero))
344354 then {
345355 let lpAssetFinalQuantity = (lpAssetQuantity - lpAssetAmountToBurn)
346356 $Tuple3(newPrice, lpAssetAmountToBurn, lpAssetFinalQuantity)
347357 }
348358 else throw("Strict value is not equal to itself.")
349359 }
350360
351361
352362 func claimCollateralINTERNAL (userAddressBytes,txId) = {
353363 let userAddress = Address(userAddressBytes)
354364 let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period"))
355365 let withdrawalRequestOption = valueOrErrorMessage(getString(factoryAddressOrFail, keyWithdrawalRequest(userAddress, txId)), wrapErr("invalid withdrawal request"))
356- let $t086178730 = parseWithdrawalRequestValueOrFail(withdrawalRequestOption)
357- let status = $t086178730._1
358- let lpAssetAmount = $t086178730._2
359- let unlockPeriod = $t086178730._3
360- let claimTxId = $t086178730._4
366+ let $t089489061 = parseWithdrawalRequestValueOrFail(withdrawalRequestOption)
367+ let status = $t089489061._1
368+ let lpAssetAmount = $t089489061._2
369+ let unlockPeriod = $t089489061._3
370+ let claimTxId = $t089489061._4
361371 if ((unlockPeriod > currentPeriodOrFail))
362372 then throwErr("invalid withdrawal request period")
363373 else {
364374 let priceOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPriceForPeriod(unlockPeriod)), wrapErr("invalid price"))
365375 let wavesAmount = if ((priceOrFail > 0))
366376 then fraction(lpAssetAmount, priceOrFail, SCALE8)
367377 else 0
368378 let targetPeriod = (unlockPeriod - 1)
369379 let assetsString = getStringValue(factoryAddressOrFail, keyPeriodWithdrawalAssetIds(targetPeriod))
370380 let amountsString = getStringValue(factoryAddressOrFail, keyPeriodWithdrawalAmounts(targetPeriod))
371381 let totalLpAmountInPeriod = valueOrElse(getInteger(factoryAddressOrFail, keyWithdrawalPeriod(targetPeriod)), 0)
372382 let userPartSCALE8 = if ((totalLpAmountInPeriod == 0))
373383 then 0
374384 else fraction(lpAssetAmount, SCALE8, totalLpAmountInPeriod)
375385 func getUserPartAmounts (currentState,amount) = {
376386 let userPartAmount = fraction(parseIntValue(amount), userPartSCALE8, SCALE8)
377387 (currentState :+ toString(userPartAmount))
378388 }
379389
380390 let amountsList = split_51C(amountsString, SEP)
381391 let amountsPrefix = value(amountsList[0])
382392 let amountsListWithoutPrefix = removeByIndex(split_51C(amountsString, SEP), 0)
383393 let userPartAmounts = {
384394 let $l = amountsListWithoutPrefix
385395 let $s = size($l)
386396 let $acc0 = nil
387397 func $f0_1 ($a,$i) = if (($i >= $s))
388398 then $a
389399 else getUserPartAmounts($a, $l[$i])
390400
391401 func $f0_2 ($a,$i) = if (($i >= $s))
392402 then $a
393403 else throw("List size exceeds 10")
394404
395405 $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)
396406 }
397407 let userPartAmountsString = makeString([amountsPrefix, makeString(userPartAmounts, SEP)], SEP)
398408 $Tuple6(userAddress, lpAssetAmount, targetPeriod, wavesAmount, assetsString, userPartAmountsString)
399409 }
400410 }
401411
402412
403413 func claimCollateralREADONLYStringResponse (userAddressBytes,txId) = {
404- let $t01041910585 = claimCollateralINTERNAL(userAddressBytes, txId)
405- let userAddress = $t01041910585._1
406- let lpAssetAmount = $t01041910585._2
407- let targetPeriod = $t01041910585._3
408- let wavesAmount = $t01041910585._4
409- let assetsString = $t01041910585._5
410- let amountsString = $t01041910585._6
414+ let $t01075010916 = claimCollateralINTERNAL(userAddressBytes, txId)
415+ let userAddress = $t01075010916._1
416+ let lpAssetAmount = $t01075010916._2
417+ let targetPeriod = $t01075010916._3
418+ let wavesAmount = $t01075010916._4
419+ let assetsString = $t01075010916._5
420+ let amountsString = $t01075010916._6
411421 let assets = makeString(removeByIndex(split_51C(assetsString, SEP), 0), ":")
412422 let amounts = makeString(removeByIndex(split_51C(amountsString, SEP), 0), ":")
413423 makeString(["%d%s%s", toString(wavesAmount), assets, amounts], SEP)
414424 }
415425
416426
417427 func getRewardSplit (generatorRewardAmount) = {
418428 let powerShareRatio = max([0, min([valueOrElse(getInteger(factoryAddressOrFail, keyPowerShareRatio()), 0), SCALE8])])
419429 let businessPartRatio = max([0, min([valueOrElse(getInteger(factoryAddressOrFail, keyBusinessTreasuryPart()), 0), SCALE8])])
420430 let amountToPowerPart = fraction(generatorRewardAmount, powerShareRatio, SCALE8)
421431 let businessTreasuryAmountPart = fraction(generatorRewardAmount, businessPartRatio, SCALE8)
422432 let rewardRemainder = ((generatorRewardAmount - amountToPowerPart) - businessTreasuryAmountPart)
423433 if ((rewardRemainder > 0))
424434 then $Tuple3(amountToPowerPart, businessTreasuryAmountPart, rewardRemainder)
425435 else throwErr("amount to main treasury cannot be negative")
426436 }
427437
428438
429439 func calcRewardSplitForAmount (amount) = {
430- let $t01168411777 = getRewardSplit(amount)
431- let amountToPowerPart = $t01168411777._1
432- let businessTreasuryAmountPart = $t01168411777._2
433- let rewardRemainder = $t01168411777._3
440+ let $t01201512108 = getRewardSplit(amount)
441+ let amountToPowerPart = $t01201512108._1
442+ let businessTreasuryAmountPart = $t01201512108._2
443+ let rewardRemainder = $t01201512108._3
434444 let blockProcessingReward = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyBlockProcessingReward()), wrapErr("invalid block processing reward"))
435445 let blockProcessingRewardByGenerator = (blockProcessingReward / blocksProcessingBatchSizeMax)
436446 let toLpAmount = (rewardRemainder - blockProcessingReward)
437447 $Tuple5(amountToPowerPart, businessTreasuryAmountPart, blockProcessingReward, toLpAmount, amount)
438448 }
439449
440450
441451 @Callable(i)
442452 func rewardSplitREADONLY () = {
443453 let targetBlockHeight = (height - 1)
444454 let targetBlockInfo = valueOrErrorMessage(blockInfoByHeight(targetBlockHeight), wrapErr("invalid block info"))
445455 let treasuryRewardOrFail = valueOrErrorMessage(rewardForOption(targetBlockInfo.rewards, proxyTreasuryAddressOrFail), wrapErr(("invalid treasury reward for height " + toString(targetBlockHeight))))
446456 $Tuple2(nil, calcRewardSplitForAmount(treasuryRewardOrFail))
447457 }
448458
449459
450460
451461 @Callable(i)
452462 func claimLP (userAddressBytes) = {
453463 let checkCaller = onlyFactory(i)
454464 if ((checkCaller == checkCaller))
455465 then {
456466 let userAddress = Address(userAddressBytes)
457467 let available = valueOrElse(getInteger(factoryAddressOrFail, keyAvailable(userAddress)), 0)
458468 let claimed = valueOrElse(getInteger(factoryAddressOrFail, keyClaimed(userAddress)), 0)
459469 let factoryActions = if ((available > 0))
460470 then [invoke(factoryAddressOrFail, "transferAsset", [userAddressBytes, available, lpAssetIdOrFail], nil), invoke(factoryAddressOrFail, "integerEntry", [keyAvailable(userAddress), 0], nil), invoke(factoryAddressOrFail, "integerEntry", [keyClaimed(userAddress), (claimed + available)], nil)]
461471 else throwErr("nothing to claim")
462472 $Tuple2(nil, factoryActions)
463473 }
464474 else throw("Strict value is not equal to itself.")
465475 }
466476
467477
468478
469479 @Callable(i)
470480 func finalize (userAddressBytes,donationPartInWaves,lpPartInWaves,claimPartInWaves,powerStakePartInWaves) = {
471481 let checkCaller = onlyFactory(i)
472482 if ((checkCaller == checkCaller))
473483 then {
474484 let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period"))
475485 let periodLength = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPeriodLength()), wrapErr("invalid period length"))
476486 let currentStartHeight = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyStartHeight(currentPeriodOrFail)), wrapErr("invalid start height"))
477487 let currentPriceOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPriceForPeriod(currentPeriodOrFail)), wrapErr("invalid price"))
478488 let nextBlockToProcess = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyNextBlockToProcess()), wrapErr("invalid next block to process"))
479489 let periodEndHeight = ((currentStartHeight + periodLength) - 1)
480- let checks = [if ((i.originCaller == mainTreasuryAddressOrFail))
490+ let checks = [if (if (isTrustedAddress(i))
491+ then true
492+ else (i.originCaller == mainTreasuryAddressOrFail))
481493 then true
482494 else throwErr("permission denied"), if ((nextBlockToProcess > periodEndHeight))
483495 then true
484496 else throwErr("unprocessed blocks"), if ((donationPartInWaves >= 0))
485497 then true
486498 else throwErr("invalid donation part"), if ((lpPartInWaves >= 0))
487499 then true
488500 else throwErr("invalid lp part"), if ((claimPartInWaves >= 0))
489501 then true
490502 else throwErr("invalid claim part"), if ((powerStakePartInWaves >= 0))
491503 then true
492504 else throwErr("invalid PWR stake part")]
493505 if ((checks == checks))
494506 then {
495- let $t01511515220 = calculatePrice(lpPartInWaves)
496- let newPrice = $t01511515220._1
497- let lpAssetAmountToBurn = $t01511515220._2
498- let lpAssetFinalQuantity = $t01511515220._3
507+ let $t01547015575 = calculatePrice(lpPartInWaves)
508+ let newPrice = $t01547015575._1
509+ let lpAssetAmountToBurn = $t01547015575._2
510+ let lpAssetFinalQuantity = $t01547015575._3
499511 let newPeriod = (currentPeriodOrFail + 1)
500512 func addNewAction (actions,payment) = {
501- let $t01536815430 = actions
502- let scriptTransfers = $t01536815430._1
503- let assetIdsString = $t01536815430._2
504- let amountsString = $t01536815430._3
513+ let $t01572315785 = actions
514+ let scriptTransfers = $t01572315785._1
515+ let assetIdsString = $t01572315785._2
516+ let amountsString = $t01572315785._3
505517 let paymentAmount = payment.amount
506518 let paymentAssetId = payment.assetId
507519 if ((assetIdToString(paymentAssetId) == l2mpAssetIdStringOrFail))
508520 then {
509521 let transferToL2mpProxy = ScriptTransfer(l2mpProxyAddressOrFail, paymentAmount, paymentAssetId)
510522 $Tuple3((scriptTransfers :+ transferToL2mpProxy), assetIdsString, amountsString)
511523 }
512524 else {
513525 let newAssetIdsString = ("%s" + makeString([assetIdsString, assetIdToString(paymentAssetId)], SEP))
514526 let newAmountsString = ("%d" + makeString([amountsString, toString(paymentAmount)], SEP))
515527 let newScriptTransfer = ScriptTransfer(factoryAddressOrFail, paymentAmount, paymentAssetId)
516528 $Tuple3((scriptTransfers :+ newScriptTransfer), newAssetIdsString, newAmountsString)
517529 }
518530 }
519531
520- let $t01622416315 = {
532+ let $t01657916670 = {
521533 let $l = i.payments
522534 let $s = size($l)
523535 let $acc0 = $Tuple3(nil, "", "")
524536 func $f0_1 ($a,$i) = if (($i >= $s))
525537 then $a
526538 else addNewAction($a, $l[$i])
527539
528540 func $f0_2 ($a,$i) = if (($i >= $s))
529541 then $a
530542 else throw("List size exceeds 10")
531543
532544 $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)
533545 }
534- let scriptTransfers = $t01622416315._1
535- let AssetIds = $t01622416315._2
536- let Amounts = $t01622416315._3
546+ let scriptTransfers = $t01657916670._1
547+ let AssetIds = $t01657916670._2
548+ let Amounts = $t01657916670._3
537549 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)]
538550 $Tuple2(scriptTransfers, factoryActions)
539551 }
540552 else throw("Strict value is not equal to itself.")
541553 }
542554 else throw("Strict value is not equal to itself.")
543555 }
544556
545557
546558
547559 @Callable(i)
548560 func finalizeREADONLY (donationPartInWaves,lpPartInWaves,claimPartInWaves,powerStakePartInWaves) = {
549561 let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period"))
550562 let periodLength = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPeriodLength()), wrapErr("invalid period length"))
551563 let currentStartHeight = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyStartHeight(currentPeriodOrFail)), wrapErr("invalid start height"))
552564 let currentPriceOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPriceForPeriod(currentPeriodOrFail)), wrapErr("invalid price"))
553565 let nextBlockToProcess = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyNextBlockToProcess()), wrapErr("invalid next block to process"))
554566 let periodEndHeight = ((currentStartHeight + periodLength) - 1)
555567 let checks = [if ((nextBlockToProcess > periodEndHeight))
556568 then true
557569 else throwErr("unprocessed blocks"), if ((donationPartInWaves >= 0))
558570 then true
559571 else throwErr("invalid donation part"), if ((lpPartInWaves >= 0))
560572 then true
561573 else throwErr("invalid lp part"), if ((claimPartInWaves >= 0))
562574 then true
563575 else throwErr("invalid claim part"), if ((powerStakePartInWaves >= 0))
564576 then true
565577 else throwErr("invalid PWR stake part")]
566578 if ((checks == checks))
567579 then {
568- let $t01933219437 = calculatePrice(lpPartInWaves)
569- let newPrice = $t01933219437._1
570- let lpAssetAmountToBurn = $t01933219437._2
571- let lpAssetFinalQuantity = $t01933219437._3
580+ let $t01968719792 = calculatePrice(lpPartInWaves)
581+ let newPrice = $t01968719792._1
582+ let lpAssetAmountToBurn = $t01968719792._2
583+ let lpAssetFinalQuantity = $t01968719792._3
572584 $Tuple2(nil, $Tuple6(claimPartInWaves, lpPartInWaves, donationPartInWaves, newPrice, lpAssetAmountToBurn, lpAssetFinalQuantity))
573585 }
574586 else throw("Strict value is not equal to itself.")
575587 }
576588
577589
578590
579591 @Callable(i)
580592 func invest (userAddressBytes) = {
581593 let checkCaller = onlyFactory(i)
582594 if ((checkCaller == checkCaller))
583595 then {
584596 let userAddress = Address(userAddressBytes)
585597 let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period"))
586598 let currentStartHeight = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyStartHeight(currentPeriodOrFail)), wrapErr("invalid start height"))
587599 let investPeriodLength = getIntegerValue(factoryAddressOrFail, keyInvestPeriodLength())
588600 let heightCheck = if (((currentStartHeight + investPeriodLength) > height))
589601 then true
590602 else throwErr("too late to invest in this period")
591603 if ((heightCheck == heightCheck))
592604 then {
593605 let currentPriceOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPriceForPeriod(currentPeriodOrFail)), wrapErr("invalid price"))
594606 let payment = if ((size(i.payments) == 1))
595607 then i.payments[0]
596608 else throwErr("invalid payments")
597- let $t02054620723 = if (if ((payment.assetId == unit))
609+ let $t02090121078 = if (if ((payment.assetId == unit))
598610 then (payment.amount > 0)
599611 else false)
600612 then $Tuple2(payment.amount, payment.assetId)
601613 else throwErr("invalid payment amount")
602- let paymentAmount = $t02054620723._1
603- let paymentAssetId = $t02054620723._2
614+ let paymentAmount = $t02090121078._1
615+ let paymentAssetId = $t02090121078._2
604616 let treasuryPart = valueOrElse(getInteger(factoryAddressOrFail, keyBusinessTreasuryPart()), 0)
605617 let paymentsWithoutTreasuryPart = fraction(paymentAmount, (SCALE8 - treasuryPart), SCALE8)
606618 let lpAssetAmount = if ((currentPriceOrFail > 0))
607619 then fraction(paymentsWithoutTreasuryPart, SCALE8, currentPriceOrFail)
608620 else 0
609621 let invested = valueOrElse(getInteger(factoryAddressOrFail, keyInvested(unit)), 0)
610622 let actions = [ScriptTransfer(mainTreasuryAddressOrFail, paymentsWithoutTreasuryPart, paymentAssetId), ScriptTransfer(businessTreasuryAddressOrFail, treasuryPart, paymentAssetId)]
611623 let factoryActions = [invoke(factoryAddressOrFail, "integerEntry", [keyInvested(unit), (invested + paymentsWithoutTreasuryPart)], nil), invoke(factoryAddressOrFail, "reissue", [lpAssetAmount], nil), invoke(factoryAddressOrFail, "transferAsset", [userAddressBytes, lpAssetAmount, lpAssetIdOrFail], nil)]
612624 $Tuple2(actions, factoryActions)
613625 }
614626 else throw("Strict value is not equal to itself.")
615627 }
616628 else throw("Strict value is not equal to itself.")
617629 }
618630
619631
620632
621633 @Callable(i)
622634 func withdraw (userAddressBytes) = {
623635 let checkCaller = onlyFactory(i)
624636 if ((checkCaller == checkCaller))
625637 then {
626638 let userAddress = Address(userAddressBytes)
627639 let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period"))
628640 let periodLength = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPeriodLength()), wrapErr("invalid period length"))
629641 let currentStartHeight = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyStartHeight(currentPeriodOrFail)), wrapErr("invalid start height"))
630642 let heightCheck = if (((currentStartHeight + periodLength) > height))
631643 then true
632644 else throwErr("too late to withdraw in this period")
633645 if ((heightCheck == heightCheck))
634646 then {
635647 let payment = if ((size(i.payments) == 1))
636648 then i.payments[0]
637649 else throwErr(wrapErr("invalid payments"))
638650 let paymentAssetId = if ((payment.assetId == lpAssetIdOrFail))
639651 then lpAssetIdOrFail
640652 else throwErr("invalid payment asset")
641653 let paymentAmount = if ((payment.amount > 0))
642654 then payment.amount
643655 else throwErr("invalid payment amount")
644656 let withdrawal = valueOrElse(getInteger(factoryAddressOrFail, keyWithdrawal()), 0)
645657 let actions = [ScriptTransfer(factoryAddressOrFail, paymentAmount, paymentAssetId)]
646658 let factoryActions = [invoke(factoryAddressOrFail, "integerEntry", [keyWithdrawal(), (withdrawal + paymentAmount)], nil), invoke(factoryAddressOrFail, "stringEntry", [keyWithdrawalRequest(userAddress, i.transactionId), valueWithdrawalRequest(PENDING, paymentAmount, (currentPeriodOrFail + 1), unit)], nil)]
647659 if ((factoryActions == factoryActions))
648660 then $Tuple2(actions, factoryActions)
649661 else throw("Strict value is not equal to itself.")
650662 }
651663 else throw("Strict value is not equal to itself.")
652664 }
653665 else throw("Strict value is not equal to itself.")
654666 }
655667
656668
657669
658670 @Callable(i)
659671 func cancelWithdraw (userAddressBytes,txId) = {
660672 let checkCaller = onlyFactory(i)
661673 if ((checkCaller == checkCaller))
662674 then throwErr("cancelWithdraw is deprecated")
663675 else throw("Strict value is not equal to itself.")
664676 }
665677
666678
667679
668680 @Callable(i)
669681 func claimCollateral (userAddressBytes,txId) = {
670682 let checkCaller = onlyFactory(i)
671683 if ((checkCaller == checkCaller))
672684 then {
673- let $t02369023875 = claimCollateralINTERNAL(userAddressBytes, fromBase58String(txId))
674- let userAddress = $t02369023875._1
675- let lpAssetAmount = $t02369023875._2
676- let targetPeriod = $t02369023875._3
677- let wavesAmount = $t02369023875._4
678- let assetsString = $t02369023875._5
679- let amountsString = $t02369023875._6
685+ let $t02404524230 = claimCollateralINTERNAL(userAddressBytes, fromBase58String(txId))
686+ let userAddress = $t02404524230._1
687+ let lpAssetAmount = $t02404524230._2
688+ let targetPeriod = $t02404524230._3
689+ let wavesAmount = $t02404524230._4
690+ let assetsString = $t02404524230._5
691+ let amountsString = $t02404524230._6
680692 let assetsList = removeByIndex(split_51C(assetsString, SEP), 0)
681693 let amountsList = removeByIndex(split_51C(amountsString, SEP), 0)
682694 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)]
683695 $Tuple2(nil, factoryActions)
684696 }
685697 else throw("Strict value is not equal to itself.")
686698 }
687699
688700
689701
690702 @Callable(i)
691703 func claimCollateralBulk (userAddressBytes,txIds) = {
692704 let checkCaller = onlyFactory(i)
693705 if ((checkCaller == checkCaller))
694706 then {
695707 func addNewAction (state,txId) = {
696- let $t02463124830 = claimCollateralINTERNAL(userAddressBytes, fromBase58String(txId))
697- let userAddress = $t02463124830._1
698- let lpAssetAmount = $t02463124830._2
699- let targetPeriod = $t02463124830._3
700- let wavesAmount = $t02463124830._4
701- let assetsString = $t02463124830._5
702- let amountsString = $t02463124830._6
708+ let $t02498625185 = claimCollateralINTERNAL(userAddressBytes, fromBase58String(txId))
709+ let userAddress = $t02498625185._1
710+ let lpAssetAmount = $t02498625185._2
711+ let targetPeriod = $t02498625185._3
712+ let wavesAmount = $t02498625185._4
713+ let assetsString = $t02498625185._5
714+ let amountsString = $t02498625185._6
703715 let assetsList = removeByIndex(split_51C(assetsString, SEP), 0)
704716 let amountsList = removeByIndex(split_51C(amountsString, SEP), 0)
705717 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)]
706718 (state ++ newActions)
707719 }
708720
709721 let allFactoryActions = {
710722 let $l = txIds
711723 let $s = size($l)
712724 let $acc0 = nil
713725 func $f0_1 ($a,$i) = if (($i >= $s))
714726 then $a
715727 else addNewAction($a, $l[$i])
716728
717729 func $f0_2 ($a,$i) = if (($i >= $s))
718730 then $a
719731 else throw("List size exceeds 10")
720732
721733 $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)
722734 }
723735 $Tuple2(nil, allFactoryActions)
724736 }
725737 else throw("Strict value is not equal to itself.")
726738 }
727739
728740
729741
730742 @Callable(i)
731743 func claimCollateralREADONLY (userAddressBytes,txId) = {
732744 let response = claimCollateralREADONLYStringResponse(userAddressBytes, fromBase58String(txId))
733745 $Tuple2(nil, response)
734746 }
735747
736748
737749
738750 @Callable(i)
739751 func claimCollateralBulkREADONLY (userAddressBytes,txIds) = {
740752 func processTxId (state,txId) = {
741753 let response = claimCollateralREADONLYStringResponse(userAddressBytes, fromBase58String(txId))
742754 (state :+ response)
743755 }
744756
745757 let allResponses = {
746758 let $l = txIds
747759 let $s = size($l)
748760 let $acc0 = nil
749761 func $f0_1 ($a,$i) = if (($i >= $s))
750762 then $a
751763 else processTxId($a, $l[$i])
752764
753765 func $f0_2 ($a,$i) = if (($i >= $s))
754766 then $a
755767 else throw("List size exceeds 10")
756768
757769 $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)
758770 }
759771 $Tuple2(nil, allResponses)
760772 }
761773
762774
763775
764776 @Callable(i)
765777 func processBlocks (userAddressBytes) = {
766778 let checkCaller = onlyFactory(i)
767779 if ((checkCaller == checkCaller))
768780 then {
769781 let userAddress = Address(userAddressBytes)
770782 let currentPeriodOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyCurrentPeriod()), wrapErr("invalid period"))
771783 let periodLength = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPeriodLength()), wrapErr("invalid period length"))
772784 let currentStartHeight = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyStartHeight(currentPeriodOrFail)), wrapErr("invalid start height"))
773785 let currentPriceOrFail = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyPriceForPeriod(currentPeriodOrFail)), wrapErr("invalid price"))
774786 let nextBlockToProcess = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyNextBlockToProcess()), wrapErr("invalid next block to process"))
775787 let periodEndHeight = ((currentStartHeight + periodLength) - 1)
776788 let blocksProcessingBatchSize = if (if (if ((height >= nextBlockToProcess))
777789 then if ((nextBlockToProcess >= currentStartHeight))
778790 then true
779791 else (currentPeriodOrFail == 0)
780792 else false)
781793 then (periodEndHeight >= nextBlockToProcess)
782794 else false)
783795 then min([((periodEndHeight - nextBlockToProcess) + 1), blocksProcessingBatchSizeMax])
784796 else throwErr(wrapErr("invalid target block"))
785797 let blockProcessingReward = valueOrErrorMessage(getInteger(factoryAddressOrFail, keyBlockProcessingReward()), wrapErr("invalid block processing reward"))
786798 let blockProcessingRewardByGenerator = (blockProcessingReward / blocksProcessingBatchSize)
787799 let blockProcessingRewardByGeneratorRemainder = (blockProcessingReward - (blockProcessingRewardByGenerator * blocksProcessingBatchSize))
788800 func map (acc,inc) = if ((inc >= blocksProcessingBatchSize))
789801 then acc
790802 else {
791803 let targetBlockHeight = (nextBlockToProcess + inc)
792804 let targetBlockInfo = valueOrErrorMessage(blockInfoByHeight(targetBlockHeight), wrapErr("invalid block info"))
793805 let treasuryRewardOrFail = valueOrErrorMessage(rewardForOption(targetBlockInfo.rewards, proxyTreasuryAddressOrFail), wrapErr(("invalid treasury reward for height " + toString(targetBlockHeight))))
794806 let generator = targetBlockInfo.generator
795807 let available = valueOrElse(getInteger(factoryAddressOrFail, keyAvailable(generator)), 0)
796808 let callerReward = if ((inc == (blocksProcessingBatchSize - 1)))
797809 then (blockProcessingRewardByGenerator + blockProcessingRewardByGeneratorRemainder)
798810 else blockProcessingRewardByGenerator
799- let $t02873028838 = getRewardSplit(treasuryRewardOrFail)
800- let shareAmountToPower = $t02873028838._1
801- let businessTreasuryAmountPart = $t02873028838._2
802- let rewardRemainder = $t02873028838._3
811+ let $t02908529193 = getRewardSplit(treasuryRewardOrFail)
812+ let shareAmountToPower = $t02908529193._1
813+ let businessTreasuryAmountPart = $t02908529193._2
814+ let rewardRemainder = $t02908529193._3
803815 let lpAssetAmount = if ((currentPriceOrFail > 0))
804816 then fraction((rewardRemainder - callerReward), SCALE8, currentPriceOrFail)
805817 else 0
806818 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)]
807819 if ((factoryActionsSingle == factoryActionsSingle))
808820 then {
809- let $t02968629761 = acc
810- let lpAssetAcc = $t02968629761._1
811- let rewardAcc = $t02968629761._2
812- let businessTreasuryAcc = $t02968629761._3
813- let powerShareDataTuple = $t02968629761._4
814- let $t02976829834 = powerShareDataTuple
815- let powerShareAcc = $t02976829834._1
816- let generatorPowerShareList = $t02976829834._2
821+ let $t03004130116 = acc
822+ let lpAssetAcc = $t03004130116._1
823+ let rewardAcc = $t03004130116._2
824+ let businessTreasuryAcc = $t03004130116._3
825+ let powerShareDataTuple = $t03004130116._4
826+ let $t03012330189 = powerShareDataTuple
827+ let powerShareAcc = $t03012330189._1
828+ let generatorPowerShareList = $t03012330189._2
817829 let newGeneratorPowerShareList = (generatorPowerShareList :+ $Tuple2(toString(generator), shareAmountToPower))
818830 $Tuple4((lpAssetAcc + lpAssetAmount), (rewardAcc + treasuryRewardOrFail), (businessTreasuryAcc + businessTreasuryAmountPart), $Tuple2((powerShareAcc + shareAmountToPower), newGeneratorPowerShareList))
819831 }
820832 else throw("Strict value is not equal to itself.")
821833 }
822834
823835 let list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
824- let $t03028230444 = {
836+ let $t03063730799 = {
825837 let $l = list
826838 let $s = size($l)
827839 let $acc0 = $Tuple4(0, 0, 0, $Tuple2(0, nil))
828840 func $f0_1 ($a,$i) = if (($i >= $s))
829841 then $a
830842 else map($a, $l[$i])
831843
832844 func $f0_2 ($a,$i) = if (($i >= $s))
833845 then $a
834846 else throw("List size exceeds 20")
835847
836848 $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)
837849 }
838- if (($t03028230444 == $t03028230444))
850+ if (($t03063730799 == $t03063730799))
839851 then {
840- let powerShareDataTuple = $t03028230444._4
841- let rewardToBusinessTreasuryAmount = $t03028230444._3
842- let rewardAmountTotal = $t03028230444._2
843- let lpAssetAmountTotal = $t03028230444._1
844- let $t03044830517 = powerShareDataTuple
845- let amountToPowerTotal = $t03044830517._1
846- let powerShareAmountsList = $t03044830517._2
852+ let powerShareDataTuple = $t03063730799._4
853+ let rewardToBusinessTreasuryAmount = $t03063730799._3
854+ let rewardAmountTotal = $t03063730799._2
855+ let lpAssetAmountTotal = $t03063730799._1
856+ let $t03080330872 = powerShareDataTuple
857+ let amountToPowerTotal = $t03080330872._1
858+ let powerShareAmountsList = $t03080330872._2
847859 let rewardToMainTreasuryAmount = (((rewardAmountTotal - rewardToBusinessTreasuryAmount) - blockProcessingReward) - amountToPowerTotal)
848860 let invested = valueOrElse(getInteger(factoryAddressOrFail, keyInvested(unit)), 0)
849861 let powerShareActions = if ((amountToPowerTotal > 0))
850862 then {
851863 let transferAction = [invoke(factoryAddressOrFail, "transferFromProxyTreasury", [factoryAddressOrFail.bytes, amountToPowerTotal], nil)]
852864 if ((transferAction == transferAction))
853865 then {
854866 let totalPowerAmount = invoke(factoryAddressOrFail, "swap", [powerAssetIdStringOrFail, WAVES, amountToPowerTotal], nil)
855867 if ((totalPowerAmount == totalPowerAmount))
856868 then {
857869 let totalPowerAmountInt = match totalPowerAmount {
858870 case pAmount: Int =>
859871 pAmount
860872 case _ =>
861873 0
862874 }
863875 func stakePowerInvoke (acc,next) = {
864- let $t03139131426 = next
865- let generator = $t03139131426._1
866- let shareAmount = $t03139131426._2
876+ let $t03174631781 = next
877+ let generator = $t03174631781._1
878+ let shareAmount = $t03174631781._2
867879 if ((amountToPowerTotal > 0))
868880 then {
869881 let powerAmount = fraction(shareAmount, totalPowerAmountInt, amountToPowerTotal)
870882 let inv = invoke(factoryAddressOrFail, "powerStake", [fromBase58String(generator), fromBase58String(powerAssetIdStringOrFail), powerAmount], nil)
871883 if ((inv == inv))
872884 then nil
873885 else throw("Strict value is not equal to itself.")
874886 }
875887 else nil
876888 }
877889
878890 let powerStakesActions = {
879891 let $l = powerShareAmountsList
880892 let $s = size($l)
881893 let $acc0 = 0
882894 func $f1_1 ($a,$i) = if (($i >= $s))
883895 then $a
884896 else stakePowerInvoke($a, $l[$i])
885897
886898 func $f1_2 ($a,$i) = if (($i >= $s))
887899 then $a
888900 else throw("List size exceeds 20")
889901
890902 $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)
891903 }
892904 if ((powerStakesActions == powerStakesActions))
893905 then nil
894906 else throw("Strict value is not equal to itself.")
895907 }
896908 else throw("Strict value is not equal to itself.")
897909 }
898910 else throw("Strict value is not equal to itself.")
899911 }
900912 else nil
901913 if ((powerShareActions == powerShareActions))
902914 then {
903915 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)]
904916 if ((actions == actions))
905917 then $Tuple2(nil, unit)
906918 else throw("Strict value is not equal to itself.")
907919 }
908920 else throw("Strict value is not equal to itself.")
909921 }
910922 else throw("Strict value is not equal to itself.")
911923 }
912924 else throw("Strict value is not equal to itself.")
913925 }
914926
915927
916928 @Verifier(tx)
917929 func verify () = {
918930 let publicKey = match getManagerPublicKeyOrUnit() {
919931 case pub: ByteVector =>
920932 pub
921933 case _ =>
922934 tx.senderPublicKey
923935 }
924936 sigVerify(tx.bodyBytes, tx.proofs[0], publicKey)
925937 }
926938

github/deemru/w8io/169f3d6 
136.88 ms