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