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