tx · GRcFi8nMnpSuK2qCwNkiQC8pSkvtEdqofCaugFZbQnRN

3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT:  -0.04000000 Waves

2023.09.25 13:59 [2770843] smart account 3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT > SELF 0.00000000 Waves

{ "type": 13, "id": "GRcFi8nMnpSuK2qCwNkiQC8pSkvtEdqofCaugFZbQnRN", "fee": 4000000, "feeAssetId": null, "timestamp": 1695639579529, "version": 2, "chainId": 84, "sender": "3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT", "senderPublicKey": "D1BL65meykxFZTCuq7jq9HSGLLnWvQamQPUNrguW5w39", "proofs": [ "3oWxnR8posaQvnPeCCY1goxYQ9WW7eqdkvxeTmyyUnHcNPWruDgQFDeB4BaK5m9CpMuHQtboKxuVUYYXCti1xaby" ], "script": "base64:BgKSLAgCEgUKAwEEARIHCgUBBAEIARIDCgEIEgQKAgEEEgQKAgEEEgMKAQESABIECgIIARIAEgQKAggBEgQKAggBEgQKAgEBEgMKAQESBQoDAQEBEgUKAwEIARIECgIBCBIECgIBCBIECgIICBIAEgMKAQgSBQoDAQEBEgQKAggBEgQKAgEBEgQKAggIEgsKCQgBAQIBAggEBBIGCgQICAEIEgAiBnNjYWxlOCIMc2NhbGU4QmlnSW50IgdzY2FsZTE4Igp6ZXJvQmlnSW50IgRiaWcwIgRiaWcxIgRiaWcyIgRiaWczIgRiaWc0IgpzbGlwcGFnZTREIgt3YXZlc1N0cmluZyIFQW11bHQiBURjb252IgNTRVAiBUVNUFRZIgpQb29sQWN0aXZlIgpQb29sUHV0RGlzIg5Qb29sTWF0Y2hlckRpcyIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyIJaWR4UG9vbFN0IglpZHhMUEFzSWQiCWlkeEFtQXNJZCIJaWR4UHJBc0lkIgtpZHhBbXRBc0RjbSINaWR4UHJpY2VBc0RjbSILaWR4SUFtdEFzSWQiDWlkeElQcmljZUFzSWQiD2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mFNAgRVbml0CAUCaWkPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IEAmFNBQJpaQMJAAECBQJhTQIFT3JkZXIEAmZiBQJhTQQCaWwJAQJiZQAEAmltAwkBAmd4AAkAlAoCBgIACQECZmEBBQJmYgQCYUcIBQJpbQJfMQQCYUgIBQJpbQJfMgQCYUkJAPQDAwgFAmZiCWJvZHlCeXRlcwkAkQMCCAUCZmIGcHJvb2ZzAAAIBQJmYg9zZW5kZXJQdWJsaWNLZXkEAmFKCQD0AwMIBQJmYglib2R5Qnl0ZXMJAJEDAggFAmZiBnByb29mcwABBQJpbAMDAwUCYUcFAmFJBwUCYUoHBgkBAmFGBAUCYUcFAmFIBQJhSQUCYUoDCQABAgUCYU0CFFNldFNjcmlwdFRyYW5zYWN0aW9uBAJhUgUCYU0DCQD0AwMIBQJpaQlib2R5Qnl0ZXMJAJEDAggFAmlpBnByb29mcwAABQJpawYEAmluCQD2AwEJAQV2YWx1ZQEIBQJhUgZzY3JpcHQEAmlvCQDbBAEJAQV2YWx1ZQEJAJ0IAgUCYVEJAQJhQgAEAmlwCQDxBwEFBHRoaXMDCQAAAgUCaW8FAmluCQECIT0CBQJpcAUCaW4HCQD0AwMIBQJpaQlib2R5Qnl0ZXMJAJEDAggFAmlpBnByb29mcwAABQJpa0XxHmY=", "height": 2770843, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9SE62DHbFfFbbZQXXRaUEGKirf2imixTrqmk9hDGYSKv Next: JFbdagHpBNy3qRjSWLENLoGQgGKW4W16TfJTNB2LHPQ Diff:
OldNewDifferences
2222 let slippage4D = toBigInt((scale8 - ((scale8 * 1) / scale8)))
2323
2424 let wavesString = "WAVES"
25-
26-let ampInitial = 50
2725
2826 let Amult = "100"
2927
127125 func pa () = "%s__priceAsset"
128126
129127
130-func amp () = "%s__amp"
131-
132-
133-func keyAmpHistory (heightBlocks) = ("%s%d__amp__" + toString(heightBlocks))
134-
135-
136-func keyChangeAmpLastCall () = "%s__changeAmpLastCall"
128+func amp () = makeString(["%s%s", "amp", toString(this)], SEP)
137129
138130
139131 let keyFee = "%s__fee"
229221 else throw(($getType(@) + " couldn't be cast to Int"))
230222 }
231223
232-let A = strf(this, amp())
224+let A = strf(fca, amp())
233225
234226 func igs () = valueOrElse(getBoolean(fca, aps()), false)
235227
263255
264256 let poolConfigParsed = parsePoolConfig(gpc())
265257
266-let $t086088794 = poolConfigParsed
258+let $t084928678 = poolConfigParsed
267259
268-let cfgPoolAddress = $t086088794._1
260+let cfgPoolAddress = $t084928678._1
269261
270-let cfgPoolStatus = $t086088794._2
262+let cfgPoolStatus = $t084928678._2
271263
272-let cfgLpAssetId = $t086088794._3
264+let cfgLpAssetId = $t084928678._3
273265
274-let cfgAmountAssetId = $t086088794._4
266+let cfgAmountAssetId = $t084928678._4
275267
276-let cfgPriceAssetId = $t086088794._5
268+let cfgPriceAssetId = $t084928678._5
277269
278-let cfgAmountAssetDecimals = $t086088794._6
270+let cfgAmountAssetDecimals = $t084928678._6
279271
280-let cfgPriceAssetDecimals = $t086088794._7
272+let cfgPriceAssetDecimals = $t084928678._7
281273
282274 func gfc () = split(strf(fca, fcfg()), SEP)
283275
398390 }
399391
400392 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
401- let $t01329913347 = {
393+ let $t01318313231 = {
402394 let $l = arr
403395 let $s = size($l)
404396 let $acc0 = $Tuple2(s, false)
412404
413405 $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($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17)
414406 }
415- let d = $t01329913347._1
416- let found = $t01329913347._2
407+ let d = $t01318313231._1
408+ let found = $t01318313231._2
417409 if (found)
418410 then d
419411 else throw(("D calculation error, D = " + toString(d)))
547539 else calcLpAmt
548540 let amDiff = (inAmAmt - calcAmAssetPmt)
549541 let prDiff = (inPrAmt - calcPrAssetPmt)
550- let $t02110921454 = if (if (isOneAsset)
542+ let $t02099321338 = if (if (isOneAsset)
551543 then (pmtId == amIdStr)
552544 else false)
553545 then $Tuple2(pmtAmt, 0)
556548 else false)
557549 then $Tuple2(0, pmtAmt)
558550 else $Tuple2(calcAmAssetPmt, calcPrAssetPmt)
559- let writeAmAmt = $t02110921454._1
560- let writePrAmt = $t02110921454._2
551+ let writeAmAmt = $t02099321338._1
552+ let writePrAmt = $t02099321338._2
561553 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))]
562554 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId)
563555 }
576568 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
577569 let b = ((s + ((D * aPrecision) / ann)) - D)
578570 func calc (acc,cur) = {
579- let $t02264922669 = acc
580- let y = $t02264922669._1
581- let found = $t02264922669._2
571+ let $t02253322553 = acc
572+ let y = $t02253322553._1
573+ let found = $t02253322553._2
582574 if ((found != unit))
583575 then acc
584576 else {
591583 }
592584
593585 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
594- let $t02297623023 = {
586+ let $t02286022907 = {
595587 let $l = arr
596588 let $s = size($l)
597589 let $acc0 = $Tuple2(D, unit)
605597
606598 $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)
607599 }
608- let y = $t02297623023._1
609- let found = $t02297623023._2
600+ let y = $t02286022907._1
601+ let found = $t02286022907._2
610602 if ((found != unit))
611603 then y
612604 else throw(("Y calculation error, Y = " + toString(y)))
650642 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
651643 let amountAssetAmount = order.amount
652644 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
653- let $t02522125433 = if ((order.orderType == Buy))
645+ let $t02510525317 = if ((order.orderType == Buy))
654646 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
655647 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
656- let amountAssetBalanceDelta = $t02522125433._1
657- let priceAssetBalanceDelta = $t02522125433._2
648+ let amountAssetBalanceDelta = $t02510525317._1
649+ let priceAssetBalanceDelta = $t02510525317._2
658650 if (if (if (igs())
659651 then true
660652 else (cfgPoolStatus == PoolMatcherDis))
667659 then throw("Wr assets")
668660 else {
669661 let dLp = parseBigIntValue(valueOrElse(getString(this, keyDLp), "0"))
670- let $t02577525875 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
671- let unusedActions = $t02577525875._1
672- let dLpNew = $t02577525875._2
662+ let $t02565925759 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
663+ let unusedActions = $t02565925759._1
664+ let dLpNew = $t02565925759._2
673665 let isOrderValid = (dLpNew >= dLp)
674666 let info = makeString(["dLp=", toString(dLp), " dLpNew=", toString(dLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "")
675667 $Tuple2(isOrderValid, info)
723715 then {
724716 let amBalance = getAccBalance(amId)
725717 let prBalance = getAccBalance(prId)
726- let $t02853128993 = if ((txId == ""))
718+ let $t02841528877 = if ((txId == ""))
727719 then $Tuple2(amBalance, prBalance)
728720 else if ((pmtAssetId == amId))
729721 then if ((pmtAmtRaw > amBalance))
734726 then throw("invalid payment amount")
735727 else $Tuple2(amBalance, (prBalance - pmtAmtRaw))
736728 else throw("wrong pmtAssetId")
737- let amBalanceOld = $t02853128993._1
738- let prBalanceOld = $t02853128993._2
739- let $t02899929175 = if ((pmtAssetId == amId))
729+ let amBalanceOld = $t02841528877._1
730+ let prBalanceOld = $t02841528877._2
731+ let $t02888329059 = if ((pmtAssetId == amId))
740732 then $Tuple2(pmtAmtRaw, 0)
741733 else if ((pmtAssetId == prId))
742734 then $Tuple2(0, pmtAmtRaw)
743735 else throw("invalid payment")
744- let amAmountRaw = $t02899929175._1
745- let prAmountRaw = $t02899929175._2
746- let $t02917929433 = if (withTakeFee)
736+ let amAmountRaw = $t02888329059._1
737+ let prAmountRaw = $t02888329059._2
738+ let $t02906329317 = if (withTakeFee)
747739 then $Tuple3(takeFee(amAmountRaw, inFee)._1, takeFee(prAmountRaw, inFee)._1, takeFee(pmtAmtRaw, inFee)._2)
748740 else $Tuple3(amAmountRaw, prAmountRaw, 0)
749- let amAmount = $t02917929433._1
750- let prAmount = $t02917929433._2
751- let feeAmount = $t02917929433._3
741+ let amAmount = $t02906329317._1
742+ let prAmount = $t02906329317._2
743+ let feeAmount = $t02906329317._3
752744 let amBalanceNew = (amBalanceOld + amAmount)
753745 let prBalanceNew = (prBalanceOld + prAmount)
754746 let D0 = getD([t1(amBalanceOld, cfgAmountAssetDecimals), t1(prBalanceOld, cfgPriceAssetDecimals)])
796788 else {
797789 let amBalance = getAccBalance(amId)
798790 let prBalance = getAccBalance(prId)
799- let $t03154531656 = {
791+ let $t03142931540 = {
800792 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil)
801793 if ($isInstanceOf(@, "(Int, Int)"))
802794 then @
803795 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
804796 }
805- if (($t03154531656 == $t03154531656))
797+ if (($t03142931540 == $t03142931540))
806798 then {
807- let feeAmount = $t03154531656._2
808- let totalGet = $t03154531656._1
799+ let feeAmount = $t03142931540._2
800+ let totalGet = $t03142931540._1
809801 let totalAmount = if (if ((minOutAmount > 0))
810802 then (minOutAmount > totalGet)
811803 else false)
812804 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
813805 else totalGet
814- let $t03184632153 = if ((outAssetId == amId))
806+ let $t03173032037 = if ((outAssetId == amId))
815807 then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance)
816808 else if ((outAssetId == prId))
817809 then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount))
818810 else throw("invalid out asset id")
819- let outAm = $t03184632153._1
820- let outPr = $t03184632153._2
821- let amBalanceNew = $t03184632153._3
822- let prBalanceNew = $t03184632153._4
811+ let outAm = $t03173032037._1
812+ let outPr = $t03173032037._2
813+ let amBalanceNew = $t03173032037._3
814+ let prBalanceNew = $t03173032037._4
823815 let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals))
824816 let curPr = f1(curPrX18, scale8)
825817 let outAssetIdOrWaves = if ((outAssetId == "WAVES"))
834826 let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
835827 if ((burn == burn))
836828 then {
837- let $t03293833288 = {
829+ let $t03282233172 = {
838830 let feeAmountForCalc = if ((this == feeCollectorAddress))
839831 then 0
840832 else feeAmount
845837 then $Tuple2(-((totalGet + feeAmountForCalc)), 0)
846838 else $Tuple2(0, -((totalGet + feeAmountForCalc)))
847839 }
848- let amountAssetBalanceDelta = $t03293833288._1
849- let priceAssetBalanceDelta = $t03293833288._2
850- let $t03329133399 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
851- let refreshDLpActions = $t03329133399._1
852- let updatedDLp = $t03329133399._2
840+ let amountAssetBalanceDelta = $t03282233172._1
841+ let priceAssetBalanceDelta = $t03282233172._2
842+ let $t03317533283 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
843+ let refreshDLpActions = $t03317533283._1
844+ let updatedDLp = $t03317533283._2
853845 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
854846 if ((isUpdatedDLpValid == isUpdatedDLpValid))
855847 then $Tuple2((state ++ refreshDLpActions), totalAmount)
921913 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
922914 let b = ((s + ((D * aPrecision) / ann)) - D)
923915 func calc (acc,cur) = {
924- let $t03488634906 = acc
925- let y = $t03488634906._1
926- let found = $t03488634906._2
916+ let $t03477034790 = acc
917+ let y = $t03477034790._1
918+ let found = $t03477034790._2
927919 if ((found != unit))
928920 then acc
929921 else {
936928 }
937929
938930 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
939- let $t03523735284 = {
931+ let $t03512135168 = {
940932 let $l = arr
941933 let $s = size($l)
942934 let $acc0 = $Tuple2(D, unit)
950942
951943 $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)
952944 }
953- let y = $t03523735284._1
954- let found = $t03523735284._2
945+ let y = $t03512135168._1
946+ let found = $t03512135168._2
955947 if ((found != unit))
956948 then y
957949 else throw(("Y calculation error, Y = " + toString(y)))
963955
964956 @Callable(i)
965957 func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = {
966- let $t03563636060 = if ((isReverse == false))
958+ let $t03552035944 = if ((isReverse == false))
967959 then {
968960 let assetOut = strf(this, pa())
969961 let poolAmountInBalance = (toBigInt(getAccBalance(strf(this, aa()))) + toBigInt(cleanAmountIn))
974966 let poolAmountInBalance = (toBigInt(getAccBalance(strf(this, pa()))) + toBigInt(cleanAmountIn))
975967 $Tuple2(assetOut, poolAmountInBalance)
976968 }
977- let assetOut = $t03563636060._1
978- let poolAmountInBalance = $t03563636060._2
969+ let assetOut = $t03552035944._1
970+ let poolAmountInBalance = $t03552035944._2
979971 let poolConfig = gpc()
980972 let amId = poolConfig[idxAmAsId]
981973 let prId = poolConfig[idxPrAsId]
10301022 then {
10311023 let pmt = value(i.payments[0])
10321024 let assetIn = assetIdToString(pmt.assetId)
1033- let $t03779538189 = if ((isReverse == false))
1025+ let $t03767938073 = if ((isReverse == false))
10341026 then {
10351027 let assetOut = strf(this, pa())
10361028 let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
10411033 let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
10421034 $Tuple2(assetOut, poolAmountInBalance)
10431035 }
1044- let assetOut = $t03779538189._1
1045- let poolAmountInBalance = $t03779538189._2
1036+ let assetOut = $t03767938073._1
1037+ let poolAmountInBalance = $t03767938073._2
10461038 let poolConfig = gpc()
10471039 let amId = poolConfig[idxAmAsId]
10481040 let prId = poolConfig[idxPrAsId]
11581150 else throw("Strict value is not equal to itself.")
11591151 }
11601152 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
1161- let $t04264442786 = refreshDLpInternal(0, 0, 0)
1162- let refreshDLpActions = $t04264442786._1
1163- let updatedDLp = $t04264442786._2
1153+ let $t04252842670 = refreshDLpInternal(0, 0, 0)
1154+ let refreshDLpActions = $t04252842670._1
1155+ let updatedDLp = $t04252842670._2
11641156 let check = if ((updatedDLp >= currentDLp))
11651157 then true
11661158 else throwErr(makeString(["updated DLp lower than current DLp", toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentDLp), toString(updatedDLp), toString(amDiff), toString(prDiff)], " "))
12331225 else calcCurrentDLp(toBigInt(0), toBigInt(pmtAmt), toBigInt(0))
12341226 if ((currentDLp == currentDLp))
12351227 then {
1236- let $t04442744585 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1237- if (($t04442744585 == $t04442744585))
1228+ let $t04431144469 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1229+ if (($t04431144469 == $t04431144469))
12381230 then {
1239- let feeAmount = $t04442744585._3
1240- let state = $t04442744585._2
1241- let estimLP = $t04442744585._1
1231+ let feeAmount = $t04431144469._3
1232+ let state = $t04431144469._2
1233+ let estimLP = $t04431144469._1
12421234 let emitLpAmt = if (if ((minOutAmount > 0))
12431235 then (minOutAmount > estimLP)
12441236 else false)
12661258 let sendFeeToMatcher = if ((feeAmount > 0))
12671259 then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))]
12681260 else nil
1269- let $t04547045819 = if ((this == feeCollectorAddress))
1261+ let $t04535445703 = if ((this == feeCollectorAddress))
12701262 then $Tuple2(0, 0)
12711263 else {
12721264 let paymentInAmountAsset = if ((pmt.assetId == cfgAmountAssetId))
12761268 then $Tuple2(-(feeAmount), 0)
12771269 else $Tuple2(0, -(feeAmount))
12781270 }
1279- let amountAssetBalanceDelta = $t04547045819._1
1280- let priceAssetBalanceDelta = $t04547045819._2
1281- let $t04582245930 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1282- let refreshDLpActions = $t04582245930._1
1283- let updatedDLp = $t04582245930._2
1271+ let amountAssetBalanceDelta = $t04535445703._1
1272+ let priceAssetBalanceDelta = $t04535445703._2
1273+ let $t04570645814 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1274+ let refreshDLpActions = $t04570645814._1
1275+ let updatedDLp = $t04570645814._2
12841276 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
12851277 if ((isUpdatedDLpValid == isUpdatedDLpValid))
12861278 then $Tuple2((((state ++ lpTrnsfr) ++ sendFeeToMatcher) ++ refreshDLpActions), emitLpAmt)
13121304 let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0))
13131305 if ((currentDLp == currentDLp))
13141306 then {
1315- let $t04696047025 = refreshDLpInternal(0, 0, 0)
1316- let refreshDLpActions = $t04696047025._1
1317- let updatedDLp = $t04696047025._2
1307+ let $t04684446909 = refreshDLpInternal(0, 0, 0)
1308+ let refreshDLpActions = $t04684446909._1
1309+ let updatedDLp = $t04684446909._2
13181310 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
13191311 if ((isUpdatedDLpValid == isUpdatedDLpValid))
13201312 then (state ++ refreshDLpActions)
13391331 let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
13401332 if ((b == b))
13411333 then {
1342- let $t04819848280 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1343- let refreshDLpActions = $t04819848280._1
1344- let updatedDLp = $t04819848280._2
1334+ let $t04808248164 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1335+ let refreshDLpActions = $t04808248164._1
1336+ let updatedDLp = $t04808248164._2
13451337 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
13461338 if ((isUpdatedDLpValid == isUpdatedDLpValid))
13471339 then (state ++ refreshDLpActions)
13761368 else throwErr("exactly 1 payment are expected")]
13771369 if ((checks == checks))
13781370 then {
1379- let $t04889849053 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1380- let state = $t04889849053._1
1381- let totalAmount = $t04889849053._2
1371+ let $t04878248937 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1372+ let state = $t04878248937._1
1373+ let totalAmount = $t04878248937._2
13821374 $Tuple2(state, totalAmount)
13831375 }
13841376 else throw("Strict value is not equal to itself.")
13951387 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
13961388 then {
13971389 let dLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyDLp), "0")), fmtErr("invalid dLp"))
1398- let $t04957749641 = refreshDLpInternal(0, 0, 0)
1399- let dLpUpdateActions = $t04957749641._1
1400- let updatedDLp = $t04957749641._2
1390+ let $t04946149525 = refreshDLpInternal(0, 0, 0)
1391+ let dLpUpdateActions = $t04946149525._1
1392+ let updatedDLp = $t04946149525._2
14011393 let actions = if ((dLp != updatedDLp))
14021394 then dLpUpdateActions
14031395 else throwErr("nothing to refresh")
14251417 let newY = getYD(xp, index, D1)
14261418 let dy = (xp[index] - newY)
14271419 let totalGetRaw = max([0, toInt((dy - big1))])
1428- let $t05065150706 = takeFee(totalGetRaw, outFee)
1429- let totalGet = $t05065150706._1
1430- let feeAmount = $t05065150706._2
1420+ let $t05053550590 = takeFee(totalGetRaw, outFee)
1421+ let totalGet = $t05053550590._1
1422+ let feeAmount = $t05053550590._2
14311423 $Tuple2(nil, $Tuple2(totalGet, feeAmount))
14321424 }
14331425
14401432 let lpId = toBase58String(value(cfgLpAssetId))
14411433 let amBalance = getAccBalance(amId)
14421434 let prBalance = getAccBalance(prId)
1443- let $t05108151196 = {
1435+ let $t05096551080 = {
14441436 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil)
14451437 if ($isInstanceOf(@, "(Int, Int)"))
14461438 then @
14471439 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
14481440 }
1449- let totalGet = $t05108151196._1
1450- let feeAmount = $t05108151196._2
1441+ let totalGet = $t05096551080._1
1442+ let feeAmount = $t05096551080._2
14511443 let r = ego("", lpId, lpAssetAmount, this)
14521444 let outAmAmt = r._1
14531445 let outPrAmt = r._2
14811473 let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14821474 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14831475 then {
1484- let $t05236252443 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1485- let refreshDLpActions = $t05236252443._1
1486- let updatedDLp = $t05236252443._2
1476+ let $t05224652327 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1477+ let refreshDLpActions = $t05224652327._1
1478+ let updatedDLp = $t05224652327._2
14871479 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
14881480 if ((isUpdatedDLpValid == isUpdatedDLpValid))
14891481 then (state ++ refreshDLpActions)
15281520 let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
15291521 if ((burnA == burnA))
15301522 then {
1531- let $t05347053551 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1532- let refreshDLpActions = $t05347053551._1
1533- let updatedDLp = $t05347053551._2
1523+ let $t05335453435 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1524+ let refreshDLpActions = $t05335453435._1
1525+ let updatedDLp = $t05335453435._2
15341526 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
15351527 if ((isUpdatedDLpValid == isUpdatedDLpValid))
15361528 then (state ++ refreshDLpActions)
15811573 let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
15821574 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15831575 then {
1584- let $t05480254883 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1585- let refreshDLpActions = $t05480254883._1
1586- let updatedDLp = $t05480254883._2
1576+ let $t05468654767 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1577+ let refreshDLpActions = $t05468654767._1
1578+ let updatedDLp = $t05468654767._2
15871579 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
15881580 if ((isUpdatedDLpValid == isUpdatedDLpValid))
15891581 then (state ++ refreshDLpActions)
16321624 let unstakeInv = invoke(staking, "unstakeINTERNAL", [lpAssetId, unstakeAmount, userAddress.bytes, lpAssetRecipientAddress.bytes], nil)
16331625 if ((unstakeInv == unstakeInv))
16341626 then {
1635- let $t05590556093 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1636- let state = $t05590556093._1
1637- let totalAmount = $t05590556093._2
1627+ let $t05578955977 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1628+ let state = $t05578955977._1
1629+ let totalAmount = $t05578955977._2
16381630 $Tuple2(state, totalAmount)
16391631 }
16401632 else throw("Strict value is not equal to itself.")
16461638
16471639 @Callable(i)
16481640 func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = {
1649- let $t05622156324 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1650- let lpAmount = $t05622156324._1
1651- let state = $t05622156324._2
1652- let feeAmount = $t05622156324._3
1653- let bonus = $t05622156324._4
1641+ let $t05610556208 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1642+ let lpAmount = $t05610556208._1
1643+ let state = $t05610556208._2
1644+ let feeAmount = $t05610556208._3
1645+ let bonus = $t05610556208._4
16541646 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
16551647 }
16561648
16581650
16591651 @Callable(i)
16601652 func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = {
1661- let $t05647256576 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1662- let lpAmount = $t05647256576._1
1663- let state = $t05647256576._2
1664- let feeAmount = $t05647256576._3
1665- let bonus = $t05647256576._4
1653+ let $t05635656460 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1654+ let lpAmount = $t05635656460._1
1655+ let state = $t05635656460._2
1656+ let feeAmount = $t05635656460._3
1657+ let bonus = $t05635656460._4
16661658 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
16671659 }
16681660
16711663 @Callable(i)
16721664 func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString(fca)))
16731665 then throw("denied")
1674- else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr), StringEntry(amp(), toString(ampInitial)), StringEntry(keyAmpHistory(height), toString(ampInitial))], "success")
1675-
1676-
1677-
1678-@Callable(i)
1679-func invert () = {
1680- let checks = [if ((i.caller == fca))
1681- then true
1682- else throwErr("invalid caller")]
1683- if ((checks == checks))
1684- then $Tuple2([StringEntry(aa(), assetIdToString(cfgPriceAssetId)), StringEntry(pa(), assetIdToString(cfgAmountAssetId))], unit)
1685- else throw("Strict value is not equal to itself.")
1686- }
1666+ else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr)], "success")
16871667
16881668
16891669
17351715
17361716 @Callable(i)
17371717 func changeAmp () = {
1738- let cfg = invoke(fca, "getChangeAmpConfigREADONLY", [toString(this)], nil)
1739- let $t05929759496 = match cfg {
1740- case list: List[Any] =>
1741- $Tuple3({
1742- let @ = list[0]
1743- if ($isInstanceOf(@, "Int"))
1744- then @
1745- else throw(($getType(@) + " couldn't be cast to Int"))
1746- }, {
1747- let @ = list[1]
1748- if ($isInstanceOf(@, "Int"))
1749- then @
1750- else throw(($getType(@) + " couldn't be cast to Int"))
1751- }, {
1752- let @ = list[2]
1753- if ($isInstanceOf(@, "Int"))
1754- then @
1755- else throw(($getType(@) + " couldn't be cast to Int"))
1756- })
1757- case _ =>
1758- throwErr("invalid entry type")
1759- }
1760- let delay = $t05929759496._1
1761- let delta = $t05929759496._2
1762- let target = $t05929759496._3
1763- let curAmp = parseIntValue(getStringValue(amp()))
1764- let newAmpRaw = (curAmp + delta)
1765- let newAmp = if ((0 > delta))
1766- then if ((target > newAmpRaw))
1767- then target
1768- else newAmpRaw
1769- else if ((newAmpRaw > target))
1770- then target
1771- else newAmpRaw
1772- let lastCall = valueOrElse(getInteger(keyChangeAmpLastCall()), 0)
1773- let wait = (lastCall + delay)
1774- let checks = [if ((height > wait))
1775- then true
1776- else throwErr("try again in few blocks"), if ((curAmp != newAmp))
1777- then true
1778- else throwErr("already reached target")]
1779- if ((checks == checks))
1780- then [IntegerEntry(keyChangeAmpLastCall(), height), StringEntry(amp(), toString(newAmp)), StringEntry(keyAmpHistory(height), toString(newAmp))]
1718+ let fcaInv = invoke(fca, "changeAmp", [toString(this)], nil)
1719+ if ((fcaInv == fcaInv))
1720+ then nil
17811721 else throw("Strict value is not equal to itself.")
17821722 }
17831723
17951735 match tx {
17961736 case order: Order =>
17971737 let matcherPub = mp()
1798- let $t06042960546 = if (skipOrderValidation())
1738+ let $t05904859165 = if (skipOrderValidation())
17991739 then $Tuple2(true, "")
18001740 else validateMatcherOrderAllowed(order)
1801- let orderValid = $t06042960546._1
1802- let orderValidInfo = $t06042960546._2
1741+ let orderValid = $t05904859165._1
1742+ let orderValidInfo = $t05904859165._2
18031743 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
18041744 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
18051745 if (if (if (orderValid)
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 big0 = toBigInt(0)
1313
1414 let big1 = toBigInt(1)
1515
1616 let big2 = toBigInt(2)
1717
1818 let big3 = toBigInt(3)
1919
2020 let big4 = toBigInt(4)
2121
2222 let slippage4D = toBigInt((scale8 - ((scale8 * 1) / scale8)))
2323
2424 let wavesString = "WAVES"
25-
26-let ampInitial = 50
2725
2826 let Amult = "100"
2927
3028 let Dconv = "1"
3129
3230 let SEP = "__"
3331
3432 let EMPTY = ""
3533
3634 let PoolActive = 1
3735
3836 let PoolPutDis = 2
3937
4038 let PoolMatcherDis = 3
4139
4240 let PoolShutdown = 4
4341
4442 let idxPoolAddress = 1
4543
4644 let idxPoolSt = 2
4745
4846 let idxLPAsId = 3
4947
5048 let idxAmAsId = 4
5149
5250 let idxPrAsId = 5
5351
5452 let idxAmtAsDcm = 6
5553
5654 let idxPriceAsDcm = 7
5755
5856 let idxIAmtAsId = 8
5957
6058 let idxIPriceAsId = 9
6159
6260 let idxFactStakCntr = 1
6361
6462 let idxFactoryRestCntr = 6
6563
6664 let idxFactSlippCntr = 7
6765
6866 let idxFactGwxRewCntr = 10
6967
7068 let feeDefault = fraction(10, scale8, 10000)
7169
7270 func t1 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
7371
7472
7573 func t1BigInt (origVal,origScaleMult) = fraction(origVal, scale18, origScaleMult)
7674
7775
7876 func f1 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
7977
8078
8179 func fromX18Round (val,resultScaleMult,round) = toInt(fraction(val, toBigInt(resultScaleMult), scale18, round))
8280
8381
8482 func t2 (origVal,origScaleMult) = fraction(origVal, scale18, toBigInt(origScaleMult))
8583
8684
8785 func f2 (val,resultScaleMult) = fraction(val, toBigInt(resultScaleMult), scale18)
8886
8987
9088 func ts (amt,resScale,curScale) = fraction(amt, resScale, curScale)
9189
9290
9391 func abs (val) = if ((zeroBigInt > val))
9492 then -(val)
9593 else val
9694
9795
9896 func absBigInt (val) = if ((zeroBigInt > val))
9997 then -(val)
10098 else val
10199
102100
103101 func fc () = "%s__factoryContract"
104102
105103
106104 func keyManagerPublicKey () = "%s__managerPublicKey"
107105
108106
109107 func keyManagerVaultAddress () = "%s__managerVaultAddress"
110108
111109
112110 func pl () = "%s%s__price__last"
113111
114112
115113 func ph (h,t) = makeString(["%s%s%d%d__price__history", toString(h), toString(t)], SEP)
116114
117115
118116 func pau (ua,txId) = ((("%s%s%s__P__" + ua) + "__") + txId)
119117
120118
121119 func gau (ua,txId) = ((("%s%s%s__G__" + ua) + "__") + txId)
122120
123121
124122 func aa () = "%s__amountAsset"
125123
126124
127125 func pa () = "%s__priceAsset"
128126
129127
130-func amp () = "%s__amp"
131-
132-
133-func keyAmpHistory (heightBlocks) = ("%s%d__amp__" + toString(heightBlocks))
134-
135-
136-func keyChangeAmpLastCall () = "%s__changeAmpLastCall"
128+func amp () = makeString(["%s%s", "amp", toString(this)], SEP)
137129
138130
139131 let keyFee = "%s__fee"
140132
141133 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
142134
143135 let keyDLp = makeString(["%s", "dLp"], SEP)
144136
145137 let keyDLpRefreshedHeight = makeString(["%s", "dLpRefreshedHeight"], SEP)
146138
147139 let keyDLpRefreshDelay = makeString(["%s", "refreshDLpDelay"], SEP)
148140
149141 let dLpRefreshDelayDefault = 30
150142
151143 let dLpRefreshDelay = valueOrElse(getInteger(this, keyDLpRefreshDelay), dLpRefreshDelayDefault)
152144
153145 func fcfg () = "%s__factoryConfig"
154146
155147
156148 func mtpk () = "%s%s__matcher__publicKey"
157149
158150
159151 func pc (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config")
160152
161153
162154 func mba (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr)
163155
164156
165157 func aps () = "%s__shutdown"
166158
167159
168160 func keyAllowedLpStableScriptHash () = "%s__allowedLpStableScriptHash"
169161
170162
171163 func keyFeeCollectorAddress () = "%s__feeCollectorAddress"
172164
173165
174166 func keySkipOrderValidation (poolAddress) = ("%s%s__skipOrderValidation__" + poolAddress)
175167
176168
177169 func throwOrderError (orderValid,orderValidInfo,senderValid,matcherValid) = throw((((((((("order validation failed: orderValid=" + toString(orderValid)) + " (") + orderValidInfo) + ")") + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
178170
179171
180172 func addressFromStringOrThis (addressString) = match addressFromString(addressString) {
181173 case a: Address =>
182174 a
183175 case _ =>
184176 this
185177 }
186178
187179
188180 func getManagerVaultAddressOrThis () = {
189181 let factoryAddress = match getString(fc()) {
190182 case fca: String =>
191183 addressFromStringOrThis(fca)
192184 case _ =>
193185 this
194186 }
195187 match getString(factoryAddress, keyManagerVaultAddress()) {
196188 case s: String =>
197189 addressFromStringOrThis(s)
198190 case _ =>
199191 this
200192 }
201193 }
202194
203195
204196 func strf (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
205197
206198
207199 func intf (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
208200
209201
210202 func throwErr (msg) = throw(makeString(["lp_stable.ride:", msg], " "))
211203
212204
213205 func fmtErr (msg) = makeString(["lp_stable.ride:", msg], " ")
214206
215207
216208 let fca = addressFromStringValue(strf(this, fc()))
217209
218210 let inFee = {
219211 let @ = invoke(fca, "getInFeeREADONLY", [toString(this)], nil)
220212 if ($isInstanceOf(@, "Int"))
221213 then @
222214 else throw(($getType(@) + " couldn't be cast to Int"))
223215 }
224216
225217 let outFee = {
226218 let @ = invoke(fca, "getOutFeeREADONLY", [toString(this)], nil)
227219 if ($isInstanceOf(@, "Int"))
228220 then @
229221 else throw(($getType(@) + " couldn't be cast to Int"))
230222 }
231223
232-let A = strf(this, amp())
224+let A = strf(fca, amp())
233225
234226 func igs () = valueOrElse(getBoolean(fca, aps()), false)
235227
236228
237229 func mp () = fromBase58String(strf(fca, mtpk()))
238230
239231
240232 let feeCollectorAddress = addressFromStringValue(strf(fca, keyFeeCollectorAddress()))
241233
242234 func gpc () = {
243235 let amtAs = strf(this, aa())
244236 let priceAs = strf(this, pa())
245237 let iPriceAs = intf(fca, mba(priceAs))
246238 let iAmtAs = intf(fca, mba(amtAs))
247239 split(strf(fca, pc(toString(iAmtAs), toString(iPriceAs))), SEP)
248240 }
249241
250242
251243 func parseAssetId (input) = if ((input == wavesString))
252244 then unit
253245 else fromBase58String(input)
254246
255247
256248 func assetIdToString (input) = if ((input == unit))
257249 then wavesString
258250 else toBase58String(value(input))
259251
260252
261253 func parsePoolConfig (poolConfig) = $Tuple7(addressFromStringValue(poolConfig[idxPoolAddress]), parseIntValue(poolConfig[idxPoolSt]), fromBase58String(poolConfig[idxLPAsId]), parseAssetId(poolConfig[idxAmAsId]), parseAssetId(poolConfig[idxPrAsId]), parseIntValue(poolConfig[idxAmtAsDcm]), parseIntValue(poolConfig[idxPriceAsDcm]))
262254
263255
264256 let poolConfigParsed = parsePoolConfig(gpc())
265257
266-let $t086088794 = poolConfigParsed
258+let $t084928678 = poolConfigParsed
267259
268-let cfgPoolAddress = $t086088794._1
260+let cfgPoolAddress = $t084928678._1
269261
270-let cfgPoolStatus = $t086088794._2
262+let cfgPoolStatus = $t084928678._2
271263
272-let cfgLpAssetId = $t086088794._3
264+let cfgLpAssetId = $t084928678._3
273265
274-let cfgAmountAssetId = $t086088794._4
266+let cfgAmountAssetId = $t084928678._4
275267
276-let cfgPriceAssetId = $t086088794._5
268+let cfgPriceAssetId = $t084928678._5
277269
278-let cfgAmountAssetDecimals = $t086088794._6
270+let cfgAmountAssetDecimals = $t084928678._6
279271
280-let cfgPriceAssetDecimals = $t086088794._7
272+let cfgPriceAssetDecimals = $t084928678._7
281273
282274 func gfc () = split(strf(fca, fcfg()), SEP)
283275
284276
285277 let factoryConfig = gfc()
286278
287279 let stakingContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactStakCntr]), "Invalid staking contract address")
288280
289281 let slipageContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactSlippCntr]), "Invalid slipage contract address")
290282
291283 let gwxContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactGwxRewCntr]), "Invalid gwx contract address")
292284
293285 let restContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactoryRestCntr]), "Invalid gwx contract address")
294286
295287 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)
296288
297289
298290 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)
299291
300292
301293 func getAccBalance (assetId) = if ((assetId == "WAVES"))
302294 then wavesBalance(this).available
303295 else assetBalance(this, fromBase58String(assetId))
304296
305297
306298 func cpbi (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
307299
308300
309301 func cpbir (prAmtX18,amAmtX18,round) = fraction(prAmtX18, scale18, amAmtX18, round)
310302
311303
312304 func vad (A1,A2,slippage) = {
313305 let diff = fraction((A1 - A2), scale8BigInt, A2)
314306 let pass = ((slippage - abs(diff)) > zeroBigInt)
315307 if (!(pass))
316308 then throw(("Big slpg: " + toString(diff)))
317309 else $Tuple2(pass, min([A1, A2]))
318310 }
319311
320312
321313 func vd (D1,D0,slpg) = {
322314 let diff = fraction(D0, scale8BigInt, D1)
323315 let fail = (slpg > diff)
324316 if (if (fail)
325317 then true
326318 else (D0 > D1))
327319 then throw(((((((toString(D0) + " ") + toString(D1)) + " ") + toString(diff)) + " ") + toString(slpg)))
328320 else fail
329321 }
330322
331323
332324 func pcp (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
333325 let amtAsAmtX18 = t1(amAmt, amAssetDcm)
334326 let prAsAmtX18 = t1(prAmt, prAssetDcm)
335327 cpbi(prAsAmtX18, amtAsAmtX18)
336328 }
337329
338330
339331 func calcPrices (amAmt,prAmt,lpAmt) = {
340332 let amtAsDcm = cfgAmountAssetDecimals
341333 let prAsDcm = cfgPriceAssetDecimals
342334 let priceX18 = pcp(amtAsDcm, prAsDcm, amAmt, prAmt)
343335 let amAmtX18 = t1(amAmt, amtAsDcm)
344336 let prAmtX18 = t1(prAmt, prAsDcm)
345337 let lpAmtX18 = t1(lpAmt, scale8)
346338 let lpPrInAmAsX18 = cpbi(amAmtX18, lpAmtX18)
347339 let lpPrInPrAsX18 = cpbi(prAmtX18, lpAmtX18)
348340 [priceX18, lpPrInAmAsX18, lpPrInPrAsX18]
349341 }
350342
351343
352344 func calculatePrices (amAmt,prAmt,lpAmt) = {
353345 let p = calcPrices(amAmt, prAmt, lpAmt)
354346 [f1(p[0], scale8), f1(p[1], scale8), f1(p[2], scale8)]
355347 }
356348
357349
358350 func takeFee (amount,fee) = {
359351 let feeAmount = if ((fee == 0))
360352 then 0
361353 else fraction(amount, fee, scale8)
362354 $Tuple2((amount - feeAmount), feeAmount)
363355 }
364356
365357
366358 func getD (xp) = {
367359 let xp0 = xp[0]
368360 let xp1 = xp[1]
369361 let s = (xp0 + xp1)
370362 if ((s == big0))
371363 then big0
372364 else {
373365 let a = parseIntValue(A)
374366 let ann = (a * 2)
375367 let p = fraction(xp0, xp1, big1)
376368 let xp0_xp1_n_n = fraction(p, big4, big1)
377369 let ann_s = fraction(toBigInt(ann), s, big1)
378370 let ann_1 = toBigInt((ann - 1))
379371 func calcDNext (d) = {
380372 let dd = fraction(d, d, big1)
381373 let ddd = fraction(dd, d, big1)
382374 let dp = fraction(ddd, big1, xp0_xp1_n_n)
383375 fraction((ann_s + fraction(dp, big2, big1)), d, (fraction(ann_1, d, big1) + fraction(big3, dp, big1)))
384376 }
385377
386378 func calc (acc,i) = if (acc._2)
387379 then acc
388380 else {
389381 let d = acc._1
390382 let dNext = calcDNext(d)
391383 let dDiffRaw = (dNext - value(d))
392384 let dDiff = if ((big0 > dDiffRaw))
393385 then -(dDiffRaw)
394386 else dDiffRaw
395387 if ((big1 >= dDiff))
396388 then $Tuple2(dNext, true)
397389 else $Tuple2(dNext, false)
398390 }
399391
400392 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
401- let $t01329913347 = {
393+ let $t01318313231 = {
402394 let $l = arr
403395 let $s = size($l)
404396 let $acc0 = $Tuple2(s, false)
405397 func $f0_1 ($a,$i) = if (($i >= $s))
406398 then $a
407399 else calc($a, $l[$i])
408400
409401 func $f0_2 ($a,$i) = if (($i >= $s))
410402 then $a
411403 else throw("List size exceeds 17")
412404
413405 $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($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17)
414406 }
415- let d = $t01329913347._1
416- let found = $t01329913347._2
407+ let d = $t01318313231._1
408+ let found = $t01318313231._2
417409 if (found)
418410 then d
419411 else throw(("D calculation error, D = " + toString(d)))
420412 }
421413 }
422414
423415
424416 func ego (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
425417 let lpId = cfgLpAssetId
426418 let amId = toBase58String(value(cfgAmountAssetId))
427419 let prId = toBase58String(value(cfgPriceAssetId))
428420 let amDcm = cfgAmountAssetDecimals
429421 let prDcm = cfgPriceAssetDecimals
430422 let sts = toString(cfgPoolStatus)
431423 let lpEmiss = valueOrErrorMessage(assetInfo(lpId), "Wrong LP id").quantity
432424 if ((toBase58String(lpId) != pmtAssetId))
433425 then throw("Wrong pmt asset")
434426 else {
435427 let amBalance = getAccBalance(amId)
436428 let amBalanceX18 = t1(amBalance, amDcm)
437429 let prBalance = getAccBalance(prId)
438430 let prBalanceX18 = t1(prBalance, prDcm)
439431 let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
440432 let curPrice = f1(curPriceX18, scale8)
441433 let pmtLpAmtX18 = t1(pmtLpAmt, scale8)
442434 let lpEmissX18 = t1(lpEmiss, scale8)
443435 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissX18)
444436 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissX18)
445437 let outAmAmt = fromX18Round(outAmAmtX18, amDcm, FLOOR)
446438 let outPrAmt = fromX18Round(outPrAmtX18, prDcm, FLOOR)
447439 let state = if ((txId58 == ""))
448440 then nil
449441 else [ScriptTransfer(userAddress, outAmAmt, if ((amId == "WAVES"))
450442 then unit
451443 else fromBase58String(amId)), ScriptTransfer(userAddress, outPrAmt, if ((prId == "WAVES"))
452444 then unit
453445 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)]
454446 $Tuple10(outAmAmt, outPrAmt, amId, prId, amBalance, prBalance, lpEmiss, curPriceX18, sts, state)
455447 }
456448 }
457449
458450
459451 func epo (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEval,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = {
460452 let lpId = cfgLpAssetId
461453 let amIdStr = toBase58String(value(cfgAmountAssetId))
462454 let prIdStr = toBase58String(value(cfgPriceAssetId))
463455 let amtDcm = cfgAmountAssetDecimals
464456 let priceDcm = cfgPriceAssetDecimals
465457 let sts = toString(cfgPoolStatus)
466458 let lpEm = valueOrErrorMessage(assetInfo(lpId), "Wr lp as").quantity
467459 let amBalance = if (isEval)
468460 then getAccBalance(amIdStr)
469461 else if (if (isOneAsset)
470462 then (pmtId == amIdStr)
471463 else false)
472464 then (getAccBalance(amIdStr) - pmtAmt)
473465 else if (isOneAsset)
474466 then getAccBalance(amIdStr)
475467 else (getAccBalance(amIdStr) - inAmAmt)
476468 let prBalance = if (isEval)
477469 then getAccBalance(prIdStr)
478470 else if (if (isOneAsset)
479471 then (pmtId == prIdStr)
480472 else false)
481473 then (getAccBalance(prIdStr) - pmtAmt)
482474 else if (isOneAsset)
483475 then getAccBalance(prIdStr)
484476 else (getAccBalance(prIdStr) - inPrAmt)
485477 let inAmAssetAmtX18 = t1(inAmAmt, amtDcm)
486478 let inPrAssetAmtX18 = t1(inPrAmt, priceDcm)
487479 let userPriceX18 = cpbi(inPrAssetAmtX18, inAmAssetAmtX18)
488480 let amBalanceX18 = t1(amBalance, amtDcm)
489481 let prBalanceX18 = t1(prBalance, priceDcm)
490482 let D0 = getD([amBalanceX18, prBalanceX18])
491483 let r = if ((lpEm == 0))
492484 then {
493485 let D1 = getD([(amBalanceX18 + inAmAssetAmtX18), (prBalanceX18 + inPrAssetAmtX18)])
494486 let checkD = if ((D1 > D0))
495487 then true
496488 else throw("D1 should be greater than D0")
497489 if ((checkD == checkD))
498490 then {
499491 let curPriceX18 = zeroBigInt
500492 let slippageX18 = zeroBigInt
501493 let lpAmtX18 = D1
502494 $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
503495 }
504496 else throw("Strict value is not equal to itself.")
505497 }
506498 else {
507499 let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
508500 let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18)
509501 let slippageX18 = t1(slippage, scale8)
510502 if (if (if (validateSlippage)
511503 then (curPriceX18 != zeroBigInt)
512504 else false)
513505 then (slippageRealX18 > slippageX18)
514506 else false)
515507 then throw(((("Price slippage " + toString(slippageRealX18)) + " > ") + toString(slippageX18)))
516508 else {
517509 let lpEmissionX18 = t1(lpEm, scale8)
518510 let prViaAmX18 = fraction(inAmAssetAmtX18, cpbir(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING)
519511 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, cpbir(prBalanceX18, amBalanceX18, FLOOR), CEILING)
520512 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
521513 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
522514 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
523515 let expAmtAssetAmtX18 = expectedAmts._1
524516 let expPriceAssetAmtX18 = expectedAmts._2
525517 let D1 = getD([(amBalanceX18 + expAmtAssetAmtX18), (prBalanceX18 + expPriceAssetAmtX18)])
526518 let checkD = if ((D1 > D0))
527519 then true
528520 else throw("D1 should be greater than D0")
529521 if ((checkD == checkD))
530522 then {
531523 let lpAmtX18 = fraction(lpEmissionX18, (D1 - D0), D0)
532524 $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceDcm, CEILING), curPriceX18, slippageX18)
533525 }
534526 else throw("Strict value is not equal to itself.")
535527 }
536528 }
537529 let calcLpAmt = r._1
538530 let calcAmAssetPmt = r._2
539531 let calcPrAssetPmt = r._3
540532 let curPrice = f1(r._4, scale8)
541533 let slippageCalc = f1(r._5, scale8)
542534 if ((0 >= calcLpAmt))
543535 then throw("LP <= 0")
544536 else {
545537 let emitLpAmt = if (!(emitLp))
546538 then 0
547539 else calcLpAmt
548540 let amDiff = (inAmAmt - calcAmAssetPmt)
549541 let prDiff = (inPrAmt - calcPrAssetPmt)
550- let $t02110921454 = if (if (isOneAsset)
542+ let $t02099321338 = if (if (isOneAsset)
551543 then (pmtId == amIdStr)
552544 else false)
553545 then $Tuple2(pmtAmt, 0)
554546 else if (if (isOneAsset)
555547 then (pmtId == prIdStr)
556548 else false)
557549 then $Tuple2(0, pmtAmt)
558550 else $Tuple2(calcAmAssetPmt, calcPrAssetPmt)
559- let writeAmAmt = $t02110921454._1
560- let writePrAmt = $t02110921454._2
551+ let writeAmAmt = $t02099321338._1
552+ let writePrAmt = $t02099321338._2
561553 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))]
562554 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId)
563555 }
564556 }
565557
566558
567559 func getYD (xp,i,D) = {
568560 let n = big2
569561 let x = xp[if ((i == 0))
570562 then 1
571563 else 0]
572564 let aPrecision = parseBigIntValue(Amult)
573565 let a = (parseBigIntValue(A) * aPrecision)
574566 let s = x
575567 let ann = (a * n)
576568 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
577569 let b = ((s + ((D * aPrecision) / ann)) - D)
578570 func calc (acc,cur) = {
579- let $t02264922669 = acc
580- let y = $t02264922669._1
581- let found = $t02264922669._2
571+ let $t02253322553 = acc
572+ let y = $t02253322553._1
573+ let found = $t02253322553._2
582574 if ((found != unit))
583575 then acc
584576 else {
585577 let yNext = (((y * y) + c) / ((big2 * y) + b))
586578 let yDiff = absBigInt((yNext - value(y)))
587579 if ((big1 >= yDiff))
588580 then $Tuple2(yNext, cur)
589581 else $Tuple2(yNext, unit)
590582 }
591583 }
592584
593585 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
594- let $t02297623023 = {
586+ let $t02286022907 = {
595587 let $l = arr
596588 let $s = size($l)
597589 let $acc0 = $Tuple2(D, unit)
598590 func $f0_1 ($a,$i) = if (($i >= $s))
599591 then $a
600592 else calc($a, $l[$i])
601593
602594 func $f0_2 ($a,$i) = if (($i >= $s))
603595 then $a
604596 else throw("List size exceeds 15")
605597
606598 $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)
607599 }
608- let y = $t02297623023._1
609- let found = $t02297623023._2
600+ let y = $t02286022907._1
601+ let found = $t02286022907._2
610602 if ((found != unit))
611603 then y
612604 else throw(("Y calculation error, Y = " + toString(y)))
613605 }
614606
615607
616608 func calcDLp (amountBalance,priceBalance,lpEmission) = {
617609 let updatedDLp = fraction(getD([t1BigInt(amountBalance, toBigInt(cfgAmountAssetDecimals)), t1BigInt(priceBalance, toBigInt(cfgPriceAssetDecimals))]), scale18, lpEmission)
618610 if ((lpEmission == big0))
619611 then big0
620612 else updatedDLp
621613 }
622614
623615
624616 func calcCurrentDLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
625617 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
626618 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
627619 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
628620 let currentDLp = calcDLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
629621 currentDLp
630622 }
631623
632624
633625 func refreshDLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
634626 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
635627 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
636628 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
637629 let updatedDLp = calcDLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
638630 let actions = [IntegerEntry(keyDLpRefreshedHeight, height), StringEntry(keyDLp, toString(updatedDLp))]
639631 $Tuple2(actions, updatedDLp)
640632 }
641633
642634
643635 func validateUpdatedDLp (oldDLp,updatedDLp) = if ((updatedDLp >= oldDLp))
644636 then true
645637 else throwErr("updated DLp lower than current DLp")
646638
647639
648640 func validateMatcherOrderAllowed (order) = {
649641 let amountAssetBalance = getAccBalance(assetIdToString(cfgAmountAssetId))
650642 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
651643 let amountAssetAmount = order.amount
652644 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
653- let $t02522125433 = if ((order.orderType == Buy))
645+ let $t02510525317 = if ((order.orderType == Buy))
654646 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
655647 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
656- let amountAssetBalanceDelta = $t02522125433._1
657- let priceAssetBalanceDelta = $t02522125433._2
648+ let amountAssetBalanceDelta = $t02510525317._1
649+ let priceAssetBalanceDelta = $t02510525317._2
658650 if (if (if (igs())
659651 then true
660652 else (cfgPoolStatus == PoolMatcherDis))
661653 then true
662654 else (cfgPoolStatus == PoolShutdown))
663655 then throw("Admin blocked")
664656 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
665657 then true
666658 else (order.assetPair.priceAsset != cfgPriceAssetId))
667659 then throw("Wr assets")
668660 else {
669661 let dLp = parseBigIntValue(valueOrElse(getString(this, keyDLp), "0"))
670- let $t02577525875 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
671- let unusedActions = $t02577525875._1
672- let dLpNew = $t02577525875._2
662+ let $t02565925759 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
663+ let unusedActions = $t02565925759._1
664+ let dLpNew = $t02565925759._2
673665 let isOrderValid = (dLpNew >= dLp)
674666 let info = makeString(["dLp=", toString(dLp), " dLpNew=", toString(dLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "")
675667 $Tuple2(isOrderValid, info)
676668 }
677669 }
678670
679671
680672 func cg (i) = if ((size(i.payments) != 1))
681673 then throw("1 pmnt exp")
682674 else {
683675 let pmt = value(i.payments[0])
684676 let pmtAssetId = value(pmt.assetId)
685677 let pmtAmt = pmt.amount
686678 let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
687679 let outAmAmt = r._1
688680 let outPrAmt = r._2
689681 let sts = parseIntValue(r._9)
690682 let state = r._10
691683 if (if (igs())
692684 then true
693685 else (sts == PoolShutdown))
694686 then throw(("Admin blocked: " + toString(sts)))
695687 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
696688 }
697689
698690
699691 func cp (caller,txId,amAsPmt,prAsPmt,slippage,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = {
700692 let r = epo(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, (txId == ""), emitLp, isOneAsset, validateSlippage, pmtAmt, pmtId)
701693 let sts = parseIntValue(r._8)
702694 if (if (if (igs())
703695 then true
704696 else (sts == PoolPutDis))
705697 then true
706698 else (sts == PoolShutdown))
707699 then throw(("Blocked:" + toString(sts)))
708700 else r
709701 }
710702
711703
712704 func calcPutOneTkn (pmtAmtRaw,pmtAssetId,userAddress,txId,withTakeFee) = {
713705 let amId = toBase58String(value(cfgAmountAssetId))
714706 let prId = toBase58String(value(cfgPriceAssetId))
715707 let lpId = cfgLpAssetId
716708 let amtDcm = cfgAmountAssetDecimals
717709 let priceDcm = cfgPriceAssetDecimals
718710 let lpAssetEmission = toBigInt(valueOrErrorMessage(assetInfo(lpId), "invalid lp asset").quantity)
719711 let chechEmission = if ((lpAssetEmission > big0))
720712 then true
721713 else throw("initial deposit requires all coins")
722714 if ((chechEmission == chechEmission))
723715 then {
724716 let amBalance = getAccBalance(amId)
725717 let prBalance = getAccBalance(prId)
726- let $t02853128993 = if ((txId == ""))
718+ let $t02841528877 = if ((txId == ""))
727719 then $Tuple2(amBalance, prBalance)
728720 else if ((pmtAssetId == amId))
729721 then if ((pmtAmtRaw > amBalance))
730722 then throw("invalid payment amount")
731723 else $Tuple2((amBalance - pmtAmtRaw), prBalance)
732724 else if ((pmtAssetId == prId))
733725 then if ((pmtAmtRaw > prBalance))
734726 then throw("invalid payment amount")
735727 else $Tuple2(amBalance, (prBalance - pmtAmtRaw))
736728 else throw("wrong pmtAssetId")
737- let amBalanceOld = $t02853128993._1
738- let prBalanceOld = $t02853128993._2
739- let $t02899929175 = if ((pmtAssetId == amId))
729+ let amBalanceOld = $t02841528877._1
730+ let prBalanceOld = $t02841528877._2
731+ let $t02888329059 = if ((pmtAssetId == amId))
740732 then $Tuple2(pmtAmtRaw, 0)
741733 else if ((pmtAssetId == prId))
742734 then $Tuple2(0, pmtAmtRaw)
743735 else throw("invalid payment")
744- let amAmountRaw = $t02899929175._1
745- let prAmountRaw = $t02899929175._2
746- let $t02917929433 = if (withTakeFee)
736+ let amAmountRaw = $t02888329059._1
737+ let prAmountRaw = $t02888329059._2
738+ let $t02906329317 = if (withTakeFee)
747739 then $Tuple3(takeFee(amAmountRaw, inFee)._1, takeFee(prAmountRaw, inFee)._1, takeFee(pmtAmtRaw, inFee)._2)
748740 else $Tuple3(amAmountRaw, prAmountRaw, 0)
749- let amAmount = $t02917929433._1
750- let prAmount = $t02917929433._2
751- let feeAmount = $t02917929433._3
741+ let amAmount = $t02906329317._1
742+ let prAmount = $t02906329317._2
743+ let feeAmount = $t02906329317._3
752744 let amBalanceNew = (amBalanceOld + amAmount)
753745 let prBalanceNew = (prBalanceOld + prAmount)
754746 let D0 = getD([t1(amBalanceOld, cfgAmountAssetDecimals), t1(prBalanceOld, cfgPriceAssetDecimals)])
755747 let D1 = getD([t1(amBalanceNew, cfgAmountAssetDecimals), t1(prBalanceNew, cfgPriceAssetDecimals)])
756748 let checkD = if ((D1 > D0))
757749 then true
758750 else throw()
759751 if ((checkD == checkD))
760752 then {
761753 let lpAmount = fraction(lpAssetEmission, (D1 - D0), D0, FLOOR)
762754 let curPrice = f1(cpbi(t1(prBalanceNew, priceDcm), t1(amBalanceNew, amtDcm)), scale8)
763755 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))]
764756 let poolProportion = fraction(prBalanceOld, scale8, amBalanceOld)
765757 let amountAssetPart = fraction(pmtAmtRaw, scale8, (poolProportion + scale8))
766758 let priceAssetPart = (pmtAmtRaw - amountAssetPart)
767759 let lpAmtBoth = fraction(lpAssetEmission, toBigInt(priceAssetPart), toBigInt(prBalanceOld))
768760 let bonus = toInt(fraction((lpAmount - lpAmtBoth), scale8BigInt, lpAmtBoth))
769761 $Tuple4(toInt(lpAmount), commonState, feeAmount, bonus)
770762 }
771763 else throw("Strict value is not equal to itself.")
772764 }
773765 else throw("Strict value is not equal to itself.")
774766 }
775767
776768
777769 func getOneTknV2Internal (outAssetId,minOutAmount,payments,caller,originCaller,transactionId) = {
778770 let lpId = toBase58String(value(cfgLpAssetId))
779771 let amId = toBase58String(value(cfgAmountAssetId))
780772 let prId = toBase58String(value(cfgPriceAssetId))
781773 let amDecimals = cfgAmountAssetDecimals
782774 let prDecimals = cfgPriceAssetDecimals
783775 let poolStatus = cfgPoolStatus
784776 let userAddress = if ((caller == restContract))
785777 then originCaller
786778 else caller
787779 let pmt = value(payments[0])
788780 let pmtAssetId = value(pmt.assetId)
789781 let pmtAmt = pmt.amount
790782 let currentDLp = calcCurrentDLp(big0, big0, big0)
791783 if ((currentDLp == currentDLp))
792784 then {
793785 let txId58 = toBase58String(transactionId)
794786 if ((lpId != toBase58String(pmtAssetId)))
795787 then throw("Wrong LP")
796788 else {
797789 let amBalance = getAccBalance(amId)
798790 let prBalance = getAccBalance(prId)
799- let $t03154531656 = {
791+ let $t03142931540 = {
800792 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil)
801793 if ($isInstanceOf(@, "(Int, Int)"))
802794 then @
803795 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
804796 }
805- if (($t03154531656 == $t03154531656))
797+ if (($t03142931540 == $t03142931540))
806798 then {
807- let feeAmount = $t03154531656._2
808- let totalGet = $t03154531656._1
799+ let feeAmount = $t03142931540._2
800+ let totalGet = $t03142931540._1
809801 let totalAmount = if (if ((minOutAmount > 0))
810802 then (minOutAmount > totalGet)
811803 else false)
812804 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
813805 else totalGet
814- let $t03184632153 = if ((outAssetId == amId))
806+ let $t03173032037 = if ((outAssetId == amId))
815807 then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance)
816808 else if ((outAssetId == prId))
817809 then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount))
818810 else throw("invalid out asset id")
819- let outAm = $t03184632153._1
820- let outPr = $t03184632153._2
821- let amBalanceNew = $t03184632153._3
822- let prBalanceNew = $t03184632153._4
811+ let outAm = $t03173032037._1
812+ let outPr = $t03173032037._2
813+ let amBalanceNew = $t03173032037._3
814+ let prBalanceNew = $t03173032037._4
823815 let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals))
824816 let curPr = f1(curPrX18, scale8)
825817 let outAssetIdOrWaves = if ((outAssetId == "WAVES"))
826818 then unit
827819 else fromBase58String(outAssetId)
828820 let sendFeeToMatcher = if ((feeAmount > 0))
829821 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetIdOrWaves)]
830822 else nil
831823 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)
832824 if ((state == state))
833825 then {
834826 let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
835827 if ((burn == burn))
836828 then {
837- let $t03293833288 = {
829+ let $t03282233172 = {
838830 let feeAmountForCalc = if ((this == feeCollectorAddress))
839831 then 0
840832 else feeAmount
841833 let outInAmountAsset = if ((parseAssetId(outAssetId) == cfgAmountAssetId))
842834 then true
843835 else false
844836 if (outInAmountAsset)
845837 then $Tuple2(-((totalGet + feeAmountForCalc)), 0)
846838 else $Tuple2(0, -((totalGet + feeAmountForCalc)))
847839 }
848- let amountAssetBalanceDelta = $t03293833288._1
849- let priceAssetBalanceDelta = $t03293833288._2
850- let $t03329133399 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
851- let refreshDLpActions = $t03329133399._1
852- let updatedDLp = $t03329133399._2
840+ let amountAssetBalanceDelta = $t03282233172._1
841+ let priceAssetBalanceDelta = $t03282233172._2
842+ let $t03317533283 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
843+ let refreshDLpActions = $t03317533283._1
844+ let updatedDLp = $t03317533283._2
853845 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
854846 if ((isUpdatedDLpValid == isUpdatedDLpValid))
855847 then $Tuple2((state ++ refreshDLpActions), totalAmount)
856848 else throw("Strict value is not equal to itself.")
857849 }
858850 else throw("Strict value is not equal to itself.")
859851 }
860852 else throw("Strict value is not equal to itself.")
861853 }
862854 else throw("Strict value is not equal to itself.")
863855 }
864856 }
865857 else throw("Strict value is not equal to itself.")
866858 }
867859
868860
869861 func managerPublicKeyOrUnit () = {
870862 let managerVaultAddress = getManagerVaultAddressOrThis()
871863 match getString(managerVaultAddress, keyManagerPublicKey()) {
872864 case s: String =>
873865 fromBase58String(s)
874866 case _: Unit =>
875867 unit
876868 case _ =>
877869 throw("Match error")
878870 }
879871 }
880872
881873
882874 let pd = throw("Permission denied")
883875
884876 func isManager (i) = match managerPublicKeyOrUnit() {
885877 case pk: ByteVector =>
886878 (i.callerPublicKey == pk)
887879 case _: Unit =>
888880 (i.caller == this)
889881 case _ =>
890882 throw("Match error")
891883 }
892884
893885
894886 func mustManager (i) = match managerPublicKeyOrUnit() {
895887 case pk: ByteVector =>
896888 if ((i.callerPublicKey == pk))
897889 then true
898890 else pd
899891 case _: Unit =>
900892 if ((i.caller == this))
901893 then true
902894 else pd
903895 case _ =>
904896 throw("Match error")
905897 }
906898
907899
908900 func getY (isReverse,D,poolAmountInBalance) = {
909901 let poolConfig = gpc()
910902 let amId = poolConfig[idxAmAsId]
911903 let prId = poolConfig[idxPrAsId]
912904 let n = big2
913905 let aPrecision = parseBigIntValue(Amult)
914906 let a = (parseBigIntValue(A) * aPrecision)
915907 let xp = if ((isReverse == false))
916908 then [(toBigInt(getAccBalance(amId)) + poolAmountInBalance), toBigInt(getAccBalance(prId))]
917909 else [(toBigInt(getAccBalance(prId)) + poolAmountInBalance), toBigInt(getAccBalance(amId))]
918910 let x = xp[0]
919911 let s = x
920912 let ann = (a * n)
921913 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
922914 let b = ((s + ((D * aPrecision) / ann)) - D)
923915 func calc (acc,cur) = {
924- let $t03488634906 = acc
925- let y = $t03488634906._1
926- let found = $t03488634906._2
916+ let $t03477034790 = acc
917+ let y = $t03477034790._1
918+ let found = $t03477034790._2
927919 if ((found != unit))
928920 then acc
929921 else {
930922 let yNext = (((y * y) + c) / ((big2 * y) + b))
931923 let yDiff = absBigInt((yNext - value(y)))
932924 if ((big1 >= yDiff))
933925 then $Tuple2(yNext, cur)
934926 else $Tuple2(yNext, unit)
935927 }
936928 }
937929
938930 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
939- let $t03523735284 = {
931+ let $t03512135168 = {
940932 let $l = arr
941933 let $s = size($l)
942934 let $acc0 = $Tuple2(D, unit)
943935 func $f0_1 ($a,$i) = if (($i >= $s))
944936 then $a
945937 else calc($a, $l[$i])
946938
947939 func $f0_2 ($a,$i) = if (($i >= $s))
948940 then $a
949941 else throw("List size exceeds 15")
950942
951943 $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)
952944 }
953- let y = $t03523735284._1
954- let found = $t03523735284._2
945+ let y = $t03512135168._1
946+ let found = $t03512135168._2
955947 if ((found != unit))
956948 then y
957949 else throw(("Y calculation error, Y = " + toString(y)))
958950 }
959951
960952
961953 func skipOrderValidation () = valueOrElse(getBoolean(fca, keySkipOrderValidation(toString(this))), false)
962954
963955
964956 @Callable(i)
965957 func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = {
966- let $t03563636060 = if ((isReverse == false))
958+ let $t03552035944 = if ((isReverse == false))
967959 then {
968960 let assetOut = strf(this, pa())
969961 let poolAmountInBalance = (toBigInt(getAccBalance(strf(this, aa()))) + toBigInt(cleanAmountIn))
970962 $Tuple2(assetOut, poolAmountInBalance)
971963 }
972964 else {
973965 let assetOut = strf(this, aa())
974966 let poolAmountInBalance = (toBigInt(getAccBalance(strf(this, pa()))) + toBigInt(cleanAmountIn))
975967 $Tuple2(assetOut, poolAmountInBalance)
976968 }
977- let assetOut = $t03563636060._1
978- let poolAmountInBalance = $t03563636060._2
969+ let assetOut = $t03552035944._1
970+ let poolAmountInBalance = $t03552035944._2
979971 let poolConfig = gpc()
980972 let amId = poolConfig[idxAmAsId]
981973 let prId = poolConfig[idxPrAsId]
982974 let xp = [toBigInt(getAccBalance(amId)), toBigInt(getAccBalance(prId))]
983975 let D = getD(xp)
984976 let y = getY(isReverse, D, toBigInt(cleanAmountIn))
985977 let dy = ((toBigInt(getAccBalance(assetOut)) - y) - toBigInt(1))
986978 let totalGetRaw = max([0, toInt(dy)])
987979 let newXp = if ((isReverse == false))
988980 then [((toBigInt(getAccBalance(amId)) + toBigInt(cleanAmountIn)) + toBigInt(feePoolAmount)), (toBigInt(getAccBalance(prId)) - dy)]
989981 else [(toBigInt(getAccBalance(amId)) - dy), ((toBigInt(getAccBalance(prId)) + toBigInt(cleanAmountIn)) + toBigInt(feePoolAmount))]
990982 let newD = getD(newXp)
991983 let checkD = if ((newD >= D))
992984 then true
993985 else throw(makeString(["new D is fewer error", toString(D), toString(newD)], "__"))
994986 if ((checkD == checkD))
995987 then $Tuple2(nil, totalGetRaw)
996988 else throw("Strict value is not equal to itself.")
997989 }
998990
999991
1000992
1001993 @Callable(i)
1002994 func calculateAmountOutForSwapAndSendTokens (cleanAmountIn,isReverse,amountOutMin,addressTo,feePoolAmount) = {
1003995 let swapContact = {
1004996 let @ = invoke(fca, "getSwapContractREADONLY", nil, nil)
1005997 if ($isInstanceOf(@, "String"))
1006998 then @
1007999 else throw(($getType(@) + " couldn't be cast to String"))
10081000 }
10091001 let isPoolSwapDisabled = {
10101002 let @ = invoke(fca, "isPoolSwapDisabledREADONLY", [toString(this)], nil)
10111003 if ($isInstanceOf(@, "Boolean"))
10121004 then @
10131005 else throw(($getType(@) + " couldn't be cast to Boolean"))
10141006 }
10151007 let isSwapDisabled = if (if (igs())
10161008 then true
10171009 else (cfgPoolStatus == PoolShutdown))
10181010 then true
10191011 else isPoolSwapDisabled
10201012 let checks = [if (if (!(isSwapDisabled))
10211013 then true
10221014 else isManager(i))
10231015 then true
10241016 else throwErr("swap operation is blocked by admin"), if ((value(i.payments[0]).amount >= cleanAmountIn))
10251017 then true
10261018 else throwErr("Wrong amount"), if ((i.caller == addressFromStringValue(swapContact)))
10271019 then true
10281020 else throwErr("Permission denied")]
10291021 if ((checks == checks))
10301022 then {
10311023 let pmt = value(i.payments[0])
10321024 let assetIn = assetIdToString(pmt.assetId)
1033- let $t03779538189 = if ((isReverse == false))
1025+ let $t03767938073 = if ((isReverse == false))
10341026 then {
10351027 let assetOut = strf(this, pa())
10361028 let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
10371029 $Tuple2(assetOut, poolAmountInBalance)
10381030 }
10391031 else {
10401032 let assetOut = strf(this, aa())
10411033 let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
10421034 $Tuple2(assetOut, poolAmountInBalance)
10431035 }
1044- let assetOut = $t03779538189._1
1045- let poolAmountInBalance = $t03779538189._2
1036+ let assetOut = $t03767938073._1
1037+ let poolAmountInBalance = $t03767938073._2
10461038 let poolConfig = gpc()
10471039 let amId = poolConfig[idxAmAsId]
10481040 let prId = poolConfig[idxPrAsId]
10491041 let xp = if ((isReverse == false))
10501042 then [(toBigInt(getAccBalance(amId)) - toBigInt(value(i.payments[0]).amount)), toBigInt(getAccBalance(prId))]
10511043 else [toBigInt(getAccBalance(amId)), (toBigInt(getAccBalance(prId)) - toBigInt(value(i.payments[0]).amount))]
10521044 let D = getD(xp)
10531045 let y = getY(isReverse, D, toBigInt(0))
10541046 let dy = ((toBigInt(getAccBalance(assetOut)) - y) - toBigInt(1))
10551047 let totalGetRaw = max([0, toInt(dy)])
10561048 let checkMin = if ((totalGetRaw >= amountOutMin))
10571049 then true
10581050 else throw("Exchange result is fewer coins than expected")
10591051 if ((checkMin == checkMin))
10601052 then {
10611053 let newXp = if ((isReverse == false))
10621054 then [(toBigInt(getAccBalance(amId)) + toBigInt(feePoolAmount)), (toBigInt(getAccBalance(prId)) - dy)]
10631055 else [(toBigInt(getAccBalance(amId)) - dy), (toBigInt(getAccBalance(prId)) + toBigInt(feePoolAmount))]
10641056 let newD = getD(newXp)
10651057 let checkD = if ((newD >= D))
10661058 then true
10671059 else throw("new D is fewer error")
10681060 if ((checkD == checkD))
10691061 then {
10701062 let amountAssetBalanceDelta = if (isReverse)
10711063 then -(totalGetRaw)
10721064 else feePoolAmount
10731065 let priceAssetBalanceDelta = if (isReverse)
10741066 then feePoolAmount
10751067 else -(totalGetRaw)
10761068 let refreshDLpActions = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)._1
10771069 if ((refreshDLpActions == refreshDLpActions))
10781070 then $Tuple2([ScriptTransfer(addressFromStringValue(addressTo), totalGetRaw, parseAssetId(assetOut))], totalGetRaw)
10791071 else throw("Strict value is not equal to itself.")
10801072 }
10811073 else throw("Strict value is not equal to itself.")
10821074 }
10831075 else throw("Strict value is not equal to itself.")
10841076 }
10851077 else throw("Strict value is not equal to itself.")
10861078 }
10871079
10881080
10891081
10901082 @Callable(i)
10911083 func constructor (fc) = {
10921084 let c = mustManager(i)
10931085 if ((c == c))
10941086 then [StringEntry(fc(), fc)]
10951087 else throw("Strict value is not equal to itself.")
10961088 }
10971089
10981090
10991091
11001092 @Callable(i)
11011093 func put (slip,autoStake) = {
11021094 let factCfg = gfc()
11031095 let stakingCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactStakCntr]), "Wr st addr")
11041096 let slipCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactSlippCntr]), "Wr sl addr")
11051097 if ((0 > slip))
11061098 then throw("Wrong slippage")
11071099 else if ((size(i.payments) != 2))
11081100 then throw("2 pmnts expd")
11091101 else {
11101102 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
11111103 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
11121104 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amAssetPmt)
11131105 if ((amountAssetBalance == amountAssetBalance))
11141106 then {
11151107 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - prAssetPmt)
11161108 if ((priceAssetBalance == priceAssetBalance))
11171109 then {
11181110 let lpAssetEmission = toBigInt(value(assetInfo(cfgLpAssetId)).quantity)
11191111 if ((lpAssetEmission == lpAssetEmission))
11201112 then {
11211113 let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0))
11221114 if ((currentDLp == currentDLp))
11231115 then {
11241116 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, "")
11251117 let emitLpAmt = e._2
11261118 let lpAssetId = e._7
11271119 let state = e._9
11281120 let amDiff = e._10
11291121 let prDiff = e._11
11301122 let amId = e._12
11311123 let prId = e._13
11321124 let r = invoke(fca, "emit", [emitLpAmt], nil)
11331125 if ((r == r))
11341126 then {
11351127 let el = match r {
11361128 case legacy: Address =>
11371129 invoke(legacy, "emit", [emitLpAmt], nil)
11381130 case _ =>
11391131 unit
11401132 }
11411133 if ((el == el))
11421134 then {
11431135 let sa = if ((amDiff > 0))
11441136 then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)])
11451137 else nil
11461138 if ((sa == sa))
11471139 then {
11481140 let sp = if ((prDiff > 0))
11491141 then invoke(slipCntr, "put", nil, [AttachedPayment(prId, prDiff)])
11501142 else nil
11511143 if ((sp == sp))
11521144 then {
11531145 let lpTrnsfr = if (autoStake)
11541146 then {
11551147 let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
11561148 if ((ss == ss))
11571149 then nil
11581150 else throw("Strict value is not equal to itself.")
11591151 }
11601152 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
1161- let $t04264442786 = refreshDLpInternal(0, 0, 0)
1162- let refreshDLpActions = $t04264442786._1
1163- let updatedDLp = $t04264442786._2
1153+ let $t04252842670 = refreshDLpInternal(0, 0, 0)
1154+ let refreshDLpActions = $t04252842670._1
1155+ let updatedDLp = $t04252842670._2
11641156 let check = if ((updatedDLp >= currentDLp))
11651157 then true
11661158 else throwErr(makeString(["updated DLp lower than current DLp", toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentDLp), toString(updatedDLp), toString(amDiff), toString(prDiff)], " "))
11671159 if ((check == check))
11681160 then {
11691161 let lpAssetEmissionAfter = value(assetInfo(cfgLpAssetId)).quantity
11701162 if ((lpAssetEmissionAfter == lpAssetEmissionAfter))
11711163 then ((state ++ lpTrnsfr) ++ refreshDLpActions)
11721164 else throw("Strict value is not equal to itself.")
11731165 }
11741166 else throw("Strict value is not equal to itself.")
11751167 }
11761168 else throw("Strict value is not equal to itself.")
11771169 }
11781170 else throw("Strict value is not equal to itself.")
11791171 }
11801172 else throw("Strict value is not equal to itself.")
11811173 }
11821174 else throw("Strict value is not equal to itself.")
11831175 }
11841176 else throw("Strict value is not equal to itself.")
11851177 }
11861178 else throw("Strict value is not equal to itself.")
11871179 }
11881180 else throw("Strict value is not equal to itself.")
11891181 }
11901182 else throw("Strict value is not equal to itself.")
11911183 }
11921184 }
11931185
11941186
11951187
11961188 @Callable(i)
11971189 func putOneTknV2 (minOutAmount,autoStake) = {
11981190 let isPoolOneTokenOperationsDisabled = {
11991191 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
12001192 if ($isInstanceOf(@, "Boolean"))
12011193 then @
12021194 else throw(($getType(@) + " couldn't be cast to Boolean"))
12031195 }
12041196 let isPutDisabled = if (if (if (igs())
12051197 then true
12061198 else (cfgPoolStatus == PoolPutDis))
12071199 then true
12081200 else (cfgPoolStatus == PoolShutdown))
12091201 then true
12101202 else isPoolOneTokenOperationsDisabled
12111203 let checks = [if (if (!(isPutDisabled))
12121204 then true
12131205 else isManager(i))
12141206 then true
12151207 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
12161208 then true
12171209 else throwErr("exactly 1 payment are expected")]
12181210 if ((checks == checks))
12191211 then {
12201212 let amId = toBase58String(value(cfgAmountAssetId))
12211213 let prId = toBase58String(value(cfgPriceAssetId))
12221214 let lpId = cfgLpAssetId
12231215 let amDecimals = cfgAmountAssetDecimals
12241216 let prDecimals = cfgPriceAssetDecimals
12251217 let userAddress = if ((i.caller == this))
12261218 then i.originCaller
12271219 else i.caller
12281220 let pmt = value(i.payments[0])
12291221 let pmtAssetId = toBase58String(value(pmt.assetId))
12301222 let pmtAmt = pmt.amount
12311223 let currentDLp = if ((pmt.assetId == cfgAmountAssetId))
12321224 then calcCurrentDLp(toBigInt(pmtAmt), toBigInt(0), toBigInt(0))
12331225 else calcCurrentDLp(toBigInt(0), toBigInt(pmtAmt), toBigInt(0))
12341226 if ((currentDLp == currentDLp))
12351227 then {
1236- let $t04442744585 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1237- if (($t04442744585 == $t04442744585))
1228+ let $t04431144469 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1229+ if (($t04431144469 == $t04431144469))
12381230 then {
1239- let feeAmount = $t04442744585._3
1240- let state = $t04442744585._2
1241- let estimLP = $t04442744585._1
1231+ let feeAmount = $t04431144469._3
1232+ let state = $t04431144469._2
1233+ let estimLP = $t04431144469._1
12421234 let emitLpAmt = if (if ((minOutAmount > 0))
12431235 then (minOutAmount > estimLP)
12441236 else false)
12451237 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
12461238 else estimLP
12471239 let e = invoke(fca, "emit", [emitLpAmt], nil)
12481240 if ((e == e))
12491241 then {
12501242 let el = match e {
12511243 case legacy: Address =>
12521244 invoke(legacy, "emit", [emitLpAmt], nil)
12531245 case _ =>
12541246 unit
12551247 }
12561248 if ((el == el))
12571249 then {
12581250 let lpTrnsfr = if (autoStake)
12591251 then {
12601252 let ss = invoke(stakingContract, "stakeFor", [toString(i.caller)], [AttachedPayment(lpId, emitLpAmt)])
12611253 if ((ss == ss))
12621254 then nil
12631255 else throw("Strict value is not equal to itself.")
12641256 }
12651257 else [ScriptTransfer(i.caller, emitLpAmt, lpId)]
12661258 let sendFeeToMatcher = if ((feeAmount > 0))
12671259 then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))]
12681260 else nil
1269- let $t04547045819 = if ((this == feeCollectorAddress))
1261+ let $t04535445703 = if ((this == feeCollectorAddress))
12701262 then $Tuple2(0, 0)
12711263 else {
12721264 let paymentInAmountAsset = if ((pmt.assetId == cfgAmountAssetId))
12731265 then true
12741266 else false
12751267 if (paymentInAmountAsset)
12761268 then $Tuple2(-(feeAmount), 0)
12771269 else $Tuple2(0, -(feeAmount))
12781270 }
1279- let amountAssetBalanceDelta = $t04547045819._1
1280- let priceAssetBalanceDelta = $t04547045819._2
1281- let $t04582245930 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1282- let refreshDLpActions = $t04582245930._1
1283- let updatedDLp = $t04582245930._2
1271+ let amountAssetBalanceDelta = $t04535445703._1
1272+ let priceAssetBalanceDelta = $t04535445703._2
1273+ let $t04570645814 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1274+ let refreshDLpActions = $t04570645814._1
1275+ let updatedDLp = $t04570645814._2
12841276 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
12851277 if ((isUpdatedDLpValid == isUpdatedDLpValid))
12861278 then $Tuple2((((state ++ lpTrnsfr) ++ sendFeeToMatcher) ++ refreshDLpActions), emitLpAmt)
12871279 else throw("Strict value is not equal to itself.")
12881280 }
12891281 else throw("Strict value is not equal to itself.")
12901282 }
12911283 else throw("Strict value is not equal to itself.")
12921284 }
12931285 else throw("Strict value is not equal to itself.")
12941286 }
12951287 else throw("Strict value is not equal to itself.")
12961288 }
12971289 else throw("Strict value is not equal to itself.")
12981290 }
12991291
13001292
13011293
13021294 @Callable(i)
13031295 func putForFree (maxSlpg) = if ((0 > maxSlpg))
13041296 then throw("Wrong slpg")
13051297 else if ((size(i.payments) != 2))
13061298 then throw("2 pmnts expd")
13071299 else {
13081300 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, "")
13091301 let state = estPut._9
13101302 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
13111303 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
13121304 let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0))
13131305 if ((currentDLp == currentDLp))
13141306 then {
1315- let $t04696047025 = refreshDLpInternal(0, 0, 0)
1316- let refreshDLpActions = $t04696047025._1
1317- let updatedDLp = $t04696047025._2
1307+ let $t04684446909 = refreshDLpInternal(0, 0, 0)
1308+ let refreshDLpActions = $t04684446909._1
1309+ let updatedDLp = $t04684446909._2
13181310 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
13191311 if ((isUpdatedDLpValid == isUpdatedDLpValid))
13201312 then (state ++ refreshDLpActions)
13211313 else throw("Strict value is not equal to itself.")
13221314 }
13231315 else throw("Strict value is not equal to itself.")
13241316 }
13251317
13261318
13271319
13281320 @Callable(i)
13291321 func get () = {
13301322 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0))
13311323 if ((currentDLp == currentDLp))
13321324 then {
13331325 let r = cg(i)
13341326 let outAmtAmt = r._1
13351327 let outPrAmt = r._2
13361328 let pmtAmt = r._3
13371329 let pmtAssetId = r._4
13381330 let state = r._5
13391331 let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
13401332 if ((b == b))
13411333 then {
1342- let $t04819848280 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1343- let refreshDLpActions = $t04819848280._1
1344- let updatedDLp = $t04819848280._2
1334+ let $t04808248164 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1335+ let refreshDLpActions = $t04808248164._1
1336+ let updatedDLp = $t04808248164._2
13451337 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
13461338 if ((isUpdatedDLpValid == isUpdatedDLpValid))
13471339 then (state ++ refreshDLpActions)
13481340 else throw("Strict value is not equal to itself.")
13491341 }
13501342 else throw("Strict value is not equal to itself.")
13511343 }
13521344 else throw("Strict value is not equal to itself.")
13531345 }
13541346
13551347
13561348
13571349 @Callable(i)
13581350 func getOneTknV2 (outAssetId,minOutAmount) = {
13591351 let isPoolOneTokenOperationsDisabled = {
13601352 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
13611353 if ($isInstanceOf(@, "Boolean"))
13621354 then @
13631355 else throw(($getType(@) + " couldn't be cast to Boolean"))
13641356 }
13651357 let isGetDisabled = if (if (igs())
13661358 then true
13671359 else (cfgPoolStatus == PoolShutdown))
13681360 then true
13691361 else isPoolOneTokenOperationsDisabled
13701362 let checks = [if (if (!(isGetDisabled))
13711363 then true
13721364 else isManager(i))
13731365 then true
13741366 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
13751367 then true
13761368 else throwErr("exactly 1 payment are expected")]
13771369 if ((checks == checks))
13781370 then {
1379- let $t04889849053 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1380- let state = $t04889849053._1
1381- let totalAmount = $t04889849053._2
1371+ let $t04878248937 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1372+ let state = $t04878248937._1
1373+ let totalAmount = $t04878248937._2
13821374 $Tuple2(state, totalAmount)
13831375 }
13841376 else throw("Strict value is not equal to itself.")
13851377 }
13861378
13871379
13881380
13891381 @Callable(i)
13901382 func refreshDLp () = {
13911383 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyDLpRefreshedHeight), 0)
13921384 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= dLpRefreshDelay))
13931385 then unit
13941386 else throwErr(makeString([toString(dLpRefreshDelay), " blocks have not passed since the previous call"], ""))
13951387 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
13961388 then {
13971389 let dLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyDLp), "0")), fmtErr("invalid dLp"))
1398- let $t04957749641 = refreshDLpInternal(0, 0, 0)
1399- let dLpUpdateActions = $t04957749641._1
1400- let updatedDLp = $t04957749641._2
1390+ let $t04946149525 = refreshDLpInternal(0, 0, 0)
1391+ let dLpUpdateActions = $t04946149525._1
1392+ let updatedDLp = $t04946149525._2
14011393 let actions = if ((dLp != updatedDLp))
14021394 then dLpUpdateActions
14031395 else throwErr("nothing to refresh")
14041396 $Tuple2(actions, toString(updatedDLp))
14051397 }
14061398 else throw("Strict value is not equal to itself.")
14071399 }
14081400
14091401
14101402
14111403 @Callable(i)
14121404 func getOneTknV2READONLY (outAssetId,lpAssetAmount) = {
14131405 let amId = toBase58String(value(cfgAmountAssetId))
14141406 let prId = toBase58String(value(cfgPriceAssetId))
14151407 let lpId = toBase58String(value(cfgLpAssetId))
14161408 let xp = [toBigInt(getAccBalance(amId)), toBigInt(getAccBalance(prId))]
14171409 let lpEmission = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "invalid lp asset").quantity)
14181410 let D0 = getD(xp)
14191411 let D1 = (D0 - fraction(toBigInt(lpAssetAmount), D0, lpEmission))
14201412 let index = if ((outAssetId == amId))
14211413 then 0
14221414 else if ((outAssetId == prId))
14231415 then 1
14241416 else throw("invalid out asset id")
14251417 let newY = getYD(xp, index, D1)
14261418 let dy = (xp[index] - newY)
14271419 let totalGetRaw = max([0, toInt((dy - big1))])
1428- let $t05065150706 = takeFee(totalGetRaw, outFee)
1429- let totalGet = $t05065150706._1
1430- let feeAmount = $t05065150706._2
1420+ let $t05053550590 = takeFee(totalGetRaw, outFee)
1421+ let totalGet = $t05053550590._1
1422+ let feeAmount = $t05053550590._2
14311423 $Tuple2(nil, $Tuple2(totalGet, feeAmount))
14321424 }
14331425
14341426
14351427
14361428 @Callable(i)
14371429 func getOneTknV2WithBonusREADONLY (outAssetId,lpAssetAmount) = {
14381430 let amId = toBase58String(value(cfgAmountAssetId))
14391431 let prId = toBase58String(value(cfgPriceAssetId))
14401432 let lpId = toBase58String(value(cfgLpAssetId))
14411433 let amBalance = getAccBalance(amId)
14421434 let prBalance = getAccBalance(prId)
1443- let $t05108151196 = {
1435+ let $t05096551080 = {
14441436 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil)
14451437 if ($isInstanceOf(@, "(Int, Int)"))
14461438 then @
14471439 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
14481440 }
1449- let totalGet = $t05108151196._1
1450- let feeAmount = $t05108151196._2
1441+ let totalGet = $t05096551080._1
1442+ let feeAmount = $t05096551080._2
14511443 let r = ego("", lpId, lpAssetAmount, this)
14521444 let outAmAmt = r._1
14531445 let outPrAmt = r._2
14541446 let sumOfGetAssets = (outAmAmt + outPrAmt)
14551447 let bonus = if ((sumOfGetAssets == 0))
14561448 then if ((totalGet == 0))
14571449 then 0
14581450 else throw("bonus calculation error")
14591451 else fraction((totalGet - sumOfGetAssets), scale8, sumOfGetAssets)
14601452 $Tuple2(nil, $Tuple3(totalGet, feeAmount, bonus))
14611453 }
14621454
14631455
14641456
14651457 @Callable(i)
14661458 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
14671459 let r = cg(i)
14681460 let outAmAmt = r._1
14691461 let outPrAmt = r._2
14701462 let pmtAmt = r._3
14711463 let pmtAssetId = r._4
14721464 let state = r._5
14731465 if ((noLessThenAmtAsset > outAmAmt))
14741466 then throw(((("Failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
14751467 else if ((noLessThenPriceAsset > outPrAmt))
14761468 then throw(((("Failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
14771469 else {
14781470 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0))
14791471 if ((currentDLp == currentDLp))
14801472 then {
14811473 let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14821474 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14831475 then {
1484- let $t05236252443 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1485- let refreshDLpActions = $t05236252443._1
1486- let updatedDLp = $t05236252443._2
1476+ let $t05224652327 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1477+ let refreshDLpActions = $t05224652327._1
1478+ let updatedDLp = $t05224652327._2
14871479 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
14881480 if ((isUpdatedDLpValid == isUpdatedDLpValid))
14891481 then (state ++ refreshDLpActions)
14901482 else throw("Strict value is not equal to itself.")
14911483 }
14921484 else throw("Strict value is not equal to itself.")
14931485 }
14941486 else throw("Strict value is not equal to itself.")
14951487 }
14961488 }
14971489
14981490
14991491
15001492 @Callable(i)
15011493 func unstakeAndGet (amount) = {
15021494 let checkPayments = if ((size(i.payments) != 0))
15031495 then throw("No pmnts expd")
15041496 else true
15051497 if ((checkPayments == checkPayments))
15061498 then {
15071499 let factoryCfg = gfc()
15081500 let lpAssetId = cfgLpAssetId
15091501 let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr")
15101502 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0))
15111503 if ((currentDLp == currentDLp))
15121504 then {
15131505 let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil)
15141506 if ((unstakeInv == unstakeInv))
15151507 then {
15161508 let r = ego(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
15171509 let outAmAmt = r._1
15181510 let outPrAmt = r._2
15191511 let sts = parseIntValue(r._9)
15201512 let state = r._10
15211513 let v = if (if (igs())
15221514 then true
15231515 else (sts == PoolShutdown))
15241516 then throw(("Blocked: " + toString(sts)))
15251517 else true
15261518 if ((v == v))
15271519 then {
15281520 let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
15291521 if ((burnA == burnA))
15301522 then {
1531- let $t05347053551 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1532- let refreshDLpActions = $t05347053551._1
1533- let updatedDLp = $t05347053551._2
1523+ let $t05335453435 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1524+ let refreshDLpActions = $t05335453435._1
1525+ let updatedDLp = $t05335453435._2
15341526 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
15351527 if ((isUpdatedDLpValid == isUpdatedDLpValid))
15361528 then (state ++ refreshDLpActions)
15371529 else throw("Strict value is not equal to itself.")
15381530 }
15391531 else throw("Strict value is not equal to itself.")
15401532 }
15411533 else throw("Strict value is not equal to itself.")
15421534 }
15431535 else throw("Strict value is not equal to itself.")
15441536 }
15451537 else throw("Strict value is not equal to itself.")
15461538 }
15471539 else throw("Strict value is not equal to itself.")
15481540 }
15491541
15501542
15511543
15521544 @Callable(i)
15531545 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
15541546 let isGetDisabled = if (igs())
15551547 then true
15561548 else (cfgPoolStatus == PoolShutdown)
15571549 let checks = [if (!(isGetDisabled))
15581550 then true
15591551 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
15601552 then true
15611553 else throw("no payments are expected")]
15621554 if ((checks == checks))
15631555 then {
15641556 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0))
15651557 if ((currentDLp == currentDLp))
15661558 then {
15671559 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
15681560 if ((unstakeInv == unstakeInv))
15691561 then {
15701562 let res = ego(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
15711563 let outAmAmt = res._1
15721564 let outPrAmt = res._2
15731565 let state = res._10
15741566 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
15751567 then true
15761568 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
15771569 then true
15781570 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
15791571 if ((checkAmounts == checkAmounts))
15801572 then {
15811573 let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
15821574 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15831575 then {
1584- let $t05480254883 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1585- let refreshDLpActions = $t05480254883._1
1586- let updatedDLp = $t05480254883._2
1576+ let $t05468654767 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1577+ let refreshDLpActions = $t05468654767._1
1578+ let updatedDLp = $t05468654767._2
15871579 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
15881580 if ((isUpdatedDLpValid == isUpdatedDLpValid))
15891581 then (state ++ refreshDLpActions)
15901582 else throw("Strict value is not equal to itself.")
15911583 }
15921584 else throw("Strict value is not equal to itself.")
15931585 }
15941586 else throw("Strict value is not equal to itself.")
15951587 }
15961588 else throw("Strict value is not equal to itself.")
15971589 }
15981590 else throw("Strict value is not equal to itself.")
15991591 }
16001592 else throw("Strict value is not equal to itself.")
16011593 }
16021594
16031595
16041596
16051597 @Callable(i)
16061598 func unstakeAndGetOneTknV2 (unstakeAmount,outAssetId,minOutAmount) = {
16071599 let isPoolOneTokenOperationsDisabled = {
16081600 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
16091601 if ($isInstanceOf(@, "Boolean"))
16101602 then @
16111603 else throw(($getType(@) + " couldn't be cast to Boolean"))
16121604 }
16131605 let isGetDisabled = if (if (igs())
16141606 then true
16151607 else (cfgPoolStatus == PoolShutdown))
16161608 then true
16171609 else isPoolOneTokenOperationsDisabled
16181610 let checks = [if (if (!(isGetDisabled))
16191611 then true
16201612 else isManager(i))
16211613 then true
16221614 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
16231615 then true
16241616 else throwErr("no payments are expected")]
16251617 if ((checks == checks))
16261618 then {
16271619 let factoryCfg = gfc()
16281620 let lpAssetId = cfgLpAssetId
16291621 let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr")
16301622 let userAddress = i.caller
16311623 let lpAssetRecipientAddress = this
16321624 let unstakeInv = invoke(staking, "unstakeINTERNAL", [lpAssetId, unstakeAmount, userAddress.bytes, lpAssetRecipientAddress.bytes], nil)
16331625 if ((unstakeInv == unstakeInv))
16341626 then {
1635- let $t05590556093 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1636- let state = $t05590556093._1
1637- let totalAmount = $t05590556093._2
1627+ let $t05578955977 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1628+ let state = $t05578955977._1
1629+ let totalAmount = $t05578955977._2
16381630 $Tuple2(state, totalAmount)
16391631 }
16401632 else throw("Strict value is not equal to itself.")
16411633 }
16421634 else throw("Strict value is not equal to itself.")
16431635 }
16441636
16451637
16461638
16471639 @Callable(i)
16481640 func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = {
1649- let $t05622156324 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1650- let lpAmount = $t05622156324._1
1651- let state = $t05622156324._2
1652- let feeAmount = $t05622156324._3
1653- let bonus = $t05622156324._4
1641+ let $t05610556208 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1642+ let lpAmount = $t05610556208._1
1643+ let state = $t05610556208._2
1644+ let feeAmount = $t05610556208._3
1645+ let bonus = $t05610556208._4
16541646 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
16551647 }
16561648
16571649
16581650
16591651 @Callable(i)
16601652 func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = {
1661- let $t05647256576 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1662- let lpAmount = $t05647256576._1
1663- let state = $t05647256576._2
1664- let feeAmount = $t05647256576._3
1665- let bonus = $t05647256576._4
1653+ let $t05635656460 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1654+ let lpAmount = $t05635656460._1
1655+ let state = $t05635656460._2
1656+ let feeAmount = $t05635656460._3
1657+ let bonus = $t05635656460._4
16661658 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
16671659 }
16681660
16691661
16701662
16711663 @Callable(i)
16721664 func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString(fca)))
16731665 then throw("denied")
1674- else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr), StringEntry(amp(), toString(ampInitial)), StringEntry(keyAmpHistory(height), toString(ampInitial))], "success")
1675-
1676-
1677-
1678-@Callable(i)
1679-func invert () = {
1680- let checks = [if ((i.caller == fca))
1681- then true
1682- else throwErr("invalid caller")]
1683- if ((checks == checks))
1684- then $Tuple2([StringEntry(aa(), assetIdToString(cfgPriceAssetId)), StringEntry(pa(), assetIdToString(cfgAmountAssetId))], unit)
1685- else throw("Strict value is not equal to itself.")
1686- }
1666+ else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr)], "success")
16871667
16881668
16891669
16901670 @Callable(i)
16911671 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, gpc())
16921672
16931673
16941674
16951675 @Callable(i)
16961676 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
16971677
16981678
16991679
17001680 @Callable(i)
17011681 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
17021682 let pr = calcPrices(amAmt, prAmt, lpAmt)
17031683 $Tuple2(nil, [toString(pr[0]), toString(pr[1]), toString(pr[2])])
17041684 }
17051685
17061686
17071687
17081688 @Callable(i)
17091689 func fromX18WrapperREADONLY (val,resScaleMult) = $Tuple2(nil, f1(parseBigIntValue(val), resScaleMult))
17101690
17111691
17121692
17131693 @Callable(i)
17141694 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(t1(origVal, origScaleMult)))
17151695
17161696
17171697
17181698 @Callable(i)
17191699 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(cpbi(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
17201700
17211701
17221702
17231703 @Callable(i)
17241704 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, ""))
17251705
17261706
17271707
17281708 @Callable(i)
17291709 func estimateGetOperationWrapperREADONLY (txId58,pmtAsId,pmtLpAmt,usrAddr) = {
17301710 let r = ego(txId58, pmtAsId, pmtLpAmt, addressFromStringValue(usrAddr))
17311711 $Tuple2(nil, $Tuple10(r._1, r._2, r._3, r._4, r._5, r._6, r._7, toString(r._8), r._9, r._10))
17321712 }
17331713
17341714
17351715
17361716 @Callable(i)
17371717 func changeAmp () = {
1738- let cfg = invoke(fca, "getChangeAmpConfigREADONLY", [toString(this)], nil)
1739- let $t05929759496 = match cfg {
1740- case list: List[Any] =>
1741- $Tuple3({
1742- let @ = list[0]
1743- if ($isInstanceOf(@, "Int"))
1744- then @
1745- else throw(($getType(@) + " couldn't be cast to Int"))
1746- }, {
1747- let @ = list[1]
1748- if ($isInstanceOf(@, "Int"))
1749- then @
1750- else throw(($getType(@) + " couldn't be cast to Int"))
1751- }, {
1752- let @ = list[2]
1753- if ($isInstanceOf(@, "Int"))
1754- then @
1755- else throw(($getType(@) + " couldn't be cast to Int"))
1756- })
1757- case _ =>
1758- throwErr("invalid entry type")
1759- }
1760- let delay = $t05929759496._1
1761- let delta = $t05929759496._2
1762- let target = $t05929759496._3
1763- let curAmp = parseIntValue(getStringValue(amp()))
1764- let newAmpRaw = (curAmp + delta)
1765- let newAmp = if ((0 > delta))
1766- then if ((target > newAmpRaw))
1767- then target
1768- else newAmpRaw
1769- else if ((newAmpRaw > target))
1770- then target
1771- else newAmpRaw
1772- let lastCall = valueOrElse(getInteger(keyChangeAmpLastCall()), 0)
1773- let wait = (lastCall + delay)
1774- let checks = [if ((height > wait))
1775- then true
1776- else throwErr("try again in few blocks"), if ((curAmp != newAmp))
1777- then true
1778- else throwErr("already reached target")]
1779- if ((checks == checks))
1780- then [IntegerEntry(keyChangeAmpLastCall(), height), StringEntry(amp(), toString(newAmp)), StringEntry(keyAmpHistory(height), toString(newAmp))]
1718+ let fcaInv = invoke(fca, "changeAmp", [toString(this)], nil)
1719+ if ((fcaInv == fcaInv))
1720+ then nil
17811721 else throw("Strict value is not equal to itself.")
17821722 }
17831723
17841724
17851725 @Verifier(tx)
17861726 func verify () = {
17871727 let targetPublicKey = match managerPublicKeyOrUnit() {
17881728 case pk: ByteVector =>
17891729 pk
17901730 case _: Unit =>
17911731 tx.senderPublicKey
17921732 case _ =>
17931733 throw("Match error")
17941734 }
17951735 match tx {
17961736 case order: Order =>
17971737 let matcherPub = mp()
1798- let $t06042960546 = if (skipOrderValidation())
1738+ let $t05904859165 = if (skipOrderValidation())
17991739 then $Tuple2(true, "")
18001740 else validateMatcherOrderAllowed(order)
1801- let orderValid = $t06042960546._1
1802- let orderValidInfo = $t06042960546._2
1741+ let orderValid = $t05904859165._1
1742+ let orderValidInfo = $t05904859165._2
18031743 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
18041744 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
18051745 if (if (if (orderValid)
18061746 then senderValid
18071747 else false)
18081748 then matcherValid
18091749 else false)
18101750 then true
18111751 else throwOrderError(orderValid, orderValidInfo, senderValid, matcherValid)
18121752 case s: SetScriptTransaction =>
18131753 if (sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey))
18141754 then true
18151755 else {
18161756 let newHash = blake2b256(value(s.script))
18171757 let allowedHash = fromBase64String(value(getString(fca, keyAllowedLpStableScriptHash())))
18181758 let currentHash = scriptHash(this)
18191759 if ((allowedHash == newHash))
18201760 then (currentHash != newHash)
18211761 else false
18221762 }
18231763 case _ =>
18241764 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
18251765 }
18261766 }
18271767

github/deemru/w8io/026f985 
235.99 ms