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