tx · 2298qTJyRiuEaCgi2LcZH5g4TgvX65H1H3eP2cjm4QeM 3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT: -0.03600000 Waves 2022.12.07 15:43 [2349940] smart account 3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT > SELF 0.00000000 Waves
{ "type": 13, "id": "2298qTJyRiuEaCgi2LcZH5g4TgvX65H1H3eP2cjm4QeM", "fee": 3600000, "feeAssetId": null, "timestamp": 1670417022409, "version": 1, "sender": "3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT", "senderPublicKey": "D1BL65meykxFZTCuq7jq9HSGLLnWvQamQPUNrguW5w39", "proofs": [ "XSniYRM8TSPWvXr5CzMfCN4rzcVbWhKgp8FVoczQEzyVifsXa7HKi7H3VJXJk1t7PhRbXkhapq4rUWuRSUyDLbe" ], "script": "base64:BgLUKAgCEgMKAQgSAwoBCBIAEgQKAgEEEgQKAgEEEgMKAQESABIECgIIARIAEgQKAggBEgQKAggBEgQKAgEBEgMKAQESBQoDAQEBEgUKAwEIARIECgIBCBIECgIBCBIECgIICBIECgIICBIECgIIARIAEgMKAQgSBQoDAQEBEgQKAggBEgQKAgEBEgQKAggIEgsKCQgBAQIBAggEBBIGCgQICAEIEgAiBnNjYWxlOCIMc2NhbGU4QmlnSW50IgdzY2FsZTE4Igp6ZXJvQmlnSW50IgRiaWcwIgRiaWcxIgRiaWcyIgRiaWczIgRiaWc0IgpzbGlwcGFnZTREIgt3YXZlc1N0cmluZyIFQW11bHQiBURjb252IgNTRVAiBUVNUFRZIgpQb29sQWN0aXZlIgpQb29sUHV0RGlzIg5Qb29sTWF0Y2hlckRpcyIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyIJaWR4UG9vbFN0IglpZHhMUEFzSWQiCWlkeEFtQXNJZCIJaWR4UHJBc0lkIgtpZHhBbXRBc0RjbSINaWR4UHJpY2VBc0RjbSILaWR4SUFtdEFzSWQiDWlkeElQcmljZUFzSWQiD2lkeEZhY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us": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3fxAE1V8ZcKjxvj8KcJ98NozrcCVL72USbdwGzKNm1L2 Next: HR6oXbCioJHvV5jnWikPf4H7osH5K7zGfDgEAqrnk2VL Diff:
Old | New | Differences | |
---|---|---|---|
602 | 602 | ||
603 | 603 | ||
604 | 604 | func calcDLp (amountBalance,priceBalance,lpEmission) = { | |
605 | - | let updatedDLp = fraction(getD([amountBalance, priceBalance]), scale18, lpEmission) | |
605 | + | let scale = toBigInt(1000000000000) | |
606 | + | let updatedDLp = fraction(getD([amountBalance, priceBalance]), scale, lpEmission) | |
606 | 607 | if ((lpEmission == big0)) | |
607 | 608 | then big0 | |
608 | 609 | else updatedDLp | |
636 | 637 | func validateMatcherOrderAllowed (order) = { | |
637 | 638 | let amountAssetAmount = order.amount | |
638 | 639 | let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR) | |
639 | - | let $ | |
640 | + | let $t02414724359 = if ((order.orderType == Buy)) | |
640 | 641 | then $Tuple2(amountAssetAmount, -(priceAssetAmount)) | |
641 | 642 | else $Tuple2(-(amountAssetAmount), priceAssetAmount) | |
642 | - | let amountAssetBalanceDelta = $ | |
643 | - | let priceAssetBalanceDelta = $ | |
643 | + | let amountAssetBalanceDelta = $t02414724359._1 | |
644 | + | let priceAssetBalanceDelta = $t02414724359._2 | |
644 | 645 | if (if (if (igs()) | |
645 | 646 | then true | |
646 | 647 | else (cfgPoolStatus == PoolMatcherDis)) | |
653 | 654 | then throw("Wr assets") | |
654 | 655 | else { | |
655 | 656 | let dLp = parseBigIntValue(getStringValue(this, keyDLp)) | |
656 | - | let $ | |
657 | - | let unusedActions = $ | |
658 | - | let dLpNew = $ | |
657 | + | let $t02468924789 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
658 | + | let unusedActions = $t02468924789._1 | |
659 | + | let dLpNew = $t02468924789._2 | |
659 | 660 | let isOrderValid = (dLpNew >= dLp) | |
660 | 661 | isOrderValid | |
661 | 662 | } | |
709 | 710 | then { | |
710 | 711 | let amBalance = getAccBalance(amId) | |
711 | 712 | let prBalance = getAccBalance(prId) | |
712 | - | let $ | |
713 | + | let $t02710627568 = if ((txId == "")) | |
713 | 714 | then $Tuple2(amBalance, prBalance) | |
714 | 715 | else if ((pmtAssetId == amId)) | |
715 | 716 | then if ((pmtAmtRaw > amBalance)) | |
720 | 721 | then throw("invalid payment amount") | |
721 | 722 | else $Tuple2(amBalance, (prBalance - pmtAmtRaw)) | |
722 | 723 | else throw("wrong pmtAssetId") | |
723 | - | let amBalanceOld = $ | |
724 | - | let prBalanceOld = $ | |
725 | - | let $ | |
724 | + | let amBalanceOld = $t02710627568._1 | |
725 | + | let prBalanceOld = $t02710627568._2 | |
726 | + | let $t02757427750 = if ((pmtAssetId == amId)) | |
726 | 727 | then $Tuple2(pmtAmtRaw, 0) | |
727 | 728 | else if ((pmtAssetId == prId)) | |
728 | 729 | then $Tuple2(0, pmtAmtRaw) | |
729 | 730 | else throw("invalid payment") | |
730 | - | let amAmountRaw = $ | |
731 | - | let prAmountRaw = $ | |
732 | - | let $ | |
731 | + | let amAmountRaw = $t02757427750._1 | |
732 | + | let prAmountRaw = $t02757427750._2 | |
733 | + | let $t02775427993 = if (withTakeFee) | |
733 | 734 | then $Tuple3(takeFee(amAmountRaw)._1, takeFee(prAmountRaw)._1, takeFee(pmtAmtRaw)._2) | |
734 | 735 | else $Tuple3(amAmountRaw, prAmountRaw, 0) | |
735 | - | let amAmount = $ | |
736 | - | let prAmount = $ | |
737 | - | let feeAmount = $ | |
736 | + | let amAmount = $t02775427993._1 | |
737 | + | let prAmount = $t02775427993._2 | |
738 | + | let feeAmount = $t02775427993._3 | |
738 | 739 | let amBalanceNew = (amBalanceOld + amAmount) | |
739 | 740 | let prBalanceNew = (prBalanceOld + prAmount) | |
740 | 741 | let D0 = getD([toBigInt(amBalanceOld), toBigInt(prBalanceOld)]) | |
783 | 784 | else { | |
784 | 785 | let amBalance = getAccBalance(amId) | |
785 | 786 | let prBalance = getAccBalance(prId) | |
786 | - | let $ | |
787 | + | let $t03005130162 = { | |
787 | 788 | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil) | |
788 | 789 | if ($isInstanceOf(@, "(Int, Int)")) | |
789 | 790 | then @ | |
790 | 791 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
791 | 792 | } | |
792 | - | if (($ | |
793 | + | if (($t03005130162 == $t03005130162)) | |
793 | 794 | then { | |
794 | - | let feeAmount = $ | |
795 | - | let totalGet = $ | |
795 | + | let feeAmount = $t03005130162._2 | |
796 | + | let totalGet = $t03005130162._1 | |
796 | 797 | let totalAmount = if (if ((minOutAmount > 0)) | |
797 | 798 | then (minOutAmount > totalGet) | |
798 | 799 | else false) | |
799 | 800 | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
800 | 801 | else totalGet | |
801 | - | let $ | |
802 | + | let $t03035230659 = if ((outAssetId == amId)) | |
802 | 803 | then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance) | |
803 | 804 | else if ((outAssetId == prId)) | |
804 | 805 | then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount)) | |
805 | 806 | else throw("invalid out asset id") | |
806 | - | let outAm = $ | |
807 | - | let outPr = $ | |
808 | - | let amBalanceNew = $ | |
809 | - | let prBalanceNew = $ | |
807 | + | let outAm = $t03035230659._1 | |
808 | + | let outPr = $t03035230659._2 | |
809 | + | let amBalanceNew = $t03035230659._3 | |
810 | + | let prBalanceNew = $t03035230659._4 | |
810 | 811 | let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals)) | |
811 | 812 | let curPr = f1(curPrX18, scale8) | |
812 | 813 | let outAssetIdOrWaves = if ((outAssetId == "WAVES")) | |
821 | 822 | let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
822 | 823 | if ((burn == burn)) | |
823 | 824 | then { | |
824 | - | let $ | |
825 | + | let $t03144431794 = { | |
825 | 826 | let feeAmountForCalc = if ((this == feeCollectorAddress)) | |
826 | 827 | then 0 | |
827 | 828 | else feeAmount | |
832 | 833 | then $Tuple2(-((totalGet + feeAmountForCalc)), 0) | |
833 | 834 | else $Tuple2(0, -((totalGet + feeAmountForCalc))) | |
834 | 835 | } | |
835 | - | let amountAssetBalanceDelta = $ | |
836 | - | let priceAssetBalanceDelta = $ | |
837 | - | let $ | |
838 | - | let refreshDLpActions = $ | |
839 | - | let updatedDLp = $ | |
836 | + | let amountAssetBalanceDelta = $t03144431794._1 | |
837 | + | let priceAssetBalanceDelta = $t03144431794._2 | |
838 | + | let $t03179731905 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
839 | + | let refreshDLpActions = $t03179731905._1 | |
840 | + | let updatedDLp = $t03179731905._2 | |
840 | 841 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
841 | 842 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
842 | 843 | then $Tuple2((state ++ refreshDLpActions), totalAmount) | |
996 | 997 | else throw("Strict value is not equal to itself.") | |
997 | 998 | } | |
998 | 999 | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
999 | - | let $ | |
1000 | - | let refreshDLpActions = $ | |
1001 | - | let updatedDLp = $ | |
1000 | + | let $t03576135826 = refreshDLpInternal(0, 0, 0) | |
1001 | + | let refreshDLpActions = $t03576135826._1 | |
1002 | + | let updatedDLp = $t03576135826._2 | |
1002 | 1003 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1003 | 1004 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1004 | 1005 | then ((state ++ lpTrnsfr) ++ refreshDLpActions) | |
1054 | 1055 | let pmt = value(i.payments[0]) | |
1055 | 1056 | let pmtAssetId = toBase58String(value(pmt.assetId)) | |
1056 | 1057 | let pmtAmt = pmt.amount | |
1057 | - | let $ | |
1058 | - | if (($ | |
1058 | + | let $t03696337121 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true) | |
1059 | + | if (($t03696337121 == $t03696337121)) | |
1059 | 1060 | then { | |
1060 | - | let feeAmount = $ | |
1061 | - | let state = $ | |
1062 | - | let estimLP = $ | |
1061 | + | let feeAmount = $t03696337121._3 | |
1062 | + | let state = $t03696337121._2 | |
1063 | + | let estimLP = $t03696337121._1 | |
1063 | 1064 | let emitLpAmt = if (if ((minOutAmount > 0)) | |
1064 | 1065 | then (minOutAmount > estimLP) | |
1065 | 1066 | else false) | |
1087 | 1088 | let sendFeeToMatcher = if ((feeAmount > 0)) | |
1088 | 1089 | then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))] | |
1089 | 1090 | else nil | |
1090 | - | let $ | |
1091 | + | let $t03793638285 = if ((this == feeCollectorAddress)) | |
1091 | 1092 | then $Tuple2(0, 0) | |
1092 | 1093 | else { | |
1093 | 1094 | let paymentInAmountAsset = if ((pmt.assetId == cfgAmountAssetId)) | |
1097 | 1098 | then $Tuple2(-(feeAmount), 0) | |
1098 | 1099 | else $Tuple2(0, -(feeAmount)) | |
1099 | 1100 | } | |
1100 | - | let amountAssetBalanceDelta = $ | |
1101 | - | let priceAssetBalanceDelta = $ | |
1102 | - | let $ | |
1103 | - | let refreshDLpActions = $ | |
1104 | - | let updatedDLp = $ | |
1101 | + | let amountAssetBalanceDelta = $t03793638285._1 | |
1102 | + | let priceAssetBalanceDelta = $t03793638285._2 | |
1103 | + | let $t03828838396 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
1104 | + | let refreshDLpActions = $t03828838396._1 | |
1105 | + | let updatedDLp = $t03828838396._2 | |
1105 | 1106 | $Tuple2((((state ++ lpTrnsfr) ++ sendFeeToMatcher) ++ refreshDLpActions), emitLpAmt) | |
1106 | 1107 | } | |
1107 | 1108 | else throw("Strict value is not equal to itself.") | |
1128 | 1129 | let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0)) | |
1129 | 1130 | if ((currentDLp == currentDLp)) | |
1130 | 1131 | then { | |
1131 | - | let $ | |
1132 | - | let refreshDLpActions = $ | |
1133 | - | let updatedDLp = $ | |
1132 | + | let $t03935539420 = refreshDLpInternal(0, 0, 0) | |
1133 | + | let refreshDLpActions = $t03935539420._1 | |
1134 | + | let updatedDLp = $t03935539420._2 | |
1134 | 1135 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1135 | 1136 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1136 | 1137 | then (state ++ refreshDLpActions) | |
1153 | 1154 | if ((b == b)) | |
1154 | 1155 | then { | |
1155 | 1156 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(pmtAmt)) | |
1156 | - | let $ | |
1157 | - | let refreshDLpActions = $ | |
1158 | - | let updatedDLp = $ | |
1157 | + | let $t04020940291 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0) | |
1158 | + | let refreshDLpActions = $t04020940291._1 | |
1159 | + | let updatedDLp = $t04020940291._2 | |
1159 | 1160 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1160 | 1161 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1161 | 1162 | then (state ++ refreshDLpActions) | |
1188 | 1189 | else throwErr("exactly 1 payment are expected")] | |
1189 | 1190 | if ((checks == checks)) | |
1190 | 1191 | then { | |
1191 | - | let $ | |
1192 | - | let state = $ | |
1193 | - | let totalAmount = $ | |
1192 | + | let $t04090941064 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId) | |
1193 | + | let state = $t04090941064._1 | |
1194 | + | let totalAmount = $t04090941064._2 | |
1194 | 1195 | $Tuple2(state, totalAmount) | |
1195 | 1196 | } | |
1196 | 1197 | else throw("Strict value is not equal to itself.") | |
1207 | 1208 | if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight)) | |
1208 | 1209 | then { | |
1209 | 1210 | let dLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyDLp), "0")), fmtErr("invalid dLp")) | |
1210 | - | let $ | |
1211 | - | let dLpUpdateActions = $ | |
1212 | - | let updatedDLp = $ | |
1211 | + | let $t04158841652 = refreshDLpInternal(0, 0, 0) | |
1212 | + | let dLpUpdateActions = $t04158841652._1 | |
1213 | + | let updatedDLp = $t04158841652._2 | |
1213 | 1214 | let actions = if ((dLp != updatedDLp)) | |
1214 | 1215 | then dLpUpdateActions | |
1215 | 1216 | else throwErr("nothing to refresh") | |
1238 | 1239 | let newY = getYD(xp, index, D1) | |
1239 | 1240 | let dy = (xp[index] - newY) | |
1240 | 1241 | let totalGetRaw = max([0, toInt((dy - big1))]) | |
1241 | - | let $ | |
1242 | - | let totalGet = $ | |
1243 | - | let feeAmount = $ | |
1242 | + | let $t04255242601 = takeFee(totalGetRaw) | |
1243 | + | let totalGet = $t04255242601._1 | |
1244 | + | let feeAmount = $t04255242601._2 | |
1244 | 1245 | $Tuple2(nil, $Tuple2(totalGet, feeAmount)) | |
1245 | 1246 | } | |
1246 | 1247 | ||
1254 | 1255 | let lpId = poolConfig[idxLPAsId] | |
1255 | 1256 | let amBalance = getAccBalance(amId) | |
1256 | 1257 | let prBalance = getAccBalance(prId) | |
1257 | - | let $ | |
1258 | + | let $t04294643061 = { | |
1258 | 1259 | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil) | |
1259 | 1260 | if ($isInstanceOf(@, "(Int, Int)")) | |
1260 | 1261 | then @ | |
1261 | 1262 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
1262 | 1263 | } | |
1263 | - | let totalGet = $ | |
1264 | - | let feeAmount = $ | |
1264 | + | let totalGet = $t04294643061._1 | |
1265 | + | let feeAmount = $t04294643061._2 | |
1265 | 1266 | let r = ego("", lpId, lpAssetAmount, this) | |
1266 | 1267 | let outAmAmt = r._1 | |
1267 | 1268 | let outPrAmt = r._2 | |
1293 | 1294 | let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1294 | 1295 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1295 | 1296 | then { | |
1296 | - | let $ | |
1297 | - | let refreshDLpActions = $ | |
1298 | - | let updatedDLp = $ | |
1297 | + | let $t04422944310 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1298 | + | let refreshDLpActions = $t04422944310._1 | |
1299 | + | let updatedDLp = $t04422944310._2 | |
1299 | 1300 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1300 | 1301 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1301 | 1302 | then (state ++ refreshDLpActions) | |
1337 | 1338 | let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)]) | |
1338 | 1339 | if ((burnA == burnA)) | |
1339 | 1340 | then { | |
1340 | - | let $ | |
1341 | - | let refreshDLpActions = $ | |
1342 | - | let updatedDLp = $ | |
1341 | + | let $t04537345454 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1342 | + | let refreshDLpActions = $t04537345454._1 | |
1343 | + | let updatedDLp = $t04537345454._2 | |
1343 | 1344 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1344 | 1345 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1345 | 1346 | then (state ++ refreshDLpActions) | |
1386 | 1387 | let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)]) | |
1387 | 1388 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1388 | 1389 | then { | |
1389 | - | let $ | |
1390 | - | let refreshDLpActions = $ | |
1391 | - | let updatedDLp = $ | |
1390 | + | let $t04670246783 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1391 | + | let refreshDLpActions = $t04670246783._1 | |
1392 | + | let updatedDLp = $t04670246783._2 | |
1392 | 1393 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1393 | 1394 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1394 | 1395 | then (state ++ refreshDLpActions) | |
1434 | 1435 | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), unstakeAmount], nil) | |
1435 | 1436 | if ((unstakeInv == unstakeInv)) | |
1436 | 1437 | then { | |
1437 | - | let $ | |
1438 | - | let state = $ | |
1439 | - | let totalAmount = $ | |
1438 | + | let $t04771747905 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId) | |
1439 | + | let state = $t04771747905._1 | |
1440 | + | let totalAmount = $t04771747905._2 | |
1440 | 1441 | $Tuple2(state, totalAmount) | |
1441 | 1442 | } | |
1442 | 1443 | else throw("Strict value is not equal to itself.") | |
1452 | 1453 | let amId = poolConfig[idxAmAsId] | |
1453 | 1454 | let prId = poolConfig[idxPrAsId] | |
1454 | 1455 | let lpId = poolConfig[idxLPAsId] | |
1455 | - | let $ | |
1456 | - | let lpAmount = $ | |
1457 | - | let state = $ | |
1458 | - | let feeAmount = $ | |
1459 | - | let bonus = $ | |
1456 | + | let $t04816448267 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true) | |
1457 | + | let lpAmount = $t04816448267._1 | |
1458 | + | let state = $t04816448267._2 | |
1459 | + | let feeAmount = $t04816448267._3 | |
1460 | + | let bonus = $t04816448267._4 | |
1460 | 1461 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1461 | 1462 | } | |
1462 | 1463 | ||
1468 | 1469 | let amId = poolConfig[idxAmAsId] | |
1469 | 1470 | let prId = poolConfig[idxPrAsId] | |
1470 | 1471 | let lpId = poolConfig[idxLPAsId] | |
1471 | - | let $ | |
1472 | - | let lpAmount = $ | |
1473 | - | let state = $ | |
1474 | - | let feeAmount = $ | |
1475 | - | let bonus = $ | |
1472 | + | let $t04854648650 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false) | |
1473 | + | let lpAmount = $t04854648650._1 | |
1474 | + | let state = $t04854648650._2 | |
1475 | + | let feeAmount = $t04854648650._3 | |
1476 | + | let bonus = $t04854648650._4 | |
1476 | 1477 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1477 | 1478 | } | |
1478 | 1479 |
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 | - | let updatedDLp = fraction(getD([amountBalance, priceBalance]), scale18, lpEmission) | |
605 | + | let scale = toBigInt(1000000000000) | |
606 | + | let updatedDLp = fraction(getD([amountBalance, priceBalance]), scale, lpEmission) | |
606 | 607 | if ((lpEmission == big0)) | |
607 | 608 | then big0 | |
608 | 609 | else updatedDLp | |
609 | 610 | } | |
610 | 611 | ||
611 | 612 | ||
612 | 613 | func calcCurrentDLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = { | |
613 | 614 | let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta) | |
614 | 615 | let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta) | |
615 | 616 | let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta) | |
616 | 617 | let currentDLp = calcDLp(amountAssetBalance, priceAssetBalance, lpAssetEmission) | |
617 | 618 | currentDLp | |
618 | 619 | } | |
619 | 620 | ||
620 | 621 | ||
621 | 622 | func refreshDLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = { | |
622 | 623 | let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta) | |
623 | 624 | let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta) | |
624 | 625 | let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta) | |
625 | 626 | let updatedDLp = calcDLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission)) | |
626 | 627 | let actions = [IntegerEntry(keyDLpRefreshedHeight, height), StringEntry(keyDLp, toString(updatedDLp))] | |
627 | 628 | $Tuple2(actions, updatedDLp) | |
628 | 629 | } | |
629 | 630 | ||
630 | 631 | ||
631 | 632 | func validateUpdatedDLp (oldDLp,updatedDLp) = if ((updatedDLp >= oldDLp)) | |
632 | 633 | then true | |
633 | 634 | else throwErr("updated DLp lower than current DLp") | |
634 | 635 | ||
635 | 636 | ||
636 | 637 | func validateMatcherOrderAllowed (order) = { | |
637 | 638 | let amountAssetAmount = order.amount | |
638 | 639 | let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR) | |
639 | - | let $ | |
640 | + | let $t02414724359 = if ((order.orderType == Buy)) | |
640 | 641 | then $Tuple2(amountAssetAmount, -(priceAssetAmount)) | |
641 | 642 | else $Tuple2(-(amountAssetAmount), priceAssetAmount) | |
642 | - | let amountAssetBalanceDelta = $ | |
643 | - | let priceAssetBalanceDelta = $ | |
643 | + | let amountAssetBalanceDelta = $t02414724359._1 | |
644 | + | let priceAssetBalanceDelta = $t02414724359._2 | |
644 | 645 | if (if (if (igs()) | |
645 | 646 | then true | |
646 | 647 | else (cfgPoolStatus == PoolMatcherDis)) | |
647 | 648 | then true | |
648 | 649 | else (cfgPoolStatus == PoolShutdown)) | |
649 | 650 | then throw("Admin blocked") | |
650 | 651 | else if (if ((order.assetPair.amountAsset != cfgAmountAssetId)) | |
651 | 652 | then true | |
652 | 653 | else (order.assetPair.priceAsset != cfgPriceAssetId)) | |
653 | 654 | then throw("Wr assets") | |
654 | 655 | else { | |
655 | 656 | let dLp = parseBigIntValue(getStringValue(this, keyDLp)) | |
656 | - | let $ | |
657 | - | let unusedActions = $ | |
658 | - | let dLpNew = $ | |
657 | + | let $t02468924789 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
658 | + | let unusedActions = $t02468924789._1 | |
659 | + | let dLpNew = $t02468924789._2 | |
659 | 660 | let isOrderValid = (dLpNew >= dLp) | |
660 | 661 | isOrderValid | |
661 | 662 | } | |
662 | 663 | } | |
663 | 664 | ||
664 | 665 | ||
665 | 666 | func cg (i) = if ((size(i.payments) != 1)) | |
666 | 667 | then throw("1 pmnt exp") | |
667 | 668 | else { | |
668 | 669 | let pmt = value(i.payments[0]) | |
669 | 670 | let pmtAssetId = value(pmt.assetId) | |
670 | 671 | let pmtAmt = pmt.amount | |
671 | 672 | let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller) | |
672 | 673 | let outAmAmt = r._1 | |
673 | 674 | let outPrAmt = r._2 | |
674 | 675 | let sts = parseIntValue(r._9) | |
675 | 676 | let state = r._10 | |
676 | 677 | if (if (igs()) | |
677 | 678 | then true | |
678 | 679 | else (sts == PoolShutdown)) | |
679 | 680 | then throw(("Admin blocked: " + toString(sts))) | |
680 | 681 | else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state) | |
681 | 682 | } | |
682 | 683 | ||
683 | 684 | ||
684 | 685 | func cp (caller,txId,amAsPmt,prAsPmt,slippage,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = { | |
685 | 686 | let r = epo(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, (txId == ""), emitLp, isOneAsset, validateSlippage, pmtAmt, pmtId) | |
686 | 687 | let sts = parseIntValue(r._8) | |
687 | 688 | if (if (if (igs()) | |
688 | 689 | then true | |
689 | 690 | else (sts == PoolPutDis)) | |
690 | 691 | then true | |
691 | 692 | else (sts == PoolShutdown)) | |
692 | 693 | then throw(("Blocked:" + toString(sts))) | |
693 | 694 | else r | |
694 | 695 | } | |
695 | 696 | ||
696 | 697 | ||
697 | 698 | func calcPutOneTkn (pmtAmtRaw,pmtAssetId,userAddress,txId,withTakeFee) = { | |
698 | 699 | let poolConfig = gpc() | |
699 | 700 | let amId = poolConfig[idxAmAsId] | |
700 | 701 | let prId = poolConfig[idxPrAsId] | |
701 | 702 | let lpId = poolConfig[idxLPAsId] | |
702 | 703 | let amtDcm = parseIntValue(poolConfig[idxAmtAsDcm]) | |
703 | 704 | let priceDcm = parseIntValue(poolConfig[idxPriceAsDcm]) | |
704 | 705 | let lpAssetEmission = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "invalid lp asset").quantity) | |
705 | 706 | let chechEmission = if ((lpAssetEmission > big0)) | |
706 | 707 | then true | |
707 | 708 | else throw("initial deposit requires all coins") | |
708 | 709 | if ((chechEmission == chechEmission)) | |
709 | 710 | then { | |
710 | 711 | let amBalance = getAccBalance(amId) | |
711 | 712 | let prBalance = getAccBalance(prId) | |
712 | - | let $ | |
713 | + | let $t02710627568 = if ((txId == "")) | |
713 | 714 | then $Tuple2(amBalance, prBalance) | |
714 | 715 | else if ((pmtAssetId == amId)) | |
715 | 716 | then if ((pmtAmtRaw > amBalance)) | |
716 | 717 | then throw("invalid payment amount") | |
717 | 718 | else $Tuple2((amBalance - pmtAmtRaw), prBalance) | |
718 | 719 | else if ((pmtAssetId == prId)) | |
719 | 720 | then if ((pmtAmtRaw > prBalance)) | |
720 | 721 | then throw("invalid payment amount") | |
721 | 722 | else $Tuple2(amBalance, (prBalance - pmtAmtRaw)) | |
722 | 723 | else throw("wrong pmtAssetId") | |
723 | - | let amBalanceOld = $ | |
724 | - | let prBalanceOld = $ | |
725 | - | let $ | |
724 | + | let amBalanceOld = $t02710627568._1 | |
725 | + | let prBalanceOld = $t02710627568._2 | |
726 | + | let $t02757427750 = if ((pmtAssetId == amId)) | |
726 | 727 | then $Tuple2(pmtAmtRaw, 0) | |
727 | 728 | else if ((pmtAssetId == prId)) | |
728 | 729 | then $Tuple2(0, pmtAmtRaw) | |
729 | 730 | else throw("invalid payment") | |
730 | - | let amAmountRaw = $ | |
731 | - | let prAmountRaw = $ | |
732 | - | let $ | |
731 | + | let amAmountRaw = $t02757427750._1 | |
732 | + | let prAmountRaw = $t02757427750._2 | |
733 | + | let $t02775427993 = if (withTakeFee) | |
733 | 734 | then $Tuple3(takeFee(amAmountRaw)._1, takeFee(prAmountRaw)._1, takeFee(pmtAmtRaw)._2) | |
734 | 735 | else $Tuple3(amAmountRaw, prAmountRaw, 0) | |
735 | - | let amAmount = $ | |
736 | - | let prAmount = $ | |
737 | - | let feeAmount = $ | |
736 | + | let amAmount = $t02775427993._1 | |
737 | + | let prAmount = $t02775427993._2 | |
738 | + | let feeAmount = $t02775427993._3 | |
738 | 739 | let amBalanceNew = (amBalanceOld + amAmount) | |
739 | 740 | let prBalanceNew = (prBalanceOld + prAmount) | |
740 | 741 | let D0 = getD([toBigInt(amBalanceOld), toBigInt(prBalanceOld)]) | |
741 | 742 | let D1 = getD([toBigInt(amBalanceNew), toBigInt(prBalanceNew)]) | |
742 | 743 | let checkD = if ((D1 > D0)) | |
743 | 744 | then true | |
744 | 745 | else throw() | |
745 | 746 | if ((checkD == checkD)) | |
746 | 747 | then { | |
747 | 748 | let lpAmount = fraction(lpAssetEmission, (D1 - D0), D0) | |
748 | 749 | let curPrice = f1(cpbi(t1(prBalanceNew, priceDcm), t1(amBalanceNew, amtDcm)), scale8) | |
749 | 750 | 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))] | |
750 | 751 | let poolProportion = fraction(prBalanceOld, scale8, amBalanceOld) | |
751 | 752 | let amountAssetPart = fraction(pmtAmtRaw, scale8, (poolProportion + scale8)) | |
752 | 753 | let priceAssetPart = (pmtAmtRaw - amountAssetPart) | |
753 | 754 | let lpAmtBoth = fraction(lpAssetEmission, toBigInt(priceAssetPart), toBigInt(prBalanceOld)) | |
754 | 755 | let bonus = toInt(fraction((lpAmount - lpAmtBoth), scale8BigInt, lpAmtBoth)) | |
755 | 756 | $Tuple4(toInt(lpAmount), commonState, feeAmount, bonus) | |
756 | 757 | } | |
757 | 758 | else throw("Strict value is not equal to itself.") | |
758 | 759 | } | |
759 | 760 | else throw("Strict value is not equal to itself.") | |
760 | 761 | } | |
761 | 762 | ||
762 | 763 | ||
763 | 764 | func getOneTknV2Internal (outAssetId,minOutAmount,payments,caller,originCaller,transactionId) = { | |
764 | 765 | let poolConfig = gpc() | |
765 | 766 | let lpId = poolConfig[idxLPAsId] | |
766 | 767 | let amId = poolConfig[idxAmAsId] | |
767 | 768 | let prId = poolConfig[idxPrAsId] | |
768 | 769 | let amDecimals = parseIntValue(poolConfig[idxAmtAsDcm]) | |
769 | 770 | let prDecimals = parseIntValue(poolConfig[idxPriceAsDcm]) | |
770 | 771 | let poolStatus = poolConfig[idxPoolSt] | |
771 | 772 | let userAddress = if ((caller == restContract)) | |
772 | 773 | then originCaller | |
773 | 774 | else caller | |
774 | 775 | let pmt = value(payments[0]) | |
775 | 776 | let pmtAssetId = value(pmt.assetId) | |
776 | 777 | let pmtAmt = pmt.amount | |
777 | 778 | let currentDLp = calcCurrentDLp(big0, big0, big0) | |
778 | 779 | if ((currentDLp == currentDLp)) | |
779 | 780 | then { | |
780 | 781 | let txId58 = toBase58String(transactionId) | |
781 | 782 | if ((lpId != toBase58String(pmtAssetId))) | |
782 | 783 | then throw("Wrong LP") | |
783 | 784 | else { | |
784 | 785 | let amBalance = getAccBalance(amId) | |
785 | 786 | let prBalance = getAccBalance(prId) | |
786 | - | let $ | |
787 | + | let $t03005130162 = { | |
787 | 788 | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil) | |
788 | 789 | if ($isInstanceOf(@, "(Int, Int)")) | |
789 | 790 | then @ | |
790 | 791 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
791 | 792 | } | |
792 | - | if (($ | |
793 | + | if (($t03005130162 == $t03005130162)) | |
793 | 794 | then { | |
794 | - | let feeAmount = $ | |
795 | - | let totalGet = $ | |
795 | + | let feeAmount = $t03005130162._2 | |
796 | + | let totalGet = $t03005130162._1 | |
796 | 797 | let totalAmount = if (if ((minOutAmount > 0)) | |
797 | 798 | then (minOutAmount > totalGet) | |
798 | 799 | else false) | |
799 | 800 | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
800 | 801 | else totalGet | |
801 | - | let $ | |
802 | + | let $t03035230659 = if ((outAssetId == amId)) | |
802 | 803 | then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance) | |
803 | 804 | else if ((outAssetId == prId)) | |
804 | 805 | then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount)) | |
805 | 806 | else throw("invalid out asset id") | |
806 | - | let outAm = $ | |
807 | - | let outPr = $ | |
808 | - | let amBalanceNew = $ | |
809 | - | let prBalanceNew = $ | |
807 | + | let outAm = $t03035230659._1 | |
808 | + | let outPr = $t03035230659._2 | |
809 | + | let amBalanceNew = $t03035230659._3 | |
810 | + | let prBalanceNew = $t03035230659._4 | |
810 | 811 | let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals)) | |
811 | 812 | let curPr = f1(curPrX18, scale8) | |
812 | 813 | let outAssetIdOrWaves = if ((outAssetId == "WAVES")) | |
813 | 814 | then unit | |
814 | 815 | else fromBase58String(outAssetId) | |
815 | 816 | let sendFeeToMatcher = if ((feeAmount > 0)) | |
816 | 817 | then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetIdOrWaves)] | |
817 | 818 | else nil | |
818 | 819 | 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) | |
819 | 820 | if ((state == state)) | |
820 | 821 | then { | |
821 | 822 | let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
822 | 823 | if ((burn == burn)) | |
823 | 824 | then { | |
824 | - | let $ | |
825 | + | let $t03144431794 = { | |
825 | 826 | let feeAmountForCalc = if ((this == feeCollectorAddress)) | |
826 | 827 | then 0 | |
827 | 828 | else feeAmount | |
828 | 829 | let outInAmountAsset = if ((parseAssetId(outAssetId) == cfgAmountAssetId)) | |
829 | 830 | then true | |
830 | 831 | else false | |
831 | 832 | if (outInAmountAsset) | |
832 | 833 | then $Tuple2(-((totalGet + feeAmountForCalc)), 0) | |
833 | 834 | else $Tuple2(0, -((totalGet + feeAmountForCalc))) | |
834 | 835 | } | |
835 | - | let amountAssetBalanceDelta = $ | |
836 | - | let priceAssetBalanceDelta = $ | |
837 | - | let $ | |
838 | - | let refreshDLpActions = $ | |
839 | - | let updatedDLp = $ | |
836 | + | let amountAssetBalanceDelta = $t03144431794._1 | |
837 | + | let priceAssetBalanceDelta = $t03144431794._2 | |
838 | + | let $t03179731905 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
839 | + | let refreshDLpActions = $t03179731905._1 | |
840 | + | let updatedDLp = $t03179731905._2 | |
840 | 841 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
841 | 842 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
842 | 843 | then $Tuple2((state ++ refreshDLpActions), totalAmount) | |
843 | 844 | else throw("Strict value is not equal to itself.") | |
844 | 845 | } | |
845 | 846 | else throw("Strict value is not equal to itself.") | |
846 | 847 | } | |
847 | 848 | else throw("Strict value is not equal to itself.") | |
848 | 849 | } | |
849 | 850 | else throw("Strict value is not equal to itself.") | |
850 | 851 | } | |
851 | 852 | } | |
852 | 853 | else throw("Strict value is not equal to itself.") | |
853 | 854 | } | |
854 | 855 | ||
855 | 856 | ||
856 | 857 | func m () = match getString(mpk()) { | |
857 | 858 | case s: String => | |
858 | 859 | fromBase58String(s) | |
859 | 860 | case _: Unit => | |
860 | 861 | unit | |
861 | 862 | case _ => | |
862 | 863 | throw("Match error") | |
863 | 864 | } | |
864 | 865 | ||
865 | 866 | ||
866 | 867 | func pm () = match getString(pmpk()) { | |
867 | 868 | case s: String => | |
868 | 869 | fromBase58String(s) | |
869 | 870 | case _: Unit => | |
870 | 871 | unit | |
871 | 872 | case _ => | |
872 | 873 | throw("Match error") | |
873 | 874 | } | |
874 | 875 | ||
875 | 876 | ||
876 | 877 | let pd = throw("Permission denied") | |
877 | 878 | ||
878 | 879 | func isManager (i) = match m() { | |
879 | 880 | case pk: ByteVector => | |
880 | 881 | (i.callerPublicKey == pk) | |
881 | 882 | case _: Unit => | |
882 | 883 | (i.caller == this) | |
883 | 884 | case _ => | |
884 | 885 | throw("Match error") | |
885 | 886 | } | |
886 | 887 | ||
887 | 888 | ||
888 | 889 | func mm (i) = match m() { | |
889 | 890 | case pk: ByteVector => | |
890 | 891 | if ((i.callerPublicKey == pk)) | |
891 | 892 | then true | |
892 | 893 | else pd | |
893 | 894 | case _: Unit => | |
894 | 895 | if ((i.caller == this)) | |
895 | 896 | then true | |
896 | 897 | else pd | |
897 | 898 | case _ => | |
898 | 899 | throw("Match error") | |
899 | 900 | } | |
900 | 901 | ||
901 | 902 | ||
902 | 903 | @Callable(i) | |
903 | 904 | func constructor (fc) = { | |
904 | 905 | let c = mm(i) | |
905 | 906 | if ((c == c)) | |
906 | 907 | then [StringEntry(fc(), fc)] | |
907 | 908 | else throw("Strict value is not equal to itself.") | |
908 | 909 | } | |
909 | 910 | ||
910 | 911 | ||
911 | 912 | ||
912 | 913 | @Callable(i) | |
913 | 914 | func setManager (pendingManagerPublicKey) = { | |
914 | 915 | let c = mm(i) | |
915 | 916 | if ((c == c)) | |
916 | 917 | then { | |
917 | 918 | let cm = fromBase58String(pendingManagerPublicKey) | |
918 | 919 | if ((cm == cm)) | |
919 | 920 | then [StringEntry(pmpk(), pendingManagerPublicKey)] | |
920 | 921 | else throw("Strict value is not equal to itself.") | |
921 | 922 | } | |
922 | 923 | else throw("Strict value is not equal to itself.") | |
923 | 924 | } | |
924 | 925 | ||
925 | 926 | ||
926 | 927 | ||
927 | 928 | @Callable(i) | |
928 | 929 | func confirmManager () = { | |
929 | 930 | let p = pm() | |
930 | 931 | let hpm = if (isDefined(p)) | |
931 | 932 | then true | |
932 | 933 | else throw("No pending manager") | |
933 | 934 | if ((hpm == hpm)) | |
934 | 935 | then { | |
935 | 936 | let cpm = if ((i.callerPublicKey == value(p))) | |
936 | 937 | then true | |
937 | 938 | else throw("You are not pending manager") | |
938 | 939 | if ((cpm == cpm)) | |
939 | 940 | then [StringEntry(mpk(), toBase58String(value(p))), DeleteEntry(pmpk())] | |
940 | 941 | else throw("Strict value is not equal to itself.") | |
941 | 942 | } | |
942 | 943 | else throw("Strict value is not equal to itself.") | |
943 | 944 | } | |
944 | 945 | ||
945 | 946 | ||
946 | 947 | ||
947 | 948 | @Callable(i) | |
948 | 949 | func put (slip,autoStake) = { | |
949 | 950 | let factCfg = gfc() | |
950 | 951 | let stakingCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactStakCntr]), "Wr st addr") | |
951 | 952 | let slipCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactSlippCntr]), "Wr sl addr") | |
952 | 953 | if ((0 > slip)) | |
953 | 954 | then throw("Wrong slippage") | |
954 | 955 | else if ((size(i.payments) != 2)) | |
955 | 956 | then throw("2 pmnts expd") | |
956 | 957 | else { | |
957 | 958 | let amAssetPmt = toBigInt(value(i.payments[0]).amount) | |
958 | 959 | let prAssetPmt = toBigInt(value(i.payments[1]).amount) | |
959 | 960 | let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0)) | |
960 | 961 | if ((currentDLp == currentDLp)) | |
961 | 962 | then { | |
962 | 963 | 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, "") | |
963 | 964 | let emitLpAmt = e._2 | |
964 | 965 | let lpAssetId = e._7 | |
965 | 966 | let state = e._9 | |
966 | 967 | let amDiff = e._10 | |
967 | 968 | let prDiff = e._11 | |
968 | 969 | let amId = e._12 | |
969 | 970 | let prId = e._13 | |
970 | 971 | let r = invoke(fca, "emit", [emitLpAmt], nil) | |
971 | 972 | if ((r == r)) | |
972 | 973 | then { | |
973 | 974 | let el = match r { | |
974 | 975 | case legacy: Address => | |
975 | 976 | invoke(legacy, "emit", [emitLpAmt], nil) | |
976 | 977 | case _ => | |
977 | 978 | unit | |
978 | 979 | } | |
979 | 980 | if ((el == el)) | |
980 | 981 | then { | |
981 | 982 | let sa = if ((amDiff > 0)) | |
982 | 983 | then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)]) | |
983 | 984 | else nil | |
984 | 985 | if ((sa == sa)) | |
985 | 986 | then { | |
986 | 987 | let sp = if ((prDiff > 0)) | |
987 | 988 | then invoke(slipCntr, "put", nil, [AttachedPayment(prId, prDiff)]) | |
988 | 989 | else nil | |
989 | 990 | if ((sp == sp)) | |
990 | 991 | then { | |
991 | 992 | let lpTrnsfr = if (autoStake) | |
992 | 993 | then { | |
993 | 994 | let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
994 | 995 | if ((ss == ss)) | |
995 | 996 | then nil | |
996 | 997 | else throw("Strict value is not equal to itself.") | |
997 | 998 | } | |
998 | 999 | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
999 | - | let $ | |
1000 | - | let refreshDLpActions = $ | |
1001 | - | let updatedDLp = $ | |
1000 | + | let $t03576135826 = refreshDLpInternal(0, 0, 0) | |
1001 | + | let refreshDLpActions = $t03576135826._1 | |
1002 | + | let updatedDLp = $t03576135826._2 | |
1002 | 1003 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1003 | 1004 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1004 | 1005 | then ((state ++ lpTrnsfr) ++ refreshDLpActions) | |
1005 | 1006 | else throw("Strict value is not equal to itself.") | |
1006 | 1007 | } | |
1007 | 1008 | else throw("Strict value is not equal to itself.") | |
1008 | 1009 | } | |
1009 | 1010 | else throw("Strict value is not equal to itself.") | |
1010 | 1011 | } | |
1011 | 1012 | else throw("Strict value is not equal to itself.") | |
1012 | 1013 | } | |
1013 | 1014 | else throw("Strict value is not equal to itself.") | |
1014 | 1015 | } | |
1015 | 1016 | else throw("Strict value is not equal to itself.") | |
1016 | 1017 | } | |
1017 | 1018 | } | |
1018 | 1019 | ||
1019 | 1020 | ||
1020 | 1021 | ||
1021 | 1022 | @Callable(i) | |
1022 | 1023 | func putOneTknV2 (minOutAmount,autoStake) = { | |
1023 | 1024 | let isPoolOneTokenOperationsDisabled = { | |
1024 | 1025 | let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1025 | 1026 | if ($isInstanceOf(@, "Boolean")) | |
1026 | 1027 | then @ | |
1027 | 1028 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
1028 | 1029 | } | |
1029 | 1030 | let isPutDisabled = if (if (if (igs()) | |
1030 | 1031 | then true | |
1031 | 1032 | else (cfgPoolStatus == PoolPutDis)) | |
1032 | 1033 | then true | |
1033 | 1034 | else (cfgPoolStatus == PoolShutdown)) | |
1034 | 1035 | then true | |
1035 | 1036 | else isPoolOneTokenOperationsDisabled | |
1036 | 1037 | let checks = [if (if (!(isPutDisabled)) | |
1037 | 1038 | then true | |
1038 | 1039 | else isManager(i)) | |
1039 | 1040 | then true | |
1040 | 1041 | else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1)) | |
1041 | 1042 | then true | |
1042 | 1043 | else throwErr("exactly 1 payment are expected")] | |
1043 | 1044 | if ((checks == checks)) | |
1044 | 1045 | then { | |
1045 | 1046 | let poolConfig = gpc() | |
1046 | 1047 | let amId = poolConfig[idxAmAsId] | |
1047 | 1048 | let prId = poolConfig[idxPrAsId] | |
1048 | 1049 | let lpId = fromBase58String(poolConfig[idxLPAsId]) | |
1049 | 1050 | let amDecimals = parseIntValue(poolConfig[idxAmtAsDcm]) | |
1050 | 1051 | let prDecimals = parseIntValue(poolConfig[idxPriceAsDcm]) | |
1051 | 1052 | let userAddress = if ((i.caller == this)) | |
1052 | 1053 | then i.originCaller | |
1053 | 1054 | else i.caller | |
1054 | 1055 | let pmt = value(i.payments[0]) | |
1055 | 1056 | let pmtAssetId = toBase58String(value(pmt.assetId)) | |
1056 | 1057 | let pmtAmt = pmt.amount | |
1057 | - | let $ | |
1058 | - | if (($ | |
1058 | + | let $t03696337121 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true) | |
1059 | + | if (($t03696337121 == $t03696337121)) | |
1059 | 1060 | then { | |
1060 | - | let feeAmount = $ | |
1061 | - | let state = $ | |
1062 | - | let estimLP = $ | |
1061 | + | let feeAmount = $t03696337121._3 | |
1062 | + | let state = $t03696337121._2 | |
1063 | + | let estimLP = $t03696337121._1 | |
1063 | 1064 | let emitLpAmt = if (if ((minOutAmount > 0)) | |
1064 | 1065 | then (minOutAmount > estimLP) | |
1065 | 1066 | else false) | |
1066 | 1067 | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
1067 | 1068 | else estimLP | |
1068 | 1069 | let e = invoke(fca, "emit", [emitLpAmt], nil) | |
1069 | 1070 | if ((e == e)) | |
1070 | 1071 | then { | |
1071 | 1072 | let el = match e { | |
1072 | 1073 | case legacy: Address => | |
1073 | 1074 | invoke(legacy, "emit", [emitLpAmt], nil) | |
1074 | 1075 | case _ => | |
1075 | 1076 | unit | |
1076 | 1077 | } | |
1077 | 1078 | if ((el == el)) | |
1078 | 1079 | then { | |
1079 | 1080 | let lpTrnsfr = if (autoStake) | |
1080 | 1081 | then { | |
1081 | 1082 | let ss = invoke(stakingContract, "stake", nil, [AttachedPayment(lpId, emitLpAmt)]) | |
1082 | 1083 | if ((ss == ss)) | |
1083 | 1084 | then nil | |
1084 | 1085 | else throw("Strict value is not equal to itself.") | |
1085 | 1086 | } | |
1086 | 1087 | else [ScriptTransfer(i.caller, emitLpAmt, lpId)] | |
1087 | 1088 | let sendFeeToMatcher = if ((feeAmount > 0)) | |
1088 | 1089 | then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))] | |
1089 | 1090 | else nil | |
1090 | - | let $ | |
1091 | + | let $t03793638285 = if ((this == feeCollectorAddress)) | |
1091 | 1092 | then $Tuple2(0, 0) | |
1092 | 1093 | else { | |
1093 | 1094 | let paymentInAmountAsset = if ((pmt.assetId == cfgAmountAssetId)) | |
1094 | 1095 | then true | |
1095 | 1096 | else false | |
1096 | 1097 | if (paymentInAmountAsset) | |
1097 | 1098 | then $Tuple2(-(feeAmount), 0) | |
1098 | 1099 | else $Tuple2(0, -(feeAmount)) | |
1099 | 1100 | } | |
1100 | - | let amountAssetBalanceDelta = $ | |
1101 | - | let priceAssetBalanceDelta = $ | |
1102 | - | let $ | |
1103 | - | let refreshDLpActions = $ | |
1104 | - | let updatedDLp = $ | |
1101 | + | let amountAssetBalanceDelta = $t03793638285._1 | |
1102 | + | let priceAssetBalanceDelta = $t03793638285._2 | |
1103 | + | let $t03828838396 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
1104 | + | let refreshDLpActions = $t03828838396._1 | |
1105 | + | let updatedDLp = $t03828838396._2 | |
1105 | 1106 | $Tuple2((((state ++ lpTrnsfr) ++ sendFeeToMatcher) ++ refreshDLpActions), emitLpAmt) | |
1106 | 1107 | } | |
1107 | 1108 | else throw("Strict value is not equal to itself.") | |
1108 | 1109 | } | |
1109 | 1110 | else throw("Strict value is not equal to itself.") | |
1110 | 1111 | } | |
1111 | 1112 | else throw("Strict value is not equal to itself.") | |
1112 | 1113 | } | |
1113 | 1114 | else throw("Strict value is not equal to itself.") | |
1114 | 1115 | } | |
1115 | 1116 | ||
1116 | 1117 | ||
1117 | 1118 | ||
1118 | 1119 | @Callable(i) | |
1119 | 1120 | func putForFree (maxSlpg) = if ((0 > maxSlpg)) | |
1120 | 1121 | then throw("Wrong slpg") | |
1121 | 1122 | else if ((size(i.payments) != 2)) | |
1122 | 1123 | then throw("2 pmnts expd") | |
1123 | 1124 | else { | |
1124 | 1125 | 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, "") | |
1125 | 1126 | let state = estPut._9 | |
1126 | 1127 | let amAssetPmt = toBigInt(value(i.payments[0]).amount) | |
1127 | 1128 | let prAssetPmt = toBigInt(value(i.payments[1]).amount) | |
1128 | 1129 | let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0)) | |
1129 | 1130 | if ((currentDLp == currentDLp)) | |
1130 | 1131 | then { | |
1131 | - | let $ | |
1132 | - | let refreshDLpActions = $ | |
1133 | - | let updatedDLp = $ | |
1132 | + | let $t03935539420 = refreshDLpInternal(0, 0, 0) | |
1133 | + | let refreshDLpActions = $t03935539420._1 | |
1134 | + | let updatedDLp = $t03935539420._2 | |
1134 | 1135 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1135 | 1136 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1136 | 1137 | then (state ++ refreshDLpActions) | |
1137 | 1138 | else throw("Strict value is not equal to itself.") | |
1138 | 1139 | } | |
1139 | 1140 | else throw("Strict value is not equal to itself.") | |
1140 | 1141 | } | |
1141 | 1142 | ||
1142 | 1143 | ||
1143 | 1144 | ||
1144 | 1145 | @Callable(i) | |
1145 | 1146 | func get () = { | |
1146 | 1147 | let r = cg(i) | |
1147 | 1148 | let outAmtAmt = r._1 | |
1148 | 1149 | let outPrAmt = r._2 | |
1149 | 1150 | let pmtAmt = r._3 | |
1150 | 1151 | let pmtAssetId = r._4 | |
1151 | 1152 | let state = r._5 | |
1152 | 1153 | let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1153 | 1154 | if ((b == b)) | |
1154 | 1155 | then { | |
1155 | 1156 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(pmtAmt)) | |
1156 | - | let $ | |
1157 | - | let refreshDLpActions = $ | |
1158 | - | let updatedDLp = $ | |
1157 | + | let $t04020940291 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0) | |
1158 | + | let refreshDLpActions = $t04020940291._1 | |
1159 | + | let updatedDLp = $t04020940291._2 | |
1159 | 1160 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1160 | 1161 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1161 | 1162 | then (state ++ refreshDLpActions) | |
1162 | 1163 | else throw("Strict value is not equal to itself.") | |
1163 | 1164 | } | |
1164 | 1165 | else throw("Strict value is not equal to itself.") | |
1165 | 1166 | } | |
1166 | 1167 | ||
1167 | 1168 | ||
1168 | 1169 | ||
1169 | 1170 | @Callable(i) | |
1170 | 1171 | func getOneTknV2 (outAssetId,minOutAmount) = { | |
1171 | 1172 | let isPoolOneTokenOperationsDisabled = { | |
1172 | 1173 | let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1173 | 1174 | if ($isInstanceOf(@, "Boolean")) | |
1174 | 1175 | then @ | |
1175 | 1176 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
1176 | 1177 | } | |
1177 | 1178 | let isGetDisabled = if (if (igs()) | |
1178 | 1179 | then true | |
1179 | 1180 | else (cfgPoolStatus == PoolShutdown)) | |
1180 | 1181 | then true | |
1181 | 1182 | else isPoolOneTokenOperationsDisabled | |
1182 | 1183 | let checks = [if (if (!(isGetDisabled)) | |
1183 | 1184 | then true | |
1184 | 1185 | else isManager(i)) | |
1185 | 1186 | then true | |
1186 | 1187 | else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1)) | |
1187 | 1188 | then true | |
1188 | 1189 | else throwErr("exactly 1 payment are expected")] | |
1189 | 1190 | if ((checks == checks)) | |
1190 | 1191 | then { | |
1191 | - | let $ | |
1192 | - | let state = $ | |
1193 | - | let totalAmount = $ | |
1192 | + | let $t04090941064 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId) | |
1193 | + | let state = $t04090941064._1 | |
1194 | + | let totalAmount = $t04090941064._2 | |
1194 | 1195 | $Tuple2(state, totalAmount) | |
1195 | 1196 | } | |
1196 | 1197 | else throw("Strict value is not equal to itself.") | |
1197 | 1198 | } | |
1198 | 1199 | ||
1199 | 1200 | ||
1200 | 1201 | ||
1201 | 1202 | @Callable(i) | |
1202 | 1203 | func refreshDLp () = { | |
1203 | 1204 | let lastRefreshedBlockHeight = valueOrElse(getInteger(keyDLpRefreshedHeight), 0) | |
1204 | 1205 | let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= dLpRefreshDelay)) | |
1205 | 1206 | then unit | |
1206 | 1207 | else throwErr(makeString([toString(dLpRefreshDelay), " blocks have not passed since the previous call"], "")) | |
1207 | 1208 | if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight)) | |
1208 | 1209 | then { | |
1209 | 1210 | let dLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyDLp), "0")), fmtErr("invalid dLp")) | |
1210 | - | let $ | |
1211 | - | let dLpUpdateActions = $ | |
1212 | - | let updatedDLp = $ | |
1211 | + | let $t04158841652 = refreshDLpInternal(0, 0, 0) | |
1212 | + | let dLpUpdateActions = $t04158841652._1 | |
1213 | + | let updatedDLp = $t04158841652._2 | |
1213 | 1214 | let actions = if ((dLp != updatedDLp)) | |
1214 | 1215 | then dLpUpdateActions | |
1215 | 1216 | else throwErr("nothing to refresh") | |
1216 | 1217 | $Tuple2(actions, toString(updatedDLp)) | |
1217 | 1218 | } | |
1218 | 1219 | else throw("Strict value is not equal to itself.") | |
1219 | 1220 | } | |
1220 | 1221 | ||
1221 | 1222 | ||
1222 | 1223 | ||
1223 | 1224 | @Callable(i) | |
1224 | 1225 | func getOneTknV2READONLY (outAssetId,lpAssetAmount) = { | |
1225 | 1226 | let poolConfig = gpc() | |
1226 | 1227 | let amId = poolConfig[idxAmAsId] | |
1227 | 1228 | let prId = poolConfig[idxPrAsId] | |
1228 | 1229 | let lpId = poolConfig[idxLPAsId] | |
1229 | 1230 | let xp = [toBigInt(getAccBalance(amId)), toBigInt(getAccBalance(prId))] | |
1230 | 1231 | let lpEmission = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "invalid lp asset").quantity) | |
1231 | 1232 | let D0 = getD(xp) | |
1232 | 1233 | let D1 = (D0 - fraction(toBigInt(lpAssetAmount), D0, lpEmission)) | |
1233 | 1234 | let index = if ((outAssetId == amId)) | |
1234 | 1235 | then 0 | |
1235 | 1236 | else if ((outAssetId == prId)) | |
1236 | 1237 | then 1 | |
1237 | 1238 | else throw("invalid out asset id") | |
1238 | 1239 | let newY = getYD(xp, index, D1) | |
1239 | 1240 | let dy = (xp[index] - newY) | |
1240 | 1241 | let totalGetRaw = max([0, toInt((dy - big1))]) | |
1241 | - | let $ | |
1242 | - | let totalGet = $ | |
1243 | - | let feeAmount = $ | |
1242 | + | let $t04255242601 = takeFee(totalGetRaw) | |
1243 | + | let totalGet = $t04255242601._1 | |
1244 | + | let feeAmount = $t04255242601._2 | |
1244 | 1245 | $Tuple2(nil, $Tuple2(totalGet, feeAmount)) | |
1245 | 1246 | } | |
1246 | 1247 | ||
1247 | 1248 | ||
1248 | 1249 | ||
1249 | 1250 | @Callable(i) | |
1250 | 1251 | func getOneTknV2WithBonusREADONLY (outAssetId,lpAssetAmount) = { | |
1251 | 1252 | let poolConfig = gpc() | |
1252 | 1253 | let amId = poolConfig[idxAmAsId] | |
1253 | 1254 | let prId = poolConfig[idxPrAsId] | |
1254 | 1255 | let lpId = poolConfig[idxLPAsId] | |
1255 | 1256 | let amBalance = getAccBalance(amId) | |
1256 | 1257 | let prBalance = getAccBalance(prId) | |
1257 | - | let $ | |
1258 | + | let $t04294643061 = { | |
1258 | 1259 | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil) | |
1259 | 1260 | if ($isInstanceOf(@, "(Int, Int)")) | |
1260 | 1261 | then @ | |
1261 | 1262 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
1262 | 1263 | } | |
1263 | - | let totalGet = $ | |
1264 | - | let feeAmount = $ | |
1264 | + | let totalGet = $t04294643061._1 | |
1265 | + | let feeAmount = $t04294643061._2 | |
1265 | 1266 | let r = ego("", lpId, lpAssetAmount, this) | |
1266 | 1267 | let outAmAmt = r._1 | |
1267 | 1268 | let outPrAmt = r._2 | |
1268 | 1269 | let sumOfGetAssets = (outAmAmt + outPrAmt) | |
1269 | 1270 | let bonus = if ((sumOfGetAssets == 0)) | |
1270 | 1271 | then if ((totalGet == 0)) | |
1271 | 1272 | then 0 | |
1272 | 1273 | else throw("bonus calculation error") | |
1273 | 1274 | else fraction((totalGet - sumOfGetAssets), scale8, sumOfGetAssets) | |
1274 | 1275 | $Tuple2(nil, $Tuple3(totalGet, feeAmount, bonus)) | |
1275 | 1276 | } | |
1276 | 1277 | ||
1277 | 1278 | ||
1278 | 1279 | ||
1279 | 1280 | @Callable(i) | |
1280 | 1281 | func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = { | |
1281 | 1282 | let r = cg(i) | |
1282 | 1283 | let outAmAmt = r._1 | |
1283 | 1284 | let outPrAmt = r._2 | |
1284 | 1285 | let pmtAmt = r._3 | |
1285 | 1286 | let pmtAssetId = r._4 | |
1286 | 1287 | let state = r._5 | |
1287 | 1288 | if ((noLessThenAmtAsset > outAmAmt)) | |
1288 | 1289 | then throw(((("Failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset))) | |
1289 | 1290 | else if ((noLessThenPriceAsset > outPrAmt)) | |
1290 | 1291 | then throw(((("Failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset))) | |
1291 | 1292 | else { | |
1292 | 1293 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(pmtAmt)) | |
1293 | 1294 | let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1294 | 1295 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1295 | 1296 | then { | |
1296 | - | let $ | |
1297 | - | let refreshDLpActions = $ | |
1298 | - | let updatedDLp = $ | |
1297 | + | let $t04422944310 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1298 | + | let refreshDLpActions = $t04422944310._1 | |
1299 | + | let updatedDLp = $t04422944310._2 | |
1299 | 1300 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1300 | 1301 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1301 | 1302 | then (state ++ refreshDLpActions) | |
1302 | 1303 | else throw("Strict value is not equal to itself.") | |
1303 | 1304 | } | |
1304 | 1305 | else throw("Strict value is not equal to itself.") | |
1305 | 1306 | } | |
1306 | 1307 | } | |
1307 | 1308 | ||
1308 | 1309 | ||
1309 | 1310 | ||
1310 | 1311 | @Callable(i) | |
1311 | 1312 | func unstakeAndGet (amount) = { | |
1312 | 1313 | let checkPayments = if ((size(i.payments) != 0)) | |
1313 | 1314 | then throw("No pmnts expd") | |
1314 | 1315 | else true | |
1315 | 1316 | if ((checkPayments == checkPayments)) | |
1316 | 1317 | then { | |
1317 | 1318 | let cfg = gpc() | |
1318 | 1319 | let factoryCfg = gfc() | |
1319 | 1320 | let lpAssetId = fromBase58String(cfg[idxLPAsId]) | |
1320 | 1321 | let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr") | |
1321 | 1322 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1322 | 1323 | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil) | |
1323 | 1324 | if ((unstakeInv == unstakeInv)) | |
1324 | 1325 | then { | |
1325 | 1326 | let r = ego(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller) | |
1326 | 1327 | let outAmAmt = r._1 | |
1327 | 1328 | let outPrAmt = r._2 | |
1328 | 1329 | let sts = parseIntValue(r._9) | |
1329 | 1330 | let state = r._10 | |
1330 | 1331 | let v = if (if (igs()) | |
1331 | 1332 | then true | |
1332 | 1333 | else (sts == PoolShutdown)) | |
1333 | 1334 | then throw(("Blocked: " + toString(sts))) | |
1334 | 1335 | else true | |
1335 | 1336 | if ((v == v)) | |
1336 | 1337 | then { | |
1337 | 1338 | let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)]) | |
1338 | 1339 | if ((burnA == burnA)) | |
1339 | 1340 | then { | |
1340 | - | let $ | |
1341 | - | let refreshDLpActions = $ | |
1342 | - | let updatedDLp = $ | |
1341 | + | let $t04537345454 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1342 | + | let refreshDLpActions = $t04537345454._1 | |
1343 | + | let updatedDLp = $t04537345454._2 | |
1343 | 1344 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1344 | 1345 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1345 | 1346 | then (state ++ refreshDLpActions) | |
1346 | 1347 | else throw("Strict value is not equal to itself.") | |
1347 | 1348 | } | |
1348 | 1349 | else throw("Strict value is not equal to itself.") | |
1349 | 1350 | } | |
1350 | 1351 | else throw("Strict value is not equal to itself.") | |
1351 | 1352 | } | |
1352 | 1353 | else throw("Strict value is not equal to itself.") | |
1353 | 1354 | } | |
1354 | 1355 | else throw("Strict value is not equal to itself.") | |
1355 | 1356 | } | |
1356 | 1357 | ||
1357 | 1358 | ||
1358 | 1359 | ||
1359 | 1360 | @Callable(i) | |
1360 | 1361 | func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = { | |
1361 | 1362 | let isGetDisabled = if (igs()) | |
1362 | 1363 | then true | |
1363 | 1364 | else (cfgPoolStatus == PoolShutdown) | |
1364 | 1365 | let checks = [if (!(isGetDisabled)) | |
1365 | 1366 | then true | |
1366 | 1367 | else throw("get operation is blocked by admin"), if ((size(i.payments) == 0)) | |
1367 | 1368 | then true | |
1368 | 1369 | else throw("no payments are expected")] | |
1369 | 1370 | if ((checks == checks)) | |
1370 | 1371 | then { | |
1371 | 1372 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1372 | 1373 | let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil) | |
1373 | 1374 | if ((unstakeInv == unstakeInv)) | |
1374 | 1375 | then { | |
1375 | 1376 | let res = ego(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller) | |
1376 | 1377 | let outAmAmt = res._1 | |
1377 | 1378 | let outPrAmt = res._2 | |
1378 | 1379 | let state = res._10 | |
1379 | 1380 | let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset)) | |
1380 | 1381 | then true | |
1381 | 1382 | else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset)) | |
1382 | 1383 | then true | |
1383 | 1384 | else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))] | |
1384 | 1385 | if ((checkAmounts == checkAmounts)) | |
1385 | 1386 | then { | |
1386 | 1387 | let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)]) | |
1387 | 1388 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1388 | 1389 | then { | |
1389 | - | let $ | |
1390 | - | let refreshDLpActions = $ | |
1391 | - | let updatedDLp = $ | |
1390 | + | let $t04670246783 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1391 | + | let refreshDLpActions = $t04670246783._1 | |
1392 | + | let updatedDLp = $t04670246783._2 | |
1392 | 1393 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1393 | 1394 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1394 | 1395 | then (state ++ refreshDLpActions) | |
1395 | 1396 | else throw("Strict value is not equal to itself.") | |
1396 | 1397 | } | |
1397 | 1398 | else throw("Strict value is not equal to itself.") | |
1398 | 1399 | } | |
1399 | 1400 | else throw("Strict value is not equal to itself.") | |
1400 | 1401 | } | |
1401 | 1402 | else throw("Strict value is not equal to itself.") | |
1402 | 1403 | } | |
1403 | 1404 | else throw("Strict value is not equal to itself.") | |
1404 | 1405 | } | |
1405 | 1406 | ||
1406 | 1407 | ||
1407 | 1408 | ||
1408 | 1409 | @Callable(i) | |
1409 | 1410 | func unstakeAndGetOneTknV2 (unstakeAmount,outAssetId,minOutAmount) = { | |
1410 | 1411 | let isPoolOneTokenOperationsDisabled = { | |
1411 | 1412 | let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1412 | 1413 | if ($isInstanceOf(@, "Boolean")) | |
1413 | 1414 | then @ | |
1414 | 1415 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
1415 | 1416 | } | |
1416 | 1417 | let isGetDisabled = if (if (igs()) | |
1417 | 1418 | then true | |
1418 | 1419 | else (cfgPoolStatus == PoolShutdown)) | |
1419 | 1420 | then true | |
1420 | 1421 | else isPoolOneTokenOperationsDisabled | |
1421 | 1422 | let checks = [if (if (!(isGetDisabled)) | |
1422 | 1423 | then true | |
1423 | 1424 | else isManager(i)) | |
1424 | 1425 | then true | |
1425 | 1426 | else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0)) | |
1426 | 1427 | then true | |
1427 | 1428 | else throwErr("no payments are expected")] | |
1428 | 1429 | if ((checks == checks)) | |
1429 | 1430 | then { | |
1430 | 1431 | let cfg = gpc() | |
1431 | 1432 | let factoryCfg = gfc() | |
1432 | 1433 | let lpAssetId = fromBase58String(cfg[idxLPAsId]) | |
1433 | 1434 | let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr") | |
1434 | 1435 | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), unstakeAmount], nil) | |
1435 | 1436 | if ((unstakeInv == unstakeInv)) | |
1436 | 1437 | then { | |
1437 | - | let $ | |
1438 | - | let state = $ | |
1439 | - | let totalAmount = $ | |
1438 | + | let $t04771747905 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId) | |
1439 | + | let state = $t04771747905._1 | |
1440 | + | let totalAmount = $t04771747905._2 | |
1440 | 1441 | $Tuple2(state, totalAmount) | |
1441 | 1442 | } | |
1442 | 1443 | else throw("Strict value is not equal to itself.") | |
1443 | 1444 | } | |
1444 | 1445 | else throw("Strict value is not equal to itself.") | |
1445 | 1446 | } | |
1446 | 1447 | ||
1447 | 1448 | ||
1448 | 1449 | ||
1449 | 1450 | @Callable(i) | |
1450 | 1451 | func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = { | |
1451 | 1452 | let poolConfig = gpc() | |
1452 | 1453 | let amId = poolConfig[idxAmAsId] | |
1453 | 1454 | let prId = poolConfig[idxPrAsId] | |
1454 | 1455 | let lpId = poolConfig[idxLPAsId] | |
1455 | - | let $ | |
1456 | - | let lpAmount = $ | |
1457 | - | let state = $ | |
1458 | - | let feeAmount = $ | |
1459 | - | let bonus = $ | |
1456 | + | let $t04816448267 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true) | |
1457 | + | let lpAmount = $t04816448267._1 | |
1458 | + | let state = $t04816448267._2 | |
1459 | + | let feeAmount = $t04816448267._3 | |
1460 | + | let bonus = $t04816448267._4 | |
1460 | 1461 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1461 | 1462 | } | |
1462 | 1463 | ||
1463 | 1464 | ||
1464 | 1465 | ||
1465 | 1466 | @Callable(i) | |
1466 | 1467 | func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = { | |
1467 | 1468 | let poolConfig = gpc() | |
1468 | 1469 | let amId = poolConfig[idxAmAsId] | |
1469 | 1470 | let prId = poolConfig[idxPrAsId] | |
1470 | 1471 | let lpId = poolConfig[idxLPAsId] | |
1471 | - | let $ | |
1472 | - | let lpAmount = $ | |
1473 | - | let state = $ | |
1474 | - | let feeAmount = $ | |
1475 | - | let bonus = $ | |
1472 | + | let $t04854648650 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false) | |
1473 | + | let lpAmount = $t04854648650._1 | |
1474 | + | let state = $t04854648650._2 | |
1475 | + | let feeAmount = $t04854648650._3 | |
1476 | + | let bonus = $t04854648650._4 | |
1476 | 1477 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1477 | 1478 | } | |
1478 | 1479 | ||
1479 | 1480 | ||
1480 | 1481 | ||
1481 | 1482 | @Callable(i) | |
1482 | 1483 | func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString(fca))) | |
1483 | 1484 | then throw("denied") | |
1484 | 1485 | else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr)], "success") | |
1485 | 1486 | ||
1486 | 1487 | ||
1487 | 1488 | ||
1488 | 1489 | @Callable(i) | |
1489 | 1490 | func setS (k,v) = if ((toString(i.caller) != strf(this, ada()))) | |
1490 | 1491 | then pd | |
1491 | 1492 | else [StringEntry(k, v)] | |
1492 | 1493 | ||
1493 | 1494 | ||
1494 | 1495 | ||
1495 | 1496 | @Callable(i) | |
1496 | 1497 | func setI (k,v) = if ((toString(i.caller) != strf(this, ada()))) | |
1497 | 1498 | then pd | |
1498 | 1499 | else [IntegerEntry(k, v)] | |
1499 | 1500 | ||
1500 | 1501 | ||
1501 | 1502 | ||
1502 | 1503 | @Callable(i) | |
1503 | 1504 | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, gpc()) | |
1504 | 1505 | ||
1505 | 1506 | ||
1506 | 1507 | ||
1507 | 1508 | @Callable(i) | |
1508 | 1509 | func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId)) | |
1509 | 1510 | ||
1510 | 1511 | ||
1511 | 1512 | ||
1512 | 1513 | @Callable(i) | |
1513 | 1514 | func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = { | |
1514 | 1515 | let pr = calcPrices(amAmt, prAmt, lpAmt) | |
1515 | 1516 | $Tuple2(nil, [toString(pr[0]), toString(pr[1]), toString(pr[2])]) | |
1516 | 1517 | } | |
1517 | 1518 | ||
1518 | 1519 | ||
1519 | 1520 | ||
1520 | 1521 | @Callable(i) | |
1521 | 1522 | func fromX18WrapperREADONLY (val,resScaleMult) = $Tuple2(nil, f1(parseBigIntValue(val), resScaleMult)) | |
1522 | 1523 | ||
1523 | 1524 | ||
1524 | 1525 | ||
1525 | 1526 | @Callable(i) | |
1526 | 1527 | func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(t1(origVal, origScaleMult))) | |
1527 | 1528 | ||
1528 | 1529 | ||
1529 | 1530 | ||
1530 | 1531 | @Callable(i) | |
1531 | 1532 | func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(cpbi(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18)))) | |
1532 | 1533 | ||
1533 | 1534 | ||
1534 | 1535 | ||
1535 | 1536 | @Callable(i) | |
1536 | 1537 | 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, "")) | |
1537 | 1538 | ||
1538 | 1539 | ||
1539 | 1540 | ||
1540 | 1541 | @Callable(i) | |
1541 | 1542 | func estimateGetOperationWrapperREADONLY (txId58,pmtAsId,pmtLpAmt,usrAddr) = { | |
1542 | 1543 | let r = ego(txId58, pmtAsId, pmtLpAmt, addressFromStringValue(usrAddr)) | |
1543 | 1544 | $Tuple2(nil, $Tuple10(r._1, r._2, r._3, r._4, r._5, r._6, r._7, toString(r._8), r._9, r._10)) | |
1544 | 1545 | } | |
1545 | 1546 | ||
1546 | 1547 | ||
1547 | 1548 | ||
1548 | 1549 | @Callable(i) | |
1549 | 1550 | func getFeeREADONLY () = $Tuple2(nil, fee) | |
1550 | 1551 | ||
1551 | 1552 | ||
1552 | 1553 | @Verifier(tx) | |
1553 | 1554 | func verify () = { | |
1554 | 1555 | let targetPublicKey = match m() { | |
1555 | 1556 | case pk: ByteVector => | |
1556 | 1557 | pk | |
1557 | 1558 | case _: Unit => | |
1558 | 1559 | tx.senderPublicKey | |
1559 | 1560 | case _ => | |
1560 | 1561 | throw("Match error") | |
1561 | 1562 | } | |
1562 | 1563 | match tx { | |
1563 | 1564 | case order: Order => | |
1564 | 1565 | let matcherPub = mp() | |
1565 | 1566 | let orderValid = validateMatcherOrderAllowed(order) | |
1566 | 1567 | let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey) | |
1567 | 1568 | let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub) | |
1568 | 1569 | if (if (if (orderValid) | |
1569 | 1570 | then senderValid | |
1570 | 1571 | else false) | |
1571 | 1572 | then matcherValid | |
1572 | 1573 | else false) | |
1573 | 1574 | then true | |
1574 | 1575 | else toe(orderValid, senderValid, matcherValid) | |
1575 | 1576 | case s: SetScriptTransaction => | |
1576 | 1577 | let newHash = blake2b256(value(s.script)) | |
1577 | 1578 | let allowedHash = fromBase64String(value(getString(fca, keyAllowedLpStableScriptHash()))) | |
1578 | 1579 | let currentHash = scriptHash(this) | |
1579 | 1580 | if (if ((allowedHash == newHash)) | |
1580 | 1581 | then (currentHash != newHash) | |
1581 | 1582 | else false) | |
1582 | 1583 | then true | |
1583 | 1584 | else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
1584 | 1585 | case _ => | |
1585 | 1586 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
1586 | 1587 | } | |
1587 | 1588 | } | |
1588 | 1589 |
github/deemru/w8io/169f3d6 196.99 ms ◑