tx · 9aXugkWGEkPRK6SpH4LTpcAECJJSqBsJv4o6724riXSt 3MxWgDbE9EmjQj8b3LfFwa91FZizptyeQXS: -0.08000000 Waves 2022.11.25 00:26 [2331710] smart account 3MxWgDbE9EmjQj8b3LfFwa91FZizptyeQXS > SELF 0.00000000 Waves
{ "type": 13, "id": "9aXugkWGEkPRK6SpH4LTpcAECJJSqBsJv4o6724riXSt", "fee": 8000000, "feeAssetId": null, "timestamp": 1669325135763, "version": 2, "chainId": 84, "sender": "3MxWgDbE9EmjQj8b3LfFwa91FZizptyeQXS", "senderPublicKey": "C7xgcYqQ8qV8rmvzAjhQWq4cz82F6VJfXMNygvrTXsfW", "proofs": [ "3KsJTucKyM1SCiXyMyCvfpNUawkvTJWXNe2RLTGpAvukBpq9YjZGA5Zvxib23hPBjW6BoR99YUE5nwyNuWznwnvC", "MsPcpcrUyudP5S79z6LGaYDZn7Wz8HRyim8mNCZD5vAnMnPku386P1J6xsdL6MLSANoDUP7znAEpWBVwB8AuEH2" ], "script": "base64:BgJmCAISBAoCEQESBQoDCAEBEgUKAwEEARIECgIRCBIDCgEBEgYKBAgIAQgSBAoCCAESAwoBERIECgIRARIFCgMBCAgSBAoCCAESBQoDCAEBEgASABIECgIRBBIECgIBARIAEgASABIAXAAJUFJFQ0lTSU9OAMCEPQAFTUFYX0EAwIQ9AAxNQVhfQV9DSEFOR0UACgAIREVDSU1BTFMABgANTUlOX1JBTVBfVElNRQkAaQIAgKMFADwAB3ZlcnNpb24CBTMuMC4wAAhrVmVyc2lvbgIHdmVyc2lvbgAHa0Fzc2V0cwIJYXNzZXRfaWRzAA1rQXNzZXRCYWxhbmNlAghfYmFsYW5jZQAHa0FjdGl2ZQIGYWN0aXZlAAtrQWN0aXZlR2xvYgIUYWN0aXZlX2FsbF9jb250cmFjdHMABmtDYXVzZQIOc2h1dGRvd25fY2F1c2UADWtTaGFyZUFzc2V0SWQCDnNoYXJlX2Fzc2V0X2lkABFrU2hhcmVBc3NldFN1cHBseQIS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eUFkbWluBwYFE211bHRpU2lnbmVkQnlBZG1pbnMFE211bHRpU2lnbmVkQnlBZG1pbnPzVD8U", "height": 2331710, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 45hJedv3552NyZDqW11cbB7HkKbTgt8t2wQFCcLsa2p6 Next: 6qhLkDFqMWisAhKUqnDMTwSTqtb6G7RCXdQuQytgVba5 Diff:
Old | New | Differences | |
---|---|---|---|
738 | 738 | } | |
739 | 739 | ||
740 | 740 | ||
741 | - | func calcWithdrawOneCoinEntries (msg,tokenOut,minAmount,unlockAmount) = if ((size(msg.payments) != 1)) | |
742 | - | then throw("size(payments) != 1") | |
743 | - | else { | |
744 | - | let suspicious = checkSuspicious() | |
745 | - | if (suspicious._1) | |
746 | - | then (suspendSuspicious(suspicious._2) ++ returnPayments(msg.originCaller, msg.payments)) | |
747 | - | else { | |
748 | - | let pmtAmount = if ((size(msg.payments) > 0)) | |
749 | - | then if ((size(msg.payments) != 1)) | |
750 | - | then throw("size(payments) != 1") | |
741 | + | func calcWithdrawOneCoinEntries (msg,tokenOut,minAmount,unlockAmount) = { | |
742 | + | let suspicious = checkSuspicious() | |
743 | + | if (suspicious._1) | |
744 | + | then (suspendSuspicious(suspicious._2) ++ returnPayments(msg.originCaller, msg.payments)) | |
745 | + | else { | |
746 | + | let pmtAmount = if ((size(msg.payments) > 0)) | |
747 | + | then { | |
748 | + | let pmtAssetId = msg.payments[0].assetId | |
749 | + | if ((shareAssetId != pmtAssetId)) | |
750 | + | then throw("unknown payment token") | |
751 | + | else msg.payments[0].amount | |
752 | + | } | |
753 | + | else 0 | |
754 | + | let outIndex = valueOrErrorMessage(indexOf(assetIds, tokenOut), "unknown token out") | |
755 | + | let tokenOutB58 = fromBase58String(tokenOut) | |
756 | + | let withdrawAmount = (pmtAmount + unlockAmount) | |
757 | + | let xp = _xp() | |
758 | + | let $t01612516212 = _calcWithdrawOneCoin(xp, withdrawAmount, outIndex, msg.originCaller) | |
759 | + | let dy = $t01612516212._1 | |
760 | + | let dy_fee = $t01612516212._2 | |
761 | + | if (assert((dy >= minAmount))) | |
762 | + | then throw("Not enough coins removed") | |
763 | + | else { | |
764 | + | let governanceFees = fraction(dy_fee, feeGovernance, feeScale6) | |
765 | + | let dy_and_fee = (dy + dy_fee) | |
766 | + | func makeNewBalances (acc,tokenBalance) = { | |
767 | + | let $t01647016496 = acc | |
768 | + | let newBalances = $t01647016496._1 | |
769 | + | let i = $t01647016496._2 | |
770 | + | if ((i == outIndex)) | |
771 | + | then $Tuple2((newBalances :+ (tokenBalance - dy_and_fee)), (i + 1)) | |
772 | + | else $Tuple2((newBalances :+ tokenBalance), (i + 1)) | |
773 | + | } | |
774 | + | ||
775 | + | let $t01666316724 = { | |
776 | + | let $l = xp | |
777 | + | let $s = size($l) | |
778 | + | let $acc0 = $Tuple2(nil, 0) | |
779 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
780 | + | then $a | |
781 | + | else makeNewBalances($a, $l[$i]) | |
782 | + | ||
783 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
784 | + | then $a | |
785 | + | else throw("List size exceeds 10") | |
786 | + | ||
787 | + | $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) | |
788 | + | } | |
789 | + | let newBalances = $t01666316724._1 | |
790 | + | let v = $t01666316724._2 | |
791 | + | if (checkDAppThreshold(newBalances)) | |
792 | + | then throw() | |
751 | 793 | else { | |
752 | - | let pmtAssetId = msg.payments[0].assetId | |
753 | - | if ((shareAssetId != pmtAssetId)) | |
754 | - | then throw("unknown payment token") | |
755 | - | else msg.payments[0].amount | |
794 | + | let us = unstake(dy_and_fee, tokenOut) | |
795 | + | if ((us == us)) | |
796 | + | then { | |
797 | + | let lpFees = (dy_fee - governanceFees) | |
798 | + | let airdrop = if ((lpFees > 0)) | |
799 | + | then invoke(lpFarmingAddress, "airDrop", nil, [AttachedPayment(tokenOutB58, lpFees)]) | |
800 | + | else 0 | |
801 | + | if ((airdrop == airdrop)) | |
802 | + | then [ScriptTransfer(msg.originCaller, dy, tokenOutB58), IntegerEntry((assetIds[outIndex] + kAssetBalance), (xp[outIndex] - dy_and_fee)), Burn(shareAssetId, withdrawAmount), ScriptTransfer(moneyBoxAddress, governanceFees, tokenOutB58), IntegerEntry(kShareAssetSupply, (shareSupply - withdrawAmount))] | |
803 | + | else throw("Strict value is not equal to itself.") | |
804 | + | } | |
805 | + | else throw("Strict value is not equal to itself.") | |
756 | 806 | } | |
757 | - | else 0 | |
758 | - | let outIndex = valueOrErrorMessage(indexOf(assetIds, tokenOut), "unknown token out") | |
759 | - | let tokenOutB58 = fromBase58String(tokenOut) | |
760 | - | let withdrawAmount = (pmtAmount + unlockAmount) | |
761 | - | let xp = _xp() | |
762 | - | let $t01627116358 = _calcWithdrawOneCoin(xp, withdrawAmount, outIndex, msg.originCaller) | |
763 | - | let dy = $t01627116358._1 | |
764 | - | let dy_fee = $t01627116358._2 | |
765 | - | if (assert((dy >= minAmount))) | |
766 | - | then throw("Not enough coins removed") | |
767 | - | else { | |
768 | - | let governanceFees = fraction(dy_fee, feeGovernance, feeScale6) | |
769 | - | let dy_and_fee = (dy + dy_fee) | |
770 | - | func makeNewBalances (acc,tokenBalance) = { | |
771 | - | let $t01661616642 = acc | |
772 | - | let newBalances = $t01661616642._1 | |
773 | - | let i = $t01661616642._2 | |
774 | - | if ((i == outIndex)) | |
775 | - | then $Tuple2((newBalances :+ (tokenBalance - dy_and_fee)), (i + 1)) | |
776 | - | else $Tuple2((newBalances :+ tokenBalance), (i + 1)) | |
777 | - | } | |
778 | - | ||
779 | - | let $t01680916870 = { | |
780 | - | let $l = xp | |
781 | - | let $s = size($l) | |
782 | - | let $acc0 = $Tuple2(nil, 0) | |
783 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
784 | - | then $a | |
785 | - | else makeNewBalances($a, $l[$i]) | |
786 | - | ||
787 | - | func $f0_2 ($a,$i) = if (($i >= $s)) | |
788 | - | then $a | |
789 | - | else throw("List size exceeds 10") | |
790 | - | ||
791 | - | $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) | |
792 | - | } | |
793 | - | let newBalances = $t01680916870._1 | |
794 | - | let v = $t01680916870._2 | |
795 | - | if (checkDAppThreshold(newBalances)) | |
796 | - | then throw() | |
797 | - | else { | |
798 | - | let us = unstake(dy_and_fee, tokenOut) | |
799 | - | if ((us == us)) | |
800 | - | then { | |
801 | - | let lpFees = (dy_fee - governanceFees) | |
802 | - | let airdrop = if ((lpFees > 0)) | |
803 | - | then invoke(lpFarmingAddress, "airDrop", nil, [AttachedPayment(tokenOutB58, lpFees)]) | |
804 | - | else 0 | |
805 | - | if ((airdrop == airdrop)) | |
806 | - | then [ScriptTransfer(msg.originCaller, dy, tokenOutB58), IntegerEntry((assetIds[outIndex] + kAssetBalance), (xp[outIndex] - dy_and_fee)), Burn(shareAssetId, withdrawAmount), ScriptTransfer(moneyBoxAddress, governanceFees, tokenOutB58), IntegerEntry(kShareAssetSupply, (shareSupply - withdrawAmount))] | |
807 | - | else throw("Strict value is not equal to itself.") | |
808 | - | } | |
809 | - | else throw("Strict value is not equal to itself.") | |
810 | - | } | |
811 | - | } | |
812 | - | } | |
813 | - | } | |
807 | + | } | |
808 | + | } | |
809 | + | } | |
814 | 810 | ||
815 | 811 | ||
816 | 812 | @Callable(msg) | |
847 | 843 | let D0 = if ((shareSupply == 0)) | |
848 | 844 | then 0 | |
849 | 845 | else getDMem(xp, amp) | |
850 | - | let $ | |
846 | + | let $t01886419118 = if (if ((lockType > 0)) | |
851 | 847 | then (msg.payments[(size(msg.payments) - 1)].assetId == unit) | |
852 | 848 | else false) | |
853 | 849 | then $Tuple2(removeByIndex(msg.payments, (size(msg.payments) - 1)), [msg.payments[(size(msg.payments) - 1)]]) | |
854 | 850 | else $Tuple2(msg.payments, nil) | |
855 | - | let payments = $ | |
856 | - | let lockFee = $ | |
851 | + | let payments = $t01886419118._1 | |
852 | + | let lockFee = $t01886419118._2 | |
857 | 853 | let paymentsSize = size(payments) | |
858 | 854 | func validPayments (n) = if ((paymentsSize > nCoins)) | |
859 | 855 | then throw(("payments size > " + toString(nCoins))) | |
890 | 886 | then (suspendSuspicious(suspicious._2) ++ returnPayments(msg.caller, payments)) | |
891 | 887 | else { | |
892 | 888 | func parsePayments (acc,assetId) = { | |
893 | - | let $ | |
894 | - | let newBalances = $ | |
895 | - | let i = $ | |
889 | + | let $t01998820014 = acc | |
890 | + | let newBalances = $t01998820014._1 | |
891 | + | let i = $t01998820014._2 | |
896 | 892 | func parsePayment (newBalance,payment) = if ((getStrAssetId(payment.assetId) == assetId)) | |
897 | 893 | then (newBalance + payment.amount) | |
898 | 894 | else newBalance | |
914 | 910 | $Tuple2((newBalances :+ newBalace), (i + 1)) | |
915 | 911 | } | |
916 | 912 | ||
917 | - | let $ | |
913 | + | let $t02036420431 = { | |
918 | 914 | let $l = assetIds | |
919 | 915 | let $s = size($l) | |
920 | 916 | let $acc0 = $Tuple2(nil, 0) | |
928 | 924 | ||
929 | 925 | $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) | |
930 | 926 | } | |
931 | - | let newBalances = $ | |
932 | - | let k = $ | |
927 | + | let newBalances = $t02036420431._1 | |
928 | + | let k = $t02036420431._2 | |
933 | 929 | if (checkDAppThreshold(newBalances)) | |
934 | 930 | then throw() | |
935 | 931 | else { | |
939 | 935 | else { | |
940 | 936 | let feeDiscount = calculateFeeDiscount(msg.caller) | |
941 | 937 | func calcScriptActions (acc,newBalance) = { | |
942 | - | let $ | |
943 | - | let invBalances = $ | |
944 | - | let scriptActions = $ | |
945 | - | let i = $ | |
938 | + | let $t02075120792 = acc | |
939 | + | let invBalances = $t02075120792._1 | |
940 | + | let scriptActions = $t02075120792._2 | |
941 | + | let i = $t02075120792._3 | |
946 | 942 | if ((shareSupply > 0)) | |
947 | 943 | then { | |
948 | 944 | let _fee = ((fraction(fee, feeDiscount, feeScale6, CEILING) * nCoins) / (4 * (nCoins - 1))) | |
980 | 976 | } | |
981 | 977 | } | |
982 | 978 | ||
983 | - | let $ | |
979 | + | let $t02249722585 = { | |
984 | 980 | let $l = newBalances | |
985 | 981 | let $s = size($l) | |
986 | 982 | let $acc0 = $Tuple3(nil, nil, 0) | |
994 | 990 | ||
995 | 991 | $f1_2($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) | |
996 | 992 | } | |
997 | - | let invBalances = $ | |
998 | - | let scriptActions = $ | |
993 | + | let invBalances = $t02249722585._1 | |
994 | + | let scriptActions = $t02249722585._2 | |
999 | 995 | let D2 = getDMem(invBalances, amp) | |
1000 | 996 | let mint_amount = if ((shareSupply == 0)) | |
1001 | 997 | then D1 | |
1034 | 1030 | let D0 = getDMem(xp, amp) | |
1035 | 1031 | let feeDiscount = calculateFeeDiscount(user) | |
1036 | 1032 | func calcInvBalances (acc,newBalance) = { | |
1037 | - | let $ | |
1038 | - | let invBalances = $ | |
1039 | - | let i = $ | |
1033 | + | let $t02386123887 = acc | |
1034 | + | let invBalances = $t02386123887._1 | |
1035 | + | let i = $t02386123887._2 | |
1040 | 1036 | let _fee = ((fraction(fee, feeDiscount, feeScale6, CEILING) * nCoins) / (4 * (nCoins - 1))) | |
1041 | 1037 | let fees = { | |
1042 | 1038 | let idealBalance = fraction(D1, xp[i], D0) | |
1049 | 1045 | $Tuple2((invBalances :+ invariantBalance), (i + 1)) | |
1050 | 1046 | } | |
1051 | 1047 | ||
1052 | - | let $ | |
1048 | + | let $t02448924559 = { | |
1053 | 1049 | let $l = newBalances | |
1054 | 1050 | let $s = size($l) | |
1055 | 1051 | let $acc0 = $Tuple2(nil, 0) | |
1063 | 1059 | ||
1064 | 1060 | $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) | |
1065 | 1061 | } | |
1066 | - | let invBalances = $ | |
1067 | - | let k = $ | |
1062 | + | let invBalances = $t02448924559._1 | |
1063 | + | let k = $t02448924559._2 | |
1068 | 1064 | let D2 = getDMem(invBalances, amp) | |
1069 | 1065 | let mintAmount = fraction(shareSupply, (D2 - D0), D0) | |
1070 | 1066 | $Tuple2(nil, mintAmount) | |
1119 | 1115 | then throw("Exchange resulted in fewer coins than expected") | |
1120 | 1116 | else { | |
1121 | 1117 | func makeNewBalances (acc,tokenBalance) = { | |
1122 | - | let $ | |
1123 | - | let newBalances = $ | |
1124 | - | let i = $ | |
1118 | + | let $t02660026626 = acc | |
1119 | + | let newBalances = $t02660026626._1 | |
1120 | + | let i = $t02660026626._2 | |
1125 | 1121 | if ((i == fromIndex)) | |
1126 | 1122 | then $Tuple2((newBalances :+ (tokenBalance + dx)), (i + 1)) | |
1127 | 1123 | else if ((i == toIndex)) | |
1129 | 1125 | else $Tuple2((newBalances :+ tokenBalance), (i + 1)) | |
1130 | 1126 | } | |
1131 | 1127 | ||
1132 | - | let $ | |
1128 | + | let $t02687726938 = { | |
1133 | 1129 | let $l = xp | |
1134 | 1130 | let $s = size($l) | |
1135 | 1131 | let $acc0 = $Tuple2(nil, 0) | |
1143 | 1139 | ||
1144 | 1140 | $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) | |
1145 | 1141 | } | |
1146 | - | let newBalances = $ | |
1147 | - | let i = $ | |
1142 | + | let newBalances = $t02687726938._1 | |
1143 | + | let i = $t02687726938._2 | |
1148 | 1144 | if (checkDAppThreshold(newBalances)) | |
1149 | 1145 | then throw() | |
1150 | 1146 | else { | |
1200 | 1196 | ||
1201 | 1197 | ||
1202 | 1198 | @Callable(msg) | |
1203 | - | func withdrawOneCoin (tokenOut,minAmount) = valueOrElse(isActive(), calcWithdrawOneCoinEntries(msg, tokenOut, minAmount, 0)) | |
1199 | + | func withdrawOneCoin (tokenOut,minAmount) = valueOrElse(isActive(), if ((size(msg.payments) != 1)) | |
1200 | + | then throw("size(payments) != 1") | |
1201 | + | else calcWithdrawOneCoinEntries(msg, tokenOut, minAmount, 0)) | |
1204 | 1202 | ||
1205 | 1203 | ||
1206 | 1204 | ||
1235 | 1233 | let balances = _xp() | |
1236 | 1234 | let D0 = getDMem(balances, amp) | |
1237 | 1235 | func calcNewBalances (acc,balance) = { | |
1238 | - | let $ | |
1239 | - | let newBalances = $ | |
1240 | - | let i = $ | |
1236 | + | let $t02951629542 = acc | |
1237 | + | let newBalances = $t02951629542._1 | |
1238 | + | let i = $t02951629542._2 | |
1241 | 1239 | let newBalance = (balance + (if (deposit) | |
1242 | 1240 | then amounts[i] | |
1243 | 1241 | else -(amounts[i]))) | |
1317 | 1315 | else { | |
1318 | 1316 | let balances = _xp() | |
1319 | 1317 | func takeExtraFunds (acc,assetId) = { | |
1320 | - | let $ | |
1321 | - | let sum = $ | |
1322 | - | let i = $ | |
1318 | + | let $t03188431902 = acc | |
1319 | + | let sum = $t03188431902._1 | |
1320 | + | let i = $t03188431902._2 | |
1323 | 1321 | let tokenB58 = fromBase58String(assetId) | |
1324 | 1322 | let rBalance = (assetBalance(this, tokenB58) + stakedAmount(tokenB58)) | |
1325 | 1323 | let enrollAmount = (rBalance - balances[i]) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let PRECISION = 1000000 | |
5 | 5 | ||
6 | 6 | let MAX_A = 1000000 | |
7 | 7 | ||
8 | 8 | let MAX_A_CHANGE = 10 | |
9 | 9 | ||
10 | 10 | let DECIMALS = 6 | |
11 | 11 | ||
12 | 12 | let MIN_RAMP_TIME = (86400 / 60) | |
13 | 13 | ||
14 | 14 | let version = "3.0.0" | |
15 | 15 | ||
16 | 16 | let kVersion = "version" | |
17 | 17 | ||
18 | 18 | let kAssets = "asset_ids" | |
19 | 19 | ||
20 | 20 | let kAssetBalance = "_balance" | |
21 | 21 | ||
22 | 22 | let kActive = "active" | |
23 | 23 | ||
24 | 24 | let kActiveGlob = "active_all_contracts" | |
25 | 25 | ||
26 | 26 | let kCause = "shutdown_cause" | |
27 | 27 | ||
28 | 28 | let kShareAssetId = "share_asset_id" | |
29 | 29 | ||
30 | 30 | let kShareAssetSupply = "share_asset_supply" | |
31 | 31 | ||
32 | 32 | let kFee = "commission" | |
33 | 33 | ||
34 | 34 | let kDAppThresholdCoef = "dAppThresholdCoef" | |
35 | 35 | ||
36 | 36 | let kUSDNAddress = "staking_usdnnsbt_address" | |
37 | 37 | ||
38 | 38 | let kDiscounts = "discounts" | |
39 | 39 | ||
40 | 40 | let kDiscountValues = "discount_values" | |
41 | 41 | ||
42 | 42 | let kUserSwopInGov = "_SWOP_amount" | |
43 | 43 | ||
44 | 44 | let kUserGSwopInGov = "_GSwop_amount" | |
45 | 45 | ||
46 | 46 | let kAdminPubKey1 = "admin_pub_1" | |
47 | 47 | ||
48 | 48 | let kAdminPubKey2 = "admin_pub_2" | |
49 | 49 | ||
50 | 50 | let kAdminPubKey3 = "admin_pub_3" | |
51 | 51 | ||
52 | 52 | let kAdminInvokePubKey = "admin_invoke_pub" | |
53 | 53 | ||
54 | 54 | let kMoneyBoxAddress = "money_box_address" | |
55 | 55 | ||
56 | 56 | let kGovAddress = "governance_address" | |
57 | 57 | ||
58 | 58 | let kVotingAddress = "voting_address" | |
59 | 59 | ||
60 | 60 | let kFarmingAddress = "farming_address" | |
61 | 61 | ||
62 | 62 | let kLPFarmingAddress = "lp_farming" | |
63 | 63 | ||
64 | 64 | let oracle = Address(base58'3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz') | |
65 | 65 | ||
66 | 66 | func getBase58FromOracle (key) = match getString(oracle, key) { | |
67 | 67 | case string: String => | |
68 | 68 | fromBase58String(string) | |
69 | 69 | case nothing => | |
70 | 70 | throw((key + "is empty")) | |
71 | 71 | } | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | let adminPubKey1 = getBase58FromOracle(kAdminPubKey1) | |
75 | 75 | ||
76 | 76 | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) | |
77 | 77 | ||
78 | 78 | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) | |
79 | 79 | ||
80 | 80 | let adminPubKeyInvoke = getBase58FromOracle(kAdminInvokePubKey) | |
81 | 81 | ||
82 | 82 | let moneyBoxAddress = Address(getBase58FromOracle(kMoneyBoxAddress)) | |
83 | 83 | ||
84 | 84 | let govAddress = Address(getBase58FromOracle(kGovAddress)) | |
85 | 85 | ||
86 | 86 | let stakingUSDNAddress = Address(getBase58FromOracle(kUSDNAddress)) | |
87 | 87 | ||
88 | 88 | let votingAddress = Address(getBase58FromOracle(kVotingAddress)) | |
89 | 89 | ||
90 | 90 | let farmingAddress = Address(getBase58FromOracle(kFarmingAddress)) | |
91 | 91 | ||
92 | 92 | let lpFarmingAddress = Address(getBase58FromOracle(kLPFarmingAddress)) | |
93 | 93 | ||
94 | 94 | let USDN = base58'8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS' | |
95 | 95 | ||
96 | 96 | let stakingAssets = [toBase58String(USDN)] | |
97 | 97 | ||
98 | 98 | let active = getBooleanValue(this, kActive) | |
99 | 99 | ||
100 | 100 | let activeGlob = valueOrElse(getBoolean(oracle, kActiveGlob), true) | |
101 | 101 | ||
102 | 102 | let shareAssetId = fromBase58String(getStringValue(this, kShareAssetId)) | |
103 | 103 | ||
104 | 104 | let shareSupply = getIntegerValue(this, kShareAssetSupply) | |
105 | 105 | ||
106 | 106 | let feeScale6 = 1000000 | |
107 | 107 | ||
108 | 108 | let fee = getIntegerValue(this, kFee) | |
109 | 109 | ||
110 | 110 | let feeGovernance = fraction(40, feeScale6, 100) | |
111 | 111 | ||
112 | 112 | let initial_A = getIntegerValue(this, "initial_A") | |
113 | 113 | ||
114 | 114 | let future_A = getIntegerValue(this, "future_A") | |
115 | 115 | ||
116 | 116 | let initial_A_time = valueOrElse(getInteger(this, "initial_A_time"), 0) | |
117 | 117 | ||
118 | 118 | let future_A_time = valueOrElse(getInteger(this, "future_A_time"), 0) | |
119 | 119 | ||
120 | 120 | let assetIds = split(getStringValue(this, kAssets), ",") | |
121 | 121 | ||
122 | 122 | let nCoins = size(assetIds) | |
123 | 123 | ||
124 | 124 | func suspend (cause) = [BooleanEntry(kActive, false), StringEntry(kCause, cause)] | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | func throwIsActive () = throw("DApp is already active") | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | func isActive () = if (if (active) | |
131 | 131 | then activeGlob | |
132 | 132 | else false) | |
133 | 133 | then unit | |
134 | 134 | else throw("DApp is inactive at this moment") | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | func isAdminCall (i) = if (containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)) | |
138 | 138 | then unit | |
139 | 139 | else throw("Only admin can call this function") | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func isSelfCall (i) = if ((this == i.caller)) | |
143 | 143 | then unit | |
144 | 144 | else throw("Only contract itself can call this function") | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | let big2 = toBigInt(2) | |
148 | 148 | ||
149 | 149 | let iter10 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | |
150 | 150 | ||
151 | 151 | let iter15 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
152 | 152 | ||
153 | 153 | let iter16 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] | |
154 | 154 | ||
155 | 155 | let blockTimestamp = height | |
156 | 156 | ||
157 | 157 | func assert (a) = if (a) | |
158 | 158 | then false | |
159 | 159 | else true | |
160 | 160 | ||
161 | 161 | ||
162 | 162 | func calculateFeeDiscount (userAddr) = { | |
163 | 163 | let user = match userAddr { | |
164 | 164 | case u: Address => | |
165 | 165 | toString(u) | |
166 | 166 | case u: String => | |
167 | 167 | u | |
168 | 168 | case _ => | |
169 | 169 | throw("Unknow type of user Addr") | |
170 | 170 | } | |
171 | 171 | let swopAmount = valueOrElse(getInteger(govAddress, (user + kUserGSwopInGov)), 0) | |
172 | 172 | let gSwopAmount = valueOrElse(getInteger(govAddress, (user + kUserGSwopInGov)), swopAmount) | |
173 | 173 | let discountValues = split(getStringValue(oracle, kDiscountValues), ",") | |
174 | 174 | let discounts = split(getStringValue(oracle, kDiscounts), ",") | |
175 | 175 | if (if ((gSwopAmount >= parseIntValue(discountValues[0]))) | |
176 | 176 | then (parseIntValue(discountValues[1]) > gSwopAmount) | |
177 | 177 | else false) | |
178 | 178 | then (feeScale6 - parseIntValue(discounts[0])) | |
179 | 179 | else if (if ((gSwopAmount >= parseIntValue(discountValues[1]))) | |
180 | 180 | then (parseIntValue(discountValues[2]) > gSwopAmount) | |
181 | 181 | else false) | |
182 | 182 | then (feeScale6 - parseIntValue(discounts[1])) | |
183 | 183 | else if (if ((gSwopAmount >= parseIntValue(discountValues[2]))) | |
184 | 184 | then (parseIntValue(discountValues[3]) > gSwopAmount) | |
185 | 185 | else false) | |
186 | 186 | then (feeScale6 - parseIntValue(discounts[2])) | |
187 | 187 | else if (if ((gSwopAmount >= parseIntValue(discountValues[3]))) | |
188 | 188 | then (parseIntValue(discountValues[4]) > gSwopAmount) | |
189 | 189 | else false) | |
190 | 190 | then (feeScale6 - parseIntValue(discounts[3])) | |
191 | 191 | else if ((gSwopAmount >= parseIntValue(discountValues[4]))) | |
192 | 192 | then (feeScale6 - parseIntValue(discounts[4])) | |
193 | 193 | else feeScale6 | |
194 | 194 | } | |
195 | 195 | ||
196 | 196 | ||
197 | 197 | func _A () = { | |
198 | 198 | let t1 = future_A_time | |
199 | 199 | let A1 = future_A | |
200 | 200 | if ((t1 > blockTimestamp)) | |
201 | 201 | then { | |
202 | 202 | let A0 = initial_A | |
203 | 203 | let t0 = initial_A_time | |
204 | 204 | if ((A1 > A0)) | |
205 | 205 | then (A0 + (((A1 - A0) * (blockTimestamp - t0)) / (t1 - t0))) | |
206 | 206 | else (A0 - (((A0 - A1) * (blockTimestamp - t0)) / (t1 - t0))) | |
207 | 207 | } | |
208 | 208 | else A1 | |
209 | 209 | } | |
210 | 210 | ||
211 | 211 | ||
212 | 212 | func _xp () = { | |
213 | 213 | func assetBalances (acc,assetId) = (acc :+ valueOrElse(getInteger(this, (assetId + kAssetBalance)), 0)) | |
214 | 214 | ||
215 | 215 | let $l = assetIds | |
216 | 216 | let $s = size($l) | |
217 | 217 | let $acc0 = nil | |
218 | 218 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
219 | 219 | then $a | |
220 | 220 | else assetBalances($a, $l[$i]) | |
221 | 221 | ||
222 | 222 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
223 | 223 | then $a | |
224 | 224 | else throw("List size exceeds 10") | |
225 | 225 | ||
226 | 226 | $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) | |
227 | 227 | } | |
228 | 228 | ||
229 | 229 | ||
230 | 230 | func _xp_mem (xp) = xp | |
231 | 231 | ||
232 | 232 | ||
233 | 233 | func sumList (acc,element) = (acc + element) | |
234 | 234 | ||
235 | 235 | ||
236 | 236 | func get_D (xp,amp) = { | |
237 | 237 | let @ = invoke(this, "D", [xp, amp], nil) | |
238 | 238 | if ($isInstanceOf(@, "Int")) | |
239 | 239 | then @ | |
240 | 240 | else throw(($getType(@) + " couldn't be cast to Int")) | |
241 | 241 | } | |
242 | 242 | ||
243 | 243 | ||
244 | 244 | func get_D_internal (xp,amp) = { | |
245 | 245 | let S = { | |
246 | 246 | let $l = xp | |
247 | 247 | let $s = size($l) | |
248 | 248 | let $acc0 = 0 | |
249 | 249 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
250 | 250 | then $a | |
251 | 251 | else sumList($a, $l[$i]) | |
252 | 252 | ||
253 | 253 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
254 | 254 | then $a | |
255 | 255 | else throw("List size exceeds 10") | |
256 | 256 | ||
257 | 257 | $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) | |
258 | 258 | } | |
259 | 259 | if ((S == 0)) | |
260 | 260 | then 0 | |
261 | 261 | else { | |
262 | 262 | let Ann = (amp * nCoins) | |
263 | 263 | let AnnS = (toBigInt(Ann) * toBigInt(S)) | |
264 | 264 | let Ann1 = toBigInt((Ann - 1)) | |
265 | 265 | func Dproc (acc,i) = if ((acc._2 == true)) | |
266 | 266 | then acc | |
267 | 267 | else { | |
268 | 268 | let Dprev = acc._1 | |
269 | 269 | func D_PProc (D_P,i) = if ((nCoins > i)) | |
270 | 270 | then ((D_P * Dprev) / (toBigInt(xp[i]) * toBigInt(nCoins))) | |
271 | 271 | else D_P | |
272 | 272 | ||
273 | 273 | let D_P = { | |
274 | 274 | let $l = iter10 | |
275 | 275 | let $s = size($l) | |
276 | 276 | let $acc0 = Dprev | |
277 | 277 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
278 | 278 | then $a | |
279 | 279 | else D_PProc($a, $l[$i]) | |
280 | 280 | ||
281 | 281 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
282 | 282 | then $a | |
283 | 283 | else throw("List size exceeds 10") | |
284 | 284 | ||
285 | 285 | $f1_2($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) | |
286 | 286 | } | |
287 | 287 | let D = fraction((AnnS + (toBigInt(nCoins) * D_P)), Dprev, ((Ann1 * Dprev) + (toBigInt((nCoins + 1)) * D_P))) | |
288 | 288 | if ((D > Dprev)) | |
289 | 289 | then if ((1 >= toInt((D - Dprev)))) | |
290 | 290 | then $Tuple2(D, true) | |
291 | 291 | else $Tuple2(D, false) | |
292 | 292 | else if ((1 >= toInt((Dprev - D)))) | |
293 | 293 | then $Tuple2(D, true) | |
294 | 294 | else $Tuple2(D, false) | |
295 | 295 | } | |
296 | 296 | ||
297 | 297 | let $t065826648 = { | |
298 | 298 | let $l = iter15 | |
299 | 299 | let $s = size($l) | |
300 | 300 | let $acc0 = $Tuple2(toBigInt(S), false) | |
301 | 301 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
302 | 302 | then $a | |
303 | 303 | else Dproc($a, $l[$i]) | |
304 | 304 | ||
305 | 305 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
306 | 306 | then $a | |
307 | 307 | else throw("List size exceeds 15") | |
308 | 308 | ||
309 | 309 | $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($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
310 | 310 | } | |
311 | 311 | let D = $t065826648._1 | |
312 | 312 | let finished = $t065826648._2 | |
313 | 313 | if ((finished == false)) | |
314 | 314 | then throw(("get_D() not finished with " + toString(D))) | |
315 | 315 | else toInt(D) | |
316 | 316 | } | |
317 | 317 | } | |
318 | 318 | ||
319 | 319 | ||
320 | 320 | func getDMem (xp,amp) = get_D(_xp_mem(xp), amp) | |
321 | 321 | ||
322 | 322 | ||
323 | 323 | func getY (in,out,x,xp_) = if (assert((in != out))) | |
324 | 324 | then throw("same coin") | |
325 | 325 | else if (assert(if ((out >= 0)) | |
326 | 326 | then (in >= 0) | |
327 | 327 | else false)) | |
328 | 328 | then throw("below zero") | |
329 | 329 | else if (assert(if ((nCoins > out)) | |
330 | 330 | then (nCoins > in) | |
331 | 331 | else false)) | |
332 | 332 | then throw("above N_COINS") | |
333 | 333 | else { | |
334 | 334 | let amp = _A() | |
335 | 335 | let D = get_D(xp_, amp) | |
336 | 336 | let Ann = (amp * nCoins) | |
337 | 337 | func S_c (acc,i) = { | |
338 | 338 | let $t072197236 = acc | |
339 | 339 | let S_ = $t072197236._1 | |
340 | 340 | let c = $t072197236._2 | |
341 | 341 | let x_ = if ((in == i)) | |
342 | 342 | then x | |
343 | 343 | else xp_[i] | |
344 | 344 | if (if ((i != out)) | |
345 | 345 | then (nCoins > i) | |
346 | 346 | else false) | |
347 | 347 | then $Tuple2((S_ + x_), fraction(c, toBigInt(D), toBigInt((x_ * nCoins)))) | |
348 | 348 | else $Tuple2(S_, c) | |
349 | 349 | } | |
350 | 350 | ||
351 | 351 | let $t074447499 = { | |
352 | 352 | let $l = iter10 | |
353 | 353 | let $s = size($l) | |
354 | 354 | let $acc0 = $Tuple2(0, toBigInt(D)) | |
355 | 355 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
356 | 356 | then $a | |
357 | 357 | else S_c($a, $l[$i]) | |
358 | 358 | ||
359 | 359 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
360 | 360 | then $a | |
361 | 361 | else throw("List size exceeds 10") | |
362 | 362 | ||
363 | 363 | $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) | |
364 | 364 | } | |
365 | 365 | let S_ = $t074447499._1 | |
366 | 366 | let c_ = $t074447499._2 | |
367 | 367 | let c = fraction(c_, toBigInt(D), toBigInt((Ann * nCoins))) | |
368 | 368 | let bD = toBigInt(((S_ + (D / Ann)) - D)) | |
369 | 369 | func y_proc (acc,_i) = if ((acc._2 == true)) | |
370 | 370 | then acc | |
371 | 371 | else { | |
372 | 372 | let y_prev = acc._1 | |
373 | 373 | let y = (((y_prev * y_prev) + c) / ((big2 * y_prev) + bD)) | |
374 | 374 | if ((y > y_prev)) | |
375 | 375 | then if ((1 >= toInt((y - y_prev)))) | |
376 | 376 | then $Tuple2(y, true) | |
377 | 377 | else $Tuple2(y, false) | |
378 | 378 | else if ((1 >= toInt((y_prev - y)))) | |
379 | 379 | then $Tuple2(y, true) | |
380 | 380 | else $Tuple2(y, false) | |
381 | 381 | } | |
382 | 382 | ||
383 | 383 | let $t079818048 = { | |
384 | 384 | let $l = iter16 | |
385 | 385 | let $s = size($l) | |
386 | 386 | let $acc0 = $Tuple2(toBigInt(D), false) | |
387 | 387 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
388 | 388 | then $a | |
389 | 389 | else y_proc($a, $l[$i]) | |
390 | 390 | ||
391 | 391 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
392 | 392 | then $a | |
393 | 393 | else throw("List size exceeds 16") | |
394 | 394 | ||
395 | 395 | $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($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16) | |
396 | 396 | } | |
397 | 397 | let y = $t079818048._1 | |
398 | 398 | let finished = $t079818048._2 | |
399 | 399 | if ((finished == false)) | |
400 | 400 | then throw(("getY() not finished with " + toString(y))) | |
401 | 401 | else toInt(y) | |
402 | 402 | } | |
403 | 403 | ||
404 | 404 | ||
405 | 405 | func get_y_D (A_,in,xp,D) = if (assert((in >= 0))) | |
406 | 406 | then throw("i below zero") | |
407 | 407 | else if (assert((nCoins > in))) | |
408 | 408 | then throw("i above N_COINS") | |
409 | 409 | else { | |
410 | 410 | let Ann = (A_ * nCoins) | |
411 | 411 | func S_c (acc,i) = { | |
412 | 412 | let $t084278444 = acc | |
413 | 413 | let S_ = $t084278444._1 | |
414 | 414 | let c = $t084278444._2 | |
415 | 415 | let x_ = if (if ((in != i)) | |
416 | 416 | then (nCoins > i) | |
417 | 417 | else false) | |
418 | 418 | then xp[i] | |
419 | 419 | else 0 | |
420 | 420 | if (if ((nCoins > i)) | |
421 | 421 | then (in != i) | |
422 | 422 | else false) | |
423 | 423 | then $Tuple2((S_ + x_), fraction(c, toBigInt(D), toBigInt((x_ * nCoins)))) | |
424 | 424 | else $Tuple2(S_, c) | |
425 | 425 | } | |
426 | 426 | ||
427 | 427 | let $t086648719 = { | |
428 | 428 | let $l = iter10 | |
429 | 429 | let $s = size($l) | |
430 | 430 | let $acc0 = $Tuple2(0, toBigInt(D)) | |
431 | 431 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
432 | 432 | then $a | |
433 | 433 | else S_c($a, $l[$i]) | |
434 | 434 | ||
435 | 435 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
436 | 436 | then $a | |
437 | 437 | else throw("List size exceeds 10") | |
438 | 438 | ||
439 | 439 | $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) | |
440 | 440 | } | |
441 | 441 | let S_ = $t086648719._1 | |
442 | 442 | let c_ = $t086648719._2 | |
443 | 443 | let c = fraction(c_, toBigInt(D), toBigInt((Ann * nCoins))) | |
444 | 444 | let bD = toBigInt(((S_ + (D / Ann)) - D)) | |
445 | 445 | func y_D_proc (acc,i) = if ((acc._2 == true)) | |
446 | 446 | then acc | |
447 | 447 | else { | |
448 | 448 | let y_prev = acc._1 | |
449 | 449 | let y = (((y_prev * y_prev) + c) / ((big2 * y_prev) + bD)) | |
450 | 450 | if ((y > y_prev)) | |
451 | 451 | then if ((1 >= toInt((y - y_prev)))) | |
452 | 452 | then $Tuple2(y, true) | |
453 | 453 | else $Tuple2(y, false) | |
454 | 454 | else if ((1 >= toInt((y_prev - y)))) | |
455 | 455 | then $Tuple2(y, true) | |
456 | 456 | else $Tuple2(y, false) | |
457 | 457 | } | |
458 | 458 | ||
459 | 459 | let $t092029271 = { | |
460 | 460 | let $l = iter16 | |
461 | 461 | let $s = size($l) | |
462 | 462 | let $acc0 = $Tuple2(toBigInt(D), false) | |
463 | 463 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
464 | 464 | then $a | |
465 | 465 | else y_D_proc($a, $l[$i]) | |
466 | 466 | ||
467 | 467 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
468 | 468 | then $a | |
469 | 469 | else throw("List size exceeds 16") | |
470 | 470 | ||
471 | 471 | $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($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16) | |
472 | 472 | } | |
473 | 473 | let y = $t092029271._1 | |
474 | 474 | let finished = $t092029271._2 | |
475 | 475 | if ((finished == false)) | |
476 | 476 | then throw(("get_y_D() not finished with " + toString(y))) | |
477 | 477 | else toInt(y) | |
478 | 478 | } | |
479 | 479 | ||
480 | 480 | ||
481 | 481 | func _calcWithdrawOneCoin (xp,_token_amount,i,caller) = { | |
482 | 482 | let feeDiscount = calculateFeeDiscount(caller) | |
483 | 483 | let amp = _A() | |
484 | 484 | let _fee = ((fraction(fee, feeDiscount, feeScale6, CEILING) * nCoins) / (4 * (nCoins - 1))) | |
485 | 485 | let total_supply = shareSupply | |
486 | 486 | let D0 = get_D(xp, amp) | |
487 | 487 | let D1 = (D0 - fraction(_token_amount, D0, total_supply)) | |
488 | 488 | let new_y = get_y_D(amp, i, xp, D1) | |
489 | 489 | let dy_0 = (xp[i] - new_y) | |
490 | 490 | func xp_reduced_proc (acc,xp_j) = { | |
491 | 491 | let $t099129941 = acc | |
492 | 492 | let xp_reduced = $t099129941._1 | |
493 | 493 | let index = $t099129941._2 | |
494 | 494 | let dx_expected = if ((index == i)) | |
495 | 495 | then (fraction(xp_j, D1, D0) - new_y) | |
496 | 496 | else (xp_j - fraction(xp_j, D1, D0)) | |
497 | 497 | $Tuple2((xp_reduced :+ (xp_j - fraction(_fee, dx_expected, feeScale6))), (index + 1)) | |
498 | 498 | } | |
499 | 499 | ||
500 | 500 | let $t01020310267 = { | |
501 | 501 | let $l = xp | |
502 | 502 | let $s = size($l) | |
503 | 503 | let $acc0 = $Tuple2(nil, 0) | |
504 | 504 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
505 | 505 | then $a | |
506 | 506 | else xp_reduced_proc($a, $l[$i]) | |
507 | 507 | ||
508 | 508 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
509 | 509 | then $a | |
510 | 510 | else throw("List size exceeds 10") | |
511 | 511 | ||
512 | 512 | $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) | |
513 | 513 | } | |
514 | 514 | let xp_reduced = $t01020310267._1 | |
515 | 515 | let index = $t01020310267._2 | |
516 | 516 | let xp_reduced_i = xp_reduced[i] | |
517 | 517 | let dy = ((xp_reduced_i - get_y_D(amp, i, xp_reduced, D1)) - 1) | |
518 | 518 | $Tuple2(dy, (dy_0 - dy)) | |
519 | 519 | } | |
520 | 520 | ||
521 | 521 | ||
522 | 522 | func getStrAssetId (assetId) = match assetId { | |
523 | 523 | case id: ByteVector => | |
524 | 524 | toBase58String(id) | |
525 | 525 | case waves: Unit => | |
526 | 526 | "WAVES" | |
527 | 527 | case _ => | |
528 | 528 | throw("Match error") | |
529 | 529 | } | |
530 | 530 | ||
531 | 531 | ||
532 | 532 | func calcStakingFuncAndAddres (stake,assetId) = if (stake) | |
533 | 533 | then $Tuple2("lockNeutrino", stakingUSDNAddress) | |
534 | 534 | else $Tuple2("unlockNeutrino", stakingUSDNAddress) | |
535 | 535 | ||
536 | 536 | ||
537 | 537 | func calcStakingParams (stake,amount,assetId) = if (stake) | |
538 | 538 | then { | |
539 | 539 | let $t01083110897 = calcStakingFuncAndAddres(stake, assetId) | |
540 | 540 | let call = $t01083110897._1 | |
541 | 541 | let stakingAddr = $t01083110897._2 | |
542 | 542 | $Tuple4(call, stakingAddr, nil, [AttachedPayment(assetId, amount)]) | |
543 | 543 | } | |
544 | 544 | else { | |
545 | 545 | let $t01098311049 = calcStakingFuncAndAddres(stake, assetId) | |
546 | 546 | let call = $t01098311049._1 | |
547 | 547 | let stakingAddr = $t01098311049._2 | |
548 | 548 | $Tuple4(call, stakingAddr, [amount, toBase58String(assetId)], nil) | |
549 | 549 | } | |
550 | 550 | ||
551 | 551 | ||
552 | 552 | func stake (amount,assetIdString) = if (containsElement(stakingAssets, assetIdString)) | |
553 | 553 | then { | |
554 | 554 | let $t01123611338 = calcStakingParams(true, amount, fromBase58String(assetIdString)) | |
555 | 555 | let call = $t01123611338._1 | |
556 | 556 | let addr = $t01123611338._2 | |
557 | 557 | let params = $t01123611338._3 | |
558 | 558 | let payments = $t01123611338._4 | |
559 | 559 | invoke(addr, call, params, payments) | |
560 | 560 | } | |
561 | 561 | else 0 | |
562 | 562 | ||
563 | 563 | ||
564 | 564 | func unstake (amount,assetIdString) = if (containsElement(stakingAssets, assetIdString)) | |
565 | 565 | then { | |
566 | 566 | let $t01152311626 = calcStakingParams(false, amount, fromBase58String(assetIdString)) | |
567 | 567 | let call = $t01152311626._1 | |
568 | 568 | let addr = $t01152311626._2 | |
569 | 569 | let params = $t01152311626._3 | |
570 | 570 | let payments = $t01152311626._4 | |
571 | 571 | invoke(addr, call, params, payments) | |
572 | 572 | } | |
573 | 573 | else 0 | |
574 | 574 | ||
575 | 575 | ||
576 | 576 | func stakedAmount (assetId) = { | |
577 | 577 | let stakedAmountCalculated = match assetId { | |
578 | 578 | case aId: ByteVector => | |
579 | 579 | if ((aId == USDN)) | |
580 | 580 | then getInteger(stakingUSDNAddress, ((("rpd_balance_" + toBase58String(aId)) + "_") + toString(this))) | |
581 | 581 | else 0 | |
582 | 582 | case _: Unit => | |
583 | 583 | 0 | |
584 | 584 | case _ => | |
585 | 585 | throw("Match error") | |
586 | 586 | } | |
587 | 587 | match stakedAmountCalculated { | |
588 | 588 | case i: Int => | |
589 | 589 | i | |
590 | 590 | case _ => | |
591 | 591 | 0 | |
592 | 592 | } | |
593 | 593 | } | |
594 | 594 | ||
595 | 595 | ||
596 | 596 | func checkSuspicious () = { | |
597 | 597 | let contractBalances = _xp() | |
598 | 598 | func checkBalance (acc,assetId) = { | |
599 | 599 | let $t01223712262 = acc | |
600 | 600 | let suspicious = $t01223712262._1 | |
601 | 601 | let i = $t01223712262._2 | |
602 | 602 | if (suspicious) | |
603 | 603 | then $Tuple2(suspicious, i) | |
604 | 604 | else { | |
605 | 605 | let aBalance = (assetBalance(this, fromBase58String(assetId)) + stakedAmount(fromBase58String(assetId))) | |
606 | 606 | if ((contractBalances[i] > aBalance)) | |
607 | 607 | then $Tuple2(true, i) | |
608 | 608 | else $Tuple2(false, (i + 1)) | |
609 | 609 | } | |
610 | 610 | } | |
611 | 611 | ||
612 | 612 | let $l = assetIds | |
613 | 613 | let $s = size($l) | |
614 | 614 | let $acc0 = $Tuple2(false, 0) | |
615 | 615 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
616 | 616 | then $a | |
617 | 617 | else checkBalance($a, $l[$i]) | |
618 | 618 | ||
619 | 619 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
620 | 620 | then $a | |
621 | 621 | else throw("List size exceeds 10") | |
622 | 622 | ||
623 | 623 | $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) | |
624 | 624 | } | |
625 | 625 | ||
626 | 626 | ||
627 | 627 | func suspendSuspicious (i) = suspend(("Suspicious state with asset: " + assetIds[i])) | |
628 | 628 | ||
629 | 629 | ||
630 | 630 | func returnPayments (caller,payments) = { | |
631 | 631 | func parsePayments (acc,payment) = (acc :+ ScriptTransfer(caller, payment.amount, payment.assetId)) | |
632 | 632 | ||
633 | 633 | let $l = payments | |
634 | 634 | let $s = size($l) | |
635 | 635 | let $acc0 = nil | |
636 | 636 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
637 | 637 | then $a | |
638 | 638 | else parsePayments($a, $l[$i]) | |
639 | 639 | ||
640 | 640 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
641 | 641 | then $a | |
642 | 642 | else throw("List size exceeds 10") | |
643 | 643 | ||
644 | 644 | $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) | |
645 | 645 | } | |
646 | 646 | ||
647 | 647 | ||
648 | 648 | func checkDAppThreshold (newBalances) = { | |
649 | 649 | let dAppThresholdCoef = valueOrErrorMessage(getInteger(this, kDAppThresholdCoef), "No dAppThresholdCoef key") | |
650 | 650 | let thresholdScale = 10000 | |
651 | 651 | let maxBalance = max(newBalances) | |
652 | 652 | let minBalance = min(newBalances) | |
653 | 653 | let ratio = fraction(maxBalance, thresholdScale, minBalance) | |
654 | 654 | if ((ratio > (dAppThresholdCoef * thresholdScale))) | |
655 | 655 | then throw("New balance in assets of the DApp is less than threshold") | |
656 | 656 | else false | |
657 | 657 | } | |
658 | 658 | ||
659 | 659 | ||
660 | 660 | func checkCoins (assetIds) = { | |
661 | 661 | let coins = split(assetIds, ",") | |
662 | 662 | if ((size(coins) > 10)) | |
663 | 663 | then throw("To many coins, max coins size 10") | |
664 | 664 | else { | |
665 | 665 | func checkCoin (error,assetId) = { | |
666 | 666 | let asset = valueOrErrorMessage(fromBase58String(assetId), ("fromBase58String: " + assetId)) | |
667 | 667 | let decimals = valueOrErrorMessage(assetInfo(asset), ("assetInfo: " + assetId)).decimals | |
668 | 668 | if ((decimals != DECIMALS)) | |
669 | 669 | then throw("wrong decimals") | |
670 | 670 | else false | |
671 | 671 | } | |
672 | 672 | ||
673 | 673 | let $l = coins | |
674 | 674 | let $s = size($l) | |
675 | 675 | let $acc0 = false | |
676 | 676 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
677 | 677 | then $a | |
678 | 678 | else checkCoin($a, $l[$i]) | |
679 | 679 | ||
680 | 680 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
681 | 681 | then $a | |
682 | 682 | else throw("List size exceeds 10") | |
683 | 683 | ||
684 | 684 | $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) | |
685 | 685 | } | |
686 | 686 | } | |
687 | 687 | ||
688 | 688 | ||
689 | 689 | func calcWithdraw (msg,minAmounts,unlockAmount) = { | |
690 | 690 | let suspicious = checkSuspicious() | |
691 | 691 | if (suspicious._1) | |
692 | 692 | then (suspendSuspicious(suspicious._2) ++ returnPayments(msg.caller, msg.payments)) | |
693 | 693 | else { | |
694 | 694 | let pmtAmount = if ((size(msg.payments) > 0)) | |
695 | 695 | then if ((size(msg.payments) != 1)) | |
696 | 696 | then throw("size(payments) != 1") | |
697 | 697 | else { | |
698 | 698 | let pmtAssetId = msg.payments[0].assetId | |
699 | 699 | if ((shareAssetId != pmtAssetId)) | |
700 | 700 | then throw("unknown payment token") | |
701 | 701 | else msg.payments[0].amount | |
702 | 702 | } | |
703 | 703 | else 0 | |
704 | 704 | let withdrawAmount = (pmtAmount + unlockAmount) | |
705 | 705 | func calcScriptActions (acc,balance) = { | |
706 | 706 | let $t01467814706 = acc | |
707 | 707 | let scriptActions = $t01467814706._1 | |
708 | 708 | let i = $t01467814706._2 | |
709 | 709 | let wAmount = fraction(balance, withdrawAmount, shareSupply) | |
710 | 710 | if (assert((wAmount >= minAmounts[i]))) | |
711 | 711 | then throw("Withdrawal resulted in fewer coins than expected") | |
712 | 712 | else { | |
713 | 713 | let us = unstake(wAmount, assetIds[i]) | |
714 | 714 | if ((us == us)) | |
715 | 715 | then $Tuple2((scriptActions ++ [IntegerEntry((assetIds[i] + kAssetBalance), (balance - wAmount)), ScriptTransfer(msg.caller, wAmount, fromBase58String(assetIds[i]))]), (i + 1)) | |
716 | 716 | else throw("Strict value is not equal to itself.") | |
717 | 717 | } | |
718 | 718 | } | |
719 | 719 | ||
720 | 720 | let $t01519515263 = { | |
721 | 721 | let $l = _xp() | |
722 | 722 | let $s = size($l) | |
723 | 723 | let $acc0 = $Tuple2(nil, 0) | |
724 | 724 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
725 | 725 | then $a | |
726 | 726 | else calcScriptActions($a, $l[$i]) | |
727 | 727 | ||
728 | 728 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
729 | 729 | then $a | |
730 | 730 | else throw("List size exceeds 10") | |
731 | 731 | ||
732 | 732 | $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) | |
733 | 733 | } | |
734 | 734 | let scriptActions = $t01519515263._1 | |
735 | 735 | let i = $t01519515263._2 | |
736 | 736 | (scriptActions ++ [Burn(shareAssetId, withdrawAmount), IntegerEntry(kShareAssetSupply, (shareSupply - withdrawAmount))]) | |
737 | 737 | } | |
738 | 738 | } | |
739 | 739 | ||
740 | 740 | ||
741 | - | func calcWithdrawOneCoinEntries (msg,tokenOut,minAmount,unlockAmount) = if ((size(msg.payments) != 1)) | |
742 | - | then throw("size(payments) != 1") | |
743 | - | else { | |
744 | - | let suspicious = checkSuspicious() | |
745 | - | if (suspicious._1) | |
746 | - | then (suspendSuspicious(suspicious._2) ++ returnPayments(msg.originCaller, msg.payments)) | |
747 | - | else { | |
748 | - | let pmtAmount = if ((size(msg.payments) > 0)) | |
749 | - | then if ((size(msg.payments) != 1)) | |
750 | - | then throw("size(payments) != 1") | |
741 | + | func calcWithdrawOneCoinEntries (msg,tokenOut,minAmount,unlockAmount) = { | |
742 | + | let suspicious = checkSuspicious() | |
743 | + | if (suspicious._1) | |
744 | + | then (suspendSuspicious(suspicious._2) ++ returnPayments(msg.originCaller, msg.payments)) | |
745 | + | else { | |
746 | + | let pmtAmount = if ((size(msg.payments) > 0)) | |
747 | + | then { | |
748 | + | let pmtAssetId = msg.payments[0].assetId | |
749 | + | if ((shareAssetId != pmtAssetId)) | |
750 | + | then throw("unknown payment token") | |
751 | + | else msg.payments[0].amount | |
752 | + | } | |
753 | + | else 0 | |
754 | + | let outIndex = valueOrErrorMessage(indexOf(assetIds, tokenOut), "unknown token out") | |
755 | + | let tokenOutB58 = fromBase58String(tokenOut) | |
756 | + | let withdrawAmount = (pmtAmount + unlockAmount) | |
757 | + | let xp = _xp() | |
758 | + | let $t01612516212 = _calcWithdrawOneCoin(xp, withdrawAmount, outIndex, msg.originCaller) | |
759 | + | let dy = $t01612516212._1 | |
760 | + | let dy_fee = $t01612516212._2 | |
761 | + | if (assert((dy >= minAmount))) | |
762 | + | then throw("Not enough coins removed") | |
763 | + | else { | |
764 | + | let governanceFees = fraction(dy_fee, feeGovernance, feeScale6) | |
765 | + | let dy_and_fee = (dy + dy_fee) | |
766 | + | func makeNewBalances (acc,tokenBalance) = { | |
767 | + | let $t01647016496 = acc | |
768 | + | let newBalances = $t01647016496._1 | |
769 | + | let i = $t01647016496._2 | |
770 | + | if ((i == outIndex)) | |
771 | + | then $Tuple2((newBalances :+ (tokenBalance - dy_and_fee)), (i + 1)) | |
772 | + | else $Tuple2((newBalances :+ tokenBalance), (i + 1)) | |
773 | + | } | |
774 | + | ||
775 | + | let $t01666316724 = { | |
776 | + | let $l = xp | |
777 | + | let $s = size($l) | |
778 | + | let $acc0 = $Tuple2(nil, 0) | |
779 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
780 | + | then $a | |
781 | + | else makeNewBalances($a, $l[$i]) | |
782 | + | ||
783 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
784 | + | then $a | |
785 | + | else throw("List size exceeds 10") | |
786 | + | ||
787 | + | $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) | |
788 | + | } | |
789 | + | let newBalances = $t01666316724._1 | |
790 | + | let v = $t01666316724._2 | |
791 | + | if (checkDAppThreshold(newBalances)) | |
792 | + | then throw() | |
751 | 793 | else { | |
752 | - | let pmtAssetId = msg.payments[0].assetId | |
753 | - | if ((shareAssetId != pmtAssetId)) | |
754 | - | then throw("unknown payment token") | |
755 | - | else msg.payments[0].amount | |
794 | + | let us = unstake(dy_and_fee, tokenOut) | |
795 | + | if ((us == us)) | |
796 | + | then { | |
797 | + | let lpFees = (dy_fee - governanceFees) | |
798 | + | let airdrop = if ((lpFees > 0)) | |
799 | + | then invoke(lpFarmingAddress, "airDrop", nil, [AttachedPayment(tokenOutB58, lpFees)]) | |
800 | + | else 0 | |
801 | + | if ((airdrop == airdrop)) | |
802 | + | then [ScriptTransfer(msg.originCaller, dy, tokenOutB58), IntegerEntry((assetIds[outIndex] + kAssetBalance), (xp[outIndex] - dy_and_fee)), Burn(shareAssetId, withdrawAmount), ScriptTransfer(moneyBoxAddress, governanceFees, tokenOutB58), IntegerEntry(kShareAssetSupply, (shareSupply - withdrawAmount))] | |
803 | + | else throw("Strict value is not equal to itself.") | |
804 | + | } | |
805 | + | else throw("Strict value is not equal to itself.") | |
756 | 806 | } | |
757 | - | else 0 | |
758 | - | let outIndex = valueOrErrorMessage(indexOf(assetIds, tokenOut), "unknown token out") | |
759 | - | let tokenOutB58 = fromBase58String(tokenOut) | |
760 | - | let withdrawAmount = (pmtAmount + unlockAmount) | |
761 | - | let xp = _xp() | |
762 | - | let $t01627116358 = _calcWithdrawOneCoin(xp, withdrawAmount, outIndex, msg.originCaller) | |
763 | - | let dy = $t01627116358._1 | |
764 | - | let dy_fee = $t01627116358._2 | |
765 | - | if (assert((dy >= minAmount))) | |
766 | - | then throw("Not enough coins removed") | |
767 | - | else { | |
768 | - | let governanceFees = fraction(dy_fee, feeGovernance, feeScale6) | |
769 | - | let dy_and_fee = (dy + dy_fee) | |
770 | - | func makeNewBalances (acc,tokenBalance) = { | |
771 | - | let $t01661616642 = acc | |
772 | - | let newBalances = $t01661616642._1 | |
773 | - | let i = $t01661616642._2 | |
774 | - | if ((i == outIndex)) | |
775 | - | then $Tuple2((newBalances :+ (tokenBalance - dy_and_fee)), (i + 1)) | |
776 | - | else $Tuple2((newBalances :+ tokenBalance), (i + 1)) | |
777 | - | } | |
778 | - | ||
779 | - | let $t01680916870 = { | |
780 | - | let $l = xp | |
781 | - | let $s = size($l) | |
782 | - | let $acc0 = $Tuple2(nil, 0) | |
783 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
784 | - | then $a | |
785 | - | else makeNewBalances($a, $l[$i]) | |
786 | - | ||
787 | - | func $f0_2 ($a,$i) = if (($i >= $s)) | |
788 | - | then $a | |
789 | - | else throw("List size exceeds 10") | |
790 | - | ||
791 | - | $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) | |
792 | - | } | |
793 | - | let newBalances = $t01680916870._1 | |
794 | - | let v = $t01680916870._2 | |
795 | - | if (checkDAppThreshold(newBalances)) | |
796 | - | then throw() | |
797 | - | else { | |
798 | - | let us = unstake(dy_and_fee, tokenOut) | |
799 | - | if ((us == us)) | |
800 | - | then { | |
801 | - | let lpFees = (dy_fee - governanceFees) | |
802 | - | let airdrop = if ((lpFees > 0)) | |
803 | - | then invoke(lpFarmingAddress, "airDrop", nil, [AttachedPayment(tokenOutB58, lpFees)]) | |
804 | - | else 0 | |
805 | - | if ((airdrop == airdrop)) | |
806 | - | then [ScriptTransfer(msg.originCaller, dy, tokenOutB58), IntegerEntry((assetIds[outIndex] + kAssetBalance), (xp[outIndex] - dy_and_fee)), Burn(shareAssetId, withdrawAmount), ScriptTransfer(moneyBoxAddress, governanceFees, tokenOutB58), IntegerEntry(kShareAssetSupply, (shareSupply - withdrawAmount))] | |
807 | - | else throw("Strict value is not equal to itself.") | |
808 | - | } | |
809 | - | else throw("Strict value is not equal to itself.") | |
810 | - | } | |
811 | - | } | |
812 | - | } | |
813 | - | } | |
807 | + | } | |
808 | + | } | |
809 | + | } | |
814 | 810 | ||
815 | 811 | ||
816 | 812 | @Callable(msg) | |
817 | 813 | func D (xp,amp) = { | |
818 | 814 | let D = get_D_internal(xp, amp) | |
819 | 815 | $Tuple2([IntegerEntry("D", D)], D) | |
820 | 816 | } | |
821 | 817 | ||
822 | 818 | ||
823 | 819 | ||
824 | 820 | @Callable(msg) | |
825 | 821 | func init (assetIds,_A,_dAppThresholdCoef) = if (!(isDataStorageUntouched(this))) | |
826 | 822 | then throw("Already initialized") | |
827 | 823 | else if ((0 >= _A)) | |
828 | 824 | then throw("Amp must be must > 0") | |
829 | 825 | else if ((0 >= _dAppThresholdCoef)) | |
830 | 826 | then throw("dApp Threshold Coef must be > 0") | |
831 | 827 | else { | |
832 | 828 | let shareName = "s_Multi_USD" | |
833 | 829 | let shareDescription = ("ShareToken of SwopFi protocol for MultiStable USD pool at address " + toString(this)) | |
834 | 830 | let issueToken = Issue(shareName, shareDescription, 0, 6, true) | |
835 | 831 | let tokenId = calculateAssetId(issueToken) | |
836 | 832 | if (checkCoins(assetIds)) | |
837 | 833 | then throw() | |
838 | 834 | else [StringEntry(kVersion, version), StringEntry(kAssets, assetIds), IntegerEntry("initial_A", _A), IntegerEntry("future_A", _A), IntegerEntry(kFee, getIntegerValue(oracle, "base_fee_flat")), StringEntry(kShareAssetId, toBase58String(tokenId)), IntegerEntry(kShareAssetSupply, 0), IntegerEntry(kDAppThresholdCoef, _dAppThresholdCoef), BooleanEntry(kActive, true), issueToken] | |
839 | 835 | } | |
840 | 836 | ||
841 | 837 | ||
842 | 838 | ||
843 | 839 | @Callable(msg) | |
844 | 840 | func addLiquidity (minMintAmount,stakeFarming,lockType) = valueOrElse(isActive(), { | |
845 | 841 | let amp = _A() | |
846 | 842 | let xp = _xp() | |
847 | 843 | let D0 = if ((shareSupply == 0)) | |
848 | 844 | then 0 | |
849 | 845 | else getDMem(xp, amp) | |
850 | - | let $ | |
846 | + | let $t01886419118 = if (if ((lockType > 0)) | |
851 | 847 | then (msg.payments[(size(msg.payments) - 1)].assetId == unit) | |
852 | 848 | else false) | |
853 | 849 | then $Tuple2(removeByIndex(msg.payments, (size(msg.payments) - 1)), [msg.payments[(size(msg.payments) - 1)]]) | |
854 | 850 | else $Tuple2(msg.payments, nil) | |
855 | - | let payments = $ | |
856 | - | let lockFee = $ | |
851 | + | let payments = $t01886419118._1 | |
852 | + | let lockFee = $t01886419118._2 | |
857 | 853 | let paymentsSize = size(payments) | |
858 | 854 | func validPayments (n) = if ((paymentsSize > nCoins)) | |
859 | 855 | then throw(("payments size > " + toString(nCoins))) | |
860 | 856 | else if ((1 > paymentsSize)) | |
861 | 857 | then throw("payments size < 1") | |
862 | 858 | else if (if ((shareSupply == 0)) | |
863 | 859 | then (nCoins != paymentsSize) | |
864 | 860 | else false) | |
865 | 861 | then throw("initial deposit requires all coins") | |
866 | 862 | else { | |
867 | 863 | func paymantValid (acc,payment) = if (containsElement(assetIds, getStrAssetId(payment.assetId))) | |
868 | 864 | then true | |
869 | 865 | else throw("Invalid asset in payment") | |
870 | 866 | ||
871 | 867 | let $l = payments | |
872 | 868 | let $s = size($l) | |
873 | 869 | let $acc0 = false | |
874 | 870 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
875 | 871 | then $a | |
876 | 872 | else paymantValid($a, $l[$i]) | |
877 | 873 | ||
878 | 874 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
879 | 875 | then $a | |
880 | 876 | else throw("List size exceeds 10") | |
881 | 877 | ||
882 | 878 | $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) | |
883 | 879 | } | |
884 | 880 | ||
885 | 881 | if (!(validPayments(paymentsSize))) | |
886 | 882 | then throw() | |
887 | 883 | else { | |
888 | 884 | let suspicious = checkSuspicious() | |
889 | 885 | if (suspicious._1) | |
890 | 886 | then (suspendSuspicious(suspicious._2) ++ returnPayments(msg.caller, payments)) | |
891 | 887 | else { | |
892 | 888 | func parsePayments (acc,assetId) = { | |
893 | - | let $ | |
894 | - | let newBalances = $ | |
895 | - | let i = $ | |
889 | + | let $t01998820014 = acc | |
890 | + | let newBalances = $t01998820014._1 | |
891 | + | let i = $t01998820014._2 | |
896 | 892 | func parsePayment (newBalance,payment) = if ((getStrAssetId(payment.assetId) == assetId)) | |
897 | 893 | then (newBalance + payment.amount) | |
898 | 894 | else newBalance | |
899 | 895 | ||
900 | 896 | let newBalace = { | |
901 | 897 | let $l = payments | |
902 | 898 | let $s = size($l) | |
903 | 899 | let $acc0 = xp[i] | |
904 | 900 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
905 | 901 | then $a | |
906 | 902 | else parsePayment($a, $l[$i]) | |
907 | 903 | ||
908 | 904 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
909 | 905 | then $a | |
910 | 906 | else throw("List size exceeds 10") | |
911 | 907 | ||
912 | 908 | $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) | |
913 | 909 | } | |
914 | 910 | $Tuple2((newBalances :+ newBalace), (i + 1)) | |
915 | 911 | } | |
916 | 912 | ||
917 | - | let $ | |
913 | + | let $t02036420431 = { | |
918 | 914 | let $l = assetIds | |
919 | 915 | let $s = size($l) | |
920 | 916 | let $acc0 = $Tuple2(nil, 0) | |
921 | 917 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
922 | 918 | then $a | |
923 | 919 | else parsePayments($a, $l[$i]) | |
924 | 920 | ||
925 | 921 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
926 | 922 | then $a | |
927 | 923 | else throw("List size exceeds 10") | |
928 | 924 | ||
929 | 925 | $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) | |
930 | 926 | } | |
931 | - | let newBalances = $ | |
932 | - | let k = $ | |
927 | + | let newBalances = $t02036420431._1 | |
928 | + | let k = $t02036420431._2 | |
933 | 929 | if (checkDAppThreshold(newBalances)) | |
934 | 930 | then throw() | |
935 | 931 | else { | |
936 | 932 | let D1 = getDMem(newBalances, amp) | |
937 | 933 | if (assert((D1 > D0))) | |
938 | 934 | then throw("D1 > D0") | |
939 | 935 | else { | |
940 | 936 | let feeDiscount = calculateFeeDiscount(msg.caller) | |
941 | 937 | func calcScriptActions (acc,newBalance) = { | |
942 | - | let $ | |
943 | - | let invBalances = $ | |
944 | - | let scriptActions = $ | |
945 | - | let i = $ | |
938 | + | let $t02075120792 = acc | |
939 | + | let invBalances = $t02075120792._1 | |
940 | + | let scriptActions = $t02075120792._2 | |
941 | + | let i = $t02075120792._3 | |
946 | 942 | if ((shareSupply > 0)) | |
947 | 943 | then { | |
948 | 944 | let _fee = ((fraction(fee, feeDiscount, feeScale6, CEILING) * nCoins) / (4 * (nCoins - 1))) | |
949 | 945 | let fees = { | |
950 | 946 | let idealBalance = fraction(D1, xp[i], D0) | |
951 | 947 | let difference = if ((idealBalance > newBalance)) | |
952 | 948 | then (idealBalance - newBalance) | |
953 | 949 | else (newBalance - idealBalance) | |
954 | 950 | fraction(_fee, difference, feeScale6) | |
955 | 951 | } | |
956 | 952 | let governanceFees = fraction(fees, feeGovernance, feeScale6) | |
957 | 953 | let finalBalance = (newBalance - fees) | |
958 | 954 | let invariantBalance = (newBalance - fees) | |
959 | 955 | let pmt = (newBalance - xp[i]) | |
960 | 956 | let lpFees = (fees - governanceFees) | |
961 | 957 | let inv = if ((pmt > 0)) | |
962 | 958 | then stake((pmt - fees), assetIds[i]) | |
963 | 959 | else unstake(fees, assetIds[i]) | |
964 | 960 | if ((inv == inv)) | |
965 | 961 | then { | |
966 | 962 | let airdrop = if ((lpFees > 0)) | |
967 | 963 | then invoke(lpFarmingAddress, "airDrop", nil, [AttachedPayment(fromBase58String(assetIds[i]), lpFees)]) | |
968 | 964 | else 0 | |
969 | 965 | if ((airdrop == airdrop)) | |
970 | 966 | then $Tuple3((invBalances :+ invariantBalance), (scriptActions ++ [ScriptTransfer(moneyBoxAddress, governanceFees, fromBase58String(assetIds[i])), IntegerEntry((assetIds[i] + kAssetBalance), finalBalance)]), (i + 1)) | |
971 | 967 | else throw("Strict value is not equal to itself.") | |
972 | 968 | } | |
973 | 969 | else throw("Strict value is not equal to itself.") | |
974 | 970 | } | |
975 | 971 | else { | |
976 | 972 | let inv = stake(newBalance, assetIds[i]) | |
977 | 973 | if ((inv == inv)) | |
978 | 974 | then $Tuple3((invBalances :+ newBalance), (scriptActions :+ IntegerEntry((assetIds[i] + kAssetBalance), newBalance)), (i + 1)) | |
979 | 975 | else throw("Strict value is not equal to itself.") | |
980 | 976 | } | |
981 | 977 | } | |
982 | 978 | ||
983 | - | let $ | |
979 | + | let $t02249722585 = { | |
984 | 980 | let $l = newBalances | |
985 | 981 | let $s = size($l) | |
986 | 982 | let $acc0 = $Tuple3(nil, nil, 0) | |
987 | 983 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
988 | 984 | then $a | |
989 | 985 | else calcScriptActions($a, $l[$i]) | |
990 | 986 | ||
991 | 987 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
992 | 988 | then $a | |
993 | 989 | else throw("List size exceeds 10") | |
994 | 990 | ||
995 | 991 | $f1_2($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) | |
996 | 992 | } | |
997 | - | let invBalances = $ | |
998 | - | let scriptActions = $ | |
993 | + | let invBalances = $t02249722585._1 | |
994 | + | let scriptActions = $t02249722585._2 | |
999 | 995 | let D2 = getDMem(invBalances, amp) | |
1000 | 996 | let mint_amount = if ((shareSupply == 0)) | |
1001 | 997 | then D1 | |
1002 | 998 | else fraction(shareSupply, (D2 - D0), D0) | |
1003 | 999 | if (assert((mint_amount >= minMintAmount))) | |
1004 | 1000 | then throw("Slippage screwed you") | |
1005 | 1001 | else if (stakeFarming) | |
1006 | 1002 | then { | |
1007 | 1003 | let re = invoke(this, "reissueShare", [mint_amount], nil) | |
1008 | 1004 | if ((re == re)) | |
1009 | 1005 | then { | |
1010 | 1006 | let s = invoke(farmingAddress, "lockShareTokensFromPool", [msg.caller.bytes, toString(this), lockType], ([AttachedPayment(shareAssetId, mint_amount)] ++ lockFee)) | |
1011 | 1007 | if ((s == s)) | |
1012 | 1008 | then (scriptActions :+ IntegerEntry(kShareAssetSupply, (shareSupply + mint_amount))) | |
1013 | 1009 | else throw("Strict value is not equal to itself.") | |
1014 | 1010 | } | |
1015 | 1011 | else throw("Strict value is not equal to itself.") | |
1016 | 1012 | } | |
1017 | 1013 | else (scriptActions ++ [Reissue(shareAssetId, mint_amount, true), ScriptTransfer(msg.caller, mint_amount, shareAssetId), IntegerEntry(kShareAssetSupply, (shareSupply + mint_amount))]) | |
1018 | 1014 | } | |
1019 | 1015 | } | |
1020 | 1016 | } | |
1021 | 1017 | } | |
1022 | 1018 | }) | |
1023 | 1019 | ||
1024 | 1020 | ||
1025 | 1021 | ||
1026 | 1022 | @Callable(msg) | |
1027 | 1023 | func calcMintAmount (newBalances,user) = { | |
1028 | 1024 | let amp = _A() | |
1029 | 1025 | let xp = _xp() | |
1030 | 1026 | let D1 = getDMem(newBalances, amp) | |
1031 | 1027 | if ((shareSupply == 0)) | |
1032 | 1028 | then $Tuple2(nil, D1) | |
1033 | 1029 | else { | |
1034 | 1030 | let D0 = getDMem(xp, amp) | |
1035 | 1031 | let feeDiscount = calculateFeeDiscount(user) | |
1036 | 1032 | func calcInvBalances (acc,newBalance) = { | |
1037 | - | let $ | |
1038 | - | let invBalances = $ | |
1039 | - | let i = $ | |
1033 | + | let $t02386123887 = acc | |
1034 | + | let invBalances = $t02386123887._1 | |
1035 | + | let i = $t02386123887._2 | |
1040 | 1036 | let _fee = ((fraction(fee, feeDiscount, feeScale6, CEILING) * nCoins) / (4 * (nCoins - 1))) | |
1041 | 1037 | let fees = { | |
1042 | 1038 | let idealBalance = fraction(D1, xp[i], D0) | |
1043 | 1039 | let difference = if ((idealBalance > newBalance)) | |
1044 | 1040 | then (idealBalance - newBalance) | |
1045 | 1041 | else (newBalance - idealBalance) | |
1046 | 1042 | fraction(_fee, difference, feeScale6) | |
1047 | 1043 | } | |
1048 | 1044 | let invariantBalance = (newBalance - fees) | |
1049 | 1045 | $Tuple2((invBalances :+ invariantBalance), (i + 1)) | |
1050 | 1046 | } | |
1051 | 1047 | ||
1052 | - | let $ | |
1048 | + | let $t02448924559 = { | |
1053 | 1049 | let $l = newBalances | |
1054 | 1050 | let $s = size($l) | |
1055 | 1051 | let $acc0 = $Tuple2(nil, 0) | |
1056 | 1052 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1057 | 1053 | then $a | |
1058 | 1054 | else calcInvBalances($a, $l[$i]) | |
1059 | 1055 | ||
1060 | 1056 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1061 | 1057 | then $a | |
1062 | 1058 | else throw("List size exceeds 10") | |
1063 | 1059 | ||
1064 | 1060 | $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) | |
1065 | 1061 | } | |
1066 | - | let invBalances = $ | |
1067 | - | let k = $ | |
1062 | + | let invBalances = $t02448924559._1 | |
1063 | + | let k = $t02448924559._2 | |
1068 | 1064 | let D2 = getDMem(invBalances, amp) | |
1069 | 1065 | let mintAmount = fraction(shareSupply, (D2 - D0), D0) | |
1070 | 1066 | $Tuple2(nil, mintAmount) | |
1071 | 1067 | } | |
1072 | 1068 | } | |
1073 | 1069 | ||
1074 | 1070 | ||
1075 | 1071 | ||
1076 | 1072 | @Callable(msg) | |
1077 | 1073 | func reissueShare (amount) = valueOrElse(isSelfCall(msg), [Reissue(shareAssetId, amount, true)]) | |
1078 | 1074 | ||
1079 | 1075 | ||
1080 | 1076 | ||
1081 | 1077 | @Callable(msg) | |
1082 | 1078 | func getDy (assetFrom,assetTo,dx,userAddress) = { | |
1083 | 1079 | let xp = _xp() | |
1084 | 1080 | let fromIndex = valueOrErrorMessage(indexOf(assetIds, assetFrom), "unknown token in") | |
1085 | 1081 | let toIndex = valueOrErrorMessage(indexOf(assetIds, assetTo), "unknown token out") | |
1086 | 1082 | let x = (xp[fromIndex] + dx) | |
1087 | 1083 | let y = getY(fromIndex, toIndex, x, xp) | |
1088 | 1084 | let dy = ((xp[toIndex] - y) - 1) | |
1089 | 1085 | let feeDiscount = calculateFeeDiscount(Address(fromBase58String(userAddress))) | |
1090 | 1086 | let _fee = fraction(fraction(fee, feeDiscount, feeScale6, CEILING), dy, feeScale6) | |
1091 | 1087 | $Tuple2(nil, $Tuple2((dy - _fee), _fee)) | |
1092 | 1088 | } | |
1093 | 1089 | ||
1094 | 1090 | ||
1095 | 1091 | ||
1096 | 1092 | @Callable(msg) | |
1097 | 1093 | func exchange (tokenOut,min_dy) = valueOrElse(isActive(), if ((size(msg.payments) != 1)) | |
1098 | 1094 | then throw("size(payments) != 1") | |
1099 | 1095 | else { | |
1100 | 1096 | let suspicious = checkSuspicious() | |
1101 | 1097 | if (suspicious._1) | |
1102 | 1098 | then (suspendSuspicious(suspicious._2) ++ returnPayments(msg.caller, msg.payments)) | |
1103 | 1099 | else { | |
1104 | 1100 | let payment = msg.payments[0] | |
1105 | 1101 | let tokenIn = getStrAssetId(payment.assetId) | |
1106 | 1102 | let tokenOutB58 = fromBase58String(tokenOut) | |
1107 | 1103 | let dx = payment.amount | |
1108 | 1104 | let fromIndex = valueOrErrorMessage(indexOf(assetIds, tokenIn), "unknown token in") | |
1109 | 1105 | let toIndex = valueOrErrorMessage(indexOf(assetIds, tokenOut), "unknown token out") | |
1110 | 1106 | let xp = _xp() | |
1111 | 1107 | let x = (xp[fromIndex] + dx) | |
1112 | 1108 | let y = getY(fromIndex, toIndex, x, xp) | |
1113 | 1109 | let _dy = ((xp[toIndex] - y) - 1) | |
1114 | 1110 | let feeDiscount = calculateFeeDiscount(msg.originCaller) | |
1115 | 1111 | let _fee = fraction(_dy, fraction(fee, feeDiscount, feeScale6, CEILING), feeScale6) | |
1116 | 1112 | let dy = (_dy - _fee) | |
1117 | 1113 | let governanceFees = fraction(_fee, feeGovernance, feeScale6) | |
1118 | 1114 | if (assert((dy >= min_dy))) | |
1119 | 1115 | then throw("Exchange resulted in fewer coins than expected") | |
1120 | 1116 | else { | |
1121 | 1117 | func makeNewBalances (acc,tokenBalance) = { | |
1122 | - | let $ | |
1123 | - | let newBalances = $ | |
1124 | - | let i = $ | |
1118 | + | let $t02660026626 = acc | |
1119 | + | let newBalances = $t02660026626._1 | |
1120 | + | let i = $t02660026626._2 | |
1125 | 1121 | if ((i == fromIndex)) | |
1126 | 1122 | then $Tuple2((newBalances :+ (tokenBalance + dx)), (i + 1)) | |
1127 | 1123 | else if ((i == toIndex)) | |
1128 | 1124 | then $Tuple2((newBalances :+ (tokenBalance - _dy)), (i + 1)) | |
1129 | 1125 | else $Tuple2((newBalances :+ tokenBalance), (i + 1)) | |
1130 | 1126 | } | |
1131 | 1127 | ||
1132 | - | let $ | |
1128 | + | let $t02687726938 = { | |
1133 | 1129 | let $l = xp | |
1134 | 1130 | let $s = size($l) | |
1135 | 1131 | let $acc0 = $Tuple2(nil, 0) | |
1136 | 1132 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1137 | 1133 | then $a | |
1138 | 1134 | else makeNewBalances($a, $l[$i]) | |
1139 | 1135 | ||
1140 | 1136 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1141 | 1137 | then $a | |
1142 | 1138 | else throw("List size exceeds 10") | |
1143 | 1139 | ||
1144 | 1140 | $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) | |
1145 | 1141 | } | |
1146 | - | let newBalances = $ | |
1147 | - | let i = $ | |
1142 | + | let newBalances = $t02687726938._1 | |
1143 | + | let i = $t02687726938._2 | |
1148 | 1144 | if (checkDAppThreshold(newBalances)) | |
1149 | 1145 | then throw() | |
1150 | 1146 | else { | |
1151 | 1147 | let s = stake(payment.amount, getStrAssetId(payment.assetId)) | |
1152 | 1148 | if ((s == s)) | |
1153 | 1149 | then { | |
1154 | 1150 | let us = unstake(_dy, tokenOut) | |
1155 | 1151 | if ((us == us)) | |
1156 | 1152 | then { | |
1157 | 1153 | let lpFees = (_fee - governanceFees) | |
1158 | 1154 | let airdrop = if ((lpFees > 0)) | |
1159 | 1155 | then invoke(lpFarmingAddress, "airDrop", nil, [AttachedPayment(tokenOutB58, lpFees)]) | |
1160 | 1156 | else 0 | |
1161 | 1157 | if ((airdrop == airdrop)) | |
1162 | 1158 | then $Tuple2([IntegerEntry((tokenIn + kAssetBalance), x), IntegerEntry((tokenOut + kAssetBalance), (xp[toIndex] - _dy)), ScriptTransfer(msg.caller, dy, tokenOutB58), ScriptTransfer(moneyBoxAddress, governanceFees, tokenOutB58)], [dy, tokenOutB58]) | |
1163 | 1159 | else throw("Strict value is not equal to itself.") | |
1164 | 1160 | } | |
1165 | 1161 | else throw("Strict value is not equal to itself.") | |
1166 | 1162 | } | |
1167 | 1163 | else throw("Strict value is not equal to itself.") | |
1168 | 1164 | } | |
1169 | 1165 | } | |
1170 | 1166 | } | |
1171 | 1167 | }) | |
1172 | 1168 | ||
1173 | 1169 | ||
1174 | 1170 | ||
1175 | 1171 | @Callable(msg) | |
1176 | 1172 | func withdraw (minAmounts) = valueOrElse(isActive(), calcWithdraw(msg, minAmounts, 0)) | |
1177 | 1173 | ||
1178 | 1174 | ||
1179 | 1175 | ||
1180 | 1176 | @Callable(msg) | |
1181 | 1177 | func withdrawWithUnlock (minAmounts,unlockAmount) = valueOrElse(isActive(), if ((0 >= unlockAmount)) | |
1182 | 1178 | then throw("Unlock amount must be positive") | |
1183 | 1179 | else { | |
1184 | 1180 | let unlock = invoke(farmingAddress, "withdrawShareTokensFromPool", [msg.caller.bytes, toString(this), unlockAmount], nil) | |
1185 | 1181 | if ((unlock == unlock)) | |
1186 | 1182 | then calcWithdraw(msg, minAmounts, unlockAmount) | |
1187 | 1183 | else throw("Strict value is not equal to itself.") | |
1188 | 1184 | }) | |
1189 | 1185 | ||
1190 | 1186 | ||
1191 | 1187 | ||
1192 | 1188 | @Callable(msg) | |
1193 | 1189 | func calcWithdrawOneCoin (tokenAmount,tokenOut,user) = if ((0 >= tokenAmount)) | |
1194 | 1190 | then throw("Amount must be positive") | |
1195 | 1191 | else { | |
1196 | 1192 | let i = valueOrErrorMessage(indexOf(assetIds, tokenOut), "unknown token out") | |
1197 | 1193 | $Tuple2(nil, _calcWithdrawOneCoin(_xp(), tokenAmount, i, Address(fromBase58String(user)))._1) | |
1198 | 1194 | } | |
1199 | 1195 | ||
1200 | 1196 | ||
1201 | 1197 | ||
1202 | 1198 | @Callable(msg) | |
1203 | - | func withdrawOneCoin (tokenOut,minAmount) = valueOrElse(isActive(), calcWithdrawOneCoinEntries(msg, tokenOut, minAmount, 0)) | |
1199 | + | func withdrawOneCoin (tokenOut,minAmount) = valueOrElse(isActive(), if ((size(msg.payments) != 1)) | |
1200 | + | then throw("size(payments) != 1") | |
1201 | + | else calcWithdrawOneCoinEntries(msg, tokenOut, minAmount, 0)) | |
1204 | 1202 | ||
1205 | 1203 | ||
1206 | 1204 | ||
1207 | 1205 | @Callable(msg) | |
1208 | 1206 | func withdrawOneCoinWithUnlock (tokenOut,minAmount,unlockAmount) = valueOrElse(isActive(), if ((0 >= unlockAmount)) | |
1209 | 1207 | then throw("Unlock amount must be positive") | |
1210 | 1208 | else { | |
1211 | 1209 | let unlock = invoke(farmingAddress, "withdrawShareTokensFromPool", [msg.caller.bytes, toString(this), unlockAmount], nil) | |
1212 | 1210 | if ((unlock == unlock)) | |
1213 | 1211 | then calcWithdrawOneCoinEntries(msg, tokenOut, minAmount, unlockAmount) | |
1214 | 1212 | else throw("Strict value is not equal to itself.") | |
1215 | 1213 | }) | |
1216 | 1214 | ||
1217 | 1215 | ||
1218 | 1216 | ||
1219 | 1217 | @Callable(msg) | |
1220 | 1218 | func A () = $Tuple2(nil, _A()) | |
1221 | 1219 | ||
1222 | 1220 | ||
1223 | 1221 | ||
1224 | 1222 | @Callable(msg) | |
1225 | 1223 | func getVirtualPrice () = { | |
1226 | 1224 | let D = get_D(_xp(), _A()) | |
1227 | 1225 | $Tuple2(nil, fraction(D, PRECISION, shareSupply)) | |
1228 | 1226 | } | |
1229 | 1227 | ||
1230 | 1228 | ||
1231 | 1229 | ||
1232 | 1230 | @Callable(msg) | |
1233 | 1231 | func calcTokenAmount (amounts,deposit) = { | |
1234 | 1232 | let amp = _A() | |
1235 | 1233 | let balances = _xp() | |
1236 | 1234 | let D0 = getDMem(balances, amp) | |
1237 | 1235 | func calcNewBalances (acc,balance) = { | |
1238 | - | let $ | |
1239 | - | let newBalances = $ | |
1240 | - | let i = $ | |
1236 | + | let $t02951629542 = acc | |
1237 | + | let newBalances = $t02951629542._1 | |
1238 | + | let i = $t02951629542._2 | |
1241 | 1239 | let newBalance = (balance + (if (deposit) | |
1242 | 1240 | then amounts[i] | |
1243 | 1241 | else -(amounts[i]))) | |
1244 | 1242 | $Tuple2((newBalances :+ newBalance), (i + 1)) | |
1245 | 1243 | } | |
1246 | 1244 | ||
1247 | 1245 | let newBalances = ( let $l = balances | |
1248 | 1246 | let $s = size($l) | |
1249 | 1247 | let $acc0 = $Tuple2(nil, 0) | |
1250 | 1248 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1251 | 1249 | then $a | |
1252 | 1250 | else calcNewBalances($a, $l[$i]) | |
1253 | 1251 | ||
1254 | 1252 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1255 | 1253 | then $a | |
1256 | 1254 | else throw("List size exceeds 10") | |
1257 | 1255 | ||
1258 | 1256 | $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))._1 | |
1259 | 1257 | let D1 = getDMem(newBalances, amp) | |
1260 | 1258 | let diff = if (deposit) | |
1261 | 1259 | then (D1 - D0) | |
1262 | 1260 | else (D0 - D1) | |
1263 | 1261 | $Tuple2(nil, fraction(diff, shareSupply, D0)) | |
1264 | 1262 | } | |
1265 | 1263 | ||
1266 | 1264 | ||
1267 | 1265 | ||
1268 | 1266 | @Callable(msg) | |
1269 | 1267 | func rampA (_futureA,_futureTime) = valueOrElse(isActive(), valueOrElse(isAdminCall(msg), if (assert((blockTimestamp >= (initial_A_time + MIN_RAMP_TIME)))) | |
1270 | 1268 | then throw("too often") | |
1271 | 1269 | else if (assert((_futureTime >= (blockTimestamp + MIN_RAMP_TIME)))) | |
1272 | 1270 | then throw("insufficient time") | |
1273 | 1271 | else { | |
1274 | 1272 | let _initial_A = _A() | |
1275 | 1273 | if (assert(if ((_futureA > 0)) | |
1276 | 1274 | then (MAX_A > _futureA) | |
1277 | 1275 | else false)) | |
1278 | 1276 | then throw("out of base range") | |
1279 | 1277 | else if (assert(if (if ((_futureA >= _initial_A)) | |
1280 | 1278 | then ((_initial_A * MAX_A_CHANGE) >= _futureA) | |
1281 | 1279 | else false) | |
1282 | 1280 | then true | |
1283 | 1281 | else if ((_initial_A > _futureA)) | |
1284 | 1282 | then ((_futureA * MAX_A_CHANGE) >= _initial_A) | |
1285 | 1283 | else false)) | |
1286 | 1284 | then throw("out of range") | |
1287 | 1285 | else [IntegerEntry("initial_A", _initial_A), IntegerEntry("future_A", _futureA), IntegerEntry("initial_A_time", blockTimestamp), IntegerEntry("future_A_time", _futureTime)] | |
1288 | 1286 | })) | |
1289 | 1287 | ||
1290 | 1288 | ||
1291 | 1289 | ||
1292 | 1290 | @Callable(msg) | |
1293 | 1291 | func stopRampA () = valueOrElse(isActive(), valueOrElse(isAdminCall(msg), { | |
1294 | 1292 | let currentA = _A() | |
1295 | 1293 | [IntegerEntry("initial_A", currentA), IntegerEntry("future_A", currentA), IntegerEntry("initial_A_time", blockTimestamp), IntegerEntry("future_A_time", blockTimestamp)] | |
1296 | 1294 | })) | |
1297 | 1295 | ||
1298 | 1296 | ||
1299 | 1297 | ||
1300 | 1298 | @Callable(msg) | |
1301 | 1299 | func shutdown () = valueOrElse(isAdminCall(msg), if (!(active)) | |
1302 | 1300 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, kCause), "the cause wasn't specified"))) | |
1303 | 1301 | else suspend("Paused by admin")) | |
1304 | 1302 | ||
1305 | 1303 | ||
1306 | 1304 | ||
1307 | 1305 | @Callable(msg) | |
1308 | 1306 | func activate () = valueOrElse(isAdminCall(msg), if (active) | |
1309 | 1307 | then throwIsActive() | |
1310 | 1308 | else [BooleanEntry(kActive, true), DeleteEntry(kCause)]) | |
1311 | 1309 | ||
1312 | 1310 | ||
1313 | 1311 | ||
1314 | 1312 | @Callable(msg) | |
1315 | 1313 | func takeIntoAccountExtraFunds () = valueOrElse(isActive(), if ((msg.caller != moneyBoxAddress)) | |
1316 | 1314 | then throw("Only the wallet can call this function") | |
1317 | 1315 | else { | |
1318 | 1316 | let balances = _xp() | |
1319 | 1317 | func takeExtraFunds (acc,assetId) = { | |
1320 | - | let $ | |
1321 | - | let sum = $ | |
1322 | - | let i = $ | |
1318 | + | let $t03188431902 = acc | |
1319 | + | let sum = $t03188431902._1 | |
1320 | + | let i = $t03188431902._2 | |
1323 | 1321 | let tokenB58 = fromBase58String(assetId) | |
1324 | 1322 | let rBalance = (assetBalance(this, tokenB58) + stakedAmount(tokenB58)) | |
1325 | 1323 | let enrollAmount = (rBalance - balances[i]) | |
1326 | 1324 | if ((0 > enrollAmount)) | |
1327 | 1325 | then suspend(("Enroll amount negative for asset" + assetId)) | |
1328 | 1326 | else { | |
1329 | 1327 | let airdrop = if ((enrollAmount > 0)) | |
1330 | 1328 | then invoke(lpFarmingAddress, "airDrop", nil, [AttachedPayment(tokenB58, enrollAmount)]) | |
1331 | 1329 | else 0 | |
1332 | 1330 | if ((airdrop == airdrop)) | |
1333 | 1331 | then $Tuple2((sum + enrollAmount), (i + 1)) | |
1334 | 1332 | else throw("Strict value is not equal to itself.") | |
1335 | 1333 | } | |
1336 | 1334 | } | |
1337 | 1335 | ||
1338 | 1336 | let k = { | |
1339 | 1337 | let $l = assetIds | |
1340 | 1338 | let $s = size($l) | |
1341 | 1339 | let $acc0 = $Tuple2(0, 0) | |
1342 | 1340 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1343 | 1341 | then $a | |
1344 | 1342 | else takeExtraFunds($a, $l[$i]) | |
1345 | 1343 | ||
1346 | 1344 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1347 | 1345 | then $a | |
1348 | 1346 | else throw("List size exceeds 10") | |
1349 | 1347 | ||
1350 | 1348 | $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) | |
1351 | 1349 | } | |
1352 | 1350 | if ((k._1 == 0)) | |
1353 | 1351 | then throw("No money to take") | |
1354 | 1352 | else nil | |
1355 | 1353 | }) | |
1356 | 1354 | ||
1357 | 1355 | ||
1358 | 1356 | @Verifier(tx) | |
1359 | 1357 | func verify () = { | |
1360 | 1358 | let multiSignedByAdmins = { | |
1361 | 1359 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
1362 | 1360 | then 1 | |
1363 | 1361 | else 0 | |
1364 | 1362 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
1365 | 1363 | then 1 | |
1366 | 1364 | else 0 | |
1367 | 1365 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
1368 | 1366 | then 1 | |
1369 | 1367 | else 0 | |
1370 | 1368 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
1371 | 1369 | } | |
1372 | 1370 | match tx { | |
1373 | 1371 | case inv: InvokeScriptTransaction => | |
1374 | 1372 | let callTakeIntoAccount = if ((inv.dApp == this)) | |
1375 | 1373 | then (inv.function == "takeIntoAccountExtraFunds") | |
1376 | 1374 | else false | |
1377 | 1375 | let signedByAdmin = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
1378 | 1376 | then true | |
1379 | 1377 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2)) | |
1380 | 1378 | then true | |
1381 | 1379 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3)) | |
1382 | 1380 | then true | |
1383 | 1381 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKeyInvoke) | |
1384 | 1382 | if (if (callTakeIntoAccount) | |
1385 | 1383 | then signedByAdmin | |
1386 | 1384 | else false) | |
1387 | 1385 | then true | |
1388 | 1386 | else multiSignedByAdmins | |
1389 | 1387 | case _ => | |
1390 | 1388 | multiSignedByAdmins | |
1391 | 1389 | } | |
1392 | 1390 | } | |
1393 | 1391 |
github/deemru/w8io/026f985 214.27 ms ◑