tx · 3YvdZnniiZ3EEdehUxfhoAaJENZmaJmNUzXc86AkmK9M 3MpygN8qm376tUAHB6mhC5BxG5NKYortiyX: -0.03700000 Waves 2023.03.17 17:11 [2494096] smart account 3MpygN8qm376tUAHB6mhC5BxG5NKYortiyX > SELF 0.00000000 Waves
{ "type": 13, "id": "3YvdZnniiZ3EEdehUxfhoAaJENZmaJmNUzXc86AkmK9M", "fee": 3700000, "feeAssetId": null, "timestamp": 1679062377246, "version": 2, "chainId": 84, "sender": "3MpygN8qm376tUAHB6mhC5BxG5NKYortiyX", "senderPublicKey": "BjnLnkAMaJLYAK36vQqSepUNjGeMDHfZGfmdYwGcLbmg", "proofs": [ "4ua5kMxw3wxRkcq1DqmEWQyGCWjraiQYrnrMP3V9irnu1aNmyDn2hi2boAQShemynK3ySdEoarCBWzo6FLnwJvAd", "KFWKeWGj7opqWZ5P9Vfm2bVhdfAWVgsiSdK7NN9LwQbnSfu9wHRuGFZ3GoaUUAK34suAf5oQgX9vdkJ1dDcHCKv" ], "script": "base64:BgJJCAISAwoBBBIECgIEARIGCgQBAQQBEgMKAQESBgoEAQgBARIECgIBARIDCgEBEgASABIAEgMKAQESBQoDBAEIEgASBAoCAQESAHAAB3ZlcnNpb24CBTIuMC4wAAhrVmVyc2lvbgIHdmVyc2lvbgAHa0FjdGl2ZQIGYWN0aXZlAAtrQWN0aXZlR2xvYgIUYWN0aXZlX2FsbF9jb250cmFjdHMAC2tEZXByZWNhdGVkAgtkZXByZWNhdGVkXwAJa0Fzc2V0SWRBAgpBX2Fzc2V0X2lkAAlrQXNzZXRJZEICCkJfYXNzZXRfaWQACWtCYWxhbmNlQQIPQV9hc3NldF9iYWxhbmNlAAlrQmFsYW5jZUICD0JfYXNzZXRfYmFsYW5jZQANa1NoYXJlQXNzZXRJZAIOc2hhcmVfYXNzZXRfaWQAEWtTaGFyZUFzc2V0U3VwcGx5AhJzaGFyZV9hc3NldF9zdXBwbHkABGtGZWUCCmNvbW1pc3Npb24ACmtJbn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blB1YktleTIAAQAABBJhZG1pblB1YktleTNTaWduZWQDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwACBQxhZG1pblB1YktleTMAAQAACQBnAgkAZAIJAGQCBRJhZG1pblB1YktleTFTaWduZWQFEmFkbWluUHViS2V5MlNpZ25lZAUSYWRtaW5QdWJLZXkzU2lnbmVkAAIEByRtYXRjaDAFAnR4AwkAAQIFByRtYXRjaDACF0ludm9rZVNjcmlwdFRyYW5zYWN0aW9uBANpbnYFByRtYXRjaDAEE2NhbGxUYWtlSW50b0FjY291bnQDCQAAAggFA2ludgRkQXBwBQR0aGlzCQAAAggFA2ludghmdW5jdGlvbgIZdGFrZUludG9BY2NvdW50RXh0cmFGdW5kcwcEDXNpZ25lZEJ5QWRtaW4DAwMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFDGFkbWluUHViS2V5MQYJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFDGFkbWluUHViS2V5MgYJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFDGFkbWluUHViS2V5MwYJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFEWFkbWluUHViS2V5SW52b2tlAwMFE2NhbGxUYWtlSW50b0FjY291bnQFDXNpZ25lZEJ5QWRtaW4HBgUTbXVsdGlTaWduZWRCeUFkbWlucwUTbXVsdGlTaWduZWRCeUFkbWluc4+qVBU=", "height": 2494096, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5PPzq43jcyeDiVERV2Ndz1HhSeCfGHiQwSpdXNeroJxW Next: none Diff:
Old | New | Differences | |
---|---|---|---|
65 | 65 | ||
66 | 66 | let kMoneyBoxAddress = "money_box_address" | |
67 | 67 | ||
68 | + | let kTeamBoxAddress = "team_box_address" | |
69 | + | ||
68 | 70 | let kGovAddress = "governance_address" | |
69 | 71 | ||
70 | 72 | let kFarmingAddress = "farming_address" | |
94 | 96 | let adminPubKeyInvoke = getBase58FromOracle(kAdminInvokePubKey) | |
95 | 97 | ||
96 | 98 | let moneyBoxAddress = Address(getBase58FromOracle(kMoneyBoxAddress)) | |
99 | + | ||
100 | + | let teamBoxAddress = Address(getBase58FromOracle(kTeamBoxAddress)) | |
97 | 101 | ||
98 | 102 | let govAddress = Address(getBase58FromOracle(kGovAddress)) | |
99 | 103 | ||
163 | 167 | ||
164 | 168 | let fee = getIntegerValue(this, kFee) | |
165 | 169 | ||
166 | - | let feeGovernance = fraction(fee, 40, 100) | |
170 | + | let feeGovernance = fraction(fee, 35, 100) | |
171 | + | ||
172 | + | let feeTeam = fraction(fee, 10, 100) | |
167 | 173 | ||
168 | 174 | let feeScale6 = 1000000 | |
169 | 175 | ||
370 | 376 | ||
371 | 377 | func calcStakingParams (stake,amount,assetId) = if (stake) | |
372 | 378 | then { | |
373 | - | let $ | |
374 | - | let call = $ | |
375 | - | let stakingAddr = $ | |
379 | + | let $t01060610672 = calcStakingFuncAndAddres(stake, assetId) | |
380 | + | let call = $t01060610672._1 | |
381 | + | let stakingAddr = $t01060610672._2 | |
376 | 382 | $Tuple4(call, stakingAddr, nil, [AttachedPayment(assetId, amount)]) | |
377 | 383 | } | |
378 | 384 | else { | |
379 | - | let $ | |
380 | - | let call = $ | |
381 | - | let stakingAddr = $ | |
385 | + | let $t01077010836 = calcStakingFuncAndAddres(stake, assetId) | |
386 | + | let call = $t01077010836._1 | |
387 | + | let stakingAddr = $t01077010836._2 | |
382 | 388 | $Tuple4(call, stakingAddr, [amount, toBase58String(assetId)], nil) | |
383 | 389 | } | |
384 | 390 | ||
423 | 429 | else 0 | |
424 | 430 | if ((ratio > dAppThreshold)) | |
425 | 431 | then { | |
426 | - | let $ | |
432 | + | let $t01268912797 = if ((pmtAssetId == assetIdA)) | |
427 | 433 | then $Tuple2(assetNameB, assetNameA) | |
428 | 434 | else $Tuple2(assetNameA, assetNameB) | |
429 | - | let token1 = $ | |
430 | - | let token2 = $ | |
435 | + | let token1 = $t01268912797._1 | |
436 | + | let token2 = $t01268912797._2 | |
431 | 437 | throw((((("Buying " + token1) + " is temporarily unavailable due to the ") + token2) + " depeg")) | |
432 | 438 | } | |
433 | 439 | else true | |
439 | 445 | let pmtAssetIdB = i.payments[1].assetId | |
440 | 446 | let ratioShareTokensInA = fraction(scale8, i.payments[0].amount, balanceA) | |
441 | 447 | let ratioShareTokensInB = fraction(scale8, i.payments[1].amount, balanceB) | |
442 | - | let $ | |
443 | - | let pmtStrAssetIdA = $ | |
444 | - | let pmtAssetNameA = $ | |
445 | - | let pmtDecimalsA = $ | |
446 | - | let $ | |
447 | - | let pmtStrAssetIdB = $ | |
448 | - | let pmtAssetNameB = $ | |
449 | - | let pmtDecimalsB = $ | |
450 | - | let $ | |
448 | + | let $t01330913386 = getAssetInfo(pmtAssetIdA) | |
449 | + | let pmtStrAssetIdA = $t01330913386._1 | |
450 | + | let pmtAssetNameA = $t01330913386._2 | |
451 | + | let pmtDecimalsA = $t01330913386._3 | |
452 | + | let $t01339513516 = getAssetInfo(pmtAssetIdB) | |
453 | + | let pmtStrAssetIdB = $t01339513516._1 | |
454 | + | let pmtAssetNameB = $t01339513516._2 | |
455 | + | let pmtDecimalsB = $t01339513516._3 | |
456 | + | let $t01352514029 = if ((ratioShareTokensInB > ratioShareTokensInA)) | |
451 | 457 | then { | |
452 | 458 | let pmt = fraction(balanceB, ratioShareTokensInA, scale8, CEILING) | |
453 | 459 | $Tuple5(i.payments[0].amount, pmt, (i.payments[1].amount - pmt), pmtAssetIdB, ratioShareTokensInA) | |
456 | 462 | let pmt = fraction(balanceA, ratioShareTokensInB, scale8, CEILING) | |
457 | 463 | $Tuple5(pmt, i.payments[1].amount, (i.payments[0].amount - pmt), pmtAssetIdA, ratioShareTokensInB) | |
458 | 464 | } | |
459 | - | let pmtAmountA = $ | |
460 | - | let pmtAmountB = $ | |
461 | - | let change = $ | |
462 | - | let changeAssetId = $ | |
463 | - | let shareTokenRatio = $ | |
465 | + | let pmtAmountA = $t01352514029._1 | |
466 | + | let pmtAmountB = $t01352514029._2 | |
467 | + | let change = $t01352514029._3 | |
468 | + | let changeAssetId = $t01352514029._4 | |
469 | + | let shareTokenRatio = $t01352514029._5 | |
464 | 470 | let shareTokenToPayAmount = fraction(shareTokenRatio, shareAssetSupply, scale8) | |
465 | 471 | if (if ((size(i.payments) != 2)) | |
466 | 472 | then (size(i.payments) != 3) | |
515 | 521 | ||
516 | 522 | ||
517 | 523 | func replenishWithOneTokenCalc (i,virtualSwapTokenPay,virtualSwapTokenGet,stakeFarming,lockType) = { | |
518 | - | let $ | |
519 | - | let pmtAmount = $ | |
520 | - | let pmtAssetId = $ | |
521 | - | let $ | |
522 | - | let pmtStrAssetId = $ | |
523 | - | let pmtAssetName = $ | |
524 | - | let pmtDecimals = $ | |
524 | + | let $t01693117006 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
525 | + | let pmtAmount = $t01693117006._1 | |
526 | + | let pmtAssetId = $t01693117006._2 | |
527 | + | let $t01701517088 = getAssetInfo(pmtAssetId) | |
528 | + | let pmtStrAssetId = $t01701517088._1 | |
529 | + | let pmtAssetName = $t01701517088._2 | |
530 | + | let pmtDecimals = $t01701517088._3 | |
525 | 531 | let pmtMinThreshold = 5000000 | |
526 | 532 | let thresholdValueForMinTolerance = 50000000 | |
527 | 533 | let tolerance = if ((thresholdValueForMinTolerance > pmtAmount)) | |
543 | 549 | else false) | |
544 | 550 | then throwAssets() | |
545 | 551 | else { | |
546 | - | let $ | |
552 | + | let $t01819818848 = if ((pmtAssetId == assetIdA)) | |
547 | 553 | then $Tuple6((pmtAmount - virtualSwapTokenPay), virtualSwapTokenGet, (balanceA + virtualSwapTokenPay), (balanceB - virtualSwapTokenGet), (balanceA + pmtAmount), balanceB) | |
548 | 554 | else $Tuple6(virtualSwapTokenGet, (pmtAmount - virtualSwapTokenPay), (balanceA - virtualSwapTokenGet), (balanceB + virtualSwapTokenPay), balanceA, (balanceB + pmtAmount)) | |
549 | - | let virtualReplenishA = $ | |
550 | - | let virtualReplenishB = $ | |
551 | - | let balanceAfterSwapA = $ | |
552 | - | let balanceAfterSwapB = $ | |
553 | - | let newBalanceA = $ | |
554 | - | let newBalanceB = $ | |
555 | + | let virtualReplenishA = $t01819818848._1 | |
556 | + | let virtualReplenishB = $t01819818848._2 | |
557 | + | let balanceAfterSwapA = $t01819818848._3 | |
558 | + | let balanceAfterSwapB = $t01819818848._4 | |
559 | + | let newBalanceA = $t01819818848._5 | |
560 | + | let newBalanceB = $t01819818848._6 | |
555 | 561 | let invariantNew = invariantCalc(balanceAfterSwapA, balanceAfterSwapB) | |
556 | 562 | let ratioVirtualBalanceToVirtualReplenish = (fraction(scale16, balanceAfterSwapA, balanceAfterSwapB) / fraction(scale8, virtualReplenishA, virtualReplenishB)) | |
557 | 563 | if (if ((slippageValueMinForSwap >= fraction(scale8, invariant, invariantNew))) | |
570 | 576 | let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scale8) | |
571 | 577 | let shareTokenToPayAmountAfterFee = fraction(shareTokenToPayAmount, (feeScale6 - (fee / 2)), feeScale6) | |
572 | 578 | let shareTokenGovernanceReward = fraction(shareTokenToPayAmount, (feeGovernance / 2), feeScale6) | |
579 | + | let shareTokenTeamReward = fraction(shareTokenToPayAmount, (feeTeam / 2), feeScale6) | |
573 | 580 | let governanceRewardTokenA = fraction(shareTokenGovernanceReward, balanceA, shareAssetSupply) | |
574 | 581 | let governanceRewardTokenB = fraction(shareTokenGovernanceReward, balanceB, shareAssetSupply) | |
575 | - | let $t01962119904 = if ((pmtStrAssetId == strAssetIdA)) | |
576 | - | then $Tuple3((pmtAmount - governanceRewardTokenA), governanceRewardTokenB, strAssetIdB) | |
577 | - | else $Tuple3((pmtAmount - governanceRewardTokenB), governanceRewardTokenA, strAssetIdA) | |
578 | - | let stakeAmount = $t01962119904._1 | |
579 | - | let unstakeAmount = $t01962119904._2 | |
580 | - | let unstakeAsset = $t01962119904._3 | |
582 | + | let teamRewardTokenA = fraction(shareTokenTeamReward, balanceA, shareAssetSupply) | |
583 | + | let teamRewardTokenB = fraction(shareTokenTeamReward, balanceB, shareAssetSupply) | |
584 | + | let $t02103321416 = if ((pmtStrAssetId == strAssetIdA)) | |
585 | + | then $Tuple3(((pmtAmount - governanceRewardTokenA) - teamRewardTokenA), (governanceRewardTokenB + teamRewardTokenB), strAssetIdB) | |
586 | + | else $Tuple3(((pmtAmount - governanceRewardTokenB) - teamRewardTokenB), (governanceRewardTokenA + teamRewardTokenA), strAssetIdA) | |
587 | + | let stakeAmount = $t02103321416._1 | |
588 | + | let unstakeAmount = $t02103321416._2 | |
589 | + | let unstakeAsset = $t02103321416._3 | |
581 | 590 | let stake1 = if (contains(stakingAssets, pmtStrAssetId)) | |
582 | 591 | then invoke(this, "stakeUnstake", [true, stakeAmount, pmtStrAssetId], nil) | |
583 | 592 | else 0 | |
588 | 597 | else 0 | |
589 | 598 | if ((stake2 == stake2)) | |
590 | 599 | then { | |
591 | - | let scriptActions = [IntegerEntry(kBalanceA, (newBalanceA - governanceRewardTokenA)), IntegerEntry(kBalanceB, (newBalanceB - governanceRewardTokenB)), IntegerEntry(kShareAssetSupply, (shareAssetSupply + shareTokenToPayAmountAfterFee)), IntegerEntry(kInvariant, invariantCalc((newBalanceA - governanceRewardTokenA), (newBalanceB - governanceRewardTokenB))), ScriptTransfer(moneyBoxAddress, governanceRewardTokenA, assetIdA), ScriptTransfer(moneyBoxAddress, governanceRewardTokenB, assetIdB)] | |
600 | + | let scriptActions = [IntegerEntry(kBalanceA, ((newBalanceA - governanceRewardTokenA) - teamRewardTokenA)), IntegerEntry(kBalanceB, ((newBalanceB - governanceRewardTokenB) - teamRewardTokenB)), IntegerEntry(kShareAssetSupply, (shareAssetSupply + shareTokenToPayAmountAfterFee)), IntegerEntry(kInvariant, invariantCalc((newBalanceA - governanceRewardTokenA), (newBalanceB - governanceRewardTokenB))), ScriptTransfer(moneyBoxAddress, governanceRewardTokenA, assetIdA), ScriptTransfer(moneyBoxAddress, governanceRewardTokenB, assetIdB), ScriptTransfer(teamBoxAddress, teamRewardTokenA, assetIdA), ScriptTransfer(teamBoxAddress, teamRewardTokenB, assetIdB)] | |
592 | 601 | if (stakeFarming) | |
593 | 602 | then { | |
594 | 603 | let stPayments = ([AttachedPayment(shareAssetId, shareTokenToPayAmountAfterFee)] ++ (if ((size(i.payments) == 2)) | |
617 | 626 | ||
618 | 627 | ||
619 | 628 | func withdrawCalc (i,unlockAmount) = { | |
620 | - | let $ | |
629 | + | let $t02417124506 = if ((size(i.payments) == 1)) | |
621 | 630 | then if ((i.payments[0].assetId != shareAssetId)) | |
622 | 631 | then throw(("Incorrect asset attached. Expected: " + toBase58String(shareAssetId))) | |
623 | 632 | else $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
624 | 633 | else $Tuple2(0, shareAssetId) | |
625 | - | let pmtAmount = $ | |
626 | - | let pmtAssetId = $ | |
634 | + | let pmtAmount = $t02417124506._1 | |
635 | + | let pmtAssetId = $t02417124506._2 | |
627 | 636 | if (!(hasEnoughBalance)) | |
628 | 637 | then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious()) | |
629 | 638 | else { | |
657 | 666 | ||
658 | 667 | @Callable(i) | |
659 | 668 | func init (firstHarvest) = { | |
660 | - | let $ | |
661 | - | let pmtAmountA = $ | |
662 | - | let pmtAssetIdA = $ | |
663 | - | let $ | |
664 | - | let pmtAmountB = $ | |
665 | - | let pmtAssetIdB = $ | |
666 | - | let $ | |
667 | - | let pmtStrAssetIdA = $ | |
668 | - | let pmtAssetNameA = $ | |
669 | - | let pmtDecimalsA = $ | |
670 | - | let $ | |
671 | - | let pmtStrAssetIdB = $ | |
672 | - | let pmtAssetNameB = $ | |
673 | - | let pmtDecimalsB = $ | |
669 | + | let $t02636226439 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
670 | + | let pmtAmountA = $t02636226439._1 | |
671 | + | let pmtAssetIdA = $t02636226439._2 | |
672 | + | let $t02644826525 = $Tuple2(i.payments[1].amount, i.payments[1].assetId) | |
673 | + | let pmtAmountB = $t02644826525._1 | |
674 | + | let pmtAssetIdB = $t02644826525._2 | |
675 | + | let $t02653426611 = getAssetInfo(pmtAssetIdA) | |
676 | + | let pmtStrAssetIdA = $t02653426611._1 | |
677 | + | let pmtAssetNameA = $t02653426611._2 | |
678 | + | let pmtDecimalsA = $t02653426611._3 | |
679 | + | let $t02662026697 = getAssetInfo(pmtAssetIdB) | |
680 | + | let pmtStrAssetIdB = $t02662026697._1 | |
681 | + | let pmtAssetNameB = $t02662026697._2 | |
682 | + | let pmtDecimalsB = $t02662026697._3 | |
674 | 683 | if (isDefined(getBoolean(this, kActive))) | |
675 | 684 | then throwIsActive() | |
676 | 685 | else if ((pmtAssetIdA == pmtAssetIdB)) | |
723 | 732 | ||
724 | 733 | @Callable(i) | |
725 | 734 | func withdrawOneToken (unlockAmount,withdrawAsset,estimatedAmountToReceive,minAmountToReceive) = valueOrElse(isActive(), valueOrElse(isDepricated(), { | |
726 | - | let $ | |
735 | + | let $t03071131070 = if ((size(i.payments) == 1)) | |
727 | 736 | then if ((i.payments[0].assetId != shareAssetId)) | |
728 | 737 | then throw(("Incorrect asset attached. Expected: " + toBase58String(shareAssetId))) | |
729 | 738 | else $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
730 | 739 | else $Tuple2(0, shareAssetId) | |
731 | - | let pmtAmount = $ | |
732 | - | let pmtAssetId = $ | |
740 | + | let pmtAmount = $t03071131070._1 | |
741 | + | let pmtAssetId = $t03071131070._2 | |
733 | 742 | let withdrawAmount = (pmtAmount + unlockAmount) | |
734 | 743 | if (if ((withdrawAsset != strAssetIdA)) | |
735 | 744 | then (withdrawAsset != strAssetIdB) | |
754 | 763 | then calculateSendAmount(estimatedAmountToReceive, minAmountToReceive, amountToPayB, assetIdB, newVirtBalcA, newVirtBalcB, invariantCalc(newVirtBalcA, newVirtBalcB)) | |
755 | 764 | else calculateSendAmount(estimatedAmountToReceive, minAmountToReceive, amountToPayA, assetIdA, newVirtBalcA, newVirtBalcB, invariantCalc(newVirtBalcA, newVirtBalcB)) | |
756 | 765 | let govReward = fraction(amountExchangedWithFee, fraction(feeGovernance, feeDiscount, feeScale6, CEILING), feeScale6) | |
766 | + | let teamReward = fraction(amountExchangedWithFee, fraction(feeTeam, feeDiscount, feeScale6, CEILING), feeScale6) | |
757 | 767 | let amountExchanged = fraction(amountExchangedWithFee, (feeScale6 - fraction(fee, feeDiscount, feeScale6, CEILING)), feeScale6) | |
758 | - | let $ | |
759 | - | then $Tuple4((amountToPayA + amountExchanged), (((balanceA - amountToPayA) - amountExchanged) - govReward), balanceB, assetIdB) | |
760 | - | else $Tuple4((amountToPayB + amountExchanged), balanceA, (((balanceB - amountToPayB) - amountExchanged) - govReward), assetIdA) | |
761 | - | let amountToPay = $ | |
762 | - | let balanceANew = $ | |
763 | - | let balanceBNew = $ | |
764 | - | let virtAssetId = $ | |
768 | + | let $t03306833492 = if ((withdrawAsset == strAssetIdA)) | |
769 | + | then $Tuple4((amountToPayA + amountExchanged), ((((balanceA - amountToPayA) - amountExchanged) - govReward) - teamReward), balanceB, assetIdB) | |
770 | + | else $Tuple4((amountToPayB + amountExchanged), balanceA, ((((balanceB - amountToPayB) - amountExchanged) - govReward) - teamReward), assetIdA) | |
771 | + | let amountToPay = $t03306833492._1 | |
772 | + | let balanceANew = $t03306833492._2 | |
773 | + | let balanceBNew = $t03306833492._3 | |
774 | + | let virtAssetId = $t03306833492._4 | |
765 | 775 | if (!(checkDAppThreshold(balanceANew, balanceBNew, virtAssetId))) | |
766 | 776 | then throw() | |
767 | 777 | else { | |
768 | 778 | let invariantCalculated = invariantCalc(balanceANew, balanceBNew) | |
769 | 779 | let stake1 = if (contains(stakingAssets, withdrawAsset)) | |
770 | - | then invoke(this, "stakeUnstake", [false, (amountToPay + govReward), withdrawAsset], nil) | |
780 | + | then invoke(this, "stakeUnstake", [false, ((amountToPay + govReward) + teamReward), withdrawAsset], nil) | |
771 | 781 | else 0 | |
772 | 782 | if ((stake1 == stake1)) | |
773 | - | then [IntegerEntry(kBalanceA, balanceANew), IntegerEntry(kBalanceB, balanceBNew), IntegerEntry(kShareAssetSupply, (shareAssetSupply - withdrawAmount)), IntegerEntry(kInvariant, invariantCalculated), Burn(shareAssetId, withdrawAmount), ScriptTransfer(i.caller, amountToPay, fromBase58String(withdrawAsset)), ScriptTransfer(moneyBoxAddress, govReward, fromBase58String(withdrawAsset))] | |
783 | + | then [IntegerEntry(kBalanceA, balanceANew), IntegerEntry(kBalanceB, balanceBNew), IntegerEntry(kShareAssetSupply, (shareAssetSupply - withdrawAmount)), IntegerEntry(kInvariant, invariantCalculated), Burn(shareAssetId, withdrawAmount), ScriptTransfer(i.caller, amountToPay, fromBase58String(withdrawAsset)), ScriptTransfer(moneyBoxAddress, govReward, fromBase58String(withdrawAsset)), ScriptTransfer(teamBoxAddress, teamReward, fromBase58String(withdrawAsset))] | |
774 | 784 | else throw("Strict value is not equal to itself.") | |
775 | 785 | } | |
776 | 786 | } | |
782 | 792 | ||
783 | 793 | @Callable(i) | |
784 | 794 | func exchange (estimatedAmountToReceive,minAmountToReceive) = valueOrElse(isActive(), valueOrElse(isDepricated(), { | |
785 | - | let $ | |
786 | - | let pmtAmount = $ | |
787 | - | let pmtAssetId = $ | |
795 | + | let $t03499335068 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
796 | + | let pmtAmount = $t03499335068._1 | |
797 | + | let pmtAssetId = $t03499335068._2 | |
788 | 798 | if ((0 >= estimatedAmountToReceive)) | |
789 | 799 | then throw(("Estimated amount must be positive. Actual: " + toString(estimatedAmountToReceive))) | |
790 | 800 | else if ((minAmountToReceive > estimatedAmountToReceive)) | |
810 | 820 | let amount = calculateSendAmount(estimatedAmountToReceive, minAmountToReceive, pmtAmount, pmtAssetId, balanceA, balanceB, invariant) | |
811 | 821 | let feeDiscount = calculateFeeDiscount(i.originCaller) | |
812 | 822 | let governanceReward = fraction(amount, fraction(feeGovernance, feeDiscount, feeScale6, CEILING), feeScale6) | |
823 | + | let teamReward = fraction(amount, fraction(feeTeam, feeDiscount, feeScale6, CEILING), feeScale6) | |
813 | 824 | let amountMinusFee = fraction(amount, (feeScale6 - fraction(fee, feeDiscount, feeScale6, CEILING)), feeScale6) | |
814 | - | let $ | |
815 | - | then $Tuple2((balanceA + pmtAmount), ((balanceB - amountMinusFee) - governanceReward)) | |
816 | - | else $Tuple2(((balanceA - amountMinusFee) - governanceReward), (balanceB + pmtAmount)) | |
817 | - | let newBalanceA = $ | |
818 | - | let newBalanceB = $ | |
825 | + | let $t03688737207 = if ((pmtAssetId == assetIdA)) | |
826 | + | then $Tuple2((balanceA + pmtAmount), (((balanceB - amountMinusFee) - governanceReward) - teamReward)) | |
827 | + | else $Tuple2((((balanceA - amountMinusFee) - governanceReward) - teamReward), (balanceB + pmtAmount)) | |
828 | + | let newBalanceA = $t03688737207._1 | |
829 | + | let newBalanceB = $t03688737207._2 | |
819 | 830 | if (!(checkDAppThreshold(newBalanceA, newBalanceB, pmtAssetId))) | |
820 | 831 | then throw() | |
821 | 832 | else { | |
822 | - | let $ | |
823 | - | let pmtStrAssetId = $ | |
824 | - | let pmtAssetName = $ | |
825 | - | let pmtDecimals = $ | |
826 | - | let $ | |
827 | - | let sendStrAssetId = $ | |
828 | - | let sendAssetName = $ | |
829 | - | let sendDecimals = $ | |
833 | + | let $t03734137414 = getAssetInfo(pmtAssetId) | |
834 | + | let pmtStrAssetId = $t03734137414._1 | |
835 | + | let pmtAssetName = $t03734137414._2 | |
836 | + | let pmtDecimals = $t03734137414._3 | |
837 | + | let $t03744337520 = getAssetInfo(sendAssetId) | |
838 | + | let sendStrAssetId = $t03744337520._1 | |
839 | + | let sendAssetName = $t03744337520._2 | |
840 | + | let sendDecimals = $t03744337520._3 | |
830 | 841 | let stake1 = if (contains(stakingAssets, pmtStrAssetId)) | |
831 | 842 | then invoke(this, "stakeUnstake", [true, pmtAmount, pmtStrAssetId], nil) | |
832 | 843 | else 0 | |
833 | 844 | if ((stake1 == stake1)) | |
834 | 845 | then { | |
835 | 846 | let stake2 = if (contains(stakingAssets, sendStrAssetId)) | |
836 | - | then invoke(this, "stakeUnstake", [false, (amountMinusFee + governanceReward), sendStrAssetId], nil) | |
847 | + | then invoke(this, "stakeUnstake", [false, ((amountMinusFee + governanceReward) + teamReward), sendStrAssetId], nil) | |
837 | 848 | else 0 | |
838 | 849 | if ((stake2 == stake2)) | |
839 | - | then $Tuple2([IntegerEntry(kBalanceA, newBalanceA), IntegerEntry(kBalanceB, newBalanceB), IntegerEntry(kInvariant, invariantCalc(newBalanceA, newBalanceB)), ScriptTransfer(i.caller, amountMinusFee, sendAssetId), ScriptTransfer(moneyBoxAddress, governanceReward, sendAssetId)], [amountMinusFee, sendAssetId]) | |
850 | + | then $Tuple2([IntegerEntry(kBalanceA, newBalanceA), IntegerEntry(kBalanceB, newBalanceB), IntegerEntry(kInvariant, invariantCalc(newBalanceA, newBalanceB)), ScriptTransfer(i.caller, amountMinusFee, sendAssetId), ScriptTransfer(moneyBoxAddress, governanceReward, sendAssetId), ScriptTransfer(teamBoxAddress, teamReward, sendAssetId)], [amountMinusFee, sendAssetId]) | |
840 | 851 | else throw("Strict value is not equal to itself.") | |
841 | 852 | } | |
842 | 853 | else throw("Strict value is not equal to itself.") | |
921 | 932 | func stakeUnstake (stake,amount,assetIdString) = if ((i.caller != this)) | |
922 | 933 | then throw("Only contract itself can invoke this function") | |
923 | 934 | else { | |
924 | - | let $ | |
925 | - | let call = $ | |
926 | - | let addr = $ | |
927 | - | let params = $ | |
928 | - | let payments = $ | |
935 | + | let $t04180641909 = calcStakingParams(stake, amount, fromBase58String(assetIdString)) | |
936 | + | let call = $t04180641909._1 | |
937 | + | let addr = $t04180641909._2 | |
938 | + | let params = $t04180641909._3 | |
939 | + | let payments = $t04180641909._4 | |
929 | 940 | let inv = invoke(addr, call, params, payments) | |
930 | 941 | if ((inv == inv)) | |
931 | 942 | then nil |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let version = "2.0.0" | |
5 | 5 | ||
6 | 6 | let kVersion = "version" | |
7 | 7 | ||
8 | 8 | let kActive = "active" | |
9 | 9 | ||
10 | 10 | let kActiveGlob = "active_all_contracts" | |
11 | 11 | ||
12 | 12 | let kDeprecated = "deprecated_" | |
13 | 13 | ||
14 | 14 | let kAssetIdA = "A_asset_id" | |
15 | 15 | ||
16 | 16 | let kAssetIdB = "B_asset_id" | |
17 | 17 | ||
18 | 18 | let kBalanceA = "A_asset_balance" | |
19 | 19 | ||
20 | 20 | let kBalanceB = "B_asset_balance" | |
21 | 21 | ||
22 | 22 | let kShareAssetId = "share_asset_id" | |
23 | 23 | ||
24 | 24 | let kShareAssetSupply = "share_asset_supply" | |
25 | 25 | ||
26 | 26 | let kFee = "commission" | |
27 | 27 | ||
28 | 28 | let kInvariant = "invariant" | |
29 | 29 | ||
30 | 30 | let kCause = "shutdown_cause" | |
31 | 31 | ||
32 | 32 | let kUSDNAddress = "staking_usdnnsbt_address" | |
33 | 33 | ||
34 | 34 | let kEURNAddress = "staking_eurn_address" | |
35 | 35 | ||
36 | 36 | let kDiscounts = "discounts" | |
37 | 37 | ||
38 | 38 | let kDiscountValues = "discount_values" | |
39 | 39 | ||
40 | 40 | let kUserSwopInGov = "_SWOP_amount" | |
41 | 41 | ||
42 | 42 | let kUserGSwopInGov = "_GSwop_amount" | |
43 | 43 | ||
44 | 44 | let kFirstHarvest = "first_harvest" | |
45 | 45 | ||
46 | 46 | let kFirstHarvestHeight = "first_harvest_height" | |
47 | 47 | ||
48 | 48 | let kShareLimit = "share_limit_on_first_harvest" | |
49 | 49 | ||
50 | 50 | let kBasePeriod = "base_period" | |
51 | 51 | ||
52 | 52 | let kPeriodLength = "period_length" | |
53 | 53 | ||
54 | 54 | let kStartHeight = "start_height" | |
55 | 55 | ||
56 | 56 | let kDAppThreshold = "dApp_threshold" | |
57 | 57 | ||
58 | 58 | let kAdminPubKey1 = "admin_pub_1" | |
59 | 59 | ||
60 | 60 | let kAdminPubKey2 = "admin_pub_2" | |
61 | 61 | ||
62 | 62 | let kAdminPubKey3 = "admin_pub_3" | |
63 | 63 | ||
64 | 64 | let kAdminInvokePubKey = "admin_invoke_pub" | |
65 | 65 | ||
66 | 66 | let kMoneyBoxAddress = "money_box_address" | |
67 | 67 | ||
68 | + | let kTeamBoxAddress = "team_box_address" | |
69 | + | ||
68 | 70 | let kGovAddress = "governance_address" | |
69 | 71 | ||
70 | 72 | let kFarmingAddress = "farming_address" | |
71 | 73 | ||
72 | 74 | let kVotingAddress = "voting_address" | |
73 | 75 | ||
74 | 76 | let kUSDNAssetId = "usdn_asset_id" | |
75 | 77 | ||
76 | 78 | let kStakingAssets = "staking_assets" | |
77 | 79 | ||
78 | 80 | let oracle = Address(base58'3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz') | |
79 | 81 | ||
80 | 82 | func getBase58FromOracle (key) = match getString(oracle, key) { | |
81 | 83 | case string: String => | |
82 | 84 | fromBase58String(string) | |
83 | 85 | case nothing => | |
84 | 86 | throw((key + "is empty")) | |
85 | 87 | } | |
86 | 88 | ||
87 | 89 | ||
88 | 90 | let adminPubKey1 = getBase58FromOracle(kAdminPubKey1) | |
89 | 91 | ||
90 | 92 | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) | |
91 | 93 | ||
92 | 94 | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) | |
93 | 95 | ||
94 | 96 | let adminPubKeyInvoke = getBase58FromOracle(kAdminInvokePubKey) | |
95 | 97 | ||
96 | 98 | let moneyBoxAddress = Address(getBase58FromOracle(kMoneyBoxAddress)) | |
99 | + | ||
100 | + | let teamBoxAddress = Address(getBase58FromOracle(kTeamBoxAddress)) | |
97 | 101 | ||
98 | 102 | let govAddress = Address(getBase58FromOracle(kGovAddress)) | |
99 | 103 | ||
100 | 104 | let stakingUSDNAddress = Address(getBase58FromOracle(kUSDNAddress)) | |
101 | 105 | ||
102 | 106 | let votingAddress = Address(getBase58FromOracle(kVotingAddress)) | |
103 | 107 | ||
104 | 108 | let farmingAddress = Address(getBase58FromOracle(kFarmingAddress)) | |
105 | 109 | ||
106 | 110 | let USDN = getBase58FromOracle(kUSDNAssetId) | |
107 | 111 | ||
108 | 112 | let stakingAssets = getStringValue(oracle, kStakingAssets) | |
109 | 113 | ||
110 | 114 | let basePeriod = valueOrErrorMessage(getInteger(votingAddress, kBasePeriod), "Empty kBasePeriod") | |
111 | 115 | ||
112 | 116 | let startHeight = valueOrErrorMessage(getInteger(votingAddress, kStartHeight), "Empty kStartHeight") | |
113 | 117 | ||
114 | 118 | let periodLength = valueOrErrorMessage(getInteger(votingAddress, kPeriodLength), "Empty kPeriodLength") | |
115 | 119 | ||
116 | 120 | let firstHarvestEndPeriod = ((basePeriod + ((height - startHeight) / periodLength)) + 3) | |
117 | 121 | ||
118 | 122 | let active = getBooleanValue(this, kActive) | |
119 | 123 | ||
120 | 124 | let activeGlob = valueOrElse(getBoolean(oracle, kActiveGlob), true) | |
121 | 125 | ||
122 | 126 | let deprecatedPool = valueOrElse(getBoolean(oracle, (kDeprecated + toString(this))), false) | |
123 | 127 | ||
124 | 128 | let strAssetIdA = getStringValue(this, kAssetIdA) | |
125 | 129 | ||
126 | 130 | let strAssetIdB = getStringValue(this, kAssetIdB) | |
127 | 131 | ||
128 | 132 | let assetIdA = if ((strAssetIdA == "WAVES")) | |
129 | 133 | then unit | |
130 | 134 | else fromBase58String(strAssetIdA) | |
131 | 135 | ||
132 | 136 | let assetIdB = if ((strAssetIdB == "WAVES")) | |
133 | 137 | then unit | |
134 | 138 | else fromBase58String(strAssetIdB) | |
135 | 139 | ||
136 | 140 | let assetNameA = match assetIdA { | |
137 | 141 | case id: ByteVector => | |
138 | 142 | value(assetInfo(id)).name | |
139 | 143 | case waves: Unit => | |
140 | 144 | "WAVES" | |
141 | 145 | case _ => | |
142 | 146 | throw("Match error") | |
143 | 147 | } | |
144 | 148 | ||
145 | 149 | let assetNameB = match assetIdB { | |
146 | 150 | case id: ByteVector => | |
147 | 151 | value(assetInfo(id)).name | |
148 | 152 | case waves: Unit => | |
149 | 153 | "WAVES" | |
150 | 154 | case _ => | |
151 | 155 | throw("Match error") | |
152 | 156 | } | |
153 | 157 | ||
154 | 158 | let balanceA = getIntegerValue(this, kBalanceA) | |
155 | 159 | ||
156 | 160 | let balanceB = getIntegerValue(this, kBalanceB) | |
157 | 161 | ||
158 | 162 | let shareAssetId = fromBase58String(getStringValue(this, kShareAssetId)) | |
159 | 163 | ||
160 | 164 | let shareAssetSupply = getIntegerValue(this, kShareAssetSupply) | |
161 | 165 | ||
162 | 166 | let invariant = getIntegerValue(this, kInvariant) | |
163 | 167 | ||
164 | 168 | let fee = getIntegerValue(this, kFee) | |
165 | 169 | ||
166 | - | let feeGovernance = fraction(fee, 40, 100) | |
170 | + | let feeGovernance = fraction(fee, 35, 100) | |
171 | + | ||
172 | + | let feeTeam = fraction(fee, 10, 100) | |
167 | 173 | ||
168 | 174 | let feeScale6 = 1000000 | |
169 | 175 | ||
170 | 176 | let scale3 = 1000 | |
171 | 177 | ||
172 | 178 | let scale8 = 100000000 | |
173 | 179 | ||
174 | 180 | let scale16 = 10000000000000000 | |
175 | 181 | ||
176 | 182 | let digits8 = 8 | |
177 | 183 | ||
178 | 184 | let exchangeRatioLimitMin = 60000000 | |
179 | 185 | ||
180 | 186 | let exchangeRatioLimitMax = 140000000 | |
181 | 187 | ||
182 | 188 | let alpha = 50 | |
183 | 189 | ||
184 | 190 | let alphaDigits = 2 | |
185 | 191 | ||
186 | 192 | let beta = 4600000000000000 | |
187 | 193 | ||
188 | 194 | func accountBalance (assetId) = match assetId { | |
189 | 195 | case id: ByteVector => | |
190 | 196 | assetBalance(this, id) | |
191 | 197 | case waves: Unit => | |
192 | 198 | wavesBalance(this).available | |
193 | 199 | case _ => | |
194 | 200 | throw("Match error") | |
195 | 201 | } | |
196 | 202 | ||
197 | 203 | ||
198 | 204 | func stakedAmount (assetId) = { | |
199 | 205 | let stakedAmountCalculated = match assetId { | |
200 | 206 | case aId: ByteVector => | |
201 | 207 | if ((aId == USDN)) | |
202 | 208 | then getInteger(stakingUSDNAddress, ((("rpd_balance_" + toBase58String(aId)) + "_") + toString(this))) | |
203 | 209 | else 0 | |
204 | 210 | case _: Unit => | |
205 | 211 | 0 | |
206 | 212 | case _ => | |
207 | 213 | throw("Match error") | |
208 | 214 | } | |
209 | 215 | match stakedAmountCalculated { | |
210 | 216 | case i: Int => | |
211 | 217 | i | |
212 | 218 | case _ => | |
213 | 219 | 0 | |
214 | 220 | } | |
215 | 221 | } | |
216 | 222 | ||
217 | 223 | ||
218 | 224 | let stakedAmountA = stakedAmount(assetIdA) | |
219 | 225 | ||
220 | 226 | let stakedAmountB = stakedAmount(assetIdB) | |
221 | 227 | ||
222 | 228 | let availableBalanceA = (balanceA - stakedAmountA) | |
223 | 229 | ||
224 | 230 | let availableBalanceB = (balanceB - stakedAmountB) | |
225 | 231 | ||
226 | 232 | let accountBalanceWithStakedA = (accountBalance(assetIdA) + stakedAmountA) | |
227 | 233 | ||
228 | 234 | let accountBalanceWithStakedB = (accountBalance(assetIdB) + stakedAmountB) | |
229 | 235 | ||
230 | 236 | let hasEnoughBalance = if ((accountBalanceWithStakedA >= balanceA)) | |
231 | 237 | then (accountBalanceWithStakedB >= balanceB) | |
232 | 238 | else false | |
233 | 239 | ||
234 | 240 | func skewness (x,y) = ((fraction(scale16, x, y) + fraction(scale16, y, x)) / 2) | |
235 | 241 | ||
236 | 242 | ||
237 | 243 | func invariantCalc (x,y) = { | |
238 | 244 | let sk = skewness(x, y) | |
239 | 245 | (fraction((x + y), scale16, pow(sk, digits8, alpha, alphaDigits, digits8, CEILING)) + (2 * fraction(toInt(pow(fraction(toBigInt(x), toBigInt(y), toBigInt(scale8)), 0, toBigInt(5), 1, (digits8 / 2), DOWN)), pow((sk - beta), digits8, alpha, alphaDigits, digits8, DOWN), scale8))) | |
240 | 246 | } | |
241 | 247 | ||
242 | 248 | ||
243 | 249 | func calculateSendAmount (amountToSendEstimated,minTokenReceiveAmount,tokenReceiveAmount,tokenId,balcA,balcB,invCur) = { | |
244 | 250 | let worstAllowedNewInvariantRatio = (scale16 - ((scale16 * 1) / 10000000)) | |
245 | 251 | let deltaBetweenMaxAndMinSendValue = (amountToSendEstimated - minTokenReceiveAmount) | |
246 | 252 | let x = (balcA + tokenReceiveAmount) | |
247 | 253 | let y = (balcB + tokenReceiveAmount) | |
248 | 254 | func getStepAmount (acc,step) = if ((acc._1 == -1)) | |
249 | 255 | then { | |
250 | 256 | let amountToSend = (amountToSendEstimated - (((step * deltaBetweenMaxAndMinSendValue) / 3) / scale3)) | |
251 | 257 | let stepInvariant = if ((tokenId == assetIdA)) | |
252 | 258 | then invariantCalc(x, (balcB - amountToSend)) | |
253 | 259 | else invariantCalc((balcA - amountToSend), y) | |
254 | 260 | if ((stepInvariant > invCur)) | |
255 | 261 | then $Tuple2(amountToSend, stepInvariant) | |
256 | 262 | else $Tuple2(-1, 0) | |
257 | 263 | } | |
258 | 264 | else acc | |
259 | 265 | ||
260 | 266 | let amountToSendMin = getStepAmount($Tuple2(-1, 0), 3000) | |
261 | 267 | if ((0 > amountToSendMin._1)) | |
262 | 268 | then throw("Price is worse than minReceived") | |
263 | 269 | else { | |
264 | 270 | let invEstimated = if ((tokenId == assetIdA)) | |
265 | 271 | then invariantCalc(x, (balcB - amountToSendEstimated)) | |
266 | 272 | else if ((tokenId == assetIdB)) | |
267 | 273 | then invariantCalc((balcA - amountToSendEstimated), y) | |
268 | 274 | else throw("Wrong asset in payment") | |
269 | 275 | if ((invCur > invEstimated)) | |
270 | 276 | then if ((worstAllowedNewInvariantRatio >= fraction(scale16, invCur, invEstimated))) | |
271 | 277 | then throw("The requested price is too not profitable for user") | |
272 | 278 | else { | |
273 | 279 | let a = { | |
274 | 280 | let $l = [25, 200, 500] | |
275 | 281 | let $s = size($l) | |
276 | 282 | let $acc0 = $Tuple2(-1, 0) | |
277 | 283 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
278 | 284 | then $a | |
279 | 285 | else getStepAmount($a, $l[$i]) | |
280 | 286 | ||
281 | 287 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
282 | 288 | then $a | |
283 | 289 | else throw("List size exceeds 3") | |
284 | 290 | ||
285 | 291 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
286 | 292 | } | |
287 | 293 | if ((0 > a._1)) | |
288 | 294 | then amountToSendMin._1 | |
289 | 295 | else a._1 | |
290 | 296 | } | |
291 | 297 | else { | |
292 | 298 | let a = { | |
293 | 299 | let $l = [-500, -200, -25] | |
294 | 300 | let $s = size($l) | |
295 | 301 | let $acc0 = $Tuple2(-1, 0) | |
296 | 302 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
297 | 303 | then $a | |
298 | 304 | else getStepAmount($a, $l[$i]) | |
299 | 305 | ||
300 | 306 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
301 | 307 | then $a | |
302 | 308 | else throw("List size exceeds 3") | |
303 | 309 | ||
304 | 310 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
305 | 311 | } | |
306 | 312 | let tupleSendBetter = if ((0 > a._1)) | |
307 | 313 | then $Tuple2(amountToSendEstimated, invEstimated) | |
308 | 314 | else a | |
309 | 315 | if ((worstAllowedNewInvariantRatio >= fraction(scale16, invCur, tupleSendBetter._2))) | |
310 | 316 | then throw("The requested price is too not profitable for user") | |
311 | 317 | else tupleSendBetter._1 | |
312 | 318 | } | |
313 | 319 | } | |
314 | 320 | } | |
315 | 321 | ||
316 | 322 | ||
317 | 323 | func getAssetInfo (assetId) = match assetId { | |
318 | 324 | case id: ByteVector => | |
319 | 325 | let stringId = toBase58String(id) | |
320 | 326 | let info = valueOrErrorMessage(assetInfo(id), (("Asset " + stringId) + " doesn't exist")) | |
321 | 327 | $Tuple3(stringId, info.name, info.decimals) | |
322 | 328 | case waves: Unit => | |
323 | 329 | $Tuple3("WAVES", "WAVES", 8) | |
324 | 330 | case _ => | |
325 | 331 | throw("Match error") | |
326 | 332 | } | |
327 | 333 | ||
328 | 334 | ||
329 | 335 | func suspend (cause) = [BooleanEntry(kActive, false), StringEntry(kCause, cause)] | |
330 | 336 | ||
331 | 337 | ||
332 | 338 | func throwIsActive () = throw("DApp is already active") | |
333 | 339 | ||
334 | 340 | ||
335 | 341 | func isActive () = if (if (active) | |
336 | 342 | then activeGlob | |
337 | 343 | else false) | |
338 | 344 | then unit | |
339 | 345 | else throw("DApp is inactive at this moment") | |
340 | 346 | ||
341 | 347 | ||
342 | 348 | func isDepricated () = if (!(deprecatedPool)) | |
343 | 349 | then unit | |
344 | 350 | else throw("Pool is deprecated. Only withdraw action allowed.") | |
345 | 351 | ||
346 | 352 | ||
347 | 353 | func isAdminCall (i) = if (containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)) | |
348 | 354 | then unit | |
349 | 355 | else throw("Only admin can call this function") | |
350 | 356 | ||
351 | 357 | ||
352 | 358 | func isSelfCall (i) = if ((this == i.caller)) | |
353 | 359 | then unit | |
354 | 360 | else throw("Only contract itself can call this function") | |
355 | 361 | ||
356 | 362 | ||
357 | 363 | func throwAssets () = throw(((("Incorrect assets attached. Expected: " + strAssetIdA) + " and ") + strAssetIdB)) | |
358 | 364 | ||
359 | 365 | ||
360 | 366 | func throwOnePayment () = throw("One attached payment expected") | |
361 | 367 | ||
362 | 368 | ||
363 | 369 | func suspendSuspicious () = suspend(((((((((((((((("Suspicious state. Actual balances: " + toString(balanceA)) + " ") + assetNameA) + ", ") + toString(balanceB)) + " ") + assetNameB) + ". State: ") + toString(accountBalance(assetIdA))) + " ") + assetNameA) + ", ") + toString(accountBalance(assetIdB))) + " ") + assetNameB)) | |
364 | 370 | ||
365 | 371 | ||
366 | 372 | func calcStakingFuncAndAddres (stake,assetId) = if (stake) | |
367 | 373 | then $Tuple2("lockNeutrino", stakingUSDNAddress) | |
368 | 374 | else $Tuple2("unlockNeutrino", stakingUSDNAddress) | |
369 | 375 | ||
370 | 376 | ||
371 | 377 | func calcStakingParams (stake,amount,assetId) = if (stake) | |
372 | 378 | then { | |
373 | - | let $ | |
374 | - | let call = $ | |
375 | - | let stakingAddr = $ | |
379 | + | let $t01060610672 = calcStakingFuncAndAddres(stake, assetId) | |
380 | + | let call = $t01060610672._1 | |
381 | + | let stakingAddr = $t01060610672._2 | |
376 | 382 | $Tuple4(call, stakingAddr, nil, [AttachedPayment(assetId, amount)]) | |
377 | 383 | } | |
378 | 384 | else { | |
379 | - | let $ | |
380 | - | let call = $ | |
381 | - | let stakingAddr = $ | |
385 | + | let $t01077010836 = calcStakingFuncAndAddres(stake, assetId) | |
386 | + | let call = $t01077010836._1 | |
387 | + | let stakingAddr = $t01077010836._2 | |
382 | 388 | $Tuple4(call, stakingAddr, [amount, toBase58String(assetId)], nil) | |
383 | 389 | } | |
384 | 390 | ||
385 | 391 | ||
386 | 392 | func calculateFeeDiscount (userAddr) = { | |
387 | 393 | let swopAmount = valueOrElse(getInteger(govAddress, (toString(userAddr) + kUserSwopInGov)), 0) | |
388 | 394 | let gSwopAmount = valueOrElse(getInteger(govAddress, (toString(userAddr) + kUserGSwopInGov)), swopAmount) | |
389 | 395 | let discountValues = split(getStringValue(oracle, kDiscountValues), ",") | |
390 | 396 | let discounts = split(getStringValue(oracle, kDiscounts), ",") | |
391 | 397 | if (if ((gSwopAmount >= parseIntValue(discountValues[0]))) | |
392 | 398 | then (parseIntValue(discountValues[1]) > gSwopAmount) | |
393 | 399 | else false) | |
394 | 400 | then (feeScale6 - parseIntValue(discounts[0])) | |
395 | 401 | else if (if ((gSwopAmount >= parseIntValue(discountValues[1]))) | |
396 | 402 | then (parseIntValue(discountValues[2]) > gSwopAmount) | |
397 | 403 | else false) | |
398 | 404 | then (feeScale6 - parseIntValue(discounts[1])) | |
399 | 405 | else if (if ((gSwopAmount >= parseIntValue(discountValues[2]))) | |
400 | 406 | then (parseIntValue(discountValues[3]) > gSwopAmount) | |
401 | 407 | else false) | |
402 | 408 | then (feeScale6 - parseIntValue(discounts[2])) | |
403 | 409 | else if (if ((gSwopAmount >= parseIntValue(discountValues[3]))) | |
404 | 410 | then (parseIntValue(discountValues[4]) > gSwopAmount) | |
405 | 411 | else false) | |
406 | 412 | then (feeScale6 - parseIntValue(discounts[3])) | |
407 | 413 | else if ((gSwopAmount >= parseIntValue(discountValues[4]))) | |
408 | 414 | then (feeScale6 - parseIntValue(discounts[4])) | |
409 | 415 | else feeScale6 | |
410 | 416 | } | |
411 | 417 | ||
412 | 418 | ||
413 | 419 | func checkDAppThreshold (newBalanceA,newBalanceB,pmtAssetId) = { | |
414 | 420 | let dAppThreshold = getIntegerValue(this, kDAppThreshold) | |
415 | 421 | let ratio = if (if ((pmtAssetId == assetIdA)) | |
416 | 422 | then (newBalanceA > newBalanceB) | |
417 | 423 | else false) | |
418 | 424 | then fraction(newBalanceA, 1, newBalanceB, CEILING) | |
419 | 425 | else if (if ((pmtAssetId == assetIdB)) | |
420 | 426 | then (newBalanceB > newBalanceA) | |
421 | 427 | else false) | |
422 | 428 | then fraction(newBalanceB, 1, newBalanceA, CEILING) | |
423 | 429 | else 0 | |
424 | 430 | if ((ratio > dAppThreshold)) | |
425 | 431 | then { | |
426 | - | let $ | |
432 | + | let $t01268912797 = if ((pmtAssetId == assetIdA)) | |
427 | 433 | then $Tuple2(assetNameB, assetNameA) | |
428 | 434 | else $Tuple2(assetNameA, assetNameB) | |
429 | - | let token1 = $ | |
430 | - | let token2 = $ | |
435 | + | let token1 = $t01268912797._1 | |
436 | + | let token2 = $t01268912797._2 | |
431 | 437 | throw((((("Buying " + token1) + " is temporarily unavailable due to the ") + token2) + " depeg")) | |
432 | 438 | } | |
433 | 439 | else true | |
434 | 440 | } | |
435 | 441 | ||
436 | 442 | ||
437 | 443 | func replenishWithTwoTokensCalc (i,stakeFarming,lockType) = { | |
438 | 444 | let pmtAssetIdA = i.payments[0].assetId | |
439 | 445 | let pmtAssetIdB = i.payments[1].assetId | |
440 | 446 | let ratioShareTokensInA = fraction(scale8, i.payments[0].amount, balanceA) | |
441 | 447 | let ratioShareTokensInB = fraction(scale8, i.payments[1].amount, balanceB) | |
442 | - | let $ | |
443 | - | let pmtStrAssetIdA = $ | |
444 | - | let pmtAssetNameA = $ | |
445 | - | let pmtDecimalsA = $ | |
446 | - | let $ | |
447 | - | let pmtStrAssetIdB = $ | |
448 | - | let pmtAssetNameB = $ | |
449 | - | let pmtDecimalsB = $ | |
450 | - | let $ | |
448 | + | let $t01330913386 = getAssetInfo(pmtAssetIdA) | |
449 | + | let pmtStrAssetIdA = $t01330913386._1 | |
450 | + | let pmtAssetNameA = $t01330913386._2 | |
451 | + | let pmtDecimalsA = $t01330913386._3 | |
452 | + | let $t01339513516 = getAssetInfo(pmtAssetIdB) | |
453 | + | let pmtStrAssetIdB = $t01339513516._1 | |
454 | + | let pmtAssetNameB = $t01339513516._2 | |
455 | + | let pmtDecimalsB = $t01339513516._3 | |
456 | + | let $t01352514029 = if ((ratioShareTokensInB > ratioShareTokensInA)) | |
451 | 457 | then { | |
452 | 458 | let pmt = fraction(balanceB, ratioShareTokensInA, scale8, CEILING) | |
453 | 459 | $Tuple5(i.payments[0].amount, pmt, (i.payments[1].amount - pmt), pmtAssetIdB, ratioShareTokensInA) | |
454 | 460 | } | |
455 | 461 | else { | |
456 | 462 | let pmt = fraction(balanceA, ratioShareTokensInB, scale8, CEILING) | |
457 | 463 | $Tuple5(pmt, i.payments[1].amount, (i.payments[0].amount - pmt), pmtAssetIdA, ratioShareTokensInB) | |
458 | 464 | } | |
459 | - | let pmtAmountA = $ | |
460 | - | let pmtAmountB = $ | |
461 | - | let change = $ | |
462 | - | let changeAssetId = $ | |
463 | - | let shareTokenRatio = $ | |
465 | + | let pmtAmountA = $t01352514029._1 | |
466 | + | let pmtAmountB = $t01352514029._2 | |
467 | + | let change = $t01352514029._3 | |
468 | + | let changeAssetId = $t01352514029._4 | |
469 | + | let shareTokenRatio = $t01352514029._5 | |
464 | 470 | let shareTokenToPayAmount = fraction(shareTokenRatio, shareAssetSupply, scale8) | |
465 | 471 | if (if ((size(i.payments) != 2)) | |
466 | 472 | then (size(i.payments) != 3) | |
467 | 473 | else false) | |
468 | 474 | then throw("Two or three payments expected") | |
469 | 475 | else if (if ((pmtAssetIdA != assetIdA)) | |
470 | 476 | then true | |
471 | 477 | else (pmtAssetIdB != assetIdB)) | |
472 | 478 | then throwAssets() | |
473 | 479 | else if ((shareTokenToPayAmount == 0)) | |
474 | 480 | then throw("Too small amount to replenish") | |
475 | 481 | else if ((0 > change)) | |
476 | 482 | then throw("Change < 0") | |
477 | 483 | else if (!(hasEnoughBalance)) | |
478 | 484 | then ([ScriptTransfer(i.caller, pmtAmountA, pmtAssetIdA), ScriptTransfer(i.caller, pmtAmountB, pmtAssetIdB)] ++ suspendSuspicious()) | |
479 | 485 | else { | |
480 | 486 | let stake1 = if (contains(stakingAssets, pmtStrAssetIdA)) | |
481 | 487 | then invoke(this, "stakeUnstake", [true, pmtAmountA, pmtStrAssetIdA], nil) | |
482 | 488 | else 0 | |
483 | 489 | if ((stake1 == stake1)) | |
484 | 490 | then { | |
485 | 491 | let stake2 = if (contains(stakingAssets, pmtStrAssetIdB)) | |
486 | 492 | then invoke(this, "stakeUnstake", [true, pmtAmountB, pmtStrAssetIdB], nil) | |
487 | 493 | else 0 | |
488 | 494 | if ((stake2 == stake2)) | |
489 | 495 | then { | |
490 | 496 | let scriptActions = [IntegerEntry(kBalanceA, (balanceA + pmtAmountA)), IntegerEntry(kBalanceB, (balanceB + pmtAmountB)), IntegerEntry(kShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), IntegerEntry(kInvariant, invariantCalc((balanceA + pmtAmountA), (balanceB + pmtAmountB))), ScriptTransfer(i.caller, change, changeAssetId)] | |
491 | 497 | if (stakeFarming) | |
492 | 498 | then { | |
493 | 499 | let stPayments = ([AttachedPayment(shareAssetId, shareTokenToPayAmount)] ++ (if ((size(i.payments) == 3)) | |
494 | 500 | then [AttachedPayment(if ((i.payments[2].assetId == base58'')) | |
495 | 501 | then unit | |
496 | 502 | else i.payments[2].assetId, i.payments[2].amount)] | |
497 | 503 | else nil)) | |
498 | 504 | let re = invoke(this, "reissueShare", [shareTokenToPayAmount], nil) | |
499 | 505 | if ((re == re)) | |
500 | 506 | then { | |
501 | 507 | let s = invoke(farmingAddress, "lockShareTokensFromPool", [i.caller.bytes, toString(this), lockType], stPayments) | |
502 | 508 | if ((s == s)) | |
503 | 509 | then scriptActions | |
504 | 510 | else throw("Strict value is not equal to itself.") | |
505 | 511 | } | |
506 | 512 | else throw("Strict value is not equal to itself.") | |
507 | 513 | } | |
508 | 514 | else (scriptActions ++ [Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId)]) | |
509 | 515 | } | |
510 | 516 | else throw("Strict value is not equal to itself.") | |
511 | 517 | } | |
512 | 518 | else throw("Strict value is not equal to itself.") | |
513 | 519 | } | |
514 | 520 | } | |
515 | 521 | ||
516 | 522 | ||
517 | 523 | func replenishWithOneTokenCalc (i,virtualSwapTokenPay,virtualSwapTokenGet,stakeFarming,lockType) = { | |
518 | - | let $ | |
519 | - | let pmtAmount = $ | |
520 | - | let pmtAssetId = $ | |
521 | - | let $ | |
522 | - | let pmtStrAssetId = $ | |
523 | - | let pmtAssetName = $ | |
524 | - | let pmtDecimals = $ | |
524 | + | let $t01693117006 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
525 | + | let pmtAmount = $t01693117006._1 | |
526 | + | let pmtAssetId = $t01693117006._2 | |
527 | + | let $t01701517088 = getAssetInfo(pmtAssetId) | |
528 | + | let pmtStrAssetId = $t01701517088._1 | |
529 | + | let pmtAssetName = $t01701517088._2 | |
530 | + | let pmtDecimals = $t01701517088._3 | |
525 | 531 | let pmtMinThreshold = 5000000 | |
526 | 532 | let thresholdValueForMinTolerance = 50000000 | |
527 | 533 | let tolerance = if ((thresholdValueForMinTolerance > pmtAmount)) | |
528 | 534 | then 100000 | |
529 | 535 | else 1 | |
530 | 536 | let slippageValueMinForReplenish = (scale8 - ((scale8 * tolerance) / 10000000)) | |
531 | 537 | let slippageValueMaxForReplenish = (scale8 + ((scale8 * tolerance) / 10000000)) | |
532 | 538 | let slippageValueMinForSwap = (scale8 - ((scale8 * 1) / 10000000)) | |
533 | 539 | if ((pmtMinThreshold > pmtAmount)) | |
534 | 540 | then throw((((("Payment amount " + toString(pmtAmount)) + " does not exceed the minimum amount of ") + toString(pmtMinThreshold)) + " tokens")) | |
535 | 541 | else if (if ((size(i.payments) != 1)) | |
536 | 542 | then (size(i.payments) != 2) | |
537 | 543 | else false) | |
538 | 544 | then throw("One or two payments expected") | |
539 | 545 | else if (!(hasEnoughBalance)) | |
540 | 546 | then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious()) | |
541 | 547 | else if (if ((pmtAssetId != assetIdA)) | |
542 | 548 | then (pmtAssetId != assetIdB) | |
543 | 549 | else false) | |
544 | 550 | then throwAssets() | |
545 | 551 | else { | |
546 | - | let $ | |
552 | + | let $t01819818848 = if ((pmtAssetId == assetIdA)) | |
547 | 553 | then $Tuple6((pmtAmount - virtualSwapTokenPay), virtualSwapTokenGet, (balanceA + virtualSwapTokenPay), (balanceB - virtualSwapTokenGet), (balanceA + pmtAmount), balanceB) | |
548 | 554 | else $Tuple6(virtualSwapTokenGet, (pmtAmount - virtualSwapTokenPay), (balanceA - virtualSwapTokenGet), (balanceB + virtualSwapTokenPay), balanceA, (balanceB + pmtAmount)) | |
549 | - | let virtualReplenishA = $ | |
550 | - | let virtualReplenishB = $ | |
551 | - | let balanceAfterSwapA = $ | |
552 | - | let balanceAfterSwapB = $ | |
553 | - | let newBalanceA = $ | |
554 | - | let newBalanceB = $ | |
555 | + | let virtualReplenishA = $t01819818848._1 | |
556 | + | let virtualReplenishB = $t01819818848._2 | |
557 | + | let balanceAfterSwapA = $t01819818848._3 | |
558 | + | let balanceAfterSwapB = $t01819818848._4 | |
559 | + | let newBalanceA = $t01819818848._5 | |
560 | + | let newBalanceB = $t01819818848._6 | |
555 | 561 | let invariantNew = invariantCalc(balanceAfterSwapA, balanceAfterSwapB) | |
556 | 562 | let ratioVirtualBalanceToVirtualReplenish = (fraction(scale16, balanceAfterSwapA, balanceAfterSwapB) / fraction(scale8, virtualReplenishA, virtualReplenishB)) | |
557 | 563 | if (if ((slippageValueMinForSwap >= fraction(scale8, invariant, invariantNew))) | |
558 | 564 | then true | |
559 | 565 | else (invariant > invariantNew)) | |
560 | 566 | then throw("Incorrect virtualSwapTokenPay or virtualSwapTokenGet value") | |
561 | 567 | else if (if ((slippageValueMinForReplenish > ratioVirtualBalanceToVirtualReplenish)) | |
562 | 568 | then true | |
563 | 569 | else (ratioVirtualBalanceToVirtualReplenish > slippageValueMaxForReplenish)) | |
564 | 570 | then throw("Swap with virtualSwapTokenPay and virtualSwapTokenGet is possible, but ratio after virtual swap is incorrect") | |
565 | 571 | else if (!(checkDAppThreshold(newBalanceA, newBalanceB, pmtAssetId))) | |
566 | 572 | then throw() | |
567 | 573 | else { | |
568 | 574 | let ratioShareTokensInA = fraction(virtualReplenishA, scale8, balanceAfterSwapA) | |
569 | 575 | let ratioShareTokensInB = fraction(virtualReplenishB, scale8, balanceAfterSwapB) | |
570 | 576 | let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scale8) | |
571 | 577 | let shareTokenToPayAmountAfterFee = fraction(shareTokenToPayAmount, (feeScale6 - (fee / 2)), feeScale6) | |
572 | 578 | let shareTokenGovernanceReward = fraction(shareTokenToPayAmount, (feeGovernance / 2), feeScale6) | |
579 | + | let shareTokenTeamReward = fraction(shareTokenToPayAmount, (feeTeam / 2), feeScale6) | |
573 | 580 | let governanceRewardTokenA = fraction(shareTokenGovernanceReward, balanceA, shareAssetSupply) | |
574 | 581 | let governanceRewardTokenB = fraction(shareTokenGovernanceReward, balanceB, shareAssetSupply) | |
575 | - | let $t01962119904 = if ((pmtStrAssetId == strAssetIdA)) | |
576 | - | then $Tuple3((pmtAmount - governanceRewardTokenA), governanceRewardTokenB, strAssetIdB) | |
577 | - | else $Tuple3((pmtAmount - governanceRewardTokenB), governanceRewardTokenA, strAssetIdA) | |
578 | - | let stakeAmount = $t01962119904._1 | |
579 | - | let unstakeAmount = $t01962119904._2 | |
580 | - | let unstakeAsset = $t01962119904._3 | |
582 | + | let teamRewardTokenA = fraction(shareTokenTeamReward, balanceA, shareAssetSupply) | |
583 | + | let teamRewardTokenB = fraction(shareTokenTeamReward, balanceB, shareAssetSupply) | |
584 | + | let $t02103321416 = if ((pmtStrAssetId == strAssetIdA)) | |
585 | + | then $Tuple3(((pmtAmount - governanceRewardTokenA) - teamRewardTokenA), (governanceRewardTokenB + teamRewardTokenB), strAssetIdB) | |
586 | + | else $Tuple3(((pmtAmount - governanceRewardTokenB) - teamRewardTokenB), (governanceRewardTokenA + teamRewardTokenA), strAssetIdA) | |
587 | + | let stakeAmount = $t02103321416._1 | |
588 | + | let unstakeAmount = $t02103321416._2 | |
589 | + | let unstakeAsset = $t02103321416._3 | |
581 | 590 | let stake1 = if (contains(stakingAssets, pmtStrAssetId)) | |
582 | 591 | then invoke(this, "stakeUnstake", [true, stakeAmount, pmtStrAssetId], nil) | |
583 | 592 | else 0 | |
584 | 593 | if ((stake1 == stake1)) | |
585 | 594 | then { | |
586 | 595 | let stake2 = if (contains(stakingAssets, unstakeAsset)) | |
587 | 596 | then invoke(this, "stakeUnstake", [false, unstakeAmount, unstakeAsset], nil) | |
588 | 597 | else 0 | |
589 | 598 | if ((stake2 == stake2)) | |
590 | 599 | then { | |
591 | - | let scriptActions = [IntegerEntry(kBalanceA, (newBalanceA - governanceRewardTokenA)), IntegerEntry(kBalanceB, (newBalanceB - governanceRewardTokenB)), IntegerEntry(kShareAssetSupply, (shareAssetSupply + shareTokenToPayAmountAfterFee)), IntegerEntry(kInvariant, invariantCalc((newBalanceA - governanceRewardTokenA), (newBalanceB - governanceRewardTokenB))), ScriptTransfer(moneyBoxAddress, governanceRewardTokenA, assetIdA), ScriptTransfer(moneyBoxAddress, governanceRewardTokenB, assetIdB)] | |
600 | + | let scriptActions = [IntegerEntry(kBalanceA, ((newBalanceA - governanceRewardTokenA) - teamRewardTokenA)), IntegerEntry(kBalanceB, ((newBalanceB - governanceRewardTokenB) - teamRewardTokenB)), IntegerEntry(kShareAssetSupply, (shareAssetSupply + shareTokenToPayAmountAfterFee)), IntegerEntry(kInvariant, invariantCalc((newBalanceA - governanceRewardTokenA), (newBalanceB - governanceRewardTokenB))), ScriptTransfer(moneyBoxAddress, governanceRewardTokenA, assetIdA), ScriptTransfer(moneyBoxAddress, governanceRewardTokenB, assetIdB), ScriptTransfer(teamBoxAddress, teamRewardTokenA, assetIdA), ScriptTransfer(teamBoxAddress, teamRewardTokenB, assetIdB)] | |
592 | 601 | if (stakeFarming) | |
593 | 602 | then { | |
594 | 603 | let stPayments = ([AttachedPayment(shareAssetId, shareTokenToPayAmountAfterFee)] ++ (if ((size(i.payments) == 2)) | |
595 | 604 | then [AttachedPayment(if ((i.payments[1].assetId == base58'')) | |
596 | 605 | then unit | |
597 | 606 | else i.payments[1].assetId, i.payments[1].amount)] | |
598 | 607 | else nil)) | |
599 | 608 | let re = invoke(this, "reissueShare", [shareTokenToPayAmountAfterFee], nil) | |
600 | 609 | if ((re == re)) | |
601 | 610 | then { | |
602 | 611 | let s = invoke(farmingAddress, "lockShareTokensFromPool", [i.caller.bytes, toString(this), lockType], stPayments) | |
603 | 612 | if ((s == s)) | |
604 | 613 | then scriptActions | |
605 | 614 | else throw("Strict value is not equal to itself.") | |
606 | 615 | } | |
607 | 616 | else throw("Strict value is not equal to itself.") | |
608 | 617 | } | |
609 | 618 | else (scriptActions ++ [Reissue(shareAssetId, shareTokenToPayAmountAfterFee, true), ScriptTransfer(i.caller, shareTokenToPayAmountAfterFee, shareAssetId)]) | |
610 | 619 | } | |
611 | 620 | else throw("Strict value is not equal to itself.") | |
612 | 621 | } | |
613 | 622 | else throw("Strict value is not equal to itself.") | |
614 | 623 | } | |
615 | 624 | } | |
616 | 625 | } | |
617 | 626 | ||
618 | 627 | ||
619 | 628 | func withdrawCalc (i,unlockAmount) = { | |
620 | - | let $ | |
629 | + | let $t02417124506 = if ((size(i.payments) == 1)) | |
621 | 630 | then if ((i.payments[0].assetId != shareAssetId)) | |
622 | 631 | then throw(("Incorrect asset attached. Expected: " + toBase58String(shareAssetId))) | |
623 | 632 | else $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
624 | 633 | else $Tuple2(0, shareAssetId) | |
625 | - | let pmtAmount = $ | |
626 | - | let pmtAssetId = $ | |
634 | + | let pmtAmount = $t02417124506._1 | |
635 | + | let pmtAssetId = $t02417124506._2 | |
627 | 636 | if (!(hasEnoughBalance)) | |
628 | 637 | then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious()) | |
629 | 638 | else { | |
630 | 639 | let unlock = if ((unlockAmount > 0)) | |
631 | 640 | then invoke(farmingAddress, "withdrawShareTokensFromPool", [i.caller.bytes, toString(this), unlockAmount], nil) | |
632 | 641 | else 0 | |
633 | 642 | if ((unlock == unlock)) | |
634 | 643 | then { | |
635 | 644 | let withdrawAmount = (pmtAmount + unlockAmount) | |
636 | 645 | let amountToPayA = fraction(withdrawAmount, balanceA, shareAssetSupply) | |
637 | 646 | let amountToPayB = fraction(withdrawAmount, balanceB, shareAssetSupply) | |
638 | 647 | let invariantCalculated = invariantCalc((balanceA - amountToPayA), (balanceB - amountToPayB)) | |
639 | 648 | let stake1 = if (contains(stakingAssets, strAssetIdA)) | |
640 | 649 | then invoke(this, "stakeUnstake", [false, amountToPayA, strAssetIdA], nil) | |
641 | 650 | else 0 | |
642 | 651 | if ((stake1 == stake1)) | |
643 | 652 | then { | |
644 | 653 | let stake2 = if (contains(stakingAssets, strAssetIdB)) | |
645 | 654 | then invoke(this, "stakeUnstake", [false, amountToPayB, strAssetIdB], nil) | |
646 | 655 | else 0 | |
647 | 656 | if ((stake2 == stake2)) | |
648 | 657 | then [IntegerEntry(kBalanceA, (balanceA - amountToPayA)), IntegerEntry(kBalanceB, (balanceB - amountToPayB)), IntegerEntry(kShareAssetSupply, (shareAssetSupply - withdrawAmount)), IntegerEntry(kInvariant, invariantCalculated), Burn(shareAssetId, withdrawAmount), ScriptTransfer(i.caller, amountToPayA, assetIdA), ScriptTransfer(i.caller, amountToPayB, assetIdB)] | |
649 | 658 | else throw("Strict value is not equal to itself.") | |
650 | 659 | } | |
651 | 660 | else throw("Strict value is not equal to itself.") | |
652 | 661 | } | |
653 | 662 | else throw("Strict value is not equal to itself.") | |
654 | 663 | } | |
655 | 664 | } | |
656 | 665 | ||
657 | 666 | ||
658 | 667 | @Callable(i) | |
659 | 668 | func init (firstHarvest) = { | |
660 | - | let $ | |
661 | - | let pmtAmountA = $ | |
662 | - | let pmtAssetIdA = $ | |
663 | - | let $ | |
664 | - | let pmtAmountB = $ | |
665 | - | let pmtAssetIdB = $ | |
666 | - | let $ | |
667 | - | let pmtStrAssetIdA = $ | |
668 | - | let pmtAssetNameA = $ | |
669 | - | let pmtDecimalsA = $ | |
670 | - | let $ | |
671 | - | let pmtStrAssetIdB = $ | |
672 | - | let pmtAssetNameB = $ | |
673 | - | let pmtDecimalsB = $ | |
669 | + | let $t02636226439 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
670 | + | let pmtAmountA = $t02636226439._1 | |
671 | + | let pmtAssetIdA = $t02636226439._2 | |
672 | + | let $t02644826525 = $Tuple2(i.payments[1].amount, i.payments[1].assetId) | |
673 | + | let pmtAmountB = $t02644826525._1 | |
674 | + | let pmtAssetIdB = $t02644826525._2 | |
675 | + | let $t02653426611 = getAssetInfo(pmtAssetIdA) | |
676 | + | let pmtStrAssetIdA = $t02653426611._1 | |
677 | + | let pmtAssetNameA = $t02653426611._2 | |
678 | + | let pmtDecimalsA = $t02653426611._3 | |
679 | + | let $t02662026697 = getAssetInfo(pmtAssetIdB) | |
680 | + | let pmtStrAssetIdB = $t02662026697._1 | |
681 | + | let pmtAssetNameB = $t02662026697._2 | |
682 | + | let pmtDecimalsB = $t02662026697._3 | |
674 | 683 | if (isDefined(getBoolean(this, kActive))) | |
675 | 684 | then throwIsActive() | |
676 | 685 | else if ((pmtAssetIdA == pmtAssetIdB)) | |
677 | 686 | then throw("Assets must be different") | |
678 | 687 | else { | |
679 | 688 | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
680 | 689 | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
681 | 690 | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
682 | 691 | let shareInitialSupply = fraction(pow(pmtAmountA, pmtDecimalsA, 5, 1, pmtDecimalsA, DOWN), pow(pmtAmountB, pmtDecimalsB, 5, 1, pmtDecimalsB, DOWN), pow(10, 0, shareDecimals, 0, 0, DOWN)) | |
683 | 692 | let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true) | |
684 | 693 | let shareIssueId = calculateAssetId(shareIssue) | |
685 | 694 | let invariantCalculated = invariantCalc(pmtAmountA, pmtAmountB) | |
686 | 695 | let stake1 = if (contains(stakingAssets, pmtStrAssetIdA)) | |
687 | 696 | then invoke(this, "stakeUnstake", [true, pmtAmountA, pmtStrAssetIdA], nil) | |
688 | 697 | else 0 | |
689 | 698 | if ((stake1 == stake1)) | |
690 | 699 | then { | |
691 | 700 | let stake2 = if (contains(stakingAssets, pmtStrAssetIdB)) | |
692 | 701 | then invoke(this, "stakeUnstake", [true, pmtAmountB, pmtStrAssetIdB], nil) | |
693 | 702 | else 0 | |
694 | 703 | if ((stake2 == stake2)) | |
695 | 704 | then { | |
696 | 705 | let baseEntry = [StringEntry(kVersion, version), BooleanEntry(kActive, true), StringEntry(kAssetIdA, pmtStrAssetIdA), StringEntry(kAssetIdB, pmtStrAssetIdB), IntegerEntry(kBalanceA, pmtAmountA), IntegerEntry(kBalanceB, pmtAmountB), IntegerEntry(kInvariant, invariantCalculated), IntegerEntry(kFee, getIntegerValue(oracle, "base_fee_flat")), IntegerEntry(kDAppThreshold, 3), shareIssue, StringEntry(kShareAssetId, toBase58String(shareIssueId)), IntegerEntry(kShareAssetSupply, shareInitialSupply), ScriptTransfer(i.caller, shareInitialSupply, shareIssueId)] | |
697 | 706 | if (firstHarvest) | |
698 | 707 | then (baseEntry ++ [BooleanEntry(kFirstHarvest, firstHarvest), IntegerEntry(kFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength)))]) | |
699 | 708 | else baseEntry | |
700 | 709 | } | |
701 | 710 | else throw("Strict value is not equal to itself.") | |
702 | 711 | } | |
703 | 712 | else throw("Strict value is not equal to itself.") | |
704 | 713 | } | |
705 | 714 | } | |
706 | 715 | ||
707 | 716 | ||
708 | 717 | ||
709 | 718 | @Callable(i) | |
710 | 719 | func replenishWithTwoTokensV2 (stakeFarming,lockType) = valueOrElse(isActive(), valueOrElse(isDepricated(), replenishWithTwoTokensCalc(i, stakeFarming, lockType))) | |
711 | 720 | ||
712 | 721 | ||
713 | 722 | ||
714 | 723 | @Callable(i) | |
715 | 724 | func replenishWithOneTokenV2 (virtualSwapTokenPay,virtualSwapTokenGet,stakeFarming,lockType) = valueOrElse(isActive(), valueOrElse(isDepricated(), replenishWithOneTokenCalc(i, virtualSwapTokenPay, virtualSwapTokenGet, stakeFarming, lockType))) | |
716 | 725 | ||
717 | 726 | ||
718 | 727 | ||
719 | 728 | @Callable(i) | |
720 | 729 | func withdrawV2 (unlockAmount) = valueOrElse(isActive(), withdrawCalc(i, unlockAmount)) | |
721 | 730 | ||
722 | 731 | ||
723 | 732 | ||
724 | 733 | @Callable(i) | |
725 | 734 | func withdrawOneToken (unlockAmount,withdrawAsset,estimatedAmountToReceive,minAmountToReceive) = valueOrElse(isActive(), valueOrElse(isDepricated(), { | |
726 | - | let $ | |
735 | + | let $t03071131070 = if ((size(i.payments) == 1)) | |
727 | 736 | then if ((i.payments[0].assetId != shareAssetId)) | |
728 | 737 | then throw(("Incorrect asset attached. Expected: " + toBase58String(shareAssetId))) | |
729 | 738 | else $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
730 | 739 | else $Tuple2(0, shareAssetId) | |
731 | - | let pmtAmount = $ | |
732 | - | let pmtAssetId = $ | |
740 | + | let pmtAmount = $t03071131070._1 | |
741 | + | let pmtAssetId = $t03071131070._2 | |
733 | 742 | let withdrawAmount = (pmtAmount + unlockAmount) | |
734 | 743 | if (if ((withdrawAsset != strAssetIdA)) | |
735 | 744 | then (withdrawAsset != strAssetIdB) | |
736 | 745 | else false) | |
737 | 746 | then throw("Incorrect withdraw asset") | |
738 | 747 | else if ((0 >= withdrawAmount)) | |
739 | 748 | then throw("withdraw amount must be grater than 0") | |
740 | 749 | else if (!(hasEnoughBalance)) | |
741 | 750 | then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious()) | |
742 | 751 | else { | |
743 | 752 | let unlock = if ((unlockAmount > 0)) | |
744 | 753 | then invoke(farmingAddress, "withdrawShareTokensFromPool", [i.caller.bytes, toString(this), unlockAmount], nil) | |
745 | 754 | else 0 | |
746 | 755 | if ((unlock == unlock)) | |
747 | 756 | then { | |
748 | 757 | let amountToPayA = fraction(withdrawAmount, balanceA, shareAssetSupply) | |
749 | 758 | let amountToPayB = fraction(withdrawAmount, balanceB, shareAssetSupply) | |
750 | 759 | let newVirtBalcA = (balanceA - amountToPayA) | |
751 | 760 | let newVirtBalcB = (balanceB - amountToPayB) | |
752 | 761 | let feeDiscount = calculateFeeDiscount(i.originCaller) | |
753 | 762 | let amountExchangedWithFee = if ((withdrawAsset == strAssetIdA)) | |
754 | 763 | then calculateSendAmount(estimatedAmountToReceive, minAmountToReceive, amountToPayB, assetIdB, newVirtBalcA, newVirtBalcB, invariantCalc(newVirtBalcA, newVirtBalcB)) | |
755 | 764 | else calculateSendAmount(estimatedAmountToReceive, minAmountToReceive, amountToPayA, assetIdA, newVirtBalcA, newVirtBalcB, invariantCalc(newVirtBalcA, newVirtBalcB)) | |
756 | 765 | let govReward = fraction(amountExchangedWithFee, fraction(feeGovernance, feeDiscount, feeScale6, CEILING), feeScale6) | |
766 | + | let teamReward = fraction(amountExchangedWithFee, fraction(feeTeam, feeDiscount, feeScale6, CEILING), feeScale6) | |
757 | 767 | let amountExchanged = fraction(amountExchangedWithFee, (feeScale6 - fraction(fee, feeDiscount, feeScale6, CEILING)), feeScale6) | |
758 | - | let $ | |
759 | - | then $Tuple4((amountToPayA + amountExchanged), (((balanceA - amountToPayA) - amountExchanged) - govReward), balanceB, assetIdB) | |
760 | - | else $Tuple4((amountToPayB + amountExchanged), balanceA, (((balanceB - amountToPayB) - amountExchanged) - govReward), assetIdA) | |
761 | - | let amountToPay = $ | |
762 | - | let balanceANew = $ | |
763 | - | let balanceBNew = $ | |
764 | - | let virtAssetId = $ | |
768 | + | let $t03306833492 = if ((withdrawAsset == strAssetIdA)) | |
769 | + | then $Tuple4((amountToPayA + amountExchanged), ((((balanceA - amountToPayA) - amountExchanged) - govReward) - teamReward), balanceB, assetIdB) | |
770 | + | else $Tuple4((amountToPayB + amountExchanged), balanceA, ((((balanceB - amountToPayB) - amountExchanged) - govReward) - teamReward), assetIdA) | |
771 | + | let amountToPay = $t03306833492._1 | |
772 | + | let balanceANew = $t03306833492._2 | |
773 | + | let balanceBNew = $t03306833492._3 | |
774 | + | let virtAssetId = $t03306833492._4 | |
765 | 775 | if (!(checkDAppThreshold(balanceANew, balanceBNew, virtAssetId))) | |
766 | 776 | then throw() | |
767 | 777 | else { | |
768 | 778 | let invariantCalculated = invariantCalc(balanceANew, balanceBNew) | |
769 | 779 | let stake1 = if (contains(stakingAssets, withdrawAsset)) | |
770 | - | then invoke(this, "stakeUnstake", [false, (amountToPay + govReward), withdrawAsset], nil) | |
780 | + | then invoke(this, "stakeUnstake", [false, ((amountToPay + govReward) + teamReward), withdrawAsset], nil) | |
771 | 781 | else 0 | |
772 | 782 | if ((stake1 == stake1)) | |
773 | - | then [IntegerEntry(kBalanceA, balanceANew), IntegerEntry(kBalanceB, balanceBNew), IntegerEntry(kShareAssetSupply, (shareAssetSupply - withdrawAmount)), IntegerEntry(kInvariant, invariantCalculated), Burn(shareAssetId, withdrawAmount), ScriptTransfer(i.caller, amountToPay, fromBase58String(withdrawAsset)), ScriptTransfer(moneyBoxAddress, govReward, fromBase58String(withdrawAsset))] | |
783 | + | then [IntegerEntry(kBalanceA, balanceANew), IntegerEntry(kBalanceB, balanceBNew), IntegerEntry(kShareAssetSupply, (shareAssetSupply - withdrawAmount)), IntegerEntry(kInvariant, invariantCalculated), Burn(shareAssetId, withdrawAmount), ScriptTransfer(i.caller, amountToPay, fromBase58String(withdrawAsset)), ScriptTransfer(moneyBoxAddress, govReward, fromBase58String(withdrawAsset)), ScriptTransfer(teamBoxAddress, teamReward, fromBase58String(withdrawAsset))] | |
774 | 784 | else throw("Strict value is not equal to itself.") | |
775 | 785 | } | |
776 | 786 | } | |
777 | 787 | else throw("Strict value is not equal to itself.") | |
778 | 788 | } | |
779 | 789 | })) | |
780 | 790 | ||
781 | 791 | ||
782 | 792 | ||
783 | 793 | @Callable(i) | |
784 | 794 | func exchange (estimatedAmountToReceive,minAmountToReceive) = valueOrElse(isActive(), valueOrElse(isDepricated(), { | |
785 | - | let $ | |
786 | - | let pmtAmount = $ | |
787 | - | let pmtAssetId = $ | |
795 | + | let $t03499335068 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
796 | + | let pmtAmount = $t03499335068._1 | |
797 | + | let pmtAssetId = $t03499335068._2 | |
788 | 798 | if ((0 >= estimatedAmountToReceive)) | |
789 | 799 | then throw(("Estimated amount must be positive. Actual: " + toString(estimatedAmountToReceive))) | |
790 | 800 | else if ((minAmountToReceive > estimatedAmountToReceive)) | |
791 | 801 | then throw("Minimal amount can't be greater than estimated.") | |
792 | 802 | else if ((size(i.payments) != 1)) | |
793 | 803 | then throwOnePayment() | |
794 | 804 | else if (!(hasEnoughBalance)) | |
795 | 805 | then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious()) | |
796 | 806 | else if (if ((pmtAssetId != assetIdA)) | |
797 | 807 | then (pmtAssetId != assetIdB) | |
798 | 808 | else false) | |
799 | 809 | then throwAssets() | |
800 | 810 | else if ((10000000 > pmtAmount)) | |
801 | 811 | then throw("Only swap of 10.000000 or more tokens is allowed") | |
802 | 812 | else if (if ((exchangeRatioLimitMin > fraction(scale8, minAmountToReceive, pmtAmount))) | |
803 | 813 | then true | |
804 | 814 | else (fraction(scale8, estimatedAmountToReceive, pmtAmount) > exchangeRatioLimitMax)) | |
805 | 815 | then throw("Incorrect args and pmt ratio") | |
806 | 816 | else { | |
807 | 817 | let sendAssetId = if ((pmtAssetId == assetIdA)) | |
808 | 818 | then assetIdB | |
809 | 819 | else assetIdA | |
810 | 820 | let amount = calculateSendAmount(estimatedAmountToReceive, minAmountToReceive, pmtAmount, pmtAssetId, balanceA, balanceB, invariant) | |
811 | 821 | let feeDiscount = calculateFeeDiscount(i.originCaller) | |
812 | 822 | let governanceReward = fraction(amount, fraction(feeGovernance, feeDiscount, feeScale6, CEILING), feeScale6) | |
823 | + | let teamReward = fraction(amount, fraction(feeTeam, feeDiscount, feeScale6, CEILING), feeScale6) | |
813 | 824 | let amountMinusFee = fraction(amount, (feeScale6 - fraction(fee, feeDiscount, feeScale6, CEILING)), feeScale6) | |
814 | - | let $ | |
815 | - | then $Tuple2((balanceA + pmtAmount), ((balanceB - amountMinusFee) - governanceReward)) | |
816 | - | else $Tuple2(((balanceA - amountMinusFee) - governanceReward), (balanceB + pmtAmount)) | |
817 | - | let newBalanceA = $ | |
818 | - | let newBalanceB = $ | |
825 | + | let $t03688737207 = if ((pmtAssetId == assetIdA)) | |
826 | + | then $Tuple2((balanceA + pmtAmount), (((balanceB - amountMinusFee) - governanceReward) - teamReward)) | |
827 | + | else $Tuple2((((balanceA - amountMinusFee) - governanceReward) - teamReward), (balanceB + pmtAmount)) | |
828 | + | let newBalanceA = $t03688737207._1 | |
829 | + | let newBalanceB = $t03688737207._2 | |
819 | 830 | if (!(checkDAppThreshold(newBalanceA, newBalanceB, pmtAssetId))) | |
820 | 831 | then throw() | |
821 | 832 | else { | |
822 | - | let $ | |
823 | - | let pmtStrAssetId = $ | |
824 | - | let pmtAssetName = $ | |
825 | - | let pmtDecimals = $ | |
826 | - | let $ | |
827 | - | let sendStrAssetId = $ | |
828 | - | let sendAssetName = $ | |
829 | - | let sendDecimals = $ | |
833 | + | let $t03734137414 = getAssetInfo(pmtAssetId) | |
834 | + | let pmtStrAssetId = $t03734137414._1 | |
835 | + | let pmtAssetName = $t03734137414._2 | |
836 | + | let pmtDecimals = $t03734137414._3 | |
837 | + | let $t03744337520 = getAssetInfo(sendAssetId) | |
838 | + | let sendStrAssetId = $t03744337520._1 | |
839 | + | let sendAssetName = $t03744337520._2 | |
840 | + | let sendDecimals = $t03744337520._3 | |
830 | 841 | let stake1 = if (contains(stakingAssets, pmtStrAssetId)) | |
831 | 842 | then invoke(this, "stakeUnstake", [true, pmtAmount, pmtStrAssetId], nil) | |
832 | 843 | else 0 | |
833 | 844 | if ((stake1 == stake1)) | |
834 | 845 | then { | |
835 | 846 | let stake2 = if (contains(stakingAssets, sendStrAssetId)) | |
836 | - | then invoke(this, "stakeUnstake", [false, (amountMinusFee + governanceReward), sendStrAssetId], nil) | |
847 | + | then invoke(this, "stakeUnstake", [false, ((amountMinusFee + governanceReward) + teamReward), sendStrAssetId], nil) | |
837 | 848 | else 0 | |
838 | 849 | if ((stake2 == stake2)) | |
839 | - | then $Tuple2([IntegerEntry(kBalanceA, newBalanceA), IntegerEntry(kBalanceB, newBalanceB), IntegerEntry(kInvariant, invariantCalc(newBalanceA, newBalanceB)), ScriptTransfer(i.caller, amountMinusFee, sendAssetId), ScriptTransfer(moneyBoxAddress, governanceReward, sendAssetId)], [amountMinusFee, sendAssetId]) | |
850 | + | then $Tuple2([IntegerEntry(kBalanceA, newBalanceA), IntegerEntry(kBalanceB, newBalanceB), IntegerEntry(kInvariant, invariantCalc(newBalanceA, newBalanceB)), ScriptTransfer(i.caller, amountMinusFee, sendAssetId), ScriptTransfer(moneyBoxAddress, governanceReward, sendAssetId), ScriptTransfer(teamBoxAddress, teamReward, sendAssetId)], [amountMinusFee, sendAssetId]) | |
840 | 851 | else throw("Strict value is not equal to itself.") | |
841 | 852 | } | |
842 | 853 | else throw("Strict value is not equal to itself.") | |
843 | 854 | } | |
844 | 855 | } | |
845 | 856 | })) | |
846 | 857 | ||
847 | 858 | ||
848 | 859 | ||
849 | 860 | @Callable(msg) | |
850 | 861 | func reissueShare (amount) = valueOrElse(isSelfCall(msg), [Reissue(shareAssetId, amount, true)]) | |
851 | 862 | ||
852 | 863 | ||
853 | 864 | ||
854 | 865 | @Callable(i) | |
855 | 866 | func shutdown () = valueOrElse(isAdminCall(i), if (!(active)) | |
856 | 867 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, kCause), "the cause wasn't specified"))) | |
857 | 868 | else suspend("Paused by admin")) | |
858 | 869 | ||
859 | 870 | ||
860 | 871 | ||
861 | 872 | @Callable(i) | |
862 | 873 | func activate () = valueOrElse(isAdminCall(i), if (active) | |
863 | 874 | then throwIsActive() | |
864 | 875 | else [BooleanEntry(kActive, true), DeleteEntry(kCause)]) | |
865 | 876 | ||
866 | 877 | ||
867 | 878 | ||
868 | 879 | @Callable(i) | |
869 | 880 | func takeIntoAccountExtraFunds () = valueOrElse(isActive(), { | |
870 | 881 | let claim = if (if ((assetIdA == USDN)) | |
871 | 882 | then true | |
872 | 883 | else (assetIdB == USDN)) | |
873 | 884 | then invoke(stakingUSDNAddress, "claimRewards", nil, nil) | |
874 | 885 | else 0 | |
875 | 886 | if ((claim == claim)) | |
876 | 887 | then { | |
877 | 888 | let amountEnrollA = (accountBalanceWithStakedA - balanceA) | |
878 | 889 | let amountEnrollB = (accountBalanceWithStakedB - balanceB) | |
879 | 890 | let invariantNew = invariantCalc((balanceA + amountEnrollA), (balanceB + amountEnrollB)) | |
880 | 891 | if ((i.caller != moneyBoxAddress)) | |
881 | 892 | then throw("Only the money box can call this function") | |
882 | 893 | else if (if ((0 > amountEnrollA)) | |
883 | 894 | then true | |
884 | 895 | else (0 > amountEnrollB)) | |
885 | 896 | then suspend("Enroll amount negative") | |
886 | 897 | else if (if ((amountEnrollA == 0)) | |
887 | 898 | then (amountEnrollB == 0) | |
888 | 899 | else false) | |
889 | 900 | then throw("No money to take") | |
890 | 901 | else { | |
891 | 902 | let stake1 = if (if (contains(stakingAssets, strAssetIdA)) | |
892 | 903 | then (amountEnrollA > 0) | |
893 | 904 | else false) | |
894 | 905 | then invoke(this, "stakeUnstake", [true, amountEnrollA, strAssetIdA], nil) | |
895 | 906 | else 0 | |
896 | 907 | if ((stake1 == stake1)) | |
897 | 908 | then { | |
898 | 909 | let stake2 = if (if (contains(stakingAssets, strAssetIdB)) | |
899 | 910 | then (amountEnrollB > 0) | |
900 | 911 | else false) | |
901 | 912 | then invoke(this, "stakeUnstake", [true, amountEnrollB, strAssetIdB], nil) | |
902 | 913 | else 0 | |
903 | 914 | if ((stake2 == stake2)) | |
904 | 915 | then [IntegerEntry(kInvariant, invariantNew), IntegerEntry(kBalanceA, (balanceA + amountEnrollA)), IntegerEntry(kBalanceB, (balanceB + amountEnrollB))] | |
905 | 916 | else throw("Strict value is not equal to itself.") | |
906 | 917 | } | |
907 | 918 | else throw("Strict value is not equal to itself.") | |
908 | 919 | } | |
909 | 920 | } | |
910 | 921 | else throw("Strict value is not equal to itself.") | |
911 | 922 | }) | |
912 | 923 | ||
913 | 924 | ||
914 | 925 | ||
915 | 926 | @Callable(i) | |
916 | 927 | func keepLimitForFirstHarvest (shareLimit) = valueOrElse(isActive(), valueOrElse(isAdminCall(i), [IntegerEntry(kShareLimit, shareLimit)])) | |
917 | 928 | ||
918 | 929 | ||
919 | 930 | ||
920 | 931 | @Callable(i) | |
921 | 932 | func stakeUnstake (stake,amount,assetIdString) = if ((i.caller != this)) | |
922 | 933 | then throw("Only contract itself can invoke this function") | |
923 | 934 | else { | |
924 | - | let $ | |
925 | - | let call = $ | |
926 | - | let addr = $ | |
927 | - | let params = $ | |
928 | - | let payments = $ | |
935 | + | let $t04180641909 = calcStakingParams(stake, amount, fromBase58String(assetIdString)) | |
936 | + | let call = $t04180641909._1 | |
937 | + | let addr = $t04180641909._2 | |
938 | + | let params = $t04180641909._3 | |
939 | + | let payments = $t04180641909._4 | |
929 | 940 | let inv = invoke(addr, call, params, payments) | |
930 | 941 | if ((inv == inv)) | |
931 | 942 | then nil | |
932 | 943 | else throw("Strict value is not equal to itself.") | |
933 | 944 | } | |
934 | 945 | ||
935 | 946 | ||
936 | 947 | ||
937 | 948 | @Callable(i) | |
938 | 949 | func replenishWithTwoTokens () = valueOrElse(isActive(), valueOrElse(isDepricated(), replenishWithTwoTokensCalc(i, false, 0))) | |
939 | 950 | ||
940 | 951 | ||
941 | 952 | ||
942 | 953 | @Callable(i) | |
943 | 954 | func replenishWithOneToken (virtualSwapTokenPay,virtualSwapTokenGet) = valueOrElse(isActive(), valueOrElse(isDepricated(), replenishWithOneTokenCalc(i, virtualSwapTokenPay, virtualSwapTokenGet, false, 0))) | |
944 | 955 | ||
945 | 956 | ||
946 | 957 | ||
947 | 958 | @Callable(i) | |
948 | 959 | func withdraw () = valueOrElse(isActive(), withdrawCalc(i, 0)) | |
949 | 960 | ||
950 | 961 | ||
951 | 962 | @Verifier(tx) | |
952 | 963 | func verify () = { | |
953 | 964 | let multiSignedByAdmins = { | |
954 | 965 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
955 | 966 | then 1 | |
956 | 967 | else 0 | |
957 | 968 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
958 | 969 | then 1 | |
959 | 970 | else 0 | |
960 | 971 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
961 | 972 | then 1 | |
962 | 973 | else 0 | |
963 | 974 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
964 | 975 | } | |
965 | 976 | match tx { | |
966 | 977 | case inv: InvokeScriptTransaction => | |
967 | 978 | let callTakeIntoAccount = if ((inv.dApp == this)) | |
968 | 979 | then (inv.function == "takeIntoAccountExtraFunds") | |
969 | 980 | else false | |
970 | 981 | let signedByAdmin = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
971 | 982 | then true | |
972 | 983 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2)) | |
973 | 984 | then true | |
974 | 985 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3)) | |
975 | 986 | then true | |
976 | 987 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKeyInvoke) | |
977 | 988 | if (if (callTakeIntoAccount) | |
978 | 989 | then signedByAdmin | |
979 | 990 | else false) | |
980 | 991 | then true | |
981 | 992 | else multiSignedByAdmins | |
982 | 993 | case _ => | |
983 | 994 | multiSignedByAdmins | |
984 | 995 | } | |
985 | 996 | } | |
986 | 997 |
github/deemru/w8io/169f3d6 161.95 ms ◑