tx · HPTgsRShEbRWtJ58XCMatJAsh6Rj5ggKzNfUN1ML5s7N

3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA:  -0.03500000 Waves

2022.09.14 13:27 [2228646] smart account 3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA > SELF 0.00000000 Waves

{ "type": 13, "id": "HPTgsRShEbRWtJ58XCMatJAsh6Rj5ggKzNfUN1ML5s7N", "fee": 3500000, "feeAssetId": null, "timestamp": 1663151277650, "version": 2, "chainId": 84, "sender": "3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA", "senderPublicKey": "35yd3qw1gxKDxKwGAykHN9fANbXNWwseaUwbWDj24o3x", "proofs": [ "KEXDYSEggKVjDyh8iPRSzFLDn5DB3EtvhvAm6P2N7W9WVWeGKJocmT1EyXhoCRMWb8n7QUPymPaN5W5M7duuKK5" ], "script": "base64:BgKTAQgCEgMKAQgSAwoBCBIAEgQKAgEEEgcKBQEBAQEEEgQKAgEEEgMKAQESABIHCgUBAQEIARIECgIIARIECgIBARIDCgEBEgYKBAEBCAESBAoCCAgSBAoCCAgSBAoCCAESABIDCgEIEgUKAwEBARIECgIIARIECgIBARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCFIABnNjYWxlOACAwtcvAAxzY2FsZThCaWdJbnQJALYCAQCAwtcvAAdzY2FsZTE4CQC2AgEAgICQu7rWrfANAAp6ZXJvQmlnSW50CQC2AgEAAAAJb25lQmlnSW50CQC2AgEAAQAKc2xpcHBhZ2U0RAkAtgIBCQBlAgUGc2NhbGU4CQBpAgkAaAIFBnNjYWxlOAABBQZzY2FsZTgABUFtdWx0AgMxMDAABURjb252AgExAANTRVACAl9fAAVFTVBUWQIAAApQb29sQWN0aXZlAAEAClBvb2xQdXREaXMAAgAOUG9vbE1hdGNoZXJEaXMAAwAMUG9vbFNodXRkb3duAAQADmlkeFBvb2xBZGRyZXNzAAEACWlkeFBvb2xTdAACAAlpZHhMUEFzSWQAAwAJaWR4QW1B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YQkBHGtleUFsbG93ZWRMcFN0YWJsZVNjcmlwdEhhc2gABAtjdXJyZW50SGFzaAkA8QcBBQR0aGlzAwMJAAACBQthbGxvd2VkSGFzaAUHbmV3SGFzaAkBAiE9AgULY3VycmVudEhhc2gFB25ld0hhc2gHBgkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAUPdGFyZ2V0UHVibGljS2V5CQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAABQ90YXJnZXRQdWJsaWNLZXlqiZTE", "height": 2228646, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6F88CMmmrNteAsSwkECQd7zmXLmmB6dVTMC1XFDPdo4g Next: D4S3UkgcwYno1rvAUZxQ7M4H8M7MissbN4xZ7kRh1eFh Diff:
OldNewDifferences
270270 }
271271
272272
273-func epo (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEval,emitLp,isOneAsset,pmtAmt,pmtId) = {
273+func epo (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEval,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = {
274274 let cfg = gpc()
275275 let lpId = fromBase58String(cfg[idxLPAsId])
276276 let amIdStr = cfg[idxAmAsId]
315315 let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
316316 let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18)
317317 let slippageX18 = t1(slippage, scale8)
318- if (if ((curPriceX18 != zeroBigInt))
318+ if (if (if (validateSlippage)
319+ then (curPriceX18 != zeroBigInt)
320+ else false)
319321 then (slippageRealX18 > slippageX18)
320322 else false)
321323 then throw(((("Price slippage " + toString(slippageRealX18)) + " > ") + toString(slippageX18)))
345347 else calcLpAmt
346348 let amDiff = (inAmAmt - calcAmAssetPmt)
347349 let prDiff = (inPrAmt - calcPrAssetPmt)
348- let $t01601016355 = if (if (isOneAsset)
350+ let $t01608316428 = if (if (isOneAsset)
349351 then (pmtId == amIdStr)
350352 else false)
351353 then $Tuple2(pmtAmt, 0)
354356 else false)
355357 then $Tuple2(0, pmtAmt)
356358 else $Tuple2(calcAmAssetPmt, calcPrAssetPmt)
357- let writeAmAmt = $t01601016355._1
358- let writePrAmt = $t01601016355._2
359+ let writeAmAmt = $t01608316428._1
360+ let writePrAmt = $t01608316428._2
359361 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))]
360362 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId)
361363 }
426428 }
427429
428430
429-func cp (caller,txId,amAsPmt,prAsPmt,slippage,emitLp,isOneAsset,pmtAmt,pmtId) = {
430- let r = epo(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, false, emitLp, isOneAsset, pmtAmt, pmtId)
431+func cp (caller,txId,amAsPmt,prAsPmt,slippage,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = {
432+ let r = epo(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, false, emitLp, isOneAsset, validateSlippage, pmtAmt, pmtId)
431433 let sts = parseIntValue(r._8)
432434 if (if (if (igs())
433435 then true
530532 else if ((size(i.payments) != 2))
531533 then throw("2 pmnts expd")
532534 else {
533- 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, 0, "")
535+ 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, "")
534536 let emitLpAmt = e._2
535537 let lpAssetId = e._7
536538 let state = e._9
618620 else {
619621 let amBalance = getAccBalance(amId)
620622 let prBalance = getAccBalance(prId)
621- let $t02526825844 = if ((pmtAssetId == amId))
623+ let $t02545426030 = if ((pmtAssetId == amId))
622624 then if (if ((pmtAmt > amBalance))
623625 then true
624626 else (amAssetPart > pmtAmt))
631633 then throw("invalid payment amount")
632634 else $Tuple6(amBalance, (prBalance - pmtAmt), 0, 0, (pmtAmt - prAssetPart), amAssetPart)
633635 else throw("wrong pmtAssetId")
634- let amBalanceNow = $t02526825844._1
635- let prBalanceNow = $t02526825844._2
636- let virtSwapInAm = $t02526825844._3
637- let virtSwapOutPr = $t02526825844._4
638- let virtSwapInPr = $t02526825844._5
639- let virtSwapOutAm = $t02526825844._6
636+ let amBalanceNow = $t02545426030._1
637+ let prBalanceNow = $t02545426030._2
638+ let virtSwapInAm = $t02545426030._3
639+ let virtSwapOutPr = $t02545426030._4
640+ let virtSwapInPr = $t02545426030._5
641+ let virtSwapOutAm = $t02545426030._6
640642 let D0 = invoke(gwxCntr, "calcD", [toString(amBalanceNow), toString(prBalanceNow), A, Amult, Dconv], nil)
641643 let D1 = invoke(gwxCntr, "calcD", [toString(toBigInt(((amBalanceNow + virtSwapInAm) - virtSwapOutAm))), toString(toBigInt(((prBalanceNow + virtSwapInPr) - virtSwapOutPr))), A, Amult, Dconv], nil)
642644 let D0vsD1 = vd(parseBigIntValue(str(D1)), parseBigIntValue(str(D0)), slippage4D)
643645 if ((D0vsD1 == D0vsD1))
644646 then {
645- let estPut = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(fromBase58String(amId), amAssetPart), AttachedPayment(fromBase58String(prId), prAssetPart), slippage, true, true, pmtAmt, pmtAssetId)
647+ let estPut = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(fromBase58String(amId), amAssetPart), AttachedPayment(fromBase58String(prId), prAssetPart), slippage, true, true, true, pmtAmt, pmtAssetId)
646648 let estimLP = estPut._2
647649 let lpAssetId = estPut._7
648650 let state = estPut._9
698700
699701
700702 @Callable(i)
701-func putOneTknV2 (outLp,slippage,autoStake) = if ((size(i.payments) != 1))
703+func putOneTknV2 (minOutAmount,autoStake) = if ((size(i.payments) != 1))
702704 then throw("1 pmnt expd")
703705 else {
704706 let poolConfig = gpc()
717719 else {
718720 let amBalance = getAccBalance(amId)
719721 let prBalance = getAccBalance(prId)
720- let $t02860828982 = if ((pmtAssetId == amId))
722+ let $t02881829192 = if ((pmtAssetId == amId))
721723 then if ((pmtAmt > amBalance))
722724 then throw("invalid payment amount")
723725 else $Tuple2((amBalance - pmtAmt), prBalance)
726728 then throw("invalid payment amount")
727729 else $Tuple2(amBalance, (prBalance - pmtAmt))
728730 else throw("wrong pmtAssetId")
729- let amBalanceNow = $t02860828982._1
730- let prBalanceNow = $t02860828982._2
731- let $t02898629120 = if ((pmtAssetId == amId))
731+ let amBalanceNow = $t02881829192._1
732+ let prBalanceNow = $t02881829192._2
733+ let $t02919629330 = if ((pmtAssetId == amId))
732734 then $Tuple2(amBalanceNow, prBalanceNow)
733735 else $Tuple2(prBalanceNow, amBalanceNow)
734- let amBalanceForCalc = $t02898629120._1
735- let prBalanceForCalc = $t02898629120._2
736+ let amBalanceForCalc = $t02919629330._1
737+ let prBalanceForCalc = $t02919629330._2
736738 let xPrecision = 1
737739 let result = {
738740 let @ = invoke(gwxContract, "calcPutXOnly", [toString(pmtAmt), toString(amBalanceForCalc), toString(prBalanceForCalc), "", A, Amult, toString(xPrecision), Dconv], nil)
740742 then @
741743 else throw(($getType(invoke(gwxContract, "calcPutXOnly", [toString(pmtAmt), toString(amBalanceForCalc), toString(prBalanceForCalc), "", A, Amult, toString(xPrecision), Dconv], nil)) + " couldn't be cast to (Int, Int)"))
742744 }
743- let $t02958929685 = if ((pmtAssetId == amId))
745+ let $t02979929895 = if ((pmtAssetId == amId))
744746 then result
745747 else $Tuple2(result._2, result._1)
746- let amAssetPart = $t02958929685._1
747- let prAssetPart = $t02958929685._2
748- let estPut = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(fromBase58String(amId), amAssetPart), AttachedPayment(fromBase58String(prId), prAssetPart), slippage, true, true, pmtAmt, pmtAssetId)
748+ let amAssetPart = $t02979929895._1
749+ let prAssetPart = $t02979929895._2
750+ let estPut = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(fromBase58String(amId), amAssetPart), AttachedPayment(fromBase58String(prId), prAssetPart), 0, true, true, false, pmtAmt, pmtAssetId)
749751 let estimLP = estPut._2
750752 let lpAssetId = estPut._7
751753 let state = estPut._9
752754 let amDiff = estPut._10
753755 let prDiff = estPut._11
754- let emitLpAmt = if ((outLp > 0))
755- then {
756- let lpCalcRes = vad(toBigInt(estimLP), toBigInt(outLp), toBigInt(slippage))
757- toInt(lpCalcRes._2)
758- }
756+ let emitLpAmt = if (if ((minOutAmount > 0))
757+ then (minOutAmount > estimLP)
758+ else false)
759+ then throw(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
759760 else estimLP
760761 let e = invoke(fca, "emit", [emitLpAmt], nil)
761762 if ((e == e))
806807 else if ((size(i.payments) != 2))
807808 then throw("2 pmnts expd")
808809 else {
809- 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, 0, "")
810+ 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, "")
810811 estPut._9
811812 }
812813
868869 let estimPrAmt = r._2
869870 let amBalance = getAccBalance(amId)
870871 let prBalance = getAccBalance(prId)
871- let $t03404934506 = if ((outAssetId == amId))
872+ let $t03429834755 = if ((outAssetId == amId))
872873 then $Tuple7((amBalance - estimAmAmt), (prBalance - estimPrAmt), exchResult, estimPrAmt, 0, 0, (estimAmAmt + exchResult))
873874 else if ((outAssetId == prId))
874875 then $Tuple7((amBalance - estimAmAmt), (prBalance - estimPrAmt), 0, 0, exchResult, estimAmAmt, (estimPrAmt + exchResult))
875876 else throw("wrong outAssetId")
876- let amBalanceNow = $t03404934506._1
877- let prBalanceNow = $t03404934506._2
878- let virtSwapInAm = $t03404934506._3
879- let virtSwapOutPr = $t03404934506._4
880- let virtSwapInPr = $t03404934506._5
881- let virtSwapOutAm = $t03404934506._6
882- let totalGet = $t03404934506._7
877+ let amBalanceNow = $t03429834755._1
878+ let prBalanceNow = $t03429834755._2
879+ let virtSwapInAm = $t03429834755._3
880+ let virtSwapOutPr = $t03429834755._4
881+ let virtSwapInPr = $t03429834755._5
882+ let virtSwapOutAm = $t03429834755._6
883+ let totalGet = $t03429834755._7
883884 if (if ((0 > virtSwapInAm))
884885 then true
885886 else (0 > virtSwapInPr))
893894 let finalRes = vad(toBigInt(totalGet), toBigInt(outAmount), toBigInt(slippage))
894895 if ((finalRes == finalRes))
895896 then {
896- let $t03521135315 = if ((outAssetId == amId))
897+ let $t03546035564 = if ((outAssetId == amId))
897898 then $Tuple2(toInt(finalRes._2), 0)
898899 else $Tuple2(0, toInt(finalRes._2))
899- let outAm = $t03521135315._1
900- let outPr = $t03521135315._2
900+ let outAm = $t03546035564._1
901+ let outPr = $t03546035564._2
901902 let curPrX18 = cpbi(t1(prBalance, prDcm), t1(amBalance, amDcm))
902903 let curPr = f1(curPrX18, scale8)
903904 let state = [ScriptTransfer(userAddress, (outAm + outPr), if ((outAssetId == "WAVES"))
923924
924925
925926 @Callable(i)
926-func getOneTknV2 (outAmount,outAssetId,slippage) = if ((size(i.payments) != 1))
927+func getOneTknV2 (outAssetId,minOutAmount) = if ((size(i.payments) != 1))
927928 then throw("1 pmnt expd")
928929 else {
929930 let poolConfig = gpc()
943944 then throw("Min pmt 10 LP")
944945 else {
945946 let txId58 = toBase58String(i.transactionId)
946- if ((0 > slippage))
947- then throw("Wrong params")
948- else if ((lpId != toBase58String(pmtAssetId)))
949- then throw("Wrong LP")
950- else {
951- let r = ego(txId58, toBase58String(pmtAssetId), pmtAmt, i.caller)
952- let estimAmAmt = r._1
953- let estimPrAmt = r._2
954- let amBalance = getAccBalance(amId)
955- let prBalance = getAccBalance(prId)
956- let amBalanceNow = (amBalance - estimAmAmt)
957- let prBalanceNow = (prBalance - estimPrAmt)
958- let $t03714137412 = if ((outAssetId == amId))
959- then $Tuple3(prBalanceNow, amBalanceNow, estimPrAmt)
960- else if ((outAssetId == prId))
961- then $Tuple3(amBalanceNow, prBalanceNow, estimAmAmt)
962- else throw("wrong outAssetId")
963- let amountBalanceForSwap = $t03714137412._1
964- let priceBalanceForSwap = $t03714137412._2
965- let amountToSwap = $t03714137412._3
966- let yPrecision = 1
967- let exchResult = {
968- let @ = invoke(gwxContract, "calcSwapXToY", [toString(amountToSwap), toString(amountBalanceForSwap), toString(priceBalanceForSwap), "", A, Amult, toString(yPrecision), Dconv], nil)
969- if ($isInstanceOf(@, "Int"))
970- then @
971- else throw(($getType(invoke(gwxContract, "calcSwapXToY", [toString(amountToSwap), toString(amountBalanceForSwap), toString(priceBalanceForSwap), "", A, Amult, toString(yPrecision), Dconv], nil)) + " couldn't be cast to Int"))
947+ if ((lpId != toBase58String(pmtAssetId)))
948+ then throw("Wrong LP")
949+ else {
950+ let r = ego(txId58, toBase58String(pmtAssetId), pmtAmt, i.caller)
951+ let estimAmAmt = r._1
952+ let estimPrAmt = r._2
953+ let amBalance = getAccBalance(amId)
954+ let prBalance = getAccBalance(prId)
955+ let amBalanceNow = (amBalance - estimAmAmt)
956+ let prBalanceNow = (prBalance - estimPrAmt)
957+ let $t03732637597 = if ((outAssetId == amId))
958+ then $Tuple3(prBalanceNow, amBalanceNow, estimPrAmt)
959+ else if ((outAssetId == prId))
960+ then $Tuple3(amBalanceNow, prBalanceNow, estimAmAmt)
961+ else throw("wrong outAssetId")
962+ let amountBalanceForSwap = $t03732637597._1
963+ let priceBalanceForSwap = $t03732637597._2
964+ let amountToSwap = $t03732637597._3
965+ let yPrecision = 1
966+ let exchResult = {
967+ let @ = invoke(gwxContract, "calcSwapXToY", [toString(amountToSwap), toString(amountBalanceForSwap), toString(priceBalanceForSwap), "", A, Amult, toString(yPrecision), Dconv], nil)
968+ if ($isInstanceOf(@, "Int"))
969+ then @
970+ else throw(($getType(invoke(gwxContract, "calcSwapXToY", [toString(amountToSwap), toString(amountBalanceForSwap), toString(priceBalanceForSwap), "", A, Amult, toString(yPrecision), Dconv], nil)) + " couldn't be cast to Int"))
971+ }
972+ let totalGet = (exchResult + (if ((outAssetId == amId))
973+ then estimAmAmt
974+ else estimPrAmt))
975+ let totalAmount = if (if ((minOutAmount > 0))
976+ then (minOutAmount > totalGet)
977+ else false)
978+ then throw(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
979+ else totalGet
980+ let $t03835038437 = if ((outAssetId == amId))
981+ then $Tuple2(totalAmount, 0)
982+ else $Tuple2(0, totalAmount)
983+ let outAm = $t03835038437._1
984+ let outPr = $t03835038437._2
985+ let curPrX18 = cpbi(t1(prBalance, prDecimals), t1(amBalance, amDecimals))
986+ let curPr = f1(curPrX18, scale8)
987+ let state = [ScriptTransfer(userAddress, totalAmount, if ((outAssetId == "WAVES"))
988+ then unit
989+ else fromBase58String(outAssetId)), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAm, outPr, pmtAmt, curPr, height, lastBlock.timestamp)), IntegerEntry(pl(), curPr), IntegerEntry(ph(height, lastBlock.timestamp), curPr)]
990+ if ((state == state))
991+ then {
992+ let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
993+ if ((burn == burn))
994+ then $Tuple2(state, totalAmount)
995+ else throw("Strict value is not equal to itself.")
972996 }
973- let totalGet = if ((outAssetId == amId))
974- then (estimAmAmt + exchResult)
975- else (estimPrAmt + exchResult)
976- let finalRes = if ((outAmount > 0))
977- then vad(toBigInt(totalGet), toBigInt(outAmount), toBigInt(slippage))
978- else $Tuple2(true, toBigInt(totalGet))
979- let $t03815838261 = if ((outAssetId == amId))
980- then $Tuple2(toInt(finalRes._2), 0)
981- else $Tuple2(0, toInt(finalRes._2))
982- let outAm = $t03815838261._1
983- let outPr = $t03815838261._2
984- let totalAmount = (outAm + outPr)
985- let curPrX18 = cpbi(t1(prBalance, prDecimals), t1(amBalance, amDecimals))
986- let curPr = f1(curPrX18, scale8)
987- let state = [ScriptTransfer(userAddress, totalAmount, if ((outAssetId == "WAVES"))
988- then unit
989- else fromBase58String(outAssetId)), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAm, outPr, pmtAmt, curPr, height, lastBlock.timestamp)), IntegerEntry(pl(), curPr), IntegerEntry(ph(height, lastBlock.timestamp), curPr)]
990- if ((state == state))
991- then {
992- let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
993- if ((burn == burn))
994- then $Tuple2(state, totalAmount)
995- else throw("Strict value is not equal to itself.")
996- }
997- else throw("Strict value is not equal to itself.")
998- }
997+ else throw("Strict value is not equal to itself.")
998+ }
999999 }
10001000 }
10011001
11471147
11481148
11491149 @Callable(i)
1150-func estimatePutOperationWrapperREADONLY (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,usrAddr,isEval,emitLp) = $Tuple2(nil, epo(txId58, slippage, inAmAmt, inAmId, inPrAmt, inPrId, usrAddr, isEval, emitLp, false, 0, ""))
1150+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, ""))
11511151
11521152
11531153
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let scale8 = 100000000
55
66 let scale8BigInt = toBigInt(100000000)
77
88 let scale18 = toBigInt(1000000000000000000)
99
1010 let zeroBigInt = toBigInt(0)
1111
1212 let oneBigInt = toBigInt(1)
1313
1414 let slippage4D = toBigInt((scale8 - ((scale8 * 1) / scale8)))
1515
1616 let Amult = "100"
1717
1818 let Dconv = "1"
1919
2020 let SEP = "__"
2121
2222 let EMPTY = ""
2323
2424 let PoolActive = 1
2525
2626 let PoolPutDis = 2
2727
2828 let PoolMatcherDis = 3
2929
3030 let PoolShutdown = 4
3131
3232 let idxPoolAddress = 1
3333
3434 let idxPoolSt = 2
3535
3636 let idxLPAsId = 3
3737
3838 let idxAmAsId = 4
3939
4040 let idxPrAsId = 5
4141
4242 let idxAmtAsDcm = 6
4343
4444 let idxPriceAsDcm = 7
4545
4646 let idxIAmtAsId = 8
4747
4848 let idxIPriceAsId = 9
4949
5050 let idxFactStakCntr = 1
5151
5252 let idxFactSlippCntr = 7
5353
5454 let idxFactGwxRewCntr = 10
5555
5656 let delay = "%s__delay"
5757
5858 func t1 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
5959
6060
6161 func f1 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
6262
6363
6464 func ts (amt,resScale,curScale) = fraction(amt, resScale, curScale)
6565
6666
6767 func abs (val) = if ((zeroBigInt > val))
6868 then -(val)
6969 else val
7070
7171
7272 func fc () = "%s__factoryContract"
7373
7474
7575 func mpk () = "%s__managerPublicKey"
7676
7777
7878 func pmpk () = "%s__pendingManagerPublicKey"
7979
8080
8181 func pl () = "%s%s__price__last"
8282
8383
8484 func ph (h,t) = makeString(["%s%s%d%d__price__history", toString(h), toString(t)], SEP)
8585
8686
8787 func pau (ua,txId) = ((("%s%s%s__P__" + ua) + "__") + txId)
8888
8989
9090 func gau (ua,txId) = ((("%s%s%s__G__" + ua) + "__") + txId)
9191
9292
9393 func aa () = "%s__amountAsset"
9494
9595
9696 func pa () = "%s__priceAsset"
9797
9898
9999 func amp () = "%s__amp"
100100
101101
102102 func ada () = "%s__addonAddr"
103103
104104
105105 func lgotc (caller) = makeString(["%s%s__lastGetOneTknCall", caller], SEP)
106106
107107
108108 func lsotc (caller) = makeString(["%s%s__lastPutOneTknCall", caller], SEP)
109109
110110
111111 func fcfg () = "%s__factoryConfig"
112112
113113
114114 func mtpk () = "%s%s__matcher__publicKey"
115115
116116
117117 func pc (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config")
118118
119119
120120 func mba (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr)
121121
122122
123123 func aps () = "%s__shutdown"
124124
125125
126126 func keyAllowedLpStableScriptHash () = "%s__allowedLpStableScriptHash"
127127
128128
129129 func toe (orV,sendrV,matchV) = throw(((((("Failed: ordValid=" + toString(orV)) + " sndrValid=") + toString(sendrV)) + " mtchrValid=") + toString(matchV)))
130130
131131
132132 func str (val) = match val {
133133 case valStr: String =>
134134 valStr
135135 case _ =>
136136 throw("fail cast to String")
137137 }
138138
139139
140140 func strf (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
141141
142142
143143 func intf (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
144144
145145
146146 let fca = addressFromStringValue(strf(this, fc()))
147147
148148 let A = strf(this, amp())
149149
150150 func igs () = valueOrElse(getBoolean(fca, aps()), false)
151151
152152
153153 func mp () = fromBase58String(strf(fca, mtpk()))
154154
155155
156156 func gpc () = {
157157 let amtAs = strf(this, aa())
158158 let priceAs = strf(this, pa())
159159 let iPriceAs = intf(fca, mba(priceAs))
160160 let iAmtAs = intf(fca, mba(amtAs))
161161 split(strf(fca, pc(toString(iAmtAs), toString(iPriceAs))), SEP)
162162 }
163163
164164
165165 func gfc () = split(strf(fca, fcfg()), SEP)
166166
167167
168168 let factoryConfig = gfc()
169169
170170 let stakingContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactStakCntr]), "Invalid staking contract address")
171171
172172 let slipageContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactSlippCntr]), "Invalid slipage contract address")
173173
174174 let gwxContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactGwxRewCntr]), "Invalid gwx contract address")
175175
176176 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)
177177
178178
179179 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)
180180
181181
182182 func getAccBalance (assetId) = if ((assetId == "WAVES"))
183183 then wavesBalance(this).available
184184 else assetBalance(this, fromBase58String(assetId))
185185
186186
187187 func cpbi (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
188188
189189
190190 func vad (A1,A2,slippage) = {
191191 let diff = fraction((A1 - A2), scale8BigInt, A2)
192192 let pass = ((slippage - abs(diff)) > zeroBigInt)
193193 if (!(pass))
194194 then throw(("Big slpg: " + toString(diff)))
195195 else $Tuple2(pass, min([A1, A2]))
196196 }
197197
198198
199199 func vd (D1,D0,slpg) = {
200200 let diff = fraction(D0, scale8BigInt, D1)
201201 let fail = (slpg > diff)
202202 if (if (fail)
203203 then true
204204 else (D0 > D1))
205205 then throw(((((((toString(D0) + " ") + toString(D1)) + " ") + toString(diff)) + " ") + toString(slpg)))
206206 else fail
207207 }
208208
209209
210210 func pcp (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
211211 let amtAsAmtX18 = t1(amAmt, amAssetDcm)
212212 let prAsAmtX18 = t1(prAmt, prAssetDcm)
213213 cpbi(prAsAmtX18, amtAsAmtX18)
214214 }
215215
216216
217217 func calcPrices (amAmt,prAmt,lpAmt) = {
218218 let cfg = gpc()
219219 let amtAsDcm = parseIntValue(cfg[idxAmtAsDcm])
220220 let prAsDcm = parseIntValue(cfg[idxPriceAsDcm])
221221 let priceX18 = pcp(amtAsDcm, prAsDcm, amAmt, prAmt)
222222 let amAmtX18 = t1(amAmt, amtAsDcm)
223223 let prAmtX18 = t1(prAmt, prAsDcm)
224224 let lpAmtX18 = t1(lpAmt, scale8)
225225 let lpPrInAmAsX18 = cpbi(amAmtX18, lpAmtX18)
226226 let lpPrInPrAsX18 = cpbi(prAmtX18, lpAmtX18)
227227 [priceX18, lpPrInAmAsX18, lpPrInPrAsX18]
228228 }
229229
230230
231231 func calculatePrices (amAmt,prAmt,lpAmt) = {
232232 let p = calcPrices(amAmt, prAmt, lpAmt)
233233 [f1(p[0], scale8), f1(p[1], scale8), f1(p[2], scale8)]
234234 }
235235
236236
237237 func ego (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
238238 let cfg = gpc()
239239 let lpId = cfg[idxLPAsId]
240240 let amId = cfg[idxAmAsId]
241241 let prId = cfg[idxPrAsId]
242242 let amDcm = parseIntValue(cfg[idxAmtAsDcm])
243243 let prDcm = parseIntValue(cfg[idxPriceAsDcm])
244244 let sts = cfg[idxPoolSt]
245245 let lpEmiss = valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "Wrong LP id").quantity
246246 if ((lpId != pmtAssetId))
247247 then throw("Wrong pmt asset")
248248 else {
249249 let amBalance = getAccBalance(amId)
250250 let amBalanceX18 = t1(amBalance, amDcm)
251251 let prBalance = getAccBalance(prId)
252252 let prBalanceX18 = t1(prBalance, prDcm)
253253 let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
254254 let curPrice = f1(curPriceX18, scale8)
255255 let pmtLpAmtX18 = t1(pmtLpAmt, scale8)
256256 let lpEmissX18 = t1(lpEmiss, scale8)
257257 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissX18)
258258 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissX18)
259259 let outAmAmt = f1(outAmAmtX18, amDcm)
260260 let outPrAmt = f1(outPrAmtX18, prDcm)
261261 let state = if ((txId58 == ""))
262262 then nil
263263 else [ScriptTransfer(userAddress, outAmAmt, if ((amId == "WAVES"))
264264 then unit
265265 else fromBase58String(amId)), ScriptTransfer(userAddress, outPrAmt, if ((prId == "WAVES"))
266266 then unit
267267 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)]
268268 $Tuple10(outAmAmt, outPrAmt, amId, prId, amBalance, prBalance, lpEmiss, curPriceX18, sts, state)
269269 }
270270 }
271271
272272
273-func epo (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEval,emitLp,isOneAsset,pmtAmt,pmtId) = {
273+func epo (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEval,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = {
274274 let cfg = gpc()
275275 let lpId = fromBase58String(cfg[idxLPAsId])
276276 let amIdStr = cfg[idxAmAsId]
277277 let prIdStr = cfg[idxPrAsId]
278278 let inAmIdStr = cfg[idxIAmtAsId]
279279 let inPrIdStr = cfg[idxIPriceAsId]
280280 let amtDcm = parseIntValue(cfg[idxAmtAsDcm])
281281 let priceDcm = parseIntValue(cfg[idxPriceAsDcm])
282282 let sts = cfg[idxPoolSt]
283283 let lpEm = valueOrErrorMessage(assetInfo(lpId), "Wr lp as").quantity
284284 let amBalance = if (isEval)
285285 then getAccBalance(amIdStr)
286286 else if (if (isOneAsset)
287287 then (pmtId == amIdStr)
288288 else false)
289289 then (getAccBalance(amIdStr) - pmtAmt)
290290 else if (isOneAsset)
291291 then getAccBalance(amIdStr)
292292 else (getAccBalance(amIdStr) - inAmAmt)
293293 let prBalance = if (isEval)
294294 then getAccBalance(prIdStr)
295295 else if (if (isOneAsset)
296296 then (pmtId == prIdStr)
297297 else false)
298298 then (getAccBalance(prIdStr) - pmtAmt)
299299 else if (isOneAsset)
300300 then getAccBalance(prIdStr)
301301 else (getAccBalance(prIdStr) - inPrAmt)
302302 let inAmAssetAmtX18 = t1(inAmAmt, amtDcm)
303303 let inPrAssetAmtX18 = t1(inPrAmt, priceDcm)
304304 let userPriceX18 = cpbi(inPrAssetAmtX18, inAmAssetAmtX18)
305305 let amBalanceX18 = t1(amBalance, amtDcm)
306306 let prBalanceX18 = t1(prBalance, priceDcm)
307307 let r = if ((lpEm == 0))
308308 then {
309309 let curPriceX18 = zeroBigInt
310310 let slippageX18 = zeroBigInt
311311 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
312312 $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
313313 }
314314 else {
315315 let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
316316 let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18)
317317 let slippageX18 = t1(slippage, scale8)
318- if (if ((curPriceX18 != zeroBigInt))
318+ if (if (if (validateSlippage)
319+ then (curPriceX18 != zeroBigInt)
320+ else false)
319321 then (slippageRealX18 > slippageX18)
320322 else false)
321323 then throw(((("Price slippage " + toString(slippageRealX18)) + " > ") + toString(slippageX18)))
322324 else {
323325 let lpEmissionX18 = t1(lpEm, scale8)
324326 let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
325327 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
326328 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
327329 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
328330 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
329331 let expAmtAssetAmtX18 = expectedAmts._1
330332 let expPriceAssetAmtX18 = expectedAmts._2
331333 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18)
332334 $Tuple5(f1(lpAmtX18, scale8), f1(expAmtAssetAmtX18, amtDcm), f1(expPriceAssetAmtX18, priceDcm), curPriceX18, slippageX18)
333335 }
334336 }
335337 let calcLpAmt = r._1
336338 let calcAmAssetPmt = r._2
337339 let calcPrAssetPmt = r._3
338340 let curPrice = f1(r._4, scale8)
339341 let slippageCalc = f1(r._5, scale8)
340342 if ((0 >= calcLpAmt))
341343 then throw("LP <= 0")
342344 else {
343345 let emitLpAmt = if (!(emitLp))
344346 then 0
345347 else calcLpAmt
346348 let amDiff = (inAmAmt - calcAmAssetPmt)
347349 let prDiff = (inPrAmt - calcPrAssetPmt)
348- let $t01601016355 = if (if (isOneAsset)
350+ let $t01608316428 = if (if (isOneAsset)
349351 then (pmtId == amIdStr)
350352 else false)
351353 then $Tuple2(pmtAmt, 0)
352354 else if (if (isOneAsset)
353355 then (pmtId == prIdStr)
354356 else false)
355357 then $Tuple2(0, pmtAmt)
356358 else $Tuple2(calcAmAssetPmt, calcPrAssetPmt)
357- let writeAmAmt = $t01601016355._1
358- let writePrAmt = $t01601016355._2
359+ let writeAmAmt = $t01608316428._1
360+ let writePrAmt = $t01608316428._2
359361 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))]
360362 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId)
361363 }
362364 }
363365
364366
365367 func moa (order) = {
366368 let cfg = gpc()
367369 let amtAsId = cfg[idxAmAsId]
368370 let prAsId = cfg[idxPrAsId]
369371 let sts = parseIntValue(cfg[idxPoolSt])
370372 let amtAsDcm = parseIntValue(cfg[idxAmtAsDcm])
371373 let prAsDcm = parseIntValue(cfg[idxPriceAsDcm])
372374 let accAmtAsBalance = getAccBalance(amtAsId)
373375 let accPrAsBalance = getAccBalance(prAsId)
374376 let curPriceX18 = if ((order.orderType == Buy))
375377 then pcp(amtAsDcm, prAsDcm, (accAmtAsBalance + order.amount), accPrAsBalance)
376378 else pcp(amtAsDcm, prAsDcm, (accAmtAsBalance - order.amount), accPrAsBalance)
377379 let curPrice = f1(curPriceX18, scale8)
378380 if (if (if (igs())
379381 then true
380382 else (sts == PoolMatcherDis))
381383 then true
382384 else (sts == PoolShutdown))
383385 then throw("Admin blocked")
384386 else {
385387 let orAmtAsset = order.assetPair.amountAsset
386388 let orAmtAsStr = if ((orAmtAsset == unit))
387389 then "WAVES"
388390 else toBase58String(value(orAmtAsset))
389391 let orPrAsset = order.assetPair.priceAsset
390392 let orPrAsStr = if ((orPrAsset == unit))
391393 then "WAVES"
392394 else toBase58String(value(orPrAsset))
393395 if (if ((orAmtAsStr != amtAsId))
394396 then true
395397 else (orPrAsStr != prAsId))
396398 then throw("Wr assets")
397399 else {
398400 let orderPrice = order.price
399401 let priceDcm = fraction(scale8, prAsDcm, amtAsDcm)
400402 let castOrderPrice = ts(orderPrice, scale8, priceDcm)
401403 let isOrderPriceValid = if ((order.orderType == Buy))
402404 then (curPrice >= castOrderPrice)
403405 else (castOrderPrice >= curPrice)
404406 true
405407 }
406408 }
407409 }
408410
409411
410412 func cg (i) = if ((size(i.payments) != 1))
411413 then throw("1 pmnt exp")
412414 else {
413415 let pmt = value(i.payments[0])
414416 let pmtAssetId = value(pmt.assetId)
415417 let pmtAmt = pmt.amount
416418 let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
417419 let outAmAmt = r._1
418420 let outPrAmt = r._2
419421 let sts = parseIntValue(r._9)
420422 let state = r._10
421423 if (if (igs())
422424 then true
423425 else (sts == PoolShutdown))
424426 then throw(("Admin blocked: " + toString(sts)))
425427 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
426428 }
427429
428430
429-func cp (caller,txId,amAsPmt,prAsPmt,slippage,emitLp,isOneAsset,pmtAmt,pmtId) = {
430- let r = epo(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, false, emitLp, isOneAsset, pmtAmt, pmtId)
431+func cp (caller,txId,amAsPmt,prAsPmt,slippage,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = {
432+ let r = epo(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, false, emitLp, isOneAsset, validateSlippage, pmtAmt, pmtId)
431433 let sts = parseIntValue(r._8)
432434 if (if (if (igs())
433435 then true
434436 else (sts == PoolPutDis))
435437 then true
436438 else (sts == PoolShutdown))
437439 then throw(("Blocked:" + toString(sts)))
438440 else r
439441 }
440442
441443
442444 func m () = match getString(mpk()) {
443445 case s: String =>
444446 fromBase58String(s)
445447 case _: Unit =>
446448 unit
447449 case _ =>
448450 throw("Match error")
449451 }
450452
451453
452454 func pm () = match getString(pmpk()) {
453455 case s: String =>
454456 fromBase58String(s)
455457 case _: Unit =>
456458 unit
457459 case _ =>
458460 throw("Match error")
459461 }
460462
461463
462464 let pd = throw("Permission denied")
463465
464466 func mm (i) = match m() {
465467 case pk: ByteVector =>
466468 if ((i.callerPublicKey == pk))
467469 then true
468470 else pd
469471 case _: Unit =>
470472 if ((i.caller == this))
471473 then true
472474 else pd
473475 case _ =>
474476 throw("Match error")
475477 }
476478
477479
478480 @Callable(i)
479481 func constructor (fc) = {
480482 let c = mm(i)
481483 if ((c == c))
482484 then [StringEntry(fc(), fc)]
483485 else throw("Strict value is not equal to itself.")
484486 }
485487
486488
487489
488490 @Callable(i)
489491 func setManager (pendingManagerPublicKey) = {
490492 let c = mm(i)
491493 if ((c == c))
492494 then {
493495 let cm = fromBase58String(pendingManagerPublicKey)
494496 if ((cm == cm))
495497 then [StringEntry(pmpk(), pendingManagerPublicKey)]
496498 else throw("Strict value is not equal to itself.")
497499 }
498500 else throw("Strict value is not equal to itself.")
499501 }
500502
501503
502504
503505 @Callable(i)
504506 func confirmManager () = {
505507 let p = pm()
506508 let hpm = if (isDefined(p))
507509 then true
508510 else throw("No pending manager")
509511 if ((hpm == hpm))
510512 then {
511513 let cpm = if ((i.callerPublicKey == value(p)))
512514 then true
513515 else throw("You are not pending manager")
514516 if ((cpm == cpm))
515517 then [StringEntry(mpk(), toBase58String(value(p))), DeleteEntry(pmpk())]
516518 else throw("Strict value is not equal to itself.")
517519 }
518520 else throw("Strict value is not equal to itself.")
519521 }
520522
521523
522524
523525 @Callable(i)
524526 func put (slip,autoStake) = {
525527 let factCfg = gfc()
526528 let stakingCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactStakCntr]), "Wr st addr")
527529 let slipCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactSlippCntr]), "Wr sl addr")
528530 if ((0 > slip))
529531 then throw("Wrong slippage")
530532 else if ((size(i.payments) != 2))
531533 then throw("2 pmnts expd")
532534 else {
533- 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, 0, "")
535+ 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, "")
534536 let emitLpAmt = e._2
535537 let lpAssetId = e._7
536538 let state = e._9
537539 let amDiff = e._10
538540 let prDiff = e._11
539541 let amId = e._12
540542 let prId = e._13
541543 let r = invoke(fca, "emit", [emitLpAmt], nil)
542544 if ((r == r))
543545 then {
544546 let el = match r {
545547 case legacy: Address =>
546548 invoke(legacy, "emit", [emitLpAmt], nil)
547549 case _ =>
548550 unit
549551 }
550552 if ((el == el))
551553 then {
552554 let sa = if ((amDiff > 0))
553555 then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)])
554556 else nil
555557 if ((sa == sa))
556558 then {
557559 let sp = if ((prDiff > 0))
558560 then invoke(slipCntr, "put", nil, [AttachedPayment(prId, prDiff)])
559561 else nil
560562 if ((sp == sp))
561563 then {
562564 let lpTrnsfr = if (autoStake)
563565 then {
564566 let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
565567 if ((ss == ss))
566568 then nil
567569 else throw("Strict value is not equal to itself.")
568570 }
569571 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
570572 (state ++ lpTrnsfr)
571573 }
572574 else throw("Strict value is not equal to itself.")
573575 }
574576 else throw("Strict value is not equal to itself.")
575577 }
576578 else throw("Strict value is not equal to itself.")
577579 }
578580 else throw("Strict value is not equal to itself.")
579581 }
580582 }
581583
582584
583585
584586 @Callable(i)
585587 func putOneTkn (amAssetPart,prAssetPart,outLp,slippage,autoStake) = {
586588 let cfg = gfc()
587589 let stakingCntr = valueOrErrorMessage(addressFromString(cfg[idxFactStakCntr]), "Wr st addr")
588590 let slipCntr = valueOrErrorMessage(addressFromString(cfg[idxFactSlippCntr]), "Wr sl addr")
589591 let gwxCntr = valueOrErrorMessage(addressFromString(cfg[idxFactGwxRewCntr]), "Wr gwx addr")
590592 let poolCfg = gpc()
591593 let amId = poolCfg[idxAmAsId]
592594 let prId = poolCfg[idxPrAsId]
593595 let amDcm = parseIntValue(poolCfg[idxAmtAsDcm])
594596 let prDcm = parseIntValue(poolCfg[idxPriceAsDcm])
595597 let addon = valueOrElse(getString(this, ada()), "")
596598 let userAddress = if ((addon == toString(i.caller)))
597599 then i.originCaller
598600 else i.caller
599601 let addonContract = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(ada()), "no addons")), "addon address in not valid")
600602 let check = reentrantInvoke(addonContract, "ensureCanPutOneTkn", [toString(userAddress)], nil)
601603 if ((check == check))
602604 then if (if (if (if ((0 >= slippage))
603605 then true
604606 else (0 >= amAssetPart))
605607 then true
606608 else (0 >= prAssetPart))
607609 then true
608610 else (0 >= outLp))
609611 then throw("Wrong params")
610612 else if ((size(i.payments) != 1))
611613 then throw("1 pmnt expd")
612614 else {
613615 let pmt = value(i.payments[0])
614616 let pmtAssetId = toBase58String(value(pmt.assetId))
615617 let pmtAmt = pmt.amount
616618 if ((10000000 > pmtAmt))
617619 then throw("Wrong pmt amt")
618620 else {
619621 let amBalance = getAccBalance(amId)
620622 let prBalance = getAccBalance(prId)
621- let $t02526825844 = if ((pmtAssetId == amId))
623+ let $t02545426030 = if ((pmtAssetId == amId))
622624 then if (if ((pmtAmt > amBalance))
623625 then true
624626 else (amAssetPart > pmtAmt))
625627 then throw("invalid payment amount")
626628 else $Tuple6((amBalance - pmtAmt), prBalance, (pmtAmt - amAssetPart), prAssetPart, 0, 0)
627629 else if ((pmtAssetId == prId))
628630 then if (if ((pmtAmt > prBalance))
629631 then true
630632 else (prAssetPart > pmtAmt))
631633 then throw("invalid payment amount")
632634 else $Tuple6(amBalance, (prBalance - pmtAmt), 0, 0, (pmtAmt - prAssetPart), amAssetPart)
633635 else throw("wrong pmtAssetId")
634- let amBalanceNow = $t02526825844._1
635- let prBalanceNow = $t02526825844._2
636- let virtSwapInAm = $t02526825844._3
637- let virtSwapOutPr = $t02526825844._4
638- let virtSwapInPr = $t02526825844._5
639- let virtSwapOutAm = $t02526825844._6
636+ let amBalanceNow = $t02545426030._1
637+ let prBalanceNow = $t02545426030._2
638+ let virtSwapInAm = $t02545426030._3
639+ let virtSwapOutPr = $t02545426030._4
640+ let virtSwapInPr = $t02545426030._5
641+ let virtSwapOutAm = $t02545426030._6
640642 let D0 = invoke(gwxCntr, "calcD", [toString(amBalanceNow), toString(prBalanceNow), A, Amult, Dconv], nil)
641643 let D1 = invoke(gwxCntr, "calcD", [toString(toBigInt(((amBalanceNow + virtSwapInAm) - virtSwapOutAm))), toString(toBigInt(((prBalanceNow + virtSwapInPr) - virtSwapOutPr))), A, Amult, Dconv], nil)
642644 let D0vsD1 = vd(parseBigIntValue(str(D1)), parseBigIntValue(str(D0)), slippage4D)
643645 if ((D0vsD1 == D0vsD1))
644646 then {
645- let estPut = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(fromBase58String(amId), amAssetPart), AttachedPayment(fromBase58String(prId), prAssetPart), slippage, true, true, pmtAmt, pmtAssetId)
647+ let estPut = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(fromBase58String(amId), amAssetPart), AttachedPayment(fromBase58String(prId), prAssetPart), slippage, true, true, true, pmtAmt, pmtAssetId)
646648 let estimLP = estPut._2
647649 let lpAssetId = estPut._7
648650 let state = estPut._9
649651 let amDiff = estPut._10
650652 let prDiff = estPut._11
651653 let lpCalcRes = vad(toBigInt(estimLP), toBigInt(outLp), toBigInt(slippage))
652654 let emitLpAmt = toInt(lpCalcRes._2)
653655 let e = invoke(fca, "emit", [emitLpAmt], nil)
654656 if ((e == e))
655657 then {
656658 let el = match e {
657659 case legacy: Address =>
658660 invoke(legacy, "emit", [emitLpAmt], nil)
659661 case _ =>
660662 unit
661663 }
662664 if ((el == el))
663665 then {
664666 let sa = if ((amDiff > 0))
665667 then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String(amId), amDiff)])
666668 else nil
667669 if ((sa == sa))
668670 then {
669671 let sp = if ((prDiff > 0))
670672 then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String(prId), prDiff)])
671673 else nil
672674 if ((sp == sp))
673675 then {
674676 let lpTrnsfr = if (autoStake)
675677 then {
676678 let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
677679 if ((ss == ss))
678680 then nil
679681 else throw("Strict value is not equal to itself.")
680682 }
681683 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
682684 (state ++ lpTrnsfr)
683685 }
684686 else throw("Strict value is not equal to itself.")
685687 }
686688 else throw("Strict value is not equal to itself.")
687689 }
688690 else throw("Strict value is not equal to itself.")
689691 }
690692 else throw("Strict value is not equal to itself.")
691693 }
692694 else throw("Strict value is not equal to itself.")
693695 }
694696 }
695697 else throw("Strict value is not equal to itself.")
696698 }
697699
698700
699701
700702 @Callable(i)
701-func putOneTknV2 (outLp,slippage,autoStake) = if ((size(i.payments) != 1))
703+func putOneTknV2 (minOutAmount,autoStake) = if ((size(i.payments) != 1))
702704 then throw("1 pmnt expd")
703705 else {
704706 let poolConfig = gpc()
705707 let amId = poolConfig[idxAmAsId]
706708 let prId = poolConfig[idxPrAsId]
707709 let amDecimals = parseIntValue(poolConfig[idxAmtAsDcm])
708710 let prDecimals = parseIntValue(poolConfig[idxPriceAsDcm])
709711 let userAddress = if ((i.caller == this))
710712 then i.originCaller
711713 else i.caller
712714 let pmt = value(i.payments[0])
713715 let pmtAssetId = toBase58String(value(pmt.assetId))
714716 let pmtAmt = pmt.amount
715717 if ((10000000 > pmtAmt))
716718 then throw("Wrong pmt amt")
717719 else {
718720 let amBalance = getAccBalance(amId)
719721 let prBalance = getAccBalance(prId)
720- let $t02860828982 = if ((pmtAssetId == amId))
722+ let $t02881829192 = if ((pmtAssetId == amId))
721723 then if ((pmtAmt > amBalance))
722724 then throw("invalid payment amount")
723725 else $Tuple2((amBalance - pmtAmt), prBalance)
724726 else if ((pmtAssetId == prId))
725727 then if ((pmtAmt > prBalance))
726728 then throw("invalid payment amount")
727729 else $Tuple2(amBalance, (prBalance - pmtAmt))
728730 else throw("wrong pmtAssetId")
729- let amBalanceNow = $t02860828982._1
730- let prBalanceNow = $t02860828982._2
731- let $t02898629120 = if ((pmtAssetId == amId))
731+ let amBalanceNow = $t02881829192._1
732+ let prBalanceNow = $t02881829192._2
733+ let $t02919629330 = if ((pmtAssetId == amId))
732734 then $Tuple2(amBalanceNow, prBalanceNow)
733735 else $Tuple2(prBalanceNow, amBalanceNow)
734- let amBalanceForCalc = $t02898629120._1
735- let prBalanceForCalc = $t02898629120._2
736+ let amBalanceForCalc = $t02919629330._1
737+ let prBalanceForCalc = $t02919629330._2
736738 let xPrecision = 1
737739 let result = {
738740 let @ = invoke(gwxContract, "calcPutXOnly", [toString(pmtAmt), toString(amBalanceForCalc), toString(prBalanceForCalc), "", A, Amult, toString(xPrecision), Dconv], nil)
739741 if ($isInstanceOf(@, "(Int, Int)"))
740742 then @
741743 else throw(($getType(invoke(gwxContract, "calcPutXOnly", [toString(pmtAmt), toString(amBalanceForCalc), toString(prBalanceForCalc), "", A, Amult, toString(xPrecision), Dconv], nil)) + " couldn't be cast to (Int, Int)"))
742744 }
743- let $t02958929685 = if ((pmtAssetId == amId))
745+ let $t02979929895 = if ((pmtAssetId == amId))
744746 then result
745747 else $Tuple2(result._2, result._1)
746- let amAssetPart = $t02958929685._1
747- let prAssetPart = $t02958929685._2
748- let estPut = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(fromBase58String(amId), amAssetPart), AttachedPayment(fromBase58String(prId), prAssetPart), slippage, true, true, pmtAmt, pmtAssetId)
748+ let amAssetPart = $t02979929895._1
749+ let prAssetPart = $t02979929895._2
750+ let estPut = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(fromBase58String(amId), amAssetPart), AttachedPayment(fromBase58String(prId), prAssetPart), 0, true, true, false, pmtAmt, pmtAssetId)
749751 let estimLP = estPut._2
750752 let lpAssetId = estPut._7
751753 let state = estPut._9
752754 let amDiff = estPut._10
753755 let prDiff = estPut._11
754- let emitLpAmt = if ((outLp > 0))
755- then {
756- let lpCalcRes = vad(toBigInt(estimLP), toBigInt(outLp), toBigInt(slippage))
757- toInt(lpCalcRes._2)
758- }
756+ let emitLpAmt = if (if ((minOutAmount > 0))
757+ then (minOutAmount > estimLP)
758+ else false)
759+ then throw(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
759760 else estimLP
760761 let e = invoke(fca, "emit", [emitLpAmt], nil)
761762 if ((e == e))
762763 then {
763764 let el = match e {
764765 case legacy: Address =>
765766 invoke(legacy, "emit", [emitLpAmt], nil)
766767 case _ =>
767768 unit
768769 }
769770 if ((el == el))
770771 then {
771772 let sa = if ((amDiff > 0))
772773 then invoke(slipageContract, "put", nil, [AttachedPayment(fromBase58String(amId), amDiff)])
773774 else nil
774775 if ((sa == sa))
775776 then {
776777 let sp = if ((prDiff > 0))
777778 then invoke(slipageContract, "put", nil, [AttachedPayment(fromBase58String(prId), prDiff)])
778779 else nil
779780 if ((sp == sp))
780781 then {
781782 let lpTrnsfr = if (autoStake)
782783 then {
783784 let ss = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
784785 if ((ss == ss))
785786 then nil
786787 else throw("Strict value is not equal to itself.")
787788 }
788789 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
789790 (state ++ lpTrnsfr)
790791 }
791792 else throw("Strict value is not equal to itself.")
792793 }
793794 else throw("Strict value is not equal to itself.")
794795 }
795796 else throw("Strict value is not equal to itself.")
796797 }
797798 else throw("Strict value is not equal to itself.")
798799 }
799800 }
800801
801802
802803
803804 @Callable(i)
804805 func putForFree (maxSlpg) = if ((0 > maxSlpg))
805806 then throw("Wrong slpg")
806807 else if ((size(i.payments) != 2))
807808 then throw("2 pmnts expd")
808809 else {
809- 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, 0, "")
810+ 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, "")
810811 estPut._9
811812 }
812813
813814
814815
815816 @Callable(i)
816817 func get () = {
817818 let r = cg(i)
818819 let outAmtAmt = r._1
819820 let outPrAmt = r._2
820821 let pmtAmt = r._3
821822 let pmtAssetId = r._4
822823 let state = r._5
823824 let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
824825 if ((b == b))
825826 then state
826827 else throw("Strict value is not equal to itself.")
827828 }
828829
829830
830831
831832 @Callable(i)
832833 func getOneTkn (exchResult,notUsed,outAmount,outAssetId,slippage) = if ((size(i.payments) != 1))
833834 then throw("1 pmnt expd")
834835 else {
835836 let cfg = gpc()
836837 let lpId = cfg[idxLPAsId]
837838 let amId = cfg[idxAmAsId]
838839 let prId = cfg[idxPrAsId]
839840 let amDcm = parseIntValue(cfg[idxAmtAsDcm])
840841 let prDcm = parseIntValue(cfg[idxPriceAsDcm])
841842 let sts = cfg[idxPoolSt]
842843 let factCfg = gfc()
843844 let gwxCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactGwxRewCntr]), "Wr sl addr")
844845 let pmt = value(i.payments[0])
845846 let addon = valueOrElse(getString(this, ada()), "")
846847 let userAddress = if ((addon == toString(i.caller)))
847848 then i.originCaller
848849 else i.caller
849850 let txId58 = toBase58String(i.transactionId)
850851 let pmtAssetId = value(pmt.assetId)
851852 let pmtAmt = pmt.amount
852853 let addonContract = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(ada()), "no addons")), "addon address in not valid")
853854 let check = reentrantInvoke(addonContract, "ensureCanGetOneTkn", [toString(userAddress)], nil)
854855 if ((check == check))
855856 then if ((1000000000 > pmtAmt))
856857 then throw("Min pmt 10 LP")
857858 else if (if (if ((0 > slippage))
858859 then true
859860 else (0 > exchResult))
860861 then true
861862 else (0 > outAmount))
862863 then throw("Wrong params")
863864 else if ((lpId != toBase58String(pmtAssetId)))
864865 then throw("Wrong LP")
865866 else {
866867 let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
867868 let estimAmAmt = r._1
868869 let estimPrAmt = r._2
869870 let amBalance = getAccBalance(amId)
870871 let prBalance = getAccBalance(prId)
871- let $t03404934506 = if ((outAssetId == amId))
872+ let $t03429834755 = if ((outAssetId == amId))
872873 then $Tuple7((amBalance - estimAmAmt), (prBalance - estimPrAmt), exchResult, estimPrAmt, 0, 0, (estimAmAmt + exchResult))
873874 else if ((outAssetId == prId))
874875 then $Tuple7((amBalance - estimAmAmt), (prBalance - estimPrAmt), 0, 0, exchResult, estimAmAmt, (estimPrAmt + exchResult))
875876 else throw("wrong outAssetId")
876- let amBalanceNow = $t03404934506._1
877- let prBalanceNow = $t03404934506._2
878- let virtSwapInAm = $t03404934506._3
879- let virtSwapOutPr = $t03404934506._4
880- let virtSwapInPr = $t03404934506._5
881- let virtSwapOutAm = $t03404934506._6
882- let totalGet = $t03404934506._7
877+ let amBalanceNow = $t03429834755._1
878+ let prBalanceNow = $t03429834755._2
879+ let virtSwapInAm = $t03429834755._3
880+ let virtSwapOutPr = $t03429834755._4
881+ let virtSwapInPr = $t03429834755._5
882+ let virtSwapOutAm = $t03429834755._6
883+ let totalGet = $t03429834755._7
883884 if (if ((0 > virtSwapInAm))
884885 then true
885886 else (0 > virtSwapInPr))
886887 then throw("Wrong calc")
887888 else {
888889 let D0 = invoke(gwxCntr, "calcD", [toString(amBalanceNow), toString(prBalanceNow), A, Amult, Dconv], nil)
889890 let D1 = invoke(gwxCntr, "calcD", [toString(((amBalanceNow - virtSwapInAm) + virtSwapOutAm)), toString(((prBalanceNow + virtSwapOutPr) - virtSwapInPr)), A, Amult, Dconv], nil)
890891 let D0vsD1 = vd(parseBigIntValue(str(D1)), parseBigIntValue(str(D0)), slippage4D)
891892 if ((D0vsD1 == D0vsD1))
892893 then {
893894 let finalRes = vad(toBigInt(totalGet), toBigInt(outAmount), toBigInt(slippage))
894895 if ((finalRes == finalRes))
895896 then {
896- let $t03521135315 = if ((outAssetId == amId))
897+ let $t03546035564 = if ((outAssetId == amId))
897898 then $Tuple2(toInt(finalRes._2), 0)
898899 else $Tuple2(0, toInt(finalRes._2))
899- let outAm = $t03521135315._1
900- let outPr = $t03521135315._2
900+ let outAm = $t03546035564._1
901+ let outPr = $t03546035564._2
901902 let curPrX18 = cpbi(t1(prBalance, prDcm), t1(amBalance, amDcm))
902903 let curPr = f1(curPrX18, scale8)
903904 let state = [ScriptTransfer(userAddress, (outAm + outPr), if ((outAssetId == "WAVES"))
904905 then unit
905906 else fromBase58String(outAssetId)), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAm, outPr, pmtAmt, curPr, height, lastBlock.timestamp)), IntegerEntry(pl(), curPr), IntegerEntry(ph(height, lastBlock.timestamp), curPr)]
906907 if ((state == state))
907908 then {
908909 let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
909910 if ((burn == burn))
910911 then state
911912 else throw("Strict value is not equal to itself.")
912913 }
913914 else throw("Strict value is not equal to itself.")
914915 }
915916 else throw("Strict value is not equal to itself.")
916917 }
917918 else throw("Strict value is not equal to itself.")
918919 }
919920 }
920921 else throw("Strict value is not equal to itself.")
921922 }
922923
923924
924925
925926 @Callable(i)
926-func getOneTknV2 (outAmount,outAssetId,slippage) = if ((size(i.payments) != 1))
927+func getOneTknV2 (outAssetId,minOutAmount) = if ((size(i.payments) != 1))
927928 then throw("1 pmnt expd")
928929 else {
929930 let poolConfig = gpc()
930931 let lpId = poolConfig[idxLPAsId]
931932 let amId = poolConfig[idxAmAsId]
932933 let prId = poolConfig[idxPrAsId]
933934 let amDecimals = parseIntValue(poolConfig[idxAmtAsDcm])
934935 let prDecimals = parseIntValue(poolConfig[idxPriceAsDcm])
935936 let poolStatus = poolConfig[idxPoolSt]
936937 let userAddress = if ((i.caller == this))
937938 then i.originCaller
938939 else i.caller
939940 let pmt = value(i.payments[0])
940941 let pmtAssetId = value(pmt.assetId)
941942 let pmtAmt = pmt.amount
942943 if ((1000000000 > pmtAmt))
943944 then throw("Min pmt 10 LP")
944945 else {
945946 let txId58 = toBase58String(i.transactionId)
946- if ((0 > slippage))
947- then throw("Wrong params")
948- else if ((lpId != toBase58String(pmtAssetId)))
949- then throw("Wrong LP")
950- else {
951- let r = ego(txId58, toBase58String(pmtAssetId), pmtAmt, i.caller)
952- let estimAmAmt = r._1
953- let estimPrAmt = r._2
954- let amBalance = getAccBalance(amId)
955- let prBalance = getAccBalance(prId)
956- let amBalanceNow = (amBalance - estimAmAmt)
957- let prBalanceNow = (prBalance - estimPrAmt)
958- let $t03714137412 = if ((outAssetId == amId))
959- then $Tuple3(prBalanceNow, amBalanceNow, estimPrAmt)
960- else if ((outAssetId == prId))
961- then $Tuple3(amBalanceNow, prBalanceNow, estimAmAmt)
962- else throw("wrong outAssetId")
963- let amountBalanceForSwap = $t03714137412._1
964- let priceBalanceForSwap = $t03714137412._2
965- let amountToSwap = $t03714137412._3
966- let yPrecision = 1
967- let exchResult = {
968- let @ = invoke(gwxContract, "calcSwapXToY", [toString(amountToSwap), toString(amountBalanceForSwap), toString(priceBalanceForSwap), "", A, Amult, toString(yPrecision), Dconv], nil)
969- if ($isInstanceOf(@, "Int"))
970- then @
971- else throw(($getType(invoke(gwxContract, "calcSwapXToY", [toString(amountToSwap), toString(amountBalanceForSwap), toString(priceBalanceForSwap), "", A, Amult, toString(yPrecision), Dconv], nil)) + " couldn't be cast to Int"))
947+ if ((lpId != toBase58String(pmtAssetId)))
948+ then throw("Wrong LP")
949+ else {
950+ let r = ego(txId58, toBase58String(pmtAssetId), pmtAmt, i.caller)
951+ let estimAmAmt = r._1
952+ let estimPrAmt = r._2
953+ let amBalance = getAccBalance(amId)
954+ let prBalance = getAccBalance(prId)
955+ let amBalanceNow = (amBalance - estimAmAmt)
956+ let prBalanceNow = (prBalance - estimPrAmt)
957+ let $t03732637597 = if ((outAssetId == amId))
958+ then $Tuple3(prBalanceNow, amBalanceNow, estimPrAmt)
959+ else if ((outAssetId == prId))
960+ then $Tuple3(amBalanceNow, prBalanceNow, estimAmAmt)
961+ else throw("wrong outAssetId")
962+ let amountBalanceForSwap = $t03732637597._1
963+ let priceBalanceForSwap = $t03732637597._2
964+ let amountToSwap = $t03732637597._3
965+ let yPrecision = 1
966+ let exchResult = {
967+ let @ = invoke(gwxContract, "calcSwapXToY", [toString(amountToSwap), toString(amountBalanceForSwap), toString(priceBalanceForSwap), "", A, Amult, toString(yPrecision), Dconv], nil)
968+ if ($isInstanceOf(@, "Int"))
969+ then @
970+ else throw(($getType(invoke(gwxContract, "calcSwapXToY", [toString(amountToSwap), toString(amountBalanceForSwap), toString(priceBalanceForSwap), "", A, Amult, toString(yPrecision), Dconv], nil)) + " couldn't be cast to Int"))
971+ }
972+ let totalGet = (exchResult + (if ((outAssetId == amId))
973+ then estimAmAmt
974+ else estimPrAmt))
975+ let totalAmount = if (if ((minOutAmount > 0))
976+ then (minOutAmount > totalGet)
977+ else false)
978+ then throw(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
979+ else totalGet
980+ let $t03835038437 = if ((outAssetId == amId))
981+ then $Tuple2(totalAmount, 0)
982+ else $Tuple2(0, totalAmount)
983+ let outAm = $t03835038437._1
984+ let outPr = $t03835038437._2
985+ let curPrX18 = cpbi(t1(prBalance, prDecimals), t1(amBalance, amDecimals))
986+ let curPr = f1(curPrX18, scale8)
987+ let state = [ScriptTransfer(userAddress, totalAmount, if ((outAssetId == "WAVES"))
988+ then unit
989+ else fromBase58String(outAssetId)), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAm, outPr, pmtAmt, curPr, height, lastBlock.timestamp)), IntegerEntry(pl(), curPr), IntegerEntry(ph(height, lastBlock.timestamp), curPr)]
990+ if ((state == state))
991+ then {
992+ let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
993+ if ((burn == burn))
994+ then $Tuple2(state, totalAmount)
995+ else throw("Strict value is not equal to itself.")
972996 }
973- let totalGet = if ((outAssetId == amId))
974- then (estimAmAmt + exchResult)
975- else (estimPrAmt + exchResult)
976- let finalRes = if ((outAmount > 0))
977- then vad(toBigInt(totalGet), toBigInt(outAmount), toBigInt(slippage))
978- else $Tuple2(true, toBigInt(totalGet))
979- let $t03815838261 = if ((outAssetId == amId))
980- then $Tuple2(toInt(finalRes._2), 0)
981- else $Tuple2(0, toInt(finalRes._2))
982- let outAm = $t03815838261._1
983- let outPr = $t03815838261._2
984- let totalAmount = (outAm + outPr)
985- let curPrX18 = cpbi(t1(prBalance, prDecimals), t1(amBalance, amDecimals))
986- let curPr = f1(curPrX18, scale8)
987- let state = [ScriptTransfer(userAddress, totalAmount, if ((outAssetId == "WAVES"))
988- then unit
989- else fromBase58String(outAssetId)), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAm, outPr, pmtAmt, curPr, height, lastBlock.timestamp)), IntegerEntry(pl(), curPr), IntegerEntry(ph(height, lastBlock.timestamp), curPr)]
990- if ((state == state))
991- then {
992- let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
993- if ((burn == burn))
994- then $Tuple2(state, totalAmount)
995- else throw("Strict value is not equal to itself.")
996- }
997- else throw("Strict value is not equal to itself.")
998- }
997+ else throw("Strict value is not equal to itself.")
998+ }
999999 }
10001000 }
10011001
10021002
10031003
10041004 @Callable(i)
10051005 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
10061006 let r = cg(i)
10071007 let outAmAmt = r._1
10081008 let outPrAmt = r._2
10091009 let pmtAmt = r._3
10101010 let pmtAssetId = r._4
10111011 let state = r._5
10121012 if ((noLessThenAmtAsset > outAmAmt))
10131013 then throw(((("Failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
10141014 else if ((noLessThenPriceAsset > outPrAmt))
10151015 then throw(((("Failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
10161016 else {
10171017 let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10181018 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10191019 then state
10201020 else throw("Strict value is not equal to itself.")
10211021 }
10221022 }
10231023
10241024
10251025
10261026 @Callable(i)
10271027 func unstakeAndGet (amount) = {
10281028 let checkPayments = if ((size(i.payments) != 0))
10291029 then throw("No pmnts expd")
10301030 else true
10311031 if ((checkPayments == checkPayments))
10321032 then {
10331033 let cfg = gpc()
10341034 let factoryCfg = gfc()
10351035 let lpAssetId = fromBase58String(cfg[idxLPAsId])
10361036 let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr")
10371037 let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil)
10381038 if ((unstakeInv == unstakeInv))
10391039 then {
10401040 let r = ego(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
10411041 let sts = parseIntValue(r._9)
10421042 let state = r._10
10431043 let v = if (if (igs())
10441044 then true
10451045 else (sts == PoolShutdown))
10461046 then throw(("Blocked: " + toString(sts)))
10471047 else true
10481048 if ((v == v))
10491049 then {
10501050 let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
10511051 if ((burnA == burnA))
10521052 then state
10531053 else throw("Strict value is not equal to itself.")
10541054 }
10551055 else throw("Strict value is not equal to itself.")
10561056 }
10571057 else throw("Strict value is not equal to itself.")
10581058 }
10591059 else throw("Strict value is not equal to itself.")
10601060 }
10611061
10621062
10631063
10641064 @Callable(i)
10651065 func unstakeAndGetOneTkn (amount,outAmount,outAssetId,slippage) = {
10661066 let checkPayments = if ((size(i.payments) != 0))
10671067 then throw("No pmnts expd")
10681068 else true
10691069 if ((checkPayments == checkPayments))
10701070 then {
10711071 let cfg = gpc()
10721072 let factoryCfg = gfc()
10731073 let lpAssetId = fromBase58String(cfg[idxLPAsId])
10741074 let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr")
10751075 let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil)
10761076 if ((unstakeInv == unstakeInv))
10771077 then {
10781078 let outAmountResult = {
10791079 let @ = invoke(this, "getOneTknV2", [outAmount, outAssetId, slippage], [AttachedPayment(lpAssetId, amount)])
10801080 if ($isInstanceOf(@, "Int"))
10811081 then @
10821082 else unit
10831083 }
10841084 if ((outAmountResult == outAmountResult))
10851085 then $Tuple2(nil, outAmountResult)
10861086 else throw("Strict value is not equal to itself.")
10871087 }
10881088 else throw("Strict value is not equal to itself.")
10891089 }
10901090 else throw("Strict value is not equal to itself.")
10911091 }
10921092
10931093
10941094
10951095 @Callable(i)
10961096 func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString(fca)))
10971097 then throw("denied")
10981098 else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr)], "success")
10991099
11001100
11011101
11021102 @Callable(i)
11031103 func setS (k,v) = if ((toString(i.caller) != strf(this, ada())))
11041104 then pd
11051105 else [StringEntry(k, v)]
11061106
11071107
11081108
11091109 @Callable(i)
11101110 func setI (k,v) = if ((toString(i.caller) != strf(this, ada())))
11111111 then pd
11121112 else [IntegerEntry(k, v)]
11131113
11141114
11151115
11161116 @Callable(i)
11171117 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, gpc())
11181118
11191119
11201120
11211121 @Callable(i)
11221122 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
11231123
11241124
11251125
11261126 @Callable(i)
11271127 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
11281128 let pr = calcPrices(amAmt, prAmt, lpAmt)
11291129 $Tuple2(nil, [toString(pr[0]), toString(pr[1]), toString(pr[2])])
11301130 }
11311131
11321132
11331133
11341134 @Callable(i)
11351135 func fromX18WrapperREADONLY (val,resScaleMult) = $Tuple2(nil, f1(parseBigIntValue(val), resScaleMult))
11361136
11371137
11381138
11391139 @Callable(i)
11401140 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(t1(origVal, origScaleMult)))
11411141
11421142
11431143
11441144 @Callable(i)
11451145 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(cpbi(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
11461146
11471147
11481148
11491149 @Callable(i)
1150-func estimatePutOperationWrapperREADONLY (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,usrAddr,isEval,emitLp) = $Tuple2(nil, epo(txId58, slippage, inAmAmt, inAmId, inPrAmt, inPrId, usrAddr, isEval, emitLp, false, 0, ""))
1150+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, ""))
11511151
11521152
11531153
11541154 @Callable(i)
11551155 func estimateGetOperationWrapperREADONLY (txId58,pmtAsId,pmtLpAmt,usrAddr) = {
11561156 let r = ego(txId58, pmtAsId, pmtLpAmt, addressFromStringValue(usrAddr))
11571157 $Tuple2(nil, $Tuple10(r._1, r._2, r._3, r._4, r._5, r._6, r._7, toString(r._8), r._9, r._10))
11581158 }
11591159
11601160
11611161 @Verifier(tx)
11621162 func verify () = {
11631163 let targetPublicKey = match m() {
11641164 case pk: ByteVector =>
11651165 pk
11661166 case _: Unit =>
11671167 tx.senderPublicKey
11681168 case _ =>
11691169 throw("Match error")
11701170 }
11711171 match tx {
11721172 case order: Order =>
11731173 let matcherPub = mp()
11741174 let orderValid = moa(order)
11751175 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
11761176 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
11771177 if (if (if (orderValid)
11781178 then senderValid
11791179 else false)
11801180 then matcherValid
11811181 else false)
11821182 then true
11831183 else toe(orderValid, senderValid, matcherValid)
11841184 case s: SetScriptTransaction =>
11851185 let newHash = blake2b256(value(s.script))
11861186 let allowedHash = fromBase64String(value(getString(fca, keyAllowedLpStableScriptHash())))
11871187 let currentHash = scriptHash(this)
11881188 if (if ((allowedHash == newHash))
11891189 then (currentHash != newHash)
11901190 else false)
11911191 then true
11921192 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
11931193 case _ =>
11941194 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
11951195 }
11961196 }
11971197

github/deemru/w8io/169f3d6 
154.80 ms