tx · CEfjh6jK6sJ5UT4v2FFrtmXHhYjjU3T8MW2UVMTmL7wG 3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT: -0.03600000 Waves 2022.12.07 10:26 [2349628] smart account 3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT > SELF 0.00000000 Waves
{ "type": 13, "id": "CEfjh6jK6sJ5UT4v2FFrtmXHhYjjU3T8MW2UVMTmL7wG", "fee": 3600000, "feeAssetId": null, "timestamp": 1670398021325, "version": 1, "sender": "3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT", "senderPublicKey": "D1BL65meykxFZTCuq7jq9HSGLLnWvQamQPUNrguW5w39", "proofs": [ "3Pi7F6y1GYirvyuTQYCnKsipinSi5Wqg9issAoe8Nacekp1WWrFLEwkJBoRM1bvrDez7eRSTXpjMHMK4T8nWAkJ3" ], "script": "base64:BgLNKAgCEgMKAQgSAwoBCBIAEgQKAgEEEgQKAgEEEgMKAQESABIECgIIARIAEgQKAggBEgQKAggBEgQKAgEBEgMKAQESBQoDAQEBEgUKAwEIARIECgIBCBIECgIBCBIECgIICBIECgIICBIECgIIARIAEgMKAQgSBQoDAQEBEgQKAggBEgQKAgEBEgQKAggIEgsKCQgBAQIBAggEBBIGCgQICAEIEgAiBnNjYWxlOCIMc2NhbGU4QmlnSW50IgdzY2FsZTE4Igp6ZXJvQmlnSW50IgRiaWcwIgRiaWcxIgRiaWcyIgRiaWczIgRiaWc0IgpzbGlwcGFnZTREIgt3YXZlc1N0cmluZyIFQW11bHQiBURjb252IgNTRVAiBUVNUFRZIgpQb29sQWN0aXZlIgpQb29sUHV0RGlzIg5Qb29sTWF0Y2hlckRpcyIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyIJaWR4UG9vbFN0IglpZHhMUEFzSWQiCWlkeEFtQXNJZCIJaWR4UHJBc0lkIgtpZHhBbXRBc0RjbSINaWR4UHJpY2VBc0RjbSILaWR4SUFtdEFzSWQiDWlkeElQcmljZUFzSWQiD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, "height": 2349628, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5G9XsAa4Krrnpvq1Xpcg9j9MGxhucVdjDXPHbygZyPxC Next: 3fxAE1V8ZcKjxvj8KcJ98NozrcCVL72USbdwGzKNm1L2 Diff:
Old | New | Differences | |
---|---|---|---|
772 | 772 | let pmt = value(payments[0]) | |
773 | 773 | let pmtAssetId = value(pmt.assetId) | |
774 | 774 | let pmtAmt = pmt.amount | |
775 | - | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(pmtAmt)) | |
776 | - | let txId58 = toBase58String(transactionId) | |
777 | - | if ((lpId != toBase58String(pmtAssetId))) | |
778 | - | then throw("Wrong LP") | |
779 | - | else { | |
780 | - | let amBalance = getAccBalance(amId) | |
781 | - | let prBalance = getAccBalance(prId) | |
782 | - | let $t02999730108 = { | |
783 | - | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil) | |
784 | - | if ($isInstanceOf(@, "(Int, Int)")) | |
785 | - | then @ | |
786 | - | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
787 | - | } | |
788 | - | if (($t02999730108 == $t02999730108)) | |
789 | - | then { | |
790 | - | let feeAmount = $t02999730108._2 | |
791 | - | let totalGet = $t02999730108._1 | |
792 | - | let totalAmount = if (if ((minOutAmount > 0)) | |
793 | - | then (minOutAmount > totalGet) | |
794 | - | else false) | |
795 | - | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
796 | - | else totalGet | |
797 | - | let $t03029830605 = if ((outAssetId == amId)) | |
798 | - | then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance) | |
799 | - | else if ((outAssetId == prId)) | |
800 | - | then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount)) | |
801 | - | else throw("invalid out asset id") | |
802 | - | let outAm = $t03029830605._1 | |
803 | - | let outPr = $t03029830605._2 | |
804 | - | let amBalanceNew = $t03029830605._3 | |
805 | - | let prBalanceNew = $t03029830605._4 | |
806 | - | let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals)) | |
807 | - | let curPr = f1(curPrX18, scale8) | |
808 | - | let outAssetIdOrWaves = if ((outAssetId == "WAVES")) | |
809 | - | then unit | |
810 | - | else fromBase58String(outAssetId) | |
811 | - | let sendFeeToMatcher = if ((feeAmount > 0)) | |
812 | - | then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetIdOrWaves)] | |
813 | - | else nil | |
814 | - | let state = ([ScriptTransfer(userAddress, totalAmount, outAssetIdOrWaves), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAm, outPr, pmtAmt, curPr, height, lastBlock.timestamp)), IntegerEntry(pl(), curPr), IntegerEntry(ph(height, lastBlock.timestamp), curPr)] ++ sendFeeToMatcher) | |
815 | - | if ((state == state)) | |
775 | + | let currentDLp = calcCurrentDLp(big0, big0, big0) | |
776 | + | if ((currentDLp == currentDLp)) | |
777 | + | then { | |
778 | + | let txId58 = toBase58String(transactionId) | |
779 | + | if ((lpId != toBase58String(pmtAssetId))) | |
780 | + | then throw("Wrong LP") | |
781 | + | else { | |
782 | + | let amBalance = getAccBalance(amId) | |
783 | + | let prBalance = getAccBalance(prId) | |
784 | + | let $t02997130082 = { | |
785 | + | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil) | |
786 | + | if ($isInstanceOf(@, "(Int, Int)")) | |
787 | + | then @ | |
788 | + | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
789 | + | } | |
790 | + | if (($t02997130082 == $t02997130082)) | |
816 | 791 | then { | |
817 | - | let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
818 | - | if ((burn == burn)) | |
792 | + | let feeAmount = $t02997130082._2 | |
793 | + | let totalGet = $t02997130082._1 | |
794 | + | let totalAmount = if (if ((minOutAmount > 0)) | |
795 | + | then (minOutAmount > totalGet) | |
796 | + | else false) | |
797 | + | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
798 | + | else totalGet | |
799 | + | let $t03027230579 = if ((outAssetId == amId)) | |
800 | + | then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance) | |
801 | + | else if ((outAssetId == prId)) | |
802 | + | then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount)) | |
803 | + | else throw("invalid out asset id") | |
804 | + | let outAm = $t03027230579._1 | |
805 | + | let outPr = $t03027230579._2 | |
806 | + | let amBalanceNew = $t03027230579._3 | |
807 | + | let prBalanceNew = $t03027230579._4 | |
808 | + | let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals)) | |
809 | + | let curPr = f1(curPrX18, scale8) | |
810 | + | let outAssetIdOrWaves = if ((outAssetId == "WAVES")) | |
811 | + | then unit | |
812 | + | else fromBase58String(outAssetId) | |
813 | + | let sendFeeToMatcher = if ((feeAmount > 0)) | |
814 | + | then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetIdOrWaves)] | |
815 | + | else nil | |
816 | + | let state = ([ScriptTransfer(userAddress, totalAmount, outAssetIdOrWaves), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAm, outPr, pmtAmt, curPr, height, lastBlock.timestamp)), IntegerEntry(pl(), curPr), IntegerEntry(ph(height, lastBlock.timestamp), curPr)] ++ sendFeeToMatcher) | |
817 | + | if ((state == state)) | |
819 | 818 | then { | |
820 | - | let $t03139031740 = { | |
821 | - | let feeAmountForCalc = if ((this == feeCollectorAddress)) | |
822 | - | then 0 | |
823 | - | else feeAmount | |
824 | - | let outInAmountAsset = if ((parseAssetId(outAssetId) == cfgAmountAssetId)) | |
825 | - | then true | |
826 | - | else false | |
827 | - | if (outInAmountAsset) | |
828 | - | then $Tuple2(-((totalGet + feeAmountForCalc)), 0) | |
829 | - | else $Tuple2(0, -((totalGet + feeAmountForCalc))) | |
830 | - | } | |
831 | - | let amountAssetBalanceDelta = $t03139031740._1 | |
832 | - | let priceAssetBalanceDelta = $t03139031740._2 | |
833 | - | let $t03174331851 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
834 | - | let refreshDLpActions = $t03174331851._1 | |
835 | - | let updatedDLp = $t03174331851._2 | |
836 | - | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
837 | - | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
838 | - | then $Tuple2((state ++ refreshDLpActions), totalAmount) | |
819 | + | let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
820 | + | if ((burn == burn)) | |
821 | + | then { | |
822 | + | let $t03136431714 = { | |
823 | + | let feeAmountForCalc = if ((this == feeCollectorAddress)) | |
824 | + | then 0 | |
825 | + | else feeAmount | |
826 | + | let outInAmountAsset = if ((parseAssetId(outAssetId) == cfgAmountAssetId)) | |
827 | + | then true | |
828 | + | else false | |
829 | + | if (outInAmountAsset) | |
830 | + | then $Tuple2(-((totalGet + feeAmountForCalc)), 0) | |
831 | + | else $Tuple2(0, -((totalGet + feeAmountForCalc))) | |
832 | + | } | |
833 | + | let amountAssetBalanceDelta = $t03136431714._1 | |
834 | + | let priceAssetBalanceDelta = $t03136431714._2 | |
835 | + | let $t03171731825 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
836 | + | let refreshDLpActions = $t03171731825._1 | |
837 | + | let updatedDLp = $t03171731825._2 | |
838 | + | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
839 | + | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
840 | + | then $Tuple2((state ++ refreshDLpActions), totalAmount) | |
841 | + | else throw("Strict value is not equal to itself.") | |
842 | + | } | |
839 | 843 | else throw("Strict value is not equal to itself.") | |
840 | 844 | } | |
841 | 845 | else throw("Strict value is not equal to itself.") | |
842 | 846 | } | |
843 | 847 | else throw("Strict value is not equal to itself.") | |
844 | 848 | } | |
845 | - | else throw("Strict value is not equal to itself.") | |
846 | 849 | } | |
850 | + | else throw("Strict value is not equal to itself.") | |
847 | 851 | } | |
848 | 852 | ||
849 | 853 | ||
990 | 994 | else throw("Strict value is not equal to itself.") | |
991 | 995 | } | |
992 | 996 | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
993 | - | let $ | |
994 | - | let refreshDLpActions = $ | |
995 | - | let updatedDLp = $ | |
997 | + | let $t03568135746 = refreshDLpInternal(0, 0, 0) | |
998 | + | let refreshDLpActions = $t03568135746._1 | |
999 | + | let updatedDLp = $t03568135746._2 | |
996 | 1000 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
997 | 1001 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
998 | 1002 | then ((state ++ lpTrnsfr) ++ refreshDLpActions) | |
1048 | 1052 | let pmt = value(i.payments[0]) | |
1049 | 1053 | let pmtAssetId = toBase58String(value(pmt.assetId)) | |
1050 | 1054 | let pmtAmt = pmt.amount | |
1051 | - | let $ | |
1052 | - | if (($ | |
1055 | + | let $t03688337041 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true) | |
1056 | + | if (($t03688337041 == $t03688337041)) | |
1053 | 1057 | then { | |
1054 | - | let feeAmount = $ | |
1055 | - | let state = $ | |
1056 | - | let estimLP = $ | |
1058 | + | let feeAmount = $t03688337041._3 | |
1059 | + | let state = $t03688337041._2 | |
1060 | + | let estimLP = $t03688337041._1 | |
1057 | 1061 | let emitLpAmt = if (if ((minOutAmount > 0)) | |
1058 | 1062 | then (minOutAmount > estimLP) | |
1059 | 1063 | else false) | |
1081 | 1085 | let sendFeeToMatcher = if ((feeAmount > 0)) | |
1082 | 1086 | then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))] | |
1083 | 1087 | else nil | |
1084 | - | let $ | |
1088 | + | let $t03785638205 = if ((this == feeCollectorAddress)) | |
1085 | 1089 | then $Tuple2(0, 0) | |
1086 | 1090 | else { | |
1087 | 1091 | let paymentInAmountAsset = if ((pmt.assetId == cfgAmountAssetId)) | |
1091 | 1095 | then $Tuple2(-(feeAmount), 0) | |
1092 | 1096 | else $Tuple2(0, -(feeAmount)) | |
1093 | 1097 | } | |
1094 | - | let amountAssetBalanceDelta = $ | |
1095 | - | let priceAssetBalanceDelta = $ | |
1096 | - | let $ | |
1097 | - | let refreshDLpActions = $ | |
1098 | - | let updatedDLp = $ | |
1098 | + | let amountAssetBalanceDelta = $t03785638205._1 | |
1099 | + | let priceAssetBalanceDelta = $t03785638205._2 | |
1100 | + | let $t03820838316 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
1101 | + | let refreshDLpActions = $t03820838316._1 | |
1102 | + | let updatedDLp = $t03820838316._2 | |
1099 | 1103 | $Tuple2((((state ++ lpTrnsfr) ++ sendFeeToMatcher) ++ refreshDLpActions), emitLpAmt) | |
1100 | 1104 | } | |
1101 | 1105 | else throw("Strict value is not equal to itself.") | |
1122 | 1126 | let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0)) | |
1123 | 1127 | if ((currentDLp == currentDLp)) | |
1124 | 1128 | then { | |
1125 | - | let $ | |
1126 | - | let refreshDLpActions = $ | |
1127 | - | let updatedDLp = $ | |
1129 | + | let $t03927539340 = refreshDLpInternal(0, 0, 0) | |
1130 | + | let refreshDLpActions = $t03927539340._1 | |
1131 | + | let updatedDLp = $t03927539340._2 | |
1128 | 1132 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1129 | 1133 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1130 | 1134 | then (state ++ refreshDLpActions) | |
1147 | 1151 | if ((b == b)) | |
1148 | 1152 | then { | |
1149 | 1153 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(pmtAmt)) | |
1150 | - | let $ | |
1151 | - | let refreshDLpActions = $ | |
1152 | - | let updatedDLp = $ | |
1154 | + | let $t04012940211 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0) | |
1155 | + | let refreshDLpActions = $t04012940211._1 | |
1156 | + | let updatedDLp = $t04012940211._2 | |
1153 | 1157 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1154 | 1158 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1155 | 1159 | then (state ++ refreshDLpActions) | |
1182 | 1186 | else throwErr("exactly 1 payment are expected")] | |
1183 | 1187 | if ((checks == checks)) | |
1184 | 1188 | then { | |
1185 | - | let $ | |
1186 | - | let state = $ | |
1187 | - | let totalAmount = $ | |
1189 | + | let $t04082940984 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId) | |
1190 | + | let state = $t04082940984._1 | |
1191 | + | let totalAmount = $t04082940984._2 | |
1188 | 1192 | $Tuple2(state, totalAmount) | |
1189 | 1193 | } | |
1190 | 1194 | else throw("Strict value is not equal to itself.") | |
1201 | 1205 | if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight)) | |
1202 | 1206 | then { | |
1203 | 1207 | let dLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyDLp), "0")), fmtErr("invalid dLp")) | |
1204 | - | let $ | |
1205 | - | let dLpUpdateActions = $ | |
1206 | - | let updatedDLp = $ | |
1208 | + | let $t04150841572 = refreshDLpInternal(0, 0, 0) | |
1209 | + | let dLpUpdateActions = $t04150841572._1 | |
1210 | + | let updatedDLp = $t04150841572._2 | |
1207 | 1211 | let actions = if ((dLp != updatedDLp)) | |
1208 | 1212 | then dLpUpdateActions | |
1209 | 1213 | else throwErr("nothing to refresh") | |
1232 | 1236 | let newY = getYD(xp, index, D1) | |
1233 | 1237 | let dy = (xp[index] - newY) | |
1234 | 1238 | let totalGetRaw = max([0, toInt((dy - big1))]) | |
1235 | - | let $ | |
1236 | - | let totalGet = $ | |
1237 | - | let feeAmount = $ | |
1239 | + | let $t04247242521 = takeFee(totalGetRaw) | |
1240 | + | let totalGet = $t04247242521._1 | |
1241 | + | let feeAmount = $t04247242521._2 | |
1238 | 1242 | $Tuple2(nil, $Tuple2(totalGet, feeAmount)) | |
1239 | 1243 | } | |
1240 | 1244 | ||
1248 | 1252 | let lpId = poolConfig[idxLPAsId] | |
1249 | 1253 | let amBalance = getAccBalance(amId) | |
1250 | 1254 | let prBalance = getAccBalance(prId) | |
1251 | - | let $ | |
1255 | + | let $t04286642981 = { | |
1252 | 1256 | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil) | |
1253 | 1257 | if ($isInstanceOf(@, "(Int, Int)")) | |
1254 | 1258 | then @ | |
1255 | 1259 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
1256 | 1260 | } | |
1257 | - | let totalGet = $ | |
1258 | - | let feeAmount = $ | |
1261 | + | let totalGet = $t04286642981._1 | |
1262 | + | let feeAmount = $t04286642981._2 | |
1259 | 1263 | let r = ego("", lpId, lpAssetAmount, this) | |
1260 | 1264 | let outAmAmt = r._1 | |
1261 | 1265 | let outPrAmt = r._2 | |
1287 | 1291 | let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1288 | 1292 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1289 | 1293 | then { | |
1290 | - | let $ | |
1291 | - | let refreshDLpActions = $ | |
1292 | - | let updatedDLp = $ | |
1294 | + | let $t04414944230 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1295 | + | let refreshDLpActions = $t04414944230._1 | |
1296 | + | let updatedDLp = $t04414944230._2 | |
1293 | 1297 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1294 | 1298 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1295 | 1299 | then (state ++ refreshDLpActions) | |
1331 | 1335 | let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)]) | |
1332 | 1336 | if ((burnA == burnA)) | |
1333 | 1337 | then { | |
1334 | - | let $ | |
1335 | - | let refreshDLpActions = $ | |
1336 | - | let updatedDLp = $ | |
1338 | + | let $t04529345374 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1339 | + | let refreshDLpActions = $t04529345374._1 | |
1340 | + | let updatedDLp = $t04529345374._2 | |
1337 | 1341 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1338 | 1342 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1339 | 1343 | then (state ++ refreshDLpActions) | |
1380 | 1384 | let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)]) | |
1381 | 1385 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1382 | 1386 | then { | |
1383 | - | let $ | |
1384 | - | let refreshDLpActions = $ | |
1385 | - | let updatedDLp = $ | |
1387 | + | let $t04662246703 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1388 | + | let refreshDLpActions = $t04662246703._1 | |
1389 | + | let updatedDLp = $t04662246703._2 | |
1386 | 1390 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1387 | 1391 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1388 | 1392 | then (state ++ refreshDLpActions) | |
1428 | 1432 | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), unstakeAmount], nil) | |
1429 | 1433 | if ((unstakeInv == unstakeInv)) | |
1430 | 1434 | then { | |
1431 | - | let $ | |
1432 | - | let state = $ | |
1433 | - | let totalAmount = $ | |
1435 | + | let $t04763747825 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId) | |
1436 | + | let state = $t04763747825._1 | |
1437 | + | let totalAmount = $t04763747825._2 | |
1434 | 1438 | $Tuple2(state, totalAmount) | |
1435 | 1439 | } | |
1436 | 1440 | else throw("Strict value is not equal to itself.") | |
1446 | 1450 | let amId = poolConfig[idxAmAsId] | |
1447 | 1451 | let prId = poolConfig[idxPrAsId] | |
1448 | 1452 | let lpId = poolConfig[idxLPAsId] | |
1449 | - | let $ | |
1450 | - | let lpAmount = $ | |
1451 | - | let state = $ | |
1452 | - | let feeAmount = $ | |
1453 | - | let bonus = $ | |
1453 | + | let $t04808448187 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true) | |
1454 | + | let lpAmount = $t04808448187._1 | |
1455 | + | let state = $t04808448187._2 | |
1456 | + | let feeAmount = $t04808448187._3 | |
1457 | + | let bonus = $t04808448187._4 | |
1454 | 1458 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1455 | 1459 | } | |
1456 | 1460 | ||
1462 | 1466 | let amId = poolConfig[idxAmAsId] | |
1463 | 1467 | let prId = poolConfig[idxPrAsId] | |
1464 | 1468 | let lpId = poolConfig[idxLPAsId] | |
1465 | - | let $ | |
1466 | - | let lpAmount = $ | |
1467 | - | let state = $ | |
1468 | - | let feeAmount = $ | |
1469 | - | let bonus = $ | |
1469 | + | let $t04846648570 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false) | |
1470 | + | let lpAmount = $t04846648570._1 | |
1471 | + | let state = $t04846648570._2 | |
1472 | + | let feeAmount = $t04846648570._3 | |
1473 | + | let bonus = $t04846648570._4 | |
1470 | 1474 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1471 | 1475 | } | |
1472 | 1476 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let scale8 = 100000000 | |
5 | 5 | ||
6 | 6 | let scale8BigInt = toBigInt(100000000) | |
7 | 7 | ||
8 | 8 | let scale18 = toBigInt(1000000000000000000) | |
9 | 9 | ||
10 | 10 | let zeroBigInt = toBigInt(0) | |
11 | 11 | ||
12 | 12 | let big0 = toBigInt(0) | |
13 | 13 | ||
14 | 14 | let big1 = toBigInt(1) | |
15 | 15 | ||
16 | 16 | let big2 = toBigInt(2) | |
17 | 17 | ||
18 | 18 | let big3 = toBigInt(3) | |
19 | 19 | ||
20 | 20 | let big4 = toBigInt(4) | |
21 | 21 | ||
22 | 22 | let slippage4D = toBigInt((scale8 - ((scale8 * 1) / scale8))) | |
23 | 23 | ||
24 | 24 | let wavesString = "WAVES" | |
25 | 25 | ||
26 | 26 | let Amult = "100" | |
27 | 27 | ||
28 | 28 | let Dconv = "1" | |
29 | 29 | ||
30 | 30 | let SEP = "__" | |
31 | 31 | ||
32 | 32 | let EMPTY = "" | |
33 | 33 | ||
34 | 34 | let PoolActive = 1 | |
35 | 35 | ||
36 | 36 | let PoolPutDis = 2 | |
37 | 37 | ||
38 | 38 | let PoolMatcherDis = 3 | |
39 | 39 | ||
40 | 40 | let PoolShutdown = 4 | |
41 | 41 | ||
42 | 42 | let idxPoolAddress = 1 | |
43 | 43 | ||
44 | 44 | let idxPoolSt = 2 | |
45 | 45 | ||
46 | 46 | let idxLPAsId = 3 | |
47 | 47 | ||
48 | 48 | let idxAmAsId = 4 | |
49 | 49 | ||
50 | 50 | let idxPrAsId = 5 | |
51 | 51 | ||
52 | 52 | let idxAmtAsDcm = 6 | |
53 | 53 | ||
54 | 54 | let idxPriceAsDcm = 7 | |
55 | 55 | ||
56 | 56 | let idxIAmtAsId = 8 | |
57 | 57 | ||
58 | 58 | let idxIPriceAsId = 9 | |
59 | 59 | ||
60 | 60 | let idxFactStakCntr = 1 | |
61 | 61 | ||
62 | 62 | let idxFactoryRestCntr = 6 | |
63 | 63 | ||
64 | 64 | let idxFactSlippCntr = 7 | |
65 | 65 | ||
66 | 66 | let idxFactGwxRewCntr = 10 | |
67 | 67 | ||
68 | 68 | let feeDefault = fraction(10, scale8, 10000) | |
69 | 69 | ||
70 | 70 | func t1 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult)) | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func f1 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18)) | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func ts (amt,resScale,curScale) = fraction(amt, resScale, curScale) | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func abs (val) = if ((zeroBigInt > val)) | |
80 | 80 | then -(val) | |
81 | 81 | else val | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func absBigInt (val) = if ((zeroBigInt > val)) | |
85 | 85 | then -(val) | |
86 | 86 | else val | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | func fc () = "%s__factoryContract" | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | func mpk () = "%s__managerPublicKey" | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func pmpk () = "%s__pendingManagerPublicKey" | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | func pl () = "%s%s__price__last" | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func ph (h,t) = makeString(["%s%s%d%d__price__history", toString(h), toString(t)], SEP) | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | func pau (ua,txId) = ((("%s%s%s__P__" + ua) + "__") + txId) | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | func gau (ua,txId) = ((("%s%s%s__G__" + ua) + "__") + txId) | |
108 | 108 | ||
109 | 109 | ||
110 | 110 | func aa () = "%s__amountAsset" | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | func pa () = "%s__priceAsset" | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | func amp () = "%s__amp" | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func ada () = "%s__addonAddr" | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | let keyFee = "%s__fee" | |
123 | 123 | ||
124 | 124 | let fee = valueOrElse(getInteger(this, keyFee), feeDefault) | |
125 | 125 | ||
126 | 126 | let keyDLp = makeString(["%s", "dLp"], SEP) | |
127 | 127 | ||
128 | 128 | let keyDLpRefreshedHeight = makeString(["%s", "dLpRefreshedHeight"], SEP) | |
129 | 129 | ||
130 | 130 | let keyDLpRefreshDelay = makeString(["%s", "refreshDLpDelay"], SEP) | |
131 | 131 | ||
132 | 132 | let dLpRefreshDelayDefault = 1 | |
133 | 133 | ||
134 | 134 | let dLpRefreshDelay = valueOrElse(getInteger(this, keyDLpRefreshDelay), dLpRefreshDelayDefault) | |
135 | 135 | ||
136 | 136 | func fcfg () = "%s__factoryConfig" | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | func mtpk () = "%s%s__matcher__publicKey" | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func pc (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config") | |
143 | 143 | ||
144 | 144 | ||
145 | 145 | func mba (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr) | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | func aps () = "%s__shutdown" | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func keyAllowedLpStableScriptHash () = "%s__allowedLpStableScriptHash" | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func keyFeeCollectorAddress () = "%s__feeCollectorAddress" | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | func toe (orV,sendrV,matchV) = throw(((((("Failed: ordValid=" + toString(orV)) + " sndrValid=") + toString(sendrV)) + " mtchrValid=") + toString(matchV))) | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | func str (val) = match val { | |
161 | 161 | case valStr: String => | |
162 | 162 | valStr | |
163 | 163 | case _ => | |
164 | 164 | throw("fail cast to String") | |
165 | 165 | } | |
166 | 166 | ||
167 | 167 | ||
168 | 168 | func strf (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], "")) | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | func intf (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], "")) | |
172 | 172 | ||
173 | 173 | ||
174 | 174 | func throwErr (msg) = throw(makeString(["lp_stable.ride:", msg], " ")) | |
175 | 175 | ||
176 | 176 | ||
177 | 177 | func fmtErr (msg) = makeString(["lp_stable.ride:", msg], " ") | |
178 | 178 | ||
179 | 179 | ||
180 | 180 | let fca = addressFromStringValue(strf(this, fc())) | |
181 | 181 | ||
182 | 182 | let A = strf(this, amp()) | |
183 | 183 | ||
184 | 184 | func igs () = valueOrElse(getBoolean(fca, aps()), false) | |
185 | 185 | ||
186 | 186 | ||
187 | 187 | func mp () = fromBase58String(strf(fca, mtpk())) | |
188 | 188 | ||
189 | 189 | ||
190 | 190 | let feeCollectorAddress = addressFromStringValue(strf(fca, keyFeeCollectorAddress())) | |
191 | 191 | ||
192 | 192 | func gpc () = { | |
193 | 193 | let amtAs = strf(this, aa()) | |
194 | 194 | let priceAs = strf(this, pa()) | |
195 | 195 | let iPriceAs = intf(fca, mba(priceAs)) | |
196 | 196 | let iAmtAs = intf(fca, mba(amtAs)) | |
197 | 197 | split(strf(fca, pc(toString(iAmtAs), toString(iPriceAs))), SEP) | |
198 | 198 | } | |
199 | 199 | ||
200 | 200 | ||
201 | 201 | func parseAssetId (input) = if ((input == wavesString)) | |
202 | 202 | then unit | |
203 | 203 | else fromBase58String(input) | |
204 | 204 | ||
205 | 205 | ||
206 | 206 | func assetIdToString (input) = if ((input == unit)) | |
207 | 207 | then wavesString | |
208 | 208 | else toBase58String(value(input)) | |
209 | 209 | ||
210 | 210 | ||
211 | 211 | func parsePoolConfig (poolConfig) = $Tuple7(addressFromStringValue(poolConfig[idxPoolAddress]), parseIntValue(poolConfig[idxPoolSt]), fromBase58String(poolConfig[idxLPAsId]), parseAssetId(poolConfig[idxAmAsId]), parseAssetId(poolConfig[idxPrAsId]), parseIntValue(poolConfig[idxAmtAsDcm]), parseIntValue(poolConfig[idxPriceAsDcm])) | |
212 | 212 | ||
213 | 213 | ||
214 | 214 | let poolConfigParsed = parsePoolConfig(gpc()) | |
215 | 215 | ||
216 | 216 | let $t072557441 = poolConfigParsed | |
217 | 217 | ||
218 | 218 | let cfgPoolAddress = $t072557441._1 | |
219 | 219 | ||
220 | 220 | let cfgPoolStatus = $t072557441._2 | |
221 | 221 | ||
222 | 222 | let cfgLpAssetId = $t072557441._3 | |
223 | 223 | ||
224 | 224 | let cfgAmountAssetId = $t072557441._4 | |
225 | 225 | ||
226 | 226 | let cfgPriceAssetId = $t072557441._5 | |
227 | 227 | ||
228 | 228 | let cfgAmountAssetDecimals = $t072557441._6 | |
229 | 229 | ||
230 | 230 | let cfgPriceAssetDecimals = $t072557441._7 | |
231 | 231 | ||
232 | 232 | func gfc () = split(strf(fca, fcfg()), SEP) | |
233 | 233 | ||
234 | 234 | ||
235 | 235 | let factoryConfig = gfc() | |
236 | 236 | ||
237 | 237 | let stakingContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactStakCntr]), "Invalid staking contract address") | |
238 | 238 | ||
239 | 239 | let slipageContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactSlippCntr]), "Invalid slipage contract address") | |
240 | 240 | ||
241 | 241 | let gwxContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactGwxRewCntr]), "Invalid gwx contract address") | |
242 | 242 | ||
243 | 243 | let restContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactoryRestCntr]), "Invalid gwx contract address") | |
244 | 244 | ||
245 | 245 | func dataPutActionInfo (inAmtAssetAmt,inPriceAssetAmt,outLpAmt,price,slipByUser,slippageReal,txHeight,txTimestamp,slipageAmAmt,slipagePrAmt) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(inAmtAssetAmt), toString(inPriceAssetAmt), toString(outLpAmt), toString(price), toString(slipByUser), toString(slippageReal), toString(txHeight), toString(txTimestamp), toString(slipageAmAmt), toString(slipagePrAmt)], SEP) | |
246 | 246 | ||
247 | 247 | ||
248 | 248 | func dataGetActionInfo (outAmtAssetAmt,outPriceAssetAmt,inLpAmt,price,txHeight,txTimestamp) = makeString(["%d%d%d%d%d%d", toString(outAmtAssetAmt), toString(outPriceAssetAmt), toString(inLpAmt), toString(price), toString(txHeight), toString(txTimestamp)], SEP) | |
249 | 249 | ||
250 | 250 | ||
251 | 251 | func getAccBalance (assetId) = if ((assetId == "WAVES")) | |
252 | 252 | then wavesBalance(this).available | |
253 | 253 | else assetBalance(this, fromBase58String(assetId)) | |
254 | 254 | ||
255 | 255 | ||
256 | 256 | func cpbi (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18) | |
257 | 257 | ||
258 | 258 | ||
259 | 259 | func vad (A1,A2,slippage) = { | |
260 | 260 | let diff = fraction((A1 - A2), scale8BigInt, A2) | |
261 | 261 | let pass = ((slippage - abs(diff)) > zeroBigInt) | |
262 | 262 | if (!(pass)) | |
263 | 263 | then throw(("Big slpg: " + toString(diff))) | |
264 | 264 | else $Tuple2(pass, min([A1, A2])) | |
265 | 265 | } | |
266 | 266 | ||
267 | 267 | ||
268 | 268 | func vd (D1,D0,slpg) = { | |
269 | 269 | let diff = fraction(D0, scale8BigInt, D1) | |
270 | 270 | let fail = (slpg > diff) | |
271 | 271 | if (if (fail) | |
272 | 272 | then true | |
273 | 273 | else (D0 > D1)) | |
274 | 274 | then throw(((((((toString(D0) + " ") + toString(D1)) + " ") + toString(diff)) + " ") + toString(slpg))) | |
275 | 275 | else fail | |
276 | 276 | } | |
277 | 277 | ||
278 | 278 | ||
279 | 279 | func pcp (amAssetDcm,prAssetDcm,amAmt,prAmt) = { | |
280 | 280 | let amtAsAmtX18 = t1(amAmt, amAssetDcm) | |
281 | 281 | let prAsAmtX18 = t1(prAmt, prAssetDcm) | |
282 | 282 | cpbi(prAsAmtX18, amtAsAmtX18) | |
283 | 283 | } | |
284 | 284 | ||
285 | 285 | ||
286 | 286 | func calcPrices (amAmt,prAmt,lpAmt) = { | |
287 | 287 | let cfg = gpc() | |
288 | 288 | let amtAsDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
289 | 289 | let prAsDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
290 | 290 | let priceX18 = pcp(amtAsDcm, prAsDcm, amAmt, prAmt) | |
291 | 291 | let amAmtX18 = t1(amAmt, amtAsDcm) | |
292 | 292 | let prAmtX18 = t1(prAmt, prAsDcm) | |
293 | 293 | let lpAmtX18 = t1(lpAmt, scale8) | |
294 | 294 | let lpPrInAmAsX18 = cpbi(amAmtX18, lpAmtX18) | |
295 | 295 | let lpPrInPrAsX18 = cpbi(prAmtX18, lpAmtX18) | |
296 | 296 | [priceX18, lpPrInAmAsX18, lpPrInPrAsX18] | |
297 | 297 | } | |
298 | 298 | ||
299 | 299 | ||
300 | 300 | func calculatePrices (amAmt,prAmt,lpAmt) = { | |
301 | 301 | let p = calcPrices(amAmt, prAmt, lpAmt) | |
302 | 302 | [f1(p[0], scale8), f1(p[1], scale8), f1(p[2], scale8)] | |
303 | 303 | } | |
304 | 304 | ||
305 | 305 | ||
306 | 306 | func takeFee (amount) = { | |
307 | 307 | let feeAmount = fraction(amount, fee, scale8) | |
308 | 308 | $Tuple2((amount - feeAmount), feeAmount) | |
309 | 309 | } | |
310 | 310 | ||
311 | 311 | ||
312 | 312 | func ego (txId58,pmtAssetId,pmtLpAmt,userAddress) = { | |
313 | 313 | let cfg = gpc() | |
314 | 314 | let lpId = cfg[idxLPAsId] | |
315 | 315 | let amId = cfg[idxAmAsId] | |
316 | 316 | let prId = cfg[idxPrAsId] | |
317 | 317 | let amDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
318 | 318 | let prDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
319 | 319 | let sts = cfg[idxPoolSt] | |
320 | 320 | let lpEmiss = valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "Wrong LP id").quantity | |
321 | 321 | if ((lpId != pmtAssetId)) | |
322 | 322 | then throw("Wrong pmt asset") | |
323 | 323 | else { | |
324 | 324 | let amBalance = getAccBalance(amId) | |
325 | 325 | let amBalanceX18 = t1(amBalance, amDcm) | |
326 | 326 | let prBalance = getAccBalance(prId) | |
327 | 327 | let prBalanceX18 = t1(prBalance, prDcm) | |
328 | 328 | let curPriceX18 = cpbi(prBalanceX18, amBalanceX18) | |
329 | 329 | let curPrice = f1(curPriceX18, scale8) | |
330 | 330 | let pmtLpAmtX18 = t1(pmtLpAmt, scale8) | |
331 | 331 | let lpEmissX18 = t1(lpEmiss, scale8) | |
332 | 332 | let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissX18) | |
333 | 333 | let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissX18) | |
334 | 334 | let outAmAmt = f1(outAmAmtX18, amDcm) | |
335 | 335 | let outPrAmt = f1(outPrAmtX18, prDcm) | |
336 | 336 | let state = if ((txId58 == "")) | |
337 | 337 | then nil | |
338 | 338 | else [ScriptTransfer(userAddress, outAmAmt, if ((amId == "WAVES")) | |
339 | 339 | then unit | |
340 | 340 | else fromBase58String(amId)), ScriptTransfer(userAddress, outPrAmt, if ((prId == "WAVES")) | |
341 | 341 | then unit | |
342 | 342 | else fromBase58String(prId)), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAmAmt, outPrAmt, pmtLpAmt, curPrice, height, lastBlock.timestamp)), IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice)] | |
343 | 343 | $Tuple10(outAmAmt, outPrAmt, amId, prId, amBalance, prBalance, lpEmiss, curPriceX18, sts, state) | |
344 | 344 | } | |
345 | 345 | } | |
346 | 346 | ||
347 | 347 | ||
348 | 348 | func epo (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEval,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = { | |
349 | 349 | let cfg = gpc() | |
350 | 350 | let lpId = fromBase58String(cfg[idxLPAsId]) | |
351 | 351 | let amIdStr = cfg[idxAmAsId] | |
352 | 352 | let prIdStr = cfg[idxPrAsId] | |
353 | 353 | let inAmIdStr = cfg[idxIAmtAsId] | |
354 | 354 | let inPrIdStr = cfg[idxIPriceAsId] | |
355 | 355 | let amtDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
356 | 356 | let priceDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
357 | 357 | let sts = cfg[idxPoolSt] | |
358 | 358 | let lpEm = valueOrErrorMessage(assetInfo(lpId), "Wr lp as").quantity | |
359 | 359 | let amBalance = if (isEval) | |
360 | 360 | then getAccBalance(amIdStr) | |
361 | 361 | else if (if (isOneAsset) | |
362 | 362 | then (pmtId == amIdStr) | |
363 | 363 | else false) | |
364 | 364 | then (getAccBalance(amIdStr) - pmtAmt) | |
365 | 365 | else if (isOneAsset) | |
366 | 366 | then getAccBalance(amIdStr) | |
367 | 367 | else (getAccBalance(amIdStr) - inAmAmt) | |
368 | 368 | let prBalance = if (isEval) | |
369 | 369 | then getAccBalance(prIdStr) | |
370 | 370 | else if (if (isOneAsset) | |
371 | 371 | then (pmtId == prIdStr) | |
372 | 372 | else false) | |
373 | 373 | then (getAccBalance(prIdStr) - pmtAmt) | |
374 | 374 | else if (isOneAsset) | |
375 | 375 | then getAccBalance(prIdStr) | |
376 | 376 | else (getAccBalance(prIdStr) - inPrAmt) | |
377 | 377 | let inAmAssetAmtX18 = t1(inAmAmt, amtDcm) | |
378 | 378 | let inPrAssetAmtX18 = t1(inPrAmt, priceDcm) | |
379 | 379 | let userPriceX18 = cpbi(inPrAssetAmtX18, inAmAssetAmtX18) | |
380 | 380 | let amBalanceX18 = t1(amBalance, amtDcm) | |
381 | 381 | let prBalanceX18 = t1(prBalance, priceDcm) | |
382 | 382 | let r = if ((lpEm == 0)) | |
383 | 383 | then { | |
384 | 384 | let curPriceX18 = zeroBigInt | |
385 | 385 | let slippageX18 = zeroBigInt | |
386 | 386 | let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN) | |
387 | 387 | $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18) | |
388 | 388 | } | |
389 | 389 | else { | |
390 | 390 | let curPriceX18 = cpbi(prBalanceX18, amBalanceX18) | |
391 | 391 | let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18) | |
392 | 392 | let slippageX18 = t1(slippage, scale8) | |
393 | 393 | if (if (if (validateSlippage) | |
394 | 394 | then (curPriceX18 != zeroBigInt) | |
395 | 395 | else false) | |
396 | 396 | then (slippageRealX18 > slippageX18) | |
397 | 397 | else false) | |
398 | 398 | then throw(((("Price slippage " + toString(slippageRealX18)) + " > ") + toString(slippageX18))) | |
399 | 399 | else { | |
400 | 400 | let lpEmissionX18 = t1(lpEm, scale8) | |
401 | 401 | let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18) | |
402 | 402 | let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18) | |
403 | 403 | let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18)) | |
404 | 404 | then $Tuple2(amViaPrX18, inPrAssetAmtX18) | |
405 | 405 | else $Tuple2(inAmAssetAmtX18, prViaAmX18) | |
406 | 406 | let expAmtAssetAmtX18 = expectedAmts._1 | |
407 | 407 | let expPriceAssetAmtX18 = expectedAmts._2 | |
408 | 408 | let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18) | |
409 | 409 | $Tuple5(f1(lpAmtX18, scale8), f1(expAmtAssetAmtX18, amtDcm), f1(expPriceAssetAmtX18, priceDcm), curPriceX18, slippageX18) | |
410 | 410 | } | |
411 | 411 | } | |
412 | 412 | let calcLpAmt = r._1 | |
413 | 413 | let calcAmAssetPmt = r._2 | |
414 | 414 | let calcPrAssetPmt = r._3 | |
415 | 415 | let curPrice = f1(r._4, scale8) | |
416 | 416 | let slippageCalc = f1(r._5, scale8) | |
417 | 417 | if ((0 >= calcLpAmt)) | |
418 | 418 | then throw("LP <= 0") | |
419 | 419 | else { | |
420 | 420 | let emitLpAmt = if (!(emitLp)) | |
421 | 421 | then 0 | |
422 | 422 | else calcLpAmt | |
423 | 423 | let amDiff = (inAmAmt - calcAmAssetPmt) | |
424 | 424 | let prDiff = (inPrAmt - calcPrAssetPmt) | |
425 | 425 | let $t01787218217 = if (if (isOneAsset) | |
426 | 426 | then (pmtId == amIdStr) | |
427 | 427 | else false) | |
428 | 428 | then $Tuple2(pmtAmt, 0) | |
429 | 429 | else if (if (isOneAsset) | |
430 | 430 | then (pmtId == prIdStr) | |
431 | 431 | else false) | |
432 | 432 | then $Tuple2(0, pmtAmt) | |
433 | 433 | else $Tuple2(calcAmAssetPmt, calcPrAssetPmt) | |
434 | 434 | let writeAmAmt = $t01787218217._1 | |
435 | 435 | let writePrAmt = $t01787218217._2 | |
436 | 436 | let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId58), dataPutActionInfo(writeAmAmt, writePrAmt, emitLpAmt, curPrice, slippage, slippageCalc, height, lastBlock.timestamp, amDiff, prDiff))] | |
437 | 437 | $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId) | |
438 | 438 | } | |
439 | 439 | } | |
440 | 440 | ||
441 | 441 | ||
442 | 442 | func getD (xp) = { | |
443 | 443 | let xp0 = xp[0] | |
444 | 444 | let xp1 = xp[1] | |
445 | 445 | let s = (xp0 + xp1) | |
446 | 446 | if ((s == big0)) | |
447 | 447 | then big0 | |
448 | 448 | else { | |
449 | 449 | let a = parseIntValue(A) | |
450 | 450 | let ann = (a * 2) | |
451 | 451 | let p = fraction(xp0, xp1, big1) | |
452 | 452 | let xp0_xp1_n_n = fraction(p, big4, big1) | |
453 | 453 | let ann_s = fraction(toBigInt(ann), s, big1) | |
454 | 454 | let ann_1 = toBigInt((ann - 1)) | |
455 | 455 | func calcDNext (d) = { | |
456 | 456 | let dd = fraction(d, d, big1) | |
457 | 457 | let ddd = fraction(dd, d, big1) | |
458 | 458 | let dp = fraction(ddd, big1, xp0_xp1_n_n) | |
459 | 459 | fraction((ann_s + fraction(dp, big2, big1)), d, (fraction(ann_1, d, big1) + fraction(big3, dp, big1))) | |
460 | 460 | } | |
461 | 461 | ||
462 | 462 | func calc (acc,i) = if (acc._2) | |
463 | 463 | then acc | |
464 | 464 | else { | |
465 | 465 | let d = acc._1 | |
466 | 466 | let dNext = calcDNext(d) | |
467 | 467 | let dDiffRaw = toInt((dNext - value(d))) | |
468 | 468 | let dDiff = if ((0 > dDiffRaw)) | |
469 | 469 | then -(dDiffRaw) | |
470 | 470 | else dDiffRaw | |
471 | 471 | if ((1 >= dDiff)) | |
472 | 472 | then $Tuple2(dNext, true) | |
473 | 473 | else $Tuple2(dNext, false) | |
474 | 474 | } | |
475 | 475 | ||
476 | 476 | let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
477 | 477 | let $t02012820176 = { | |
478 | 478 | let $l = arr | |
479 | 479 | let $s = size($l) | |
480 | 480 | let $acc0 = $Tuple2(s, false) | |
481 | 481 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
482 | 482 | then $a | |
483 | 483 | else calc($a, $l[$i]) | |
484 | 484 | ||
485 | 485 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
486 | 486 | then $a | |
487 | 487 | else throw("List size exceeds 15") | |
488 | 488 | ||
489 | 489 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
490 | 490 | } | |
491 | 491 | let d = $t02012820176._1 | |
492 | 492 | let found = $t02012820176._2 | |
493 | 493 | if (found) | |
494 | 494 | then d | |
495 | 495 | else throw(("D calculation error, D = " + toString(d))) | |
496 | 496 | } | |
497 | 497 | } | |
498 | 498 | ||
499 | 499 | ||
500 | 500 | func getDOld (xp) = { | |
501 | 501 | let n = big2 | |
502 | 502 | let xp0 = xp[0] | |
503 | 503 | let xp1 = xp[1] | |
504 | 504 | let aPrecision = parseBigIntValue(Amult) | |
505 | 505 | let a = (parseBigIntValue(A) * aPrecision) | |
506 | 506 | let s = (xp0 + xp1) | |
507 | 507 | if ((s == big0)) | |
508 | 508 | then big0 | |
509 | 509 | else { | |
510 | 510 | let ann = (a * n) | |
511 | 511 | let xp0_xp1_n_n = (((xp0 * xp1) * n) * n) | |
512 | 512 | let ann_s_aPrecision = ((ann * s) / aPrecision) | |
513 | 513 | let ann_aPrecision = (ann - aPrecision) | |
514 | 514 | let n1 = (n + big1) | |
515 | 515 | func calc (acc,cur) = { | |
516 | 516 | let $t02080520825 = acc | |
517 | 517 | let d = $t02080520825._1 | |
518 | 518 | let found = $t02080520825._2 | |
519 | 519 | if ((found != unit)) | |
520 | 520 | then acc | |
521 | 521 | else { | |
522 | 522 | let dp = (((d * d) * d) / xp0_xp1_n_n) | |
523 | 523 | let dNext = (((ann_s_aPrecision + (dp * n)) * d) / (((ann_aPrecision * d) / aPrecision) + (n1 * dp))) | |
524 | 524 | let dDiff = absBigInt((dNext - value(d))) | |
525 | 525 | if ((big1 >= dDiff)) | |
526 | 526 | then $Tuple2(dNext, cur) | |
527 | 527 | else $Tuple2(dNext, unit) | |
528 | 528 | } | |
529 | 529 | } | |
530 | 530 | ||
531 | 531 | let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
532 | 532 | let $t02124621293 = { | |
533 | 533 | let $l = arr | |
534 | 534 | let $s = size($l) | |
535 | 535 | let $acc0 = $Tuple2(s, unit) | |
536 | 536 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
537 | 537 | then $a | |
538 | 538 | else calc($a, $l[$i]) | |
539 | 539 | ||
540 | 540 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
541 | 541 | then $a | |
542 | 542 | else throw("List size exceeds 15") | |
543 | 543 | ||
544 | 544 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
545 | 545 | } | |
546 | 546 | let d = $t02124621293._1 | |
547 | 547 | let found = $t02124621293._2 | |
548 | 548 | if ((found != unit)) | |
549 | 549 | then d | |
550 | 550 | else throw(("D calculation error, D = " + toString(d))) | |
551 | 551 | } | |
552 | 552 | } | |
553 | 553 | ||
554 | 554 | ||
555 | 555 | func getYD (xp,i,D) = { | |
556 | 556 | let n = big2 | |
557 | 557 | let x = xp[if ((i == 0)) | |
558 | 558 | then 1 | |
559 | 559 | else 0] | |
560 | 560 | let aPrecision = parseBigIntValue(Amult) | |
561 | 561 | let a = (parseBigIntValue(A) * aPrecision) | |
562 | 562 | let s = x | |
563 | 563 | let ann = (a * n) | |
564 | 564 | let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n)) | |
565 | 565 | let b = ((s + ((D * aPrecision) / ann)) - D) | |
566 | 566 | func calc (acc,cur) = { | |
567 | 567 | let $t02179321813 = acc | |
568 | 568 | let y = $t02179321813._1 | |
569 | 569 | let found = $t02179321813._2 | |
570 | 570 | if ((found != unit)) | |
571 | 571 | then acc | |
572 | 572 | else { | |
573 | 573 | let yNext = (((y * y) + c) / ((big2 * y) + b)) | |
574 | 574 | let yDiff = absBigInt((yNext - value(y))) | |
575 | 575 | if ((big1 >= yDiff)) | |
576 | 576 | then $Tuple2(yNext, cur) | |
577 | 577 | else $Tuple2(yNext, unit) | |
578 | 578 | } | |
579 | 579 | } | |
580 | 580 | ||
581 | 581 | let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
582 | 582 | let $t02212022167 = { | |
583 | 583 | let $l = arr | |
584 | 584 | let $s = size($l) | |
585 | 585 | let $acc0 = $Tuple2(D, unit) | |
586 | 586 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
587 | 587 | then $a | |
588 | 588 | else calc($a, $l[$i]) | |
589 | 589 | ||
590 | 590 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
591 | 591 | then $a | |
592 | 592 | else throw("List size exceeds 15") | |
593 | 593 | ||
594 | 594 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
595 | 595 | } | |
596 | 596 | let y = $t02212022167._1 | |
597 | 597 | let found = $t02212022167._2 | |
598 | 598 | if ((found != unit)) | |
599 | 599 | then y | |
600 | 600 | else throw(("Y calculation error, Y = " + toString(y))) | |
601 | 601 | } | |
602 | 602 | ||
603 | 603 | ||
604 | 604 | func calcDLp (amountBalance,priceBalance,lpEmission) = { | |
605 | 605 | let updatedDLp = fraction(getD([amountBalance, priceBalance]), scale18, lpEmission) | |
606 | 606 | updatedDLp | |
607 | 607 | } | |
608 | 608 | ||
609 | 609 | ||
610 | 610 | func calcCurrentDLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = { | |
611 | 611 | let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta) | |
612 | 612 | let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta) | |
613 | 613 | let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta) | |
614 | 614 | let currentDLp = calcDLp(amountAssetBalance, priceAssetBalance, lpAssetEmission) | |
615 | 615 | currentDLp | |
616 | 616 | } | |
617 | 617 | ||
618 | 618 | ||
619 | 619 | func refreshDLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = { | |
620 | 620 | let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta) | |
621 | 621 | let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta) | |
622 | 622 | let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta) | |
623 | 623 | let updatedDLp = calcDLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission)) | |
624 | 624 | let actions = [IntegerEntry(keyDLpRefreshedHeight, height), StringEntry(keyDLp, toString(updatedDLp))] | |
625 | 625 | $Tuple2(actions, updatedDLp) | |
626 | 626 | } | |
627 | 627 | ||
628 | 628 | ||
629 | 629 | func validateUpdatedDLp (oldDLp,updatedDLp) = if ((updatedDLp >= oldDLp)) | |
630 | 630 | then true | |
631 | 631 | else throwErr("updated DLp lower than current DLp") | |
632 | 632 | ||
633 | 633 | ||
634 | 634 | func validateMatcherOrderAllowed (order) = { | |
635 | 635 | let amountAssetAmount = order.amount | |
636 | 636 | let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR) | |
637 | 637 | let $t02406724279 = if ((order.orderType == Buy)) | |
638 | 638 | then $Tuple2(amountAssetAmount, -(priceAssetAmount)) | |
639 | 639 | else $Tuple2(-(amountAssetAmount), priceAssetAmount) | |
640 | 640 | let amountAssetBalanceDelta = $t02406724279._1 | |
641 | 641 | let priceAssetBalanceDelta = $t02406724279._2 | |
642 | 642 | if (if (if (igs()) | |
643 | 643 | then true | |
644 | 644 | else (cfgPoolStatus == PoolMatcherDis)) | |
645 | 645 | then true | |
646 | 646 | else (cfgPoolStatus == PoolShutdown)) | |
647 | 647 | then throw("Admin blocked") | |
648 | 648 | else if (if ((order.assetPair.amountAsset != cfgAmountAssetId)) | |
649 | 649 | then true | |
650 | 650 | else (order.assetPair.priceAsset != cfgPriceAssetId)) | |
651 | 651 | then throw("Wr assets") | |
652 | 652 | else { | |
653 | 653 | let dLp = parseBigIntValue(getStringValue(this, keyDLp)) | |
654 | 654 | let $t02460924709 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
655 | 655 | let unusedActions = $t02460924709._1 | |
656 | 656 | let dLpNew = $t02460924709._2 | |
657 | 657 | let isOrderValid = (dLpNew >= dLp) | |
658 | 658 | isOrderValid | |
659 | 659 | } | |
660 | 660 | } | |
661 | 661 | ||
662 | 662 | ||
663 | 663 | func cg (i) = if ((size(i.payments) != 1)) | |
664 | 664 | then throw("1 pmnt exp") | |
665 | 665 | else { | |
666 | 666 | let pmt = value(i.payments[0]) | |
667 | 667 | let pmtAssetId = value(pmt.assetId) | |
668 | 668 | let pmtAmt = pmt.amount | |
669 | 669 | let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller) | |
670 | 670 | let outAmAmt = r._1 | |
671 | 671 | let outPrAmt = r._2 | |
672 | 672 | let sts = parseIntValue(r._9) | |
673 | 673 | let state = r._10 | |
674 | 674 | if (if (igs()) | |
675 | 675 | then true | |
676 | 676 | else (sts == PoolShutdown)) | |
677 | 677 | then throw(("Admin blocked: " + toString(sts))) | |
678 | 678 | else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state) | |
679 | 679 | } | |
680 | 680 | ||
681 | 681 | ||
682 | 682 | func cp (caller,txId,amAsPmt,prAsPmt,slippage,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = { | |
683 | 683 | let r = epo(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, (txId == ""), emitLp, isOneAsset, validateSlippage, pmtAmt, pmtId) | |
684 | 684 | let sts = parseIntValue(r._8) | |
685 | 685 | if (if (if (igs()) | |
686 | 686 | then true | |
687 | 687 | else (sts == PoolPutDis)) | |
688 | 688 | then true | |
689 | 689 | else (sts == PoolShutdown)) | |
690 | 690 | then throw(("Blocked:" + toString(sts))) | |
691 | 691 | else r | |
692 | 692 | } | |
693 | 693 | ||
694 | 694 | ||
695 | 695 | func calcPutOneTkn (pmtAmtRaw,pmtAssetId,userAddress,txId,withTakeFee) = { | |
696 | 696 | let poolConfig = gpc() | |
697 | 697 | let amId = poolConfig[idxAmAsId] | |
698 | 698 | let prId = poolConfig[idxPrAsId] | |
699 | 699 | let lpId = poolConfig[idxLPAsId] | |
700 | 700 | let amtDcm = parseIntValue(poolConfig[idxAmtAsDcm]) | |
701 | 701 | let priceDcm = parseIntValue(poolConfig[idxPriceAsDcm]) | |
702 | 702 | let lpAssetEmission = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "invalid lp asset").quantity) | |
703 | 703 | let chechEmission = if ((lpAssetEmission > big0)) | |
704 | 704 | then true | |
705 | 705 | else throw("initial deposit requires all coins") | |
706 | 706 | if ((chechEmission == chechEmission)) | |
707 | 707 | then { | |
708 | 708 | let amBalance = getAccBalance(amId) | |
709 | 709 | let prBalance = getAccBalance(prId) | |
710 | 710 | let $t02702627488 = if ((txId == "")) | |
711 | 711 | then $Tuple2(amBalance, prBalance) | |
712 | 712 | else if ((pmtAssetId == amId)) | |
713 | 713 | then if ((pmtAmtRaw > amBalance)) | |
714 | 714 | then throw("invalid payment amount") | |
715 | 715 | else $Tuple2((amBalance - pmtAmtRaw), prBalance) | |
716 | 716 | else if ((pmtAssetId == prId)) | |
717 | 717 | then if ((pmtAmtRaw > prBalance)) | |
718 | 718 | then throw("invalid payment amount") | |
719 | 719 | else $Tuple2(amBalance, (prBalance - pmtAmtRaw)) | |
720 | 720 | else throw("wrong pmtAssetId") | |
721 | 721 | let amBalanceOld = $t02702627488._1 | |
722 | 722 | let prBalanceOld = $t02702627488._2 | |
723 | 723 | let $t02749427670 = if ((pmtAssetId == amId)) | |
724 | 724 | then $Tuple2(pmtAmtRaw, 0) | |
725 | 725 | else if ((pmtAssetId == prId)) | |
726 | 726 | then $Tuple2(0, pmtAmtRaw) | |
727 | 727 | else throw("invalid payment") | |
728 | 728 | let amAmountRaw = $t02749427670._1 | |
729 | 729 | let prAmountRaw = $t02749427670._2 | |
730 | 730 | let $t02767427913 = if (withTakeFee) | |
731 | 731 | then $Tuple3(takeFee(amAmountRaw)._1, takeFee(prAmountRaw)._1, takeFee(pmtAmtRaw)._2) | |
732 | 732 | else $Tuple3(amAmountRaw, prAmountRaw, 0) | |
733 | 733 | let amAmount = $t02767427913._1 | |
734 | 734 | let prAmount = $t02767427913._2 | |
735 | 735 | let feeAmount = $t02767427913._3 | |
736 | 736 | let amBalanceNew = (amBalanceOld + amAmount) | |
737 | 737 | let prBalanceNew = (prBalanceOld + prAmount) | |
738 | 738 | let D0 = getD([toBigInt(amBalanceOld), toBigInt(prBalanceOld)]) | |
739 | 739 | let D1 = getD([toBigInt(amBalanceNew), toBigInt(prBalanceNew)]) | |
740 | 740 | let checkD = if ((D1 > D0)) | |
741 | 741 | then true | |
742 | 742 | else throw() | |
743 | 743 | if ((checkD == checkD)) | |
744 | 744 | then { | |
745 | 745 | let lpAmount = fraction(lpAssetEmission, (D1 - D0), D0) | |
746 | 746 | let curPrice = f1(cpbi(t1(prBalanceNew, priceDcm), t1(amBalanceNew, amtDcm)), scale8) | |
747 | 747 | let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId), dataPutActionInfo(amAmountRaw, prAmountRaw, toInt(lpAmount), curPrice, 0, 0, height, lastBlock.timestamp, 0, 0))] | |
748 | 748 | let poolProportion = fraction(prBalanceOld, scale8, amBalanceOld) | |
749 | 749 | let amountAssetPart = fraction(pmtAmtRaw, scale8, (poolProportion + scale8)) | |
750 | 750 | let priceAssetPart = (pmtAmtRaw - amountAssetPart) | |
751 | 751 | let lpAmtBoth = fraction(lpAssetEmission, toBigInt(priceAssetPart), toBigInt(prBalanceOld)) | |
752 | 752 | let bonus = toInt(fraction((lpAmount - lpAmtBoth), scale8BigInt, lpAmtBoth)) | |
753 | 753 | $Tuple4(toInt(lpAmount), commonState, feeAmount, bonus) | |
754 | 754 | } | |
755 | 755 | else throw("Strict value is not equal to itself.") | |
756 | 756 | } | |
757 | 757 | else throw("Strict value is not equal to itself.") | |
758 | 758 | } | |
759 | 759 | ||
760 | 760 | ||
761 | 761 | func getOneTknV2Internal (outAssetId,minOutAmount,payments,caller,originCaller,transactionId) = { | |
762 | 762 | let poolConfig = gpc() | |
763 | 763 | let lpId = poolConfig[idxLPAsId] | |
764 | 764 | let amId = poolConfig[idxAmAsId] | |
765 | 765 | let prId = poolConfig[idxPrAsId] | |
766 | 766 | let amDecimals = parseIntValue(poolConfig[idxAmtAsDcm]) | |
767 | 767 | let prDecimals = parseIntValue(poolConfig[idxPriceAsDcm]) | |
768 | 768 | let poolStatus = poolConfig[idxPoolSt] | |
769 | 769 | let userAddress = if ((caller == restContract)) | |
770 | 770 | then originCaller | |
771 | 771 | else caller | |
772 | 772 | let pmt = value(payments[0]) | |
773 | 773 | let pmtAssetId = value(pmt.assetId) | |
774 | 774 | let pmtAmt = pmt.amount | |
775 | - | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(pmtAmt)) | |
776 | - | let txId58 = toBase58String(transactionId) | |
777 | - | if ((lpId != toBase58String(pmtAssetId))) | |
778 | - | then throw("Wrong LP") | |
779 | - | else { | |
780 | - | let amBalance = getAccBalance(amId) | |
781 | - | let prBalance = getAccBalance(prId) | |
782 | - | let $t02999730108 = { | |
783 | - | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil) | |
784 | - | if ($isInstanceOf(@, "(Int, Int)")) | |
785 | - | then @ | |
786 | - | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
787 | - | } | |
788 | - | if (($t02999730108 == $t02999730108)) | |
789 | - | then { | |
790 | - | let feeAmount = $t02999730108._2 | |
791 | - | let totalGet = $t02999730108._1 | |
792 | - | let totalAmount = if (if ((minOutAmount > 0)) | |
793 | - | then (minOutAmount > totalGet) | |
794 | - | else false) | |
795 | - | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
796 | - | else totalGet | |
797 | - | let $t03029830605 = if ((outAssetId == amId)) | |
798 | - | then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance) | |
799 | - | else if ((outAssetId == prId)) | |
800 | - | then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount)) | |
801 | - | else throw("invalid out asset id") | |
802 | - | let outAm = $t03029830605._1 | |
803 | - | let outPr = $t03029830605._2 | |
804 | - | let amBalanceNew = $t03029830605._3 | |
805 | - | let prBalanceNew = $t03029830605._4 | |
806 | - | let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals)) | |
807 | - | let curPr = f1(curPrX18, scale8) | |
808 | - | let outAssetIdOrWaves = if ((outAssetId == "WAVES")) | |
809 | - | then unit | |
810 | - | else fromBase58String(outAssetId) | |
811 | - | let sendFeeToMatcher = if ((feeAmount > 0)) | |
812 | - | then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetIdOrWaves)] | |
813 | - | else nil | |
814 | - | let state = ([ScriptTransfer(userAddress, totalAmount, outAssetIdOrWaves), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAm, outPr, pmtAmt, curPr, height, lastBlock.timestamp)), IntegerEntry(pl(), curPr), IntegerEntry(ph(height, lastBlock.timestamp), curPr)] ++ sendFeeToMatcher) | |
815 | - | if ((state == state)) | |
775 | + | let currentDLp = calcCurrentDLp(big0, big0, big0) | |
776 | + | if ((currentDLp == currentDLp)) | |
777 | + | then { | |
778 | + | let txId58 = toBase58String(transactionId) | |
779 | + | if ((lpId != toBase58String(pmtAssetId))) | |
780 | + | then throw("Wrong LP") | |
781 | + | else { | |
782 | + | let amBalance = getAccBalance(amId) | |
783 | + | let prBalance = getAccBalance(prId) | |
784 | + | let $t02997130082 = { | |
785 | + | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil) | |
786 | + | if ($isInstanceOf(@, "(Int, Int)")) | |
787 | + | then @ | |
788 | + | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
789 | + | } | |
790 | + | if (($t02997130082 == $t02997130082)) | |
816 | 791 | then { | |
817 | - | let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
818 | - | if ((burn == burn)) | |
792 | + | let feeAmount = $t02997130082._2 | |
793 | + | let totalGet = $t02997130082._1 | |
794 | + | let totalAmount = if (if ((minOutAmount > 0)) | |
795 | + | then (minOutAmount > totalGet) | |
796 | + | else false) | |
797 | + | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
798 | + | else totalGet | |
799 | + | let $t03027230579 = if ((outAssetId == amId)) | |
800 | + | then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance) | |
801 | + | else if ((outAssetId == prId)) | |
802 | + | then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount)) | |
803 | + | else throw("invalid out asset id") | |
804 | + | let outAm = $t03027230579._1 | |
805 | + | let outPr = $t03027230579._2 | |
806 | + | let amBalanceNew = $t03027230579._3 | |
807 | + | let prBalanceNew = $t03027230579._4 | |
808 | + | let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals)) | |
809 | + | let curPr = f1(curPrX18, scale8) | |
810 | + | let outAssetIdOrWaves = if ((outAssetId == "WAVES")) | |
811 | + | then unit | |
812 | + | else fromBase58String(outAssetId) | |
813 | + | let sendFeeToMatcher = if ((feeAmount > 0)) | |
814 | + | then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetIdOrWaves)] | |
815 | + | else nil | |
816 | + | let state = ([ScriptTransfer(userAddress, totalAmount, outAssetIdOrWaves), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAm, outPr, pmtAmt, curPr, height, lastBlock.timestamp)), IntegerEntry(pl(), curPr), IntegerEntry(ph(height, lastBlock.timestamp), curPr)] ++ sendFeeToMatcher) | |
817 | + | if ((state == state)) | |
819 | 818 | then { | |
820 | - | let $t03139031740 = { | |
821 | - | let feeAmountForCalc = if ((this == feeCollectorAddress)) | |
822 | - | then 0 | |
823 | - | else feeAmount | |
824 | - | let outInAmountAsset = if ((parseAssetId(outAssetId) == cfgAmountAssetId)) | |
825 | - | then true | |
826 | - | else false | |
827 | - | if (outInAmountAsset) | |
828 | - | then $Tuple2(-((totalGet + feeAmountForCalc)), 0) | |
829 | - | else $Tuple2(0, -((totalGet + feeAmountForCalc))) | |
830 | - | } | |
831 | - | let amountAssetBalanceDelta = $t03139031740._1 | |
832 | - | let priceAssetBalanceDelta = $t03139031740._2 | |
833 | - | let $t03174331851 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
834 | - | let refreshDLpActions = $t03174331851._1 | |
835 | - | let updatedDLp = $t03174331851._2 | |
836 | - | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
837 | - | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
838 | - | then $Tuple2((state ++ refreshDLpActions), totalAmount) | |
819 | + | let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
820 | + | if ((burn == burn)) | |
821 | + | then { | |
822 | + | let $t03136431714 = { | |
823 | + | let feeAmountForCalc = if ((this == feeCollectorAddress)) | |
824 | + | then 0 | |
825 | + | else feeAmount | |
826 | + | let outInAmountAsset = if ((parseAssetId(outAssetId) == cfgAmountAssetId)) | |
827 | + | then true | |
828 | + | else false | |
829 | + | if (outInAmountAsset) | |
830 | + | then $Tuple2(-((totalGet + feeAmountForCalc)), 0) | |
831 | + | else $Tuple2(0, -((totalGet + feeAmountForCalc))) | |
832 | + | } | |
833 | + | let amountAssetBalanceDelta = $t03136431714._1 | |
834 | + | let priceAssetBalanceDelta = $t03136431714._2 | |
835 | + | let $t03171731825 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
836 | + | let refreshDLpActions = $t03171731825._1 | |
837 | + | let updatedDLp = $t03171731825._2 | |
838 | + | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
839 | + | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
840 | + | then $Tuple2((state ++ refreshDLpActions), totalAmount) | |
841 | + | else throw("Strict value is not equal to itself.") | |
842 | + | } | |
839 | 843 | else throw("Strict value is not equal to itself.") | |
840 | 844 | } | |
841 | 845 | else throw("Strict value is not equal to itself.") | |
842 | 846 | } | |
843 | 847 | else throw("Strict value is not equal to itself.") | |
844 | 848 | } | |
845 | - | else throw("Strict value is not equal to itself.") | |
846 | 849 | } | |
850 | + | else throw("Strict value is not equal to itself.") | |
847 | 851 | } | |
848 | 852 | ||
849 | 853 | ||
850 | 854 | func m () = match getString(mpk()) { | |
851 | 855 | case s: String => | |
852 | 856 | fromBase58String(s) | |
853 | 857 | case _: Unit => | |
854 | 858 | unit | |
855 | 859 | case _ => | |
856 | 860 | throw("Match error") | |
857 | 861 | } | |
858 | 862 | ||
859 | 863 | ||
860 | 864 | func pm () = match getString(pmpk()) { | |
861 | 865 | case s: String => | |
862 | 866 | fromBase58String(s) | |
863 | 867 | case _: Unit => | |
864 | 868 | unit | |
865 | 869 | case _ => | |
866 | 870 | throw("Match error") | |
867 | 871 | } | |
868 | 872 | ||
869 | 873 | ||
870 | 874 | let pd = throw("Permission denied") | |
871 | 875 | ||
872 | 876 | func isManager (i) = match m() { | |
873 | 877 | case pk: ByteVector => | |
874 | 878 | (i.callerPublicKey == pk) | |
875 | 879 | case _: Unit => | |
876 | 880 | (i.caller == this) | |
877 | 881 | case _ => | |
878 | 882 | throw("Match error") | |
879 | 883 | } | |
880 | 884 | ||
881 | 885 | ||
882 | 886 | func mm (i) = match m() { | |
883 | 887 | case pk: ByteVector => | |
884 | 888 | if ((i.callerPublicKey == pk)) | |
885 | 889 | then true | |
886 | 890 | else pd | |
887 | 891 | case _: Unit => | |
888 | 892 | if ((i.caller == this)) | |
889 | 893 | then true | |
890 | 894 | else pd | |
891 | 895 | case _ => | |
892 | 896 | throw("Match error") | |
893 | 897 | } | |
894 | 898 | ||
895 | 899 | ||
896 | 900 | @Callable(i) | |
897 | 901 | func constructor (fc) = { | |
898 | 902 | let c = mm(i) | |
899 | 903 | if ((c == c)) | |
900 | 904 | then [StringEntry(fc(), fc)] | |
901 | 905 | else throw("Strict value is not equal to itself.") | |
902 | 906 | } | |
903 | 907 | ||
904 | 908 | ||
905 | 909 | ||
906 | 910 | @Callable(i) | |
907 | 911 | func setManager (pendingManagerPublicKey) = { | |
908 | 912 | let c = mm(i) | |
909 | 913 | if ((c == c)) | |
910 | 914 | then { | |
911 | 915 | let cm = fromBase58String(pendingManagerPublicKey) | |
912 | 916 | if ((cm == cm)) | |
913 | 917 | then [StringEntry(pmpk(), pendingManagerPublicKey)] | |
914 | 918 | else throw("Strict value is not equal to itself.") | |
915 | 919 | } | |
916 | 920 | else throw("Strict value is not equal to itself.") | |
917 | 921 | } | |
918 | 922 | ||
919 | 923 | ||
920 | 924 | ||
921 | 925 | @Callable(i) | |
922 | 926 | func confirmManager () = { | |
923 | 927 | let p = pm() | |
924 | 928 | let hpm = if (isDefined(p)) | |
925 | 929 | then true | |
926 | 930 | else throw("No pending manager") | |
927 | 931 | if ((hpm == hpm)) | |
928 | 932 | then { | |
929 | 933 | let cpm = if ((i.callerPublicKey == value(p))) | |
930 | 934 | then true | |
931 | 935 | else throw("You are not pending manager") | |
932 | 936 | if ((cpm == cpm)) | |
933 | 937 | then [StringEntry(mpk(), toBase58String(value(p))), DeleteEntry(pmpk())] | |
934 | 938 | else throw("Strict value is not equal to itself.") | |
935 | 939 | } | |
936 | 940 | else throw("Strict value is not equal to itself.") | |
937 | 941 | } | |
938 | 942 | ||
939 | 943 | ||
940 | 944 | ||
941 | 945 | @Callable(i) | |
942 | 946 | func put (slip,autoStake) = { | |
943 | 947 | let factCfg = gfc() | |
944 | 948 | let stakingCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactStakCntr]), "Wr st addr") | |
945 | 949 | let slipCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactSlippCntr]), "Wr sl addr") | |
946 | 950 | if ((0 > slip)) | |
947 | 951 | then throw("Wrong slippage") | |
948 | 952 | else if ((size(i.payments) != 2)) | |
949 | 953 | then throw("2 pmnts expd") | |
950 | 954 | else { | |
951 | 955 | let amAssetPmt = toBigInt(value(i.payments[0]).amount) | |
952 | 956 | let prAssetPmt = toBigInt(value(i.payments[1]).amount) | |
953 | 957 | let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0)) | |
954 | 958 | if ((currentDLp == currentDLp)) | |
955 | 959 | then { | |
956 | 960 | let e = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(value(i.payments[0]).assetId, value(i.payments[0]).amount), i.payments[1], slip, true, false, true, 0, "") | |
957 | 961 | let emitLpAmt = e._2 | |
958 | 962 | let lpAssetId = e._7 | |
959 | 963 | let state = e._9 | |
960 | 964 | let amDiff = e._10 | |
961 | 965 | let prDiff = e._11 | |
962 | 966 | let amId = e._12 | |
963 | 967 | let prId = e._13 | |
964 | 968 | let r = invoke(fca, "emit", [emitLpAmt], nil) | |
965 | 969 | if ((r == r)) | |
966 | 970 | then { | |
967 | 971 | let el = match r { | |
968 | 972 | case legacy: Address => | |
969 | 973 | invoke(legacy, "emit", [emitLpAmt], nil) | |
970 | 974 | case _ => | |
971 | 975 | unit | |
972 | 976 | } | |
973 | 977 | if ((el == el)) | |
974 | 978 | then { | |
975 | 979 | let sa = if ((amDiff > 0)) | |
976 | 980 | then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)]) | |
977 | 981 | else nil | |
978 | 982 | if ((sa == sa)) | |
979 | 983 | then { | |
980 | 984 | let sp = if ((prDiff > 0)) | |
981 | 985 | then invoke(slipCntr, "put", nil, [AttachedPayment(prId, prDiff)]) | |
982 | 986 | else nil | |
983 | 987 | if ((sp == sp)) | |
984 | 988 | then { | |
985 | 989 | let lpTrnsfr = if (autoStake) | |
986 | 990 | then { | |
987 | 991 | let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
988 | 992 | if ((ss == ss)) | |
989 | 993 | then nil | |
990 | 994 | else throw("Strict value is not equal to itself.") | |
991 | 995 | } | |
992 | 996 | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
993 | - | let $ | |
994 | - | let refreshDLpActions = $ | |
995 | - | let updatedDLp = $ | |
997 | + | let $t03568135746 = refreshDLpInternal(0, 0, 0) | |
998 | + | let refreshDLpActions = $t03568135746._1 | |
999 | + | let updatedDLp = $t03568135746._2 | |
996 | 1000 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
997 | 1001 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
998 | 1002 | then ((state ++ lpTrnsfr) ++ refreshDLpActions) | |
999 | 1003 | else throw("Strict value is not equal to itself.") | |
1000 | 1004 | } | |
1001 | 1005 | else throw("Strict value is not equal to itself.") | |
1002 | 1006 | } | |
1003 | 1007 | else throw("Strict value is not equal to itself.") | |
1004 | 1008 | } | |
1005 | 1009 | else throw("Strict value is not equal to itself.") | |
1006 | 1010 | } | |
1007 | 1011 | else throw("Strict value is not equal to itself.") | |
1008 | 1012 | } | |
1009 | 1013 | else throw("Strict value is not equal to itself.") | |
1010 | 1014 | } | |
1011 | 1015 | } | |
1012 | 1016 | ||
1013 | 1017 | ||
1014 | 1018 | ||
1015 | 1019 | @Callable(i) | |
1016 | 1020 | func putOneTknV2 (minOutAmount,autoStake) = { | |
1017 | 1021 | let isPoolOneTokenOperationsDisabled = { | |
1018 | 1022 | let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1019 | 1023 | if ($isInstanceOf(@, "Boolean")) | |
1020 | 1024 | then @ | |
1021 | 1025 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
1022 | 1026 | } | |
1023 | 1027 | let isPutDisabled = if (if (if (igs()) | |
1024 | 1028 | then true | |
1025 | 1029 | else (cfgPoolStatus == PoolPutDis)) | |
1026 | 1030 | then true | |
1027 | 1031 | else (cfgPoolStatus == PoolShutdown)) | |
1028 | 1032 | then true | |
1029 | 1033 | else isPoolOneTokenOperationsDisabled | |
1030 | 1034 | let checks = [if (if (!(isPutDisabled)) | |
1031 | 1035 | then true | |
1032 | 1036 | else isManager(i)) | |
1033 | 1037 | then true | |
1034 | 1038 | else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1)) | |
1035 | 1039 | then true | |
1036 | 1040 | else throwErr("exactly 1 payment are expected")] | |
1037 | 1041 | if ((checks == checks)) | |
1038 | 1042 | then { | |
1039 | 1043 | let poolConfig = gpc() | |
1040 | 1044 | let amId = poolConfig[idxAmAsId] | |
1041 | 1045 | let prId = poolConfig[idxPrAsId] | |
1042 | 1046 | let lpId = fromBase58String(poolConfig[idxLPAsId]) | |
1043 | 1047 | let amDecimals = parseIntValue(poolConfig[idxAmtAsDcm]) | |
1044 | 1048 | let prDecimals = parseIntValue(poolConfig[idxPriceAsDcm]) | |
1045 | 1049 | let userAddress = if ((i.caller == this)) | |
1046 | 1050 | then i.originCaller | |
1047 | 1051 | else i.caller | |
1048 | 1052 | let pmt = value(i.payments[0]) | |
1049 | 1053 | let pmtAssetId = toBase58String(value(pmt.assetId)) | |
1050 | 1054 | let pmtAmt = pmt.amount | |
1051 | - | let $ | |
1052 | - | if (($ | |
1055 | + | let $t03688337041 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true) | |
1056 | + | if (($t03688337041 == $t03688337041)) | |
1053 | 1057 | then { | |
1054 | - | let feeAmount = $ | |
1055 | - | let state = $ | |
1056 | - | let estimLP = $ | |
1058 | + | let feeAmount = $t03688337041._3 | |
1059 | + | let state = $t03688337041._2 | |
1060 | + | let estimLP = $t03688337041._1 | |
1057 | 1061 | let emitLpAmt = if (if ((minOutAmount > 0)) | |
1058 | 1062 | then (minOutAmount > estimLP) | |
1059 | 1063 | else false) | |
1060 | 1064 | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
1061 | 1065 | else estimLP | |
1062 | 1066 | let e = invoke(fca, "emit", [emitLpAmt], nil) | |
1063 | 1067 | if ((e == e)) | |
1064 | 1068 | then { | |
1065 | 1069 | let el = match e { | |
1066 | 1070 | case legacy: Address => | |
1067 | 1071 | invoke(legacy, "emit", [emitLpAmt], nil) | |
1068 | 1072 | case _ => | |
1069 | 1073 | unit | |
1070 | 1074 | } | |
1071 | 1075 | if ((el == el)) | |
1072 | 1076 | then { | |
1073 | 1077 | let lpTrnsfr = if (autoStake) | |
1074 | 1078 | then { | |
1075 | 1079 | let ss = invoke(stakingContract, "stake", nil, [AttachedPayment(lpId, emitLpAmt)]) | |
1076 | 1080 | if ((ss == ss)) | |
1077 | 1081 | then nil | |
1078 | 1082 | else throw("Strict value is not equal to itself.") | |
1079 | 1083 | } | |
1080 | 1084 | else [ScriptTransfer(i.caller, emitLpAmt, lpId)] | |
1081 | 1085 | let sendFeeToMatcher = if ((feeAmount > 0)) | |
1082 | 1086 | then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))] | |
1083 | 1087 | else nil | |
1084 | - | let $ | |
1088 | + | let $t03785638205 = if ((this == feeCollectorAddress)) | |
1085 | 1089 | then $Tuple2(0, 0) | |
1086 | 1090 | else { | |
1087 | 1091 | let paymentInAmountAsset = if ((pmt.assetId == cfgAmountAssetId)) | |
1088 | 1092 | then true | |
1089 | 1093 | else false | |
1090 | 1094 | if (paymentInAmountAsset) | |
1091 | 1095 | then $Tuple2(-(feeAmount), 0) | |
1092 | 1096 | else $Tuple2(0, -(feeAmount)) | |
1093 | 1097 | } | |
1094 | - | let amountAssetBalanceDelta = $ | |
1095 | - | let priceAssetBalanceDelta = $ | |
1096 | - | let $ | |
1097 | - | let refreshDLpActions = $ | |
1098 | - | let updatedDLp = $ | |
1098 | + | let amountAssetBalanceDelta = $t03785638205._1 | |
1099 | + | let priceAssetBalanceDelta = $t03785638205._2 | |
1100 | + | let $t03820838316 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
1101 | + | let refreshDLpActions = $t03820838316._1 | |
1102 | + | let updatedDLp = $t03820838316._2 | |
1099 | 1103 | $Tuple2((((state ++ lpTrnsfr) ++ sendFeeToMatcher) ++ refreshDLpActions), emitLpAmt) | |
1100 | 1104 | } | |
1101 | 1105 | else throw("Strict value is not equal to itself.") | |
1102 | 1106 | } | |
1103 | 1107 | else throw("Strict value is not equal to itself.") | |
1104 | 1108 | } | |
1105 | 1109 | else throw("Strict value is not equal to itself.") | |
1106 | 1110 | } | |
1107 | 1111 | else throw("Strict value is not equal to itself.") | |
1108 | 1112 | } | |
1109 | 1113 | ||
1110 | 1114 | ||
1111 | 1115 | ||
1112 | 1116 | @Callable(i) | |
1113 | 1117 | func putForFree (maxSlpg) = if ((0 > maxSlpg)) | |
1114 | 1118 | then throw("Wrong slpg") | |
1115 | 1119 | else if ((size(i.payments) != 2)) | |
1116 | 1120 | then throw("2 pmnts expd") | |
1117 | 1121 | else { | |
1118 | 1122 | let estPut = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(value(i.payments[0]).assetId, value(i.payments[0]).amount), i.payments[1], maxSlpg, false, false, true, 0, "") | |
1119 | 1123 | let state = estPut._9 | |
1120 | 1124 | let amAssetPmt = toBigInt(value(i.payments[0]).amount) | |
1121 | 1125 | let prAssetPmt = toBigInt(value(i.payments[1]).amount) | |
1122 | 1126 | let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0)) | |
1123 | 1127 | if ((currentDLp == currentDLp)) | |
1124 | 1128 | then { | |
1125 | - | let $ | |
1126 | - | let refreshDLpActions = $ | |
1127 | - | let updatedDLp = $ | |
1129 | + | let $t03927539340 = refreshDLpInternal(0, 0, 0) | |
1130 | + | let refreshDLpActions = $t03927539340._1 | |
1131 | + | let updatedDLp = $t03927539340._2 | |
1128 | 1132 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1129 | 1133 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1130 | 1134 | then (state ++ refreshDLpActions) | |
1131 | 1135 | else throw("Strict value is not equal to itself.") | |
1132 | 1136 | } | |
1133 | 1137 | else throw("Strict value is not equal to itself.") | |
1134 | 1138 | } | |
1135 | 1139 | ||
1136 | 1140 | ||
1137 | 1141 | ||
1138 | 1142 | @Callable(i) | |
1139 | 1143 | func get () = { | |
1140 | 1144 | let r = cg(i) | |
1141 | 1145 | let outAmtAmt = r._1 | |
1142 | 1146 | let outPrAmt = r._2 | |
1143 | 1147 | let pmtAmt = r._3 | |
1144 | 1148 | let pmtAssetId = r._4 | |
1145 | 1149 | let state = r._5 | |
1146 | 1150 | let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1147 | 1151 | if ((b == b)) | |
1148 | 1152 | then { | |
1149 | 1153 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(pmtAmt)) | |
1150 | - | let $ | |
1151 | - | let refreshDLpActions = $ | |
1152 | - | let updatedDLp = $ | |
1154 | + | let $t04012940211 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0) | |
1155 | + | let refreshDLpActions = $t04012940211._1 | |
1156 | + | let updatedDLp = $t04012940211._2 | |
1153 | 1157 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1154 | 1158 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1155 | 1159 | then (state ++ refreshDLpActions) | |
1156 | 1160 | else throw("Strict value is not equal to itself.") | |
1157 | 1161 | } | |
1158 | 1162 | else throw("Strict value is not equal to itself.") | |
1159 | 1163 | } | |
1160 | 1164 | ||
1161 | 1165 | ||
1162 | 1166 | ||
1163 | 1167 | @Callable(i) | |
1164 | 1168 | func getOneTknV2 (outAssetId,minOutAmount) = { | |
1165 | 1169 | let isPoolOneTokenOperationsDisabled = { | |
1166 | 1170 | let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1167 | 1171 | if ($isInstanceOf(@, "Boolean")) | |
1168 | 1172 | then @ | |
1169 | 1173 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
1170 | 1174 | } | |
1171 | 1175 | let isGetDisabled = if (if (igs()) | |
1172 | 1176 | then true | |
1173 | 1177 | else (cfgPoolStatus == PoolShutdown)) | |
1174 | 1178 | then true | |
1175 | 1179 | else isPoolOneTokenOperationsDisabled | |
1176 | 1180 | let checks = [if (if (!(isGetDisabled)) | |
1177 | 1181 | then true | |
1178 | 1182 | else isManager(i)) | |
1179 | 1183 | then true | |
1180 | 1184 | else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1)) | |
1181 | 1185 | then true | |
1182 | 1186 | else throwErr("exactly 1 payment are expected")] | |
1183 | 1187 | if ((checks == checks)) | |
1184 | 1188 | then { | |
1185 | - | let $ | |
1186 | - | let state = $ | |
1187 | - | let totalAmount = $ | |
1189 | + | let $t04082940984 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId) | |
1190 | + | let state = $t04082940984._1 | |
1191 | + | let totalAmount = $t04082940984._2 | |
1188 | 1192 | $Tuple2(state, totalAmount) | |
1189 | 1193 | } | |
1190 | 1194 | else throw("Strict value is not equal to itself.") | |
1191 | 1195 | } | |
1192 | 1196 | ||
1193 | 1197 | ||
1194 | 1198 | ||
1195 | 1199 | @Callable(i) | |
1196 | 1200 | func refreshDLp () = { | |
1197 | 1201 | let lastRefreshedBlockHeight = valueOrElse(getInteger(keyDLpRefreshedHeight), 0) | |
1198 | 1202 | let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= dLpRefreshDelay)) | |
1199 | 1203 | then unit | |
1200 | 1204 | else throwErr(makeString([toString(dLpRefreshDelay), " blocks have not passed since the previous call"], "")) | |
1201 | 1205 | if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight)) | |
1202 | 1206 | then { | |
1203 | 1207 | let dLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyDLp), "0")), fmtErr("invalid dLp")) | |
1204 | - | let $ | |
1205 | - | let dLpUpdateActions = $ | |
1206 | - | let updatedDLp = $ | |
1208 | + | let $t04150841572 = refreshDLpInternal(0, 0, 0) | |
1209 | + | let dLpUpdateActions = $t04150841572._1 | |
1210 | + | let updatedDLp = $t04150841572._2 | |
1207 | 1211 | let actions = if ((dLp != updatedDLp)) | |
1208 | 1212 | then dLpUpdateActions | |
1209 | 1213 | else throwErr("nothing to refresh") | |
1210 | 1214 | $Tuple2(actions, toString(updatedDLp)) | |
1211 | 1215 | } | |
1212 | 1216 | else throw("Strict value is not equal to itself.") | |
1213 | 1217 | } | |
1214 | 1218 | ||
1215 | 1219 | ||
1216 | 1220 | ||
1217 | 1221 | @Callable(i) | |
1218 | 1222 | func getOneTknV2READONLY (outAssetId,lpAssetAmount) = { | |
1219 | 1223 | let poolConfig = gpc() | |
1220 | 1224 | let amId = poolConfig[idxAmAsId] | |
1221 | 1225 | let prId = poolConfig[idxPrAsId] | |
1222 | 1226 | let lpId = poolConfig[idxLPAsId] | |
1223 | 1227 | let xp = [toBigInt(getAccBalance(amId)), toBigInt(getAccBalance(prId))] | |
1224 | 1228 | let lpEmission = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "invalid lp asset").quantity) | |
1225 | 1229 | let D0 = getD(xp) | |
1226 | 1230 | let D1 = (D0 - fraction(toBigInt(lpAssetAmount), D0, lpEmission)) | |
1227 | 1231 | let index = if ((outAssetId == amId)) | |
1228 | 1232 | then 0 | |
1229 | 1233 | else if ((outAssetId == prId)) | |
1230 | 1234 | then 1 | |
1231 | 1235 | else throw("invalid out asset id") | |
1232 | 1236 | let newY = getYD(xp, index, D1) | |
1233 | 1237 | let dy = (xp[index] - newY) | |
1234 | 1238 | let totalGetRaw = max([0, toInt((dy - big1))]) | |
1235 | - | let $ | |
1236 | - | let totalGet = $ | |
1237 | - | let feeAmount = $ | |
1239 | + | let $t04247242521 = takeFee(totalGetRaw) | |
1240 | + | let totalGet = $t04247242521._1 | |
1241 | + | let feeAmount = $t04247242521._2 | |
1238 | 1242 | $Tuple2(nil, $Tuple2(totalGet, feeAmount)) | |
1239 | 1243 | } | |
1240 | 1244 | ||
1241 | 1245 | ||
1242 | 1246 | ||
1243 | 1247 | @Callable(i) | |
1244 | 1248 | func getOneTknV2WithBonusREADONLY (outAssetId,lpAssetAmount) = { | |
1245 | 1249 | let poolConfig = gpc() | |
1246 | 1250 | let amId = poolConfig[idxAmAsId] | |
1247 | 1251 | let prId = poolConfig[idxPrAsId] | |
1248 | 1252 | let lpId = poolConfig[idxLPAsId] | |
1249 | 1253 | let amBalance = getAccBalance(amId) | |
1250 | 1254 | let prBalance = getAccBalance(prId) | |
1251 | - | let $ | |
1255 | + | let $t04286642981 = { | |
1252 | 1256 | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil) | |
1253 | 1257 | if ($isInstanceOf(@, "(Int, Int)")) | |
1254 | 1258 | then @ | |
1255 | 1259 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
1256 | 1260 | } | |
1257 | - | let totalGet = $ | |
1258 | - | let feeAmount = $ | |
1261 | + | let totalGet = $t04286642981._1 | |
1262 | + | let feeAmount = $t04286642981._2 | |
1259 | 1263 | let r = ego("", lpId, lpAssetAmount, this) | |
1260 | 1264 | let outAmAmt = r._1 | |
1261 | 1265 | let outPrAmt = r._2 | |
1262 | 1266 | let sumOfGetAssets = (outAmAmt + outPrAmt) | |
1263 | 1267 | let bonus = if ((sumOfGetAssets == 0)) | |
1264 | 1268 | then if ((totalGet == 0)) | |
1265 | 1269 | then 0 | |
1266 | 1270 | else throw("bonus calculation error") | |
1267 | 1271 | else fraction((totalGet - sumOfGetAssets), scale8, sumOfGetAssets) | |
1268 | 1272 | $Tuple2(nil, $Tuple3(totalGet, feeAmount, bonus)) | |
1269 | 1273 | } | |
1270 | 1274 | ||
1271 | 1275 | ||
1272 | 1276 | ||
1273 | 1277 | @Callable(i) | |
1274 | 1278 | func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = { | |
1275 | 1279 | let r = cg(i) | |
1276 | 1280 | let outAmAmt = r._1 | |
1277 | 1281 | let outPrAmt = r._2 | |
1278 | 1282 | let pmtAmt = r._3 | |
1279 | 1283 | let pmtAssetId = r._4 | |
1280 | 1284 | let state = r._5 | |
1281 | 1285 | if ((noLessThenAmtAsset > outAmAmt)) | |
1282 | 1286 | then throw(((("Failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset))) | |
1283 | 1287 | else if ((noLessThenPriceAsset > outPrAmt)) | |
1284 | 1288 | then throw(((("Failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset))) | |
1285 | 1289 | else { | |
1286 | 1290 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(pmtAmt)) | |
1287 | 1291 | let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1288 | 1292 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1289 | 1293 | then { | |
1290 | - | let $ | |
1291 | - | let refreshDLpActions = $ | |
1292 | - | let updatedDLp = $ | |
1294 | + | let $t04414944230 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1295 | + | let refreshDLpActions = $t04414944230._1 | |
1296 | + | let updatedDLp = $t04414944230._2 | |
1293 | 1297 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1294 | 1298 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1295 | 1299 | then (state ++ refreshDLpActions) | |
1296 | 1300 | else throw("Strict value is not equal to itself.") | |
1297 | 1301 | } | |
1298 | 1302 | else throw("Strict value is not equal to itself.") | |
1299 | 1303 | } | |
1300 | 1304 | } | |
1301 | 1305 | ||
1302 | 1306 | ||
1303 | 1307 | ||
1304 | 1308 | @Callable(i) | |
1305 | 1309 | func unstakeAndGet (amount) = { | |
1306 | 1310 | let checkPayments = if ((size(i.payments) != 0)) | |
1307 | 1311 | then throw("No pmnts expd") | |
1308 | 1312 | else true | |
1309 | 1313 | if ((checkPayments == checkPayments)) | |
1310 | 1314 | then { | |
1311 | 1315 | let cfg = gpc() | |
1312 | 1316 | let factoryCfg = gfc() | |
1313 | 1317 | let lpAssetId = fromBase58String(cfg[idxLPAsId]) | |
1314 | 1318 | let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr") | |
1315 | 1319 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1316 | 1320 | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil) | |
1317 | 1321 | if ((unstakeInv == unstakeInv)) | |
1318 | 1322 | then { | |
1319 | 1323 | let r = ego(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller) | |
1320 | 1324 | let outAmAmt = r._1 | |
1321 | 1325 | let outPrAmt = r._2 | |
1322 | 1326 | let sts = parseIntValue(r._9) | |
1323 | 1327 | let state = r._10 | |
1324 | 1328 | let v = if (if (igs()) | |
1325 | 1329 | then true | |
1326 | 1330 | else (sts == PoolShutdown)) | |
1327 | 1331 | then throw(("Blocked: " + toString(sts))) | |
1328 | 1332 | else true | |
1329 | 1333 | if ((v == v)) | |
1330 | 1334 | then { | |
1331 | 1335 | let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)]) | |
1332 | 1336 | if ((burnA == burnA)) | |
1333 | 1337 | then { | |
1334 | - | let $ | |
1335 | - | let refreshDLpActions = $ | |
1336 | - | let updatedDLp = $ | |
1338 | + | let $t04529345374 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1339 | + | let refreshDLpActions = $t04529345374._1 | |
1340 | + | let updatedDLp = $t04529345374._2 | |
1337 | 1341 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1338 | 1342 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1339 | 1343 | then (state ++ refreshDLpActions) | |
1340 | 1344 | else throw("Strict value is not equal to itself.") | |
1341 | 1345 | } | |
1342 | 1346 | else throw("Strict value is not equal to itself.") | |
1343 | 1347 | } | |
1344 | 1348 | else throw("Strict value is not equal to itself.") | |
1345 | 1349 | } | |
1346 | 1350 | else throw("Strict value is not equal to itself.") | |
1347 | 1351 | } | |
1348 | 1352 | else throw("Strict value is not equal to itself.") | |
1349 | 1353 | } | |
1350 | 1354 | ||
1351 | 1355 | ||
1352 | 1356 | ||
1353 | 1357 | @Callable(i) | |
1354 | 1358 | func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = { | |
1355 | 1359 | let isGetDisabled = if (igs()) | |
1356 | 1360 | then true | |
1357 | 1361 | else (cfgPoolStatus == PoolShutdown) | |
1358 | 1362 | let checks = [if (!(isGetDisabled)) | |
1359 | 1363 | then true | |
1360 | 1364 | else throw("get operation is blocked by admin"), if ((size(i.payments) == 0)) | |
1361 | 1365 | then true | |
1362 | 1366 | else throw("no payments are expected")] | |
1363 | 1367 | if ((checks == checks)) | |
1364 | 1368 | then { | |
1365 | 1369 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1366 | 1370 | let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil) | |
1367 | 1371 | if ((unstakeInv == unstakeInv)) | |
1368 | 1372 | then { | |
1369 | 1373 | let res = ego(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller) | |
1370 | 1374 | let outAmAmt = res._1 | |
1371 | 1375 | let outPrAmt = res._2 | |
1372 | 1376 | let state = res._10 | |
1373 | 1377 | let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset)) | |
1374 | 1378 | then true | |
1375 | 1379 | else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset)) | |
1376 | 1380 | then true | |
1377 | 1381 | else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))] | |
1378 | 1382 | if ((checkAmounts == checkAmounts)) | |
1379 | 1383 | then { | |
1380 | 1384 | let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)]) | |
1381 | 1385 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1382 | 1386 | then { | |
1383 | - | let $ | |
1384 | - | let refreshDLpActions = $ | |
1385 | - | let updatedDLp = $ | |
1387 | + | let $t04662246703 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1388 | + | let refreshDLpActions = $t04662246703._1 | |
1389 | + | let updatedDLp = $t04662246703._2 | |
1386 | 1390 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1387 | 1391 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1388 | 1392 | then (state ++ refreshDLpActions) | |
1389 | 1393 | else throw("Strict value is not equal to itself.") | |
1390 | 1394 | } | |
1391 | 1395 | else throw("Strict value is not equal to itself.") | |
1392 | 1396 | } | |
1393 | 1397 | else throw("Strict value is not equal to itself.") | |
1394 | 1398 | } | |
1395 | 1399 | else throw("Strict value is not equal to itself.") | |
1396 | 1400 | } | |
1397 | 1401 | else throw("Strict value is not equal to itself.") | |
1398 | 1402 | } | |
1399 | 1403 | ||
1400 | 1404 | ||
1401 | 1405 | ||
1402 | 1406 | @Callable(i) | |
1403 | 1407 | func unstakeAndGetOneTknV2 (unstakeAmount,outAssetId,minOutAmount) = { | |
1404 | 1408 | let isPoolOneTokenOperationsDisabled = { | |
1405 | 1409 | let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1406 | 1410 | if ($isInstanceOf(@, "Boolean")) | |
1407 | 1411 | then @ | |
1408 | 1412 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
1409 | 1413 | } | |
1410 | 1414 | let isGetDisabled = if (if (igs()) | |
1411 | 1415 | then true | |
1412 | 1416 | else (cfgPoolStatus == PoolShutdown)) | |
1413 | 1417 | then true | |
1414 | 1418 | else isPoolOneTokenOperationsDisabled | |
1415 | 1419 | let checks = [if (if (!(isGetDisabled)) | |
1416 | 1420 | then true | |
1417 | 1421 | else isManager(i)) | |
1418 | 1422 | then true | |
1419 | 1423 | else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0)) | |
1420 | 1424 | then true | |
1421 | 1425 | else throwErr("no payments are expected")] | |
1422 | 1426 | if ((checks == checks)) | |
1423 | 1427 | then { | |
1424 | 1428 | let cfg = gpc() | |
1425 | 1429 | let factoryCfg = gfc() | |
1426 | 1430 | let lpAssetId = fromBase58String(cfg[idxLPAsId]) | |
1427 | 1431 | let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr") | |
1428 | 1432 | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), unstakeAmount], nil) | |
1429 | 1433 | if ((unstakeInv == unstakeInv)) | |
1430 | 1434 | then { | |
1431 | - | let $ | |
1432 | - | let state = $ | |
1433 | - | let totalAmount = $ | |
1435 | + | let $t04763747825 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId) | |
1436 | + | let state = $t04763747825._1 | |
1437 | + | let totalAmount = $t04763747825._2 | |
1434 | 1438 | $Tuple2(state, totalAmount) | |
1435 | 1439 | } | |
1436 | 1440 | else throw("Strict value is not equal to itself.") | |
1437 | 1441 | } | |
1438 | 1442 | else throw("Strict value is not equal to itself.") | |
1439 | 1443 | } | |
1440 | 1444 | ||
1441 | 1445 | ||
1442 | 1446 | ||
1443 | 1447 | @Callable(i) | |
1444 | 1448 | func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = { | |
1445 | 1449 | let poolConfig = gpc() | |
1446 | 1450 | let amId = poolConfig[idxAmAsId] | |
1447 | 1451 | let prId = poolConfig[idxPrAsId] | |
1448 | 1452 | let lpId = poolConfig[idxLPAsId] | |
1449 | - | let $ | |
1450 | - | let lpAmount = $ | |
1451 | - | let state = $ | |
1452 | - | let feeAmount = $ | |
1453 | - | let bonus = $ | |
1453 | + | let $t04808448187 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true) | |
1454 | + | let lpAmount = $t04808448187._1 | |
1455 | + | let state = $t04808448187._2 | |
1456 | + | let feeAmount = $t04808448187._3 | |
1457 | + | let bonus = $t04808448187._4 | |
1454 | 1458 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1455 | 1459 | } | |
1456 | 1460 | ||
1457 | 1461 | ||
1458 | 1462 | ||
1459 | 1463 | @Callable(i) | |
1460 | 1464 | func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = { | |
1461 | 1465 | let poolConfig = gpc() | |
1462 | 1466 | let amId = poolConfig[idxAmAsId] | |
1463 | 1467 | let prId = poolConfig[idxPrAsId] | |
1464 | 1468 | let lpId = poolConfig[idxLPAsId] | |
1465 | - | let $ | |
1466 | - | let lpAmount = $ | |
1467 | - | let state = $ | |
1468 | - | let feeAmount = $ | |
1469 | - | let bonus = $ | |
1469 | + | let $t04846648570 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false) | |
1470 | + | let lpAmount = $t04846648570._1 | |
1471 | + | let state = $t04846648570._2 | |
1472 | + | let feeAmount = $t04846648570._3 | |
1473 | + | let bonus = $t04846648570._4 | |
1470 | 1474 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1471 | 1475 | } | |
1472 | 1476 | ||
1473 | 1477 | ||
1474 | 1478 | ||
1475 | 1479 | @Callable(i) | |
1476 | 1480 | func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString(fca))) | |
1477 | 1481 | then throw("denied") | |
1478 | 1482 | else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr)], "success") | |
1479 | 1483 | ||
1480 | 1484 | ||
1481 | 1485 | ||
1482 | 1486 | @Callable(i) | |
1483 | 1487 | func setS (k,v) = if ((toString(i.caller) != strf(this, ada()))) | |
1484 | 1488 | then pd | |
1485 | 1489 | else [StringEntry(k, v)] | |
1486 | 1490 | ||
1487 | 1491 | ||
1488 | 1492 | ||
1489 | 1493 | @Callable(i) | |
1490 | 1494 | func setI (k,v) = if ((toString(i.caller) != strf(this, ada()))) | |
1491 | 1495 | then pd | |
1492 | 1496 | else [IntegerEntry(k, v)] | |
1493 | 1497 | ||
1494 | 1498 | ||
1495 | 1499 | ||
1496 | 1500 | @Callable(i) | |
1497 | 1501 | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, gpc()) | |
1498 | 1502 | ||
1499 | 1503 | ||
1500 | 1504 | ||
1501 | 1505 | @Callable(i) | |
1502 | 1506 | func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId)) | |
1503 | 1507 | ||
1504 | 1508 | ||
1505 | 1509 | ||
1506 | 1510 | @Callable(i) | |
1507 | 1511 | func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = { | |
1508 | 1512 | let pr = calcPrices(amAmt, prAmt, lpAmt) | |
1509 | 1513 | $Tuple2(nil, [toString(pr[0]), toString(pr[1]), toString(pr[2])]) | |
1510 | 1514 | } | |
1511 | 1515 | ||
1512 | 1516 | ||
1513 | 1517 | ||
1514 | 1518 | @Callable(i) | |
1515 | 1519 | func fromX18WrapperREADONLY (val,resScaleMult) = $Tuple2(nil, f1(parseBigIntValue(val), resScaleMult)) | |
1516 | 1520 | ||
1517 | 1521 | ||
1518 | 1522 | ||
1519 | 1523 | @Callable(i) | |
1520 | 1524 | func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(t1(origVal, origScaleMult))) | |
1521 | 1525 | ||
1522 | 1526 | ||
1523 | 1527 | ||
1524 | 1528 | @Callable(i) | |
1525 | 1529 | func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(cpbi(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18)))) | |
1526 | 1530 | ||
1527 | 1531 | ||
1528 | 1532 | ||
1529 | 1533 | @Callable(i) | |
1530 | 1534 | func estimatePutOperationWrapperREADONLY (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,usrAddr,isEval,emitLp) = $Tuple2(nil, epo(txId58, slippage, inAmAmt, inAmId, inPrAmt, inPrId, usrAddr, isEval, emitLp, true, false, 0, "")) | |
1531 | 1535 | ||
1532 | 1536 | ||
1533 | 1537 | ||
1534 | 1538 | @Callable(i) | |
1535 | 1539 | func estimateGetOperationWrapperREADONLY (txId58,pmtAsId,pmtLpAmt,usrAddr) = { | |
1536 | 1540 | let r = ego(txId58, pmtAsId, pmtLpAmt, addressFromStringValue(usrAddr)) | |
1537 | 1541 | $Tuple2(nil, $Tuple10(r._1, r._2, r._3, r._4, r._5, r._6, r._7, toString(r._8), r._9, r._10)) | |
1538 | 1542 | } | |
1539 | 1543 | ||
1540 | 1544 | ||
1541 | 1545 | ||
1542 | 1546 | @Callable(i) | |
1543 | 1547 | func getFeeREADONLY () = $Tuple2(nil, fee) | |
1544 | 1548 | ||
1545 | 1549 | ||
1546 | 1550 | @Verifier(tx) | |
1547 | 1551 | func verify () = { | |
1548 | 1552 | let targetPublicKey = match m() { | |
1549 | 1553 | case pk: ByteVector => | |
1550 | 1554 | pk | |
1551 | 1555 | case _: Unit => | |
1552 | 1556 | tx.senderPublicKey | |
1553 | 1557 | case _ => | |
1554 | 1558 | throw("Match error") | |
1555 | 1559 | } | |
1556 | 1560 | match tx { | |
1557 | 1561 | case order: Order => | |
1558 | 1562 | let matcherPub = mp() | |
1559 | 1563 | let orderValid = validateMatcherOrderAllowed(order) | |
1560 | 1564 | let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey) | |
1561 | 1565 | let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub) | |
1562 | 1566 | if (if (if (orderValid) | |
1563 | 1567 | then senderValid | |
1564 | 1568 | else false) | |
1565 | 1569 | then matcherValid | |
1566 | 1570 | else false) | |
1567 | 1571 | then true | |
1568 | 1572 | else toe(orderValid, senderValid, matcherValid) | |
1569 | 1573 | case s: SetScriptTransaction => | |
1570 | 1574 | let newHash = blake2b256(value(s.script)) | |
1571 | 1575 | let allowedHash = fromBase64String(value(getString(fca, keyAllowedLpStableScriptHash()))) | |
1572 | 1576 | let currentHash = scriptHash(this) | |
1573 | 1577 | if (if ((allowedHash == newHash)) | |
1574 | 1578 | then (currentHash != newHash) | |
1575 | 1579 | else false) | |
1576 | 1580 | then true | |
1577 | 1581 | else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
1578 | 1582 | case _ => | |
1579 | 1583 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
1580 | 1584 | } | |
1581 | 1585 | } | |
1582 | 1586 |
github/deemru/w8io/169f3d6 387.83 ms ◑