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