tx · 9N9nNRsnWVTt1E5buq3R5Y62Zrt8o7uLBk9YxpqpMYS4

3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA:  -0.04000000 Waves

2023.03.22 22:27 [2501640] smart account 3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA > SELF 0.00000000 Waves

{ "type": 13, "id": "9N9nNRsnWVTt1E5buq3R5Y62Zrt8o7uLBk9YxpqpMYS4", "fee": 4000000, "feeAssetId": null, "timestamp": 1679513209695, "version": 2, "chainId": 84, "sender": "3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA", "senderPublicKey": "35yd3qw1gxKDxKwGAykHN9fANbXNWwseaUwbWDj24o3x", "proofs": [ "22HaeeKDNPddTpJ3Hfjd3Q6WXiJMsf824CWpjidLgexyKJfujJsuer3uwUQ85S3CMa3w3e7JgNnWDrE1JF6o1DQa" ], "script": "base64:BgKCKwgCEgUKAwEEARIHCgUBBAEIARIDCgEIEgMKAQgSABIECgIBBBIECgIBBBIDCgEBEgASBAoCCAESABIECgIIARIECgIIARIECgIBARIDCgEBEgUKAwEBARIFCgMBCAESBAoCAQgSBAoCAQgSBAoCCAgSBAoCCAgSBAoCCAESABIDCgEIEgUKAwEBARIECgIIARIECgIBARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCCIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiBGJpZzMiBGJpZzQiCnNsaXBwYWdlNEQiC3dhdmVzU3RyaW5nIgVBbXVsdCIFRGNvbnYiA1NFUCIFRU1QVFkiClBvb2xBY3RpdmUiClBvb2xQdXREaXMiDlBvb2xNYXRjaGVyRGlzIgxQb29sU2h1dGRvd24iDmlkeFBvb2xBZGRyZXNzIglpZHhQb29sU3QiCWlkeExQQXNJZCIJaWR4QW1Bc0lkIglpZHhQckFzSWQiC2lkeEFtdEFzRGNtIg1pZHhQcmljZUFzRGNtIgtpZHhJQ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BU9yZGVyBAJlWgUCZ2wEAmlsCQECYVcABAJpbQkBAmVZAQUCZVoEAmFGCAUCaW0CXzEEAmFHCAUCaW0CXzIEAmFICQD0AwMIBQJlWglib2R5Qnl0ZXMJAJEDAggFAmVaBnByb29mcwAACAUCZVoPc2VuZGVyUHVibGljS2V5BAJhSQkA9AMDCAUCZVoJYm9keUJ5dGVzCQCRAwIIBQJlWgZwcm9vZnMAAQUCaWwDAwMFAmFGBQJhSAcFAmFJBwYJAQJhRQQFAmFGBQJhRwUCYUgFAmFJAwkAAQIFAmdsAhRTZXRTY3JpcHRUcmFuc2FjdGlvbgQCY0MFAmdsAwkA9AMDCAUCaWkJYm9keUJ5dGVzCQCRAwIIBQJpaQZwcm9vZnMAAAUCaWsGBAJpbgkA9gMBCQEFdmFsdWUBCAUCY0MGc2NyaXB0BAJpbwkA2wQBCQEFdmFsdWUBCQCdCAIFAmFRCQECYUMABAJpcAkA8QcBBQR0aGlzAwkAAAIFAmlvBQJpbgkBAiE9AgUCaXAFAmluBwkA9AMDCAUCaWkJYm9keUJ5dGVzCQCRAwIIBQJpaQZwcm9vZnMAAAUCaWso85DP", "height": 2501640, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7v9S1gKw3hABhY9YnQkEaYJTKocjUq4R4T4RManfSJeR Next: BAQ5R5WWHG5zPXCgib15HoFnCu9GthriJKnwcfJASQ2d Diff:
OldNewDifferences
128128 func amp () = "%s__amp"
129129
130130
131-func keyAmpHistory (heightBlocks) = ("%s%d__amp__" + toString(heightBlocks))
132-
133-
134131 func ada () = "%s__addonAddr"
135-
136-
137-func keyChangeAmpLastCall () = "%s__changeAmpLastCall"
138132
139133
140134 let keyFee = "%s__fee"
170164
171165
172166 func keyFeeCollectorAddress () = "%s__feeCollectorAddress"
173-
174-
175-func keySkipOrderValidation (poolAddress) = ("%s%s__skipOrderValidation__" + poolAddress)
176167
177168
178169 func throwOrderError (orderValid,orderValidInfo,senderValid,matcherValid) = throw((((((((("order validation failed: orderValid=" + toString(orderValid)) + " (") + orderValidInfo) + ")") + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
240231
241232 let poolConfigParsed = parsePoolConfig(gpc())
242233
243-let $t081938404 = poolConfigParsed
234+let $t079658194 = poolConfigParsed
244235
245-let cfgPoolAddress = $t081938404._1
236+let cfgPoolAddress = $t079658194._1
246237
247-let cfgPoolStatus = $t081938404._2
238+let cfgPoolStatus = $t079658194._2
248239
249-let cfgLpAssetId = $t081938404._3
240+let cfgLpAssetId = $t079658194._3
250241
251-let cfgAmountAssetId = $t081938404._4
242+let cfgAmountAssetId = $t079658194._4
252243
253-let cfgPriceAssetId = $t081938404._5
244+let cfgPriceAssetId = $t079658194._5
254245
255-let cfgAmountAssetDecimals = $t081938404._6
246+let cfgAmountAssetDecimals = $t079658194._6
256247
257-let cfgPriceAssetDecimals = $t081938404._7
248+let cfgPriceAssetDecimals = $t079658194._7
258249
259-let cfgInAmountAssedId = $t081938404._8
250+let cfgInAmountAssedId = $t079658194._8
260251
261-let cfgInPriceAssetId = $t081938404._9
252+let cfgInPriceAssetId = $t079658194._9
262253
263254 func gfc () = split(strf(fca, fcfg()), SEP)
264255
378369 else $Tuple2(dNext, false)
379370 }
380371
381- let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
382- let $t01289112939 = {
372+ let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
373+ let $t01270312751 = {
383374 let $l = arr
384375 let $s = size($l)
385376 let $acc0 = $Tuple2(s, false)
389380
390381 func $f0_2 ($a,$i) = if (($i >= $s))
391382 then $a
392- else throw("List size exceeds 17")
383+ else throw("List size exceeds 18")
393384
394- $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)
385+ $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($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), 18)
395386 }
396- let d = $t01289112939._1
397- let found = $t01289112939._2
387+ let d = $t01270312751._1
388+ let found = $t01270312751._2
398389 if (found)
399390 then d
400391 else throw(("D calculation error, D = " + toString(d)))
530521 else calcLpAmt
531522 let amDiff = (inAmAmt - calcAmAssetPmt)
532523 let prDiff = (inPrAmt - calcPrAssetPmt)
533- let $t01992420117 = if (if (isOneAsset)
524+ let $t02059020935 = if (if (isOneAsset)
534525 then (pmtId == amIdStr)
535526 else false)
536527 then $Tuple2(pmtAmt, 0)
539530 else false)
540531 then $Tuple2(0, pmtAmt)
541532 else $Tuple2(calcAmAssetPmt, calcPrAssetPmt)
542- let writeAmAmt = $t01992420117._1
543- let writePrAmt = $t01992420117._2
533+ let writeAmAmt = $t02059020935._1
534+ let writePrAmt = $t02059020935._2
544535 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))]
545536 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId)
546537 }
559550 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
560551 let b = ((s + ((D * aPrecision) / ann)) - D)
561552 func calc (acc,cur) = {
562- let $t02130821328 = acc
563- let y = $t02130821328._1
564- let found = $t02130821328._2
553+ let $t02213022150 = acc
554+ let y = $t02213022150._1
555+ let found = $t02213022150._2
565556 if ((found != unit))
566557 then acc
567558 else {
574565 }
575566
576567 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
577- let $t02163521682 = {
568+ let $t02245722504 = {
578569 let $l = arr
579570 let $s = size($l)
580571 let $acc0 = $Tuple2(D, unit)
588579
589580 $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)
590581 }
591- let y = $t02163521682._1
592- let found = $t02163521682._2
582+ let y = $t02245722504._1
583+ let found = $t02245722504._2
593584 if ((found != unit))
594585 then y
595586 else throw(("Y calculation error, Y = " + toString(y)))
633624 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
634625 let amountAssetAmount = order.amount
635626 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
636- let $t02388024092 = if ((order.orderType == Buy))
627+ let $t02470224914 = if ((order.orderType == Buy))
637628 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
638629 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
639- let amountAssetBalanceDelta = $t02388024092._1
640- let priceAssetBalanceDelta = $t02388024092._2
630+ let amountAssetBalanceDelta = $t02470224914._1
631+ let priceAssetBalanceDelta = $t02470224914._2
641632 if (if (if (igs())
642633 then true
643634 else (cfgPoolStatus == PoolMatcherDis))
650641 then throw("Wr assets")
651642 else {
652643 let dLp = parseBigIntValue(valueOrElse(getString(this, keyDLp), "0"))
653- let $t02443824538 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
654- let unusedActions = $t02443824538._1
655- let dLpNew = $t02443824538._2
644+ let $t02525625356 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
645+ let unusedActions = $t02525625356._1
646+ let dLpNew = $t02525625356._2
656647 let isOrderValid = (dLpNew >= dLp)
657648 let info = makeString(["dLp=", toString(dLp), " dLpNew=", toString(dLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "")
658649 $Tuple2(isOrderValid, info)
706697 then {
707698 let amBalance = getAccBalance(amId)
708699 let prBalance = getAccBalance(prId)
709- let $t02688627330 = if ((txId == ""))
700+ let $t02801228474 = if ((txId == ""))
710701 then $Tuple2(amBalance, prBalance)
711702 else if ((pmtAssetId == amId))
712703 then if ((pmtAmtRaw > amBalance))
717708 then throw("invalid payment amount")
718709 else $Tuple2(amBalance, (prBalance - pmtAmtRaw))
719710 else throw("wrong pmtAssetId")
720- let amBalanceOld = $t02688627330._1
721- let prBalanceOld = $t02688627330._2
722- let $t02733427510 = if ((pmtAssetId == amId))
711+ let amBalanceOld = $t02801228474._1
712+ let prBalanceOld = $t02801228474._2
713+ let $t02848028656 = if ((pmtAssetId == amId))
723714 then $Tuple2(pmtAmtRaw, 0)
724715 else if ((pmtAssetId == prId))
725716 then $Tuple2(0, pmtAmtRaw)
726717 else throw("invalid payment")
727- let amAmountRaw = $t02733427510._1
728- let prAmountRaw = $t02733427510._2
729- let $t02751427768 = if (withTakeFee)
718+ let amAmountRaw = $t02848028656._1
719+ let prAmountRaw = $t02848028656._2
720+ let $t02866028914 = if (withTakeFee)
730721 then $Tuple3(takeFee(amAmountRaw, inFee)._1, takeFee(prAmountRaw, inFee)._1, takeFee(pmtAmtRaw, inFee)._2)
731722 else $Tuple3(amAmountRaw, prAmountRaw, 0)
732- let amAmount = $t02751427768._1
733- let prAmount = $t02751427768._2
734- let feeAmount = $t02751427768._3
723+ let amAmount = $t02866028914._1
724+ let prAmount = $t02866028914._2
725+ let feeAmount = $t02866028914._3
735726 let amBalanceNew = (amBalanceOld + amAmount)
736727 let prBalanceNew = (prBalanceOld + prAmount)
737728 let D0 = getD([t1(amBalanceOld, cfgAmountAssetDecimals), t1(prBalanceOld, cfgPriceAssetDecimals)])
779770 else {
780771 let amBalance = getAccBalance(amId)
781772 let prBalance = getAccBalance(prId)
782- let $t02988429995 = {
773+ let $t03102631137 = {
783774 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil)
784775 if ($isInstanceOf(@, "(Int, Int)"))
785776 then @
786777 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
787778 }
788- if (($t02988429995 == $t02988429995))
779+ if (($t03102631137 == $t03102631137))
789780 then {
790- let feeAmount = $t02988429995._2
791- let totalGet = $t02988429995._1
781+ let feeAmount = $t03102631137._2
782+ let totalGet = $t03102631137._1
792783 let totalAmount = if (if ((minOutAmount > 0))
793784 then (minOutAmount > totalGet)
794785 else false)
795786 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
796787 else totalGet
797- let $t03019330512 = if ((outAssetId == amId))
788+ let $t03132731634 = if ((outAssetId == amId))
798789 then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance)
799790 else if ((outAssetId == prId))
800791 then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount))
801792 else throw("invalid out asset id")
802- let outAm = $t03019330512._1
803- let outPr = $t03019330512._2
804- let amBalanceNew = $t03019330512._3
805- let prBalanceNew = $t03019330512._4
793+ let outAm = $t03132731634._1
794+ let outPr = $t03132731634._2
795+ let amBalanceNew = $t03132731634._3
796+ let prBalanceNew = $t03132731634._4
806797 let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals))
807798 let curPr = f1(curPrX18, scale8)
808799 let outAssetIdOrWaves = if ((outAssetId == "WAVES"))
817808 let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
818809 if ((burn == burn))
819810 then {
820- let $t03132731685 = {
811+ let $t03241932769 = {
821812 let feeAmountForCalc = if ((this == feeCollectorAddress))
822813 then 0
823814 else feeAmount
828819 then $Tuple2(-((totalGet + feeAmountForCalc)), 0)
829820 else $Tuple2(0, -((totalGet + feeAmountForCalc)))
830821 }
831- let amountAssetBalanceDelta = $t03132731685._1
832- let priceAssetBalanceDelta = $t03132731685._2
833- let $t03169031798 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
834- let refreshDLpActions = $t03169031798._1
835- let updatedDLp = $t03169031798._2
822+ let amountAssetBalanceDelta = $t03241932769._1
823+ let priceAssetBalanceDelta = $t03241932769._2
824+ let $t03277232880 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
825+ let refreshDLpActions = $t03277232880._1
826+ let updatedDLp = $t03277232880._2
836827 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
837828 if ((isUpdatedDLpValid == isUpdatedDLpValid))
838829 then $Tuple2((state ++ refreshDLpActions), totalAmount)
911902 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
912903 let b = ((s + ((D * aPrecision) / ann)) - D)
913904 func calc (acc,cur) = {
914- let $t03324633266 = acc
915- let y = $t03324633266._1
916- let found = $t03324633266._2
905+ let $t03432734347 = acc
906+ let y = $t03432734347._1
907+ let found = $t03432734347._2
917908 if ((found != unit))
918909 then acc
919910 else {
926917 }
927918
928919 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
929- let $t03357333620 = {
920+ let $t03467834725 = {
930921 let $l = arr
931922 let $s = size($l)
932923 let $acc0 = $Tuple2(D, unit)
940931
941932 $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)
942933 }
943- let y = $t03357333620._1
944- let found = $t03357333620._2
934+ let y = $t03467834725._1
935+ let found = $t03467834725._2
945936 if ((found != unit))
946937 then y
947938 else throw(("Y calculation error, Y = " + toString(y)))
948939 }
949940
950941
951-func skipOrderValidation () = valueOrElse(getBoolean(fca, keySkipOrderValidation(toString(this))), false)
952-
953-
954942 @Callable(i)
955943 func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = {
956- let $t03396134384 = if ((isReverse == false))
944+ let $t03496635390 = if ((isReverse == false))
957945 then {
958946 let assetOut = strf(this, pa())
959947 let poolAmountInBalance = (toBigInt(getAccBalance(strf(this, aa()))) + toBigInt(cleanAmountIn))
964952 let poolAmountInBalance = (toBigInt(getAccBalance(strf(this, pa()))) + toBigInt(cleanAmountIn))
965953 $Tuple2(assetOut, poolAmountInBalance)
966954 }
967- let assetOut = $t03396134384._1
968- let poolAmountInBalance = $t03396134384._2
955+ let assetOut = $t03496635390._1
956+ let poolAmountInBalance = $t03496635390._2
969957 let poolConfig = gpc()
970958 let amId = poolConfig[idxAmAsId]
971959 let prId = poolConfig[idxPrAsId]
1005993 then {
1006994 let pmt = value(i.payments[0])
1007995 let assetIn = assetIdToString(pmt.assetId)
1008- let $t03581336206 = if ((isReverse == false))
996+ let $t03682637220 = if ((isReverse == false))
1009997 then {
1010998 let assetOut = strf(this, pa())
1011999 let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
10161004 let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
10171005 $Tuple2(assetOut, poolAmountInBalance)
10181006 }
1019- let assetOut = $t03581336206._1
1020- let poolAmountInBalance = $t03581336206._2
1007+ let assetOut = $t03682637220._1
1008+ let poolAmountInBalance = $t03682637220._2
10211009 let poolConfig = gpc()
10221010 let amId = poolConfig[idxAmAsId]
10231011 let prId = poolConfig[idxPrAsId]
11571145 else throw("Strict value is not equal to itself.")
11581146 }
11591147 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
1160- let $t04060540747 = refreshDLpInternal(0, 0, 0)
1161- let refreshDLpActions = $t04060540747._1
1162- let updatedDLp = $t04060540747._2
1148+ let $t04183941981 = refreshDLpInternal(0, 0, 0)
1149+ let refreshDLpActions = $t04183941981._1
1150+ let updatedDLp = $t04183941981._2
11631151 let check = if ((updatedDLp >= currentDLp))
11641152 then true
11651153 else throwErr(makeString(["updated DLp lower than current DLp", toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentDLp), toString(updatedDLp), toString(amDiff), toString(prDiff)], " "))
12321220 else calcCurrentDLp(toBigInt(0), toBigInt(pmtAmt), toBigInt(0))
12331221 if ((currentDLp == currentDLp))
12341222 then {
1235- let $t04238842546 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1236- if (($t04238842546 == $t04238842546))
1223+ let $t04362243780 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1224+ if (($t04362243780 == $t04362243780))
12371225 then {
1238- let feeAmount = $t04238842546._3
1239- let state = $t04238842546._2
1240- let estimLP = $t04238842546._1
1226+ let feeAmount = $t04362243780._3
1227+ let state = $t04362243780._2
1228+ let estimLP = $t04362243780._1
12411229 let emitLpAmt = if (if ((minOutAmount > 0))
12421230 then (minOutAmount > estimLP)
12431231 else false)
12561244 then {
12571245 let lpTrnsfr = if (autoStake)
12581246 then {
1259- let ss = invoke(stakingContract, "stakeFor", [toString(i.caller)], [AttachedPayment(lpId, emitLpAmt)])
1247+ let ss = invoke(stakingContract, "stake", nil, [AttachedPayment(lpId, emitLpAmt)])
12601248 if ((ss == ss))
12611249 then nil
12621250 else throw("Strict value is not equal to itself.")
12651253 let sendFeeToMatcher = if ((feeAmount > 0))
12661254 then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))]
12671255 else nil
1268- let $t04341543762 = if ((this == feeCollectorAddress))
1256+ let $t04459544944 = if ((this == feeCollectorAddress))
12691257 then $Tuple2(0, 0)
12701258 else {
12711259 let paymentInAmountAsset = if ((pmt.assetId == cfgAmountAssetId))
12751263 then $Tuple2(-(feeAmount), 0)
12761264 else $Tuple2(0, -(feeAmount))
12771265 }
1278- let amountAssetBalanceDelta = $t04341543762._1
1279- let priceAssetBalanceDelta = $t04341543762._2
1280- let $t04376543873 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1281- let refreshDLpActions = $t04376543873._1
1282- let updatedDLp = $t04376543873._2
1266+ let amountAssetBalanceDelta = $t04459544944._1
1267+ let priceAssetBalanceDelta = $t04459544944._2
1268+ let $t04494745055 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1269+ let refreshDLpActions = $t04494745055._1
1270+ let updatedDLp = $t04494745055._2
12831271 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
12841272 if ((isUpdatedDLpValid == isUpdatedDLpValid))
12851273 then $Tuple2((((state ++ lpTrnsfr) ++ sendFeeToMatcher) ++ refreshDLpActions), emitLpAmt)
13111299 let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0))
13121300 if ((currentDLp == currentDLp))
13131301 then {
1314- let $t04470544770 = refreshDLpInternal(0, 0, 0)
1315- let refreshDLpActions = $t04470544770._1
1316- let updatedDLp = $t04470544770._2
1302+ let $t04608546150 = refreshDLpInternal(0, 0, 0)
1303+ let refreshDLpActions = $t04608546150._1
1304+ let updatedDLp = $t04608546150._2
13171305 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
13181306 if ((isUpdatedDLpValid == isUpdatedDLpValid))
13191307 then (state ++ refreshDLpActions)
13381326 let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
13391327 if ((b == b))
13401328 then {
1341- let $t04587345955 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1342- let refreshDLpActions = $t04587345955._1
1343- let updatedDLp = $t04587345955._2
1329+ let $t04732347405 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1330+ let refreshDLpActions = $t04732347405._1
1331+ let updatedDLp = $t04732347405._2
13441332 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
13451333 if ((isUpdatedDLpValid == isUpdatedDLpValid))
13461334 then (state ++ refreshDLpActions)
13751363 else throwErr("exactly 1 payment are expected")]
13761364 if ((checks == checks))
13771365 then {
1378- let $t04657346728 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1379- let state = $t04657346728._1
1380- let totalAmount = $t04657346728._2
1366+ let $t04802348178 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1367+ let state = $t04802348178._1
1368+ let totalAmount = $t04802348178._2
13811369 $Tuple2(state, totalAmount)
13821370 }
13831371 else throw("Strict value is not equal to itself.")
13941382 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
13951383 then {
13961384 let dLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyDLp), "0")), fmtErr("invalid dLp"))
1397- let $t04724647310 = refreshDLpInternal(0, 0, 0)
1398- let dLpUpdateActions = $t04724647310._1
1399- let updatedDLp = $t04724647310._2
1385+ let $t04870248766 = refreshDLpInternal(0, 0, 0)
1386+ let dLpUpdateActions = $t04870248766._1
1387+ let updatedDLp = $t04870248766._2
14001388 let actions = if ((dLp != updatedDLp))
14011389 then dLpUpdateActions
14021390 else throwErr("nothing to refresh")
14241412 let newY = getYD(xp, index, D1)
14251413 let dy = (xp[index] - newY)
14261414 let totalGetRaw = max([0, toInt((dy - big1))])
1427- let $t04832048375 = takeFee(totalGetRaw, outFee)
1428- let totalGet = $t04832048375._1
1429- let feeAmount = $t04832048375._2
1415+ let $t04977649831 = takeFee(totalGetRaw, outFee)
1416+ let totalGet = $t04977649831._1
1417+ let feeAmount = $t04977649831._2
14301418 $Tuple2(nil, $Tuple2(totalGet, feeAmount))
14311419 }
14321420
14391427 let lpId = toBase58String(value(cfgLpAssetId))
14401428 let amBalance = getAccBalance(amId)
14411429 let prBalance = getAccBalance(prId)
1442- let $t04875048865 = {
1430+ let $t05020650321 = {
14431431 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil)
14441432 if ($isInstanceOf(@, "(Int, Int)"))
14451433 then @
14461434 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
14471435 }
1448- let totalGet = $t04875048865._1
1449- let feeAmount = $t04875048865._2
1436+ let totalGet = $t05020650321._1
1437+ let feeAmount = $t05020650321._2
14501438 let r = ego("", lpId, lpAssetAmount, this)
14511439 let outAmAmt = r._1
14521440 let outPrAmt = r._2
14801468 let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14811469 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14821470 then {
1483- let $t04994550026 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1484- let refreshDLpActions = $t04994550026._1
1485- let updatedDLp = $t04994550026._2
1471+ let $t05148751568 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1472+ let refreshDLpActions = $t05148751568._1
1473+ let updatedDLp = $t05148751568._2
14861474 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
14871475 if ((isUpdatedDLpValid == isUpdatedDLpValid))
14881476 then (state ++ refreshDLpActions)
15271515 let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
15281516 if ((burnA == burnA))
15291517 then {
1530- let $t05105751138 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1531- let refreshDLpActions = $t05105751138._1
1532- let updatedDLp = $t05105751138._2
1518+ let $t05259552676 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1519+ let refreshDLpActions = $t05259552676._1
1520+ let updatedDLp = $t05259552676._2
15331521 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
15341522 if ((isUpdatedDLpValid == isUpdatedDLpValid))
15351523 then (state ++ refreshDLpActions)
15801568 let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
15811569 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15821570 then {
1583- let $t05238952470 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1584- let refreshDLpActions = $t05238952470._1
1585- let updatedDLp = $t05238952470._2
1571+ let $t05392754008 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1572+ let refreshDLpActions = $t05392754008._1
1573+ let updatedDLp = $t05392754008._2
15861574 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
15871575 if ((isUpdatedDLpValid == isUpdatedDLpValid))
15881576 then (state ++ refreshDLpActions)
16311619 let unstakeInv = invoke(staking, "unstakeINTERNAL", [lpAssetId, unstakeAmount, userAddress.bytes, lpAssetRecipientAddress.bytes], nil)
16321620 if ((unstakeInv == unstakeInv))
16331621 then {
1634- let $t05349253680 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1635- let state = $t05349253680._1
1636- let totalAmount = $t05349253680._2
1622+ let $t05503055218 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1623+ let state = $t05503055218._1
1624+ let totalAmount = $t05503055218._2
16371625 $Tuple2(state, totalAmount)
16381626 }
16391627 else throw("Strict value is not equal to itself.")
16451633
16461634 @Callable(i)
16471635 func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = {
1648- let $t05380853911 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1649- let lpAmount = $t05380853911._1
1650- let state = $t05380853911._2
1651- let feeAmount = $t05380853911._3
1652- let bonus = $t05380853911._4
1636+ let $t05534655449 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1637+ let lpAmount = $t05534655449._1
1638+ let state = $t05534655449._2
1639+ let feeAmount = $t05534655449._3
1640+ let bonus = $t05534655449._4
16531641 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
16541642 }
16551643
16571645
16581646 @Callable(i)
16591647 func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = {
1660- let $t05405954163 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1661- let lpAmount = $t05405954163._1
1662- let state = $t05405954163._2
1663- let feeAmount = $t05405954163._3
1664- let bonus = $t05405954163._4
1648+ let $t05559755701 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1649+ let lpAmount = $t05559755701._1
1650+ let state = $t05559755701._2
1651+ let feeAmount = $t05559755701._3
1652+ let bonus = $t05559755701._4
16651653 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
16661654 }
16671655
17331721 }
17341722
17351723
1736-
1737-@Callable(i)
1738-func changeAmp () = {
1739- let cfg = invoke(fca, "getChangeAmpConfigREADONLY", [toString(this)], nil)
1740- let $t05683057026 = match cfg {
1741- case list: List[Any] =>
1742- $Tuple3({
1743- let @ = list[0]
1744- if ($isInstanceOf(@, "Int"))
1745- then @
1746- else throw(($getType(@) + " couldn't be cast to Int"))
1747- }, {
1748- let @ = list[1]
1749- if ($isInstanceOf(@, "Int"))
1750- then @
1751- else throw(($getType(@) + " couldn't be cast to Int"))
1752- }, {
1753- let @ = list[2]
1754- if ($isInstanceOf(@, "Int"))
1755- then @
1756- else throw(($getType(@) + " couldn't be cast to Int"))
1757- })
1758- case _ =>
1759- throw("invalid entry type")
1760- }
1761- let delay = $t05683057026._1
1762- let delta = $t05683057026._2
1763- let target = $t05683057026._3
1764- let curAmp = parseIntValue(getStringValue(amp()))
1765- let newAmpRaw = (curAmp + delta)
1766- let newAmp = if ((0 > delta))
1767- then if ((target > newAmpRaw))
1768- then target
1769- else newAmpRaw
1770- else if ((newAmpRaw > target))
1771- then target
1772- else newAmpRaw
1773- let lastCall = valueOrElse(getInteger(keyChangeAmpLastCall()), 0)
1774- let wait = (lastCall + delay)
1775- let checks = [if ((height > wait))
1776- then true
1777- else throwErr("try again in few blocks"), if ((curAmp != newAmp))
1778- then true
1779- else throwErr("already reached target")]
1780- if ((checks == checks))
1781- then [IntegerEntry(keyChangeAmpLastCall(), height), StringEntry(amp(), toString(newAmp)), StringEntry(keyAmpHistory(height), toString(newAmp))]
1782- else throw("Strict value is not equal to itself.")
1783- }
1784-
1785-
17861724 @Verifier(tx)
17871725 func verify () = {
17881726 let targetPublicKey = match m() {
17961734 match tx {
17971735 case order: Order =>
17981736 let matcherPub = mp()
1799- let $t05793858055 = if (skipOrderValidation())
1800- then $Tuple2(true, "")
1801- else validateMatcherOrderAllowed(order)
1802- let orderValid = $t05793858055._1
1803- let orderValidInfo = $t05793858055._2
1737+ let $t05849358562 = validateMatcherOrderAllowed(order)
1738+ let orderValid = $t05849358562._1
1739+ let orderValidInfo = $t05849358562._2
18041740 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
18051741 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
18061742 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"
2525
2626 let Amult = "100"
2727
2828 let Dconv = "1"
2929
3030 let SEP = "__"
3131
3232 let EMPTY = ""
3333
3434 let PoolActive = 1
3535
3636 let PoolPutDis = 2
3737
3838 let PoolMatcherDis = 3
3939
4040 let PoolShutdown = 4
4141
4242 let idxPoolAddress = 1
4343
4444 let idxPoolSt = 2
4545
4646 let idxLPAsId = 3
4747
4848 let idxAmAsId = 4
4949
5050 let idxPrAsId = 5
5151
5252 let idxAmtAsDcm = 6
5353
5454 let idxPriceAsDcm = 7
5555
5656 let idxIAmtAsId = 8
5757
5858 let idxIPriceAsId = 9
5959
6060 let idxFactStakCntr = 1
6161
6262 let idxFactoryRestCntr = 6
6363
6464 let idxFactSlippCntr = 7
6565
6666 let idxFactGwxRewCntr = 10
6767
6868 let feeDefault = fraction(10, scale8, 10000)
6969
7070 func t1 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
7171
7272
7373 func t1BigInt (origVal,origScaleMult) = fraction(origVal, scale18, origScaleMult)
7474
7575
7676 func f1 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
7777
7878
7979 func fromX18Round (val,resultScaleMult,round) = toInt(fraction(val, toBigInt(resultScaleMult), scale18, round))
8080
8181
8282 func t2 (origVal,origScaleMult) = fraction(origVal, scale18, toBigInt(origScaleMult))
8383
8484
8585 func f2 (val,resultScaleMult) = fraction(val, toBigInt(resultScaleMult), scale18)
8686
8787
8888 func ts (amt,resScale,curScale) = fraction(amt, resScale, curScale)
8989
9090
9191 func abs (val) = if ((zeroBigInt > val))
9292 then -(val)
9393 else val
9494
9595
9696 func absBigInt (val) = if ((zeroBigInt > val))
9797 then -(val)
9898 else val
9999
100100
101101 func fc () = "%s__factoryContract"
102102
103103
104104 func mpk () = "%s__managerPublicKey"
105105
106106
107107 func pmpk () = "%s__pendingManagerPublicKey"
108108
109109
110110 func pl () = "%s%s__price__last"
111111
112112
113113 func ph (h,t) = makeString(["%s%s%d%d__price__history", toString(h), toString(t)], SEP)
114114
115115
116116 func pau (ua,txId) = ((("%s%s%s__P__" + ua) + "__") + txId)
117117
118118
119119 func gau (ua,txId) = ((("%s%s%s__G__" + ua) + "__") + txId)
120120
121121
122122 func aa () = "%s__amountAsset"
123123
124124
125125 func pa () = "%s__priceAsset"
126126
127127
128128 func amp () = "%s__amp"
129129
130130
131-func keyAmpHistory (heightBlocks) = ("%s%d__amp__" + toString(heightBlocks))
132-
133-
134131 func ada () = "%s__addonAddr"
135-
136-
137-func keyChangeAmpLastCall () = "%s__changeAmpLastCall"
138132
139133
140134 let keyFee = "%s__fee"
141135
142136 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
143137
144138 let keyDLp = makeString(["%s", "dLp"], SEP)
145139
146140 let keyDLpRefreshedHeight = makeString(["%s", "dLpRefreshedHeight"], SEP)
147141
148142 let keyDLpRefreshDelay = makeString(["%s", "refreshDLpDelay"], SEP)
149143
150144 let dLpRefreshDelayDefault = 30
151145
152146 let dLpRefreshDelay = valueOrElse(getInteger(this, keyDLpRefreshDelay), dLpRefreshDelayDefault)
153147
154148 func fcfg () = "%s__factoryConfig"
155149
156150
157151 func mtpk () = "%s%s__matcher__publicKey"
158152
159153
160154 func pc (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config")
161155
162156
163157 func mba (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr)
164158
165159
166160 func aps () = "%s__shutdown"
167161
168162
169163 func keyAllowedLpStableScriptHash () = "%s__allowedLpStableScriptHash"
170164
171165
172166 func keyFeeCollectorAddress () = "%s__feeCollectorAddress"
173-
174-
175-func keySkipOrderValidation (poolAddress) = ("%s%s__skipOrderValidation__" + poolAddress)
176167
177168
178169 func throwOrderError (orderValid,orderValidInfo,senderValid,matcherValid) = throw((((((((("order validation failed: orderValid=" + toString(orderValid)) + " (") + orderValidInfo) + ")") + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
179170
180171
181172 func strf (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
182173
183174
184175 func intf (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
185176
186177
187178 func throwErr (msg) = throw(makeString(["lp_stable.ride:", msg], " "))
188179
189180
190181 func fmtErr (msg) = makeString(["lp_stable.ride:", msg], " ")
191182
192183
193184 let fca = addressFromStringValue(strf(this, fc()))
194185
195186 let inFee = {
196187 let @ = invoke(fca, "getInFeeREADONLY", [toString(this)], nil)
197188 if ($isInstanceOf(@, "Int"))
198189 then @
199190 else throw(($getType(@) + " couldn't be cast to Int"))
200191 }
201192
202193 let outFee = {
203194 let @ = invoke(fca, "getOutFeeREADONLY", [toString(this)], nil)
204195 if ($isInstanceOf(@, "Int"))
205196 then @
206197 else throw(($getType(@) + " couldn't be cast to Int"))
207198 }
208199
209200 let A = strf(this, amp())
210201
211202 func igs () = valueOrElse(getBoolean(fca, aps()), false)
212203
213204
214205 func mp () = fromBase58String(strf(fca, mtpk()))
215206
216207
217208 let feeCollectorAddress = addressFromStringValue(strf(fca, keyFeeCollectorAddress()))
218209
219210 func gpc () = {
220211 let amtAs = strf(this, aa())
221212 let priceAs = strf(this, pa())
222213 let iPriceAs = intf(fca, mba(priceAs))
223214 let iAmtAs = intf(fca, mba(amtAs))
224215 split(strf(fca, pc(toString(iAmtAs), toString(iPriceAs))), SEP)
225216 }
226217
227218
228219 func parseAssetId (input) = if ((input == wavesString))
229220 then unit
230221 else fromBase58String(input)
231222
232223
233224 func assetIdToString (input) = if ((input == unit))
234225 then wavesString
235226 else toBase58String(value(input))
236227
237228
238229 func parsePoolConfig (poolConfig) = $Tuple9(addressFromStringValue(poolConfig[idxPoolAddress]), parseIntValue(poolConfig[idxPoolSt]), fromBase58String(poolConfig[idxLPAsId]), parseAssetId(poolConfig[idxAmAsId]), parseAssetId(poolConfig[idxPrAsId]), parseIntValue(poolConfig[idxAmtAsDcm]), parseIntValue(poolConfig[idxPriceAsDcm]), fromBase58String(poolConfig[idxIAmtAsId]), fromBase58String(poolConfig[idxIPriceAsId]))
239230
240231
241232 let poolConfigParsed = parsePoolConfig(gpc())
242233
243-let $t081938404 = poolConfigParsed
234+let $t079658194 = poolConfigParsed
244235
245-let cfgPoolAddress = $t081938404._1
236+let cfgPoolAddress = $t079658194._1
246237
247-let cfgPoolStatus = $t081938404._2
238+let cfgPoolStatus = $t079658194._2
248239
249-let cfgLpAssetId = $t081938404._3
240+let cfgLpAssetId = $t079658194._3
250241
251-let cfgAmountAssetId = $t081938404._4
242+let cfgAmountAssetId = $t079658194._4
252243
253-let cfgPriceAssetId = $t081938404._5
244+let cfgPriceAssetId = $t079658194._5
254245
255-let cfgAmountAssetDecimals = $t081938404._6
246+let cfgAmountAssetDecimals = $t079658194._6
256247
257-let cfgPriceAssetDecimals = $t081938404._7
248+let cfgPriceAssetDecimals = $t079658194._7
258249
259-let cfgInAmountAssedId = $t081938404._8
250+let cfgInAmountAssedId = $t079658194._8
260251
261-let cfgInPriceAssetId = $t081938404._9
252+let cfgInPriceAssetId = $t079658194._9
262253
263254 func gfc () = split(strf(fca, fcfg()), SEP)
264255
265256
266257 let factoryConfig = gfc()
267258
268259 let stakingContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactStakCntr]), "Invalid staking contract address")
269260
270261 let slipageContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactSlippCntr]), "Invalid slipage contract address")
271262
272263 let gwxContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactGwxRewCntr]), "Invalid gwx contract address")
273264
274265 let restContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactoryRestCntr]), "Invalid gwx contract address")
275266
276267 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)
277268
278269
279270 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)
280271
281272
282273 func getAccBalance (assetId) = if ((assetId == "WAVES"))
283274 then wavesBalance(this).available
284275 else assetBalance(this, fromBase58String(assetId))
285276
286277
287278 func cpbi (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
288279
289280
290281 func cpbir (prAmtX18,amAmtX18,round) = fraction(prAmtX18, scale18, amAmtX18, round)
291282
292283
293284 func vad (A1,A2,slippage) = {
294285 let diff = fraction((A1 - A2), scale8BigInt, A2)
295286 let pass = ((slippage - abs(diff)) > zeroBigInt)
296287 if (!(pass))
297288 then throw(("Big slpg: " + toString(diff)))
298289 else $Tuple2(pass, min([A1, A2]))
299290 }
300291
301292
302293 func vd (D1,D0,slpg) = {
303294 let diff = fraction(D0, scale8BigInt, D1)
304295 let fail = (slpg > diff)
305296 if (if (fail)
306297 then true
307298 else (D0 > D1))
308299 then throw(((((((toString(D0) + " ") + toString(D1)) + " ") + toString(diff)) + " ") + toString(slpg)))
309300 else fail
310301 }
311302
312303
313304 func pcp (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
314305 let amtAsAmtX18 = t1(amAmt, amAssetDcm)
315306 let prAsAmtX18 = t1(prAmt, prAssetDcm)
316307 cpbi(prAsAmtX18, amtAsAmtX18)
317308 }
318309
319310
320311 func calcPrices (amAmt,prAmt,lpAmt) = {
321312 let amtAsDcm = cfgAmountAssetDecimals
322313 let prAsDcm = cfgPriceAssetDecimals
323314 let priceX18 = pcp(amtAsDcm, prAsDcm, amAmt, prAmt)
324315 let amAmtX18 = t1(amAmt, amtAsDcm)
325316 let prAmtX18 = t1(prAmt, prAsDcm)
326317 let lpAmtX18 = t1(lpAmt, scale8)
327318 let lpPrInAmAsX18 = cpbi(amAmtX18, lpAmtX18)
328319 let lpPrInPrAsX18 = cpbi(prAmtX18, lpAmtX18)
329320 [priceX18, lpPrInAmAsX18, lpPrInPrAsX18]
330321 }
331322
332323
333324 func calculatePrices (amAmt,prAmt,lpAmt) = {
334325 let p = calcPrices(amAmt, prAmt, lpAmt)
335326 [f1(p[0], scale8), f1(p[1], scale8), f1(p[2], scale8)]
336327 }
337328
338329
339330 func takeFee (amount,fee) = {
340331 let feeAmount = if ((fee == 0))
341332 then 0
342333 else fraction(amount, fee, scale8)
343334 $Tuple2((amount - feeAmount), feeAmount)
344335 }
345336
346337
347338 func getD (xp) = {
348339 let xp0 = xp[0]
349340 let xp1 = xp[1]
350341 let s = (xp0 + xp1)
351342 if ((s == big0))
352343 then big0
353344 else {
354345 let a = parseIntValue(A)
355346 let ann = (a * 2)
356347 let p = fraction(xp0, xp1, big1)
357348 let xp0_xp1_n_n = fraction(p, big4, big1)
358349 let ann_s = fraction(toBigInt(ann), s, big1)
359350 let ann_1 = toBigInt((ann - 1))
360351 func calcDNext (d) = {
361352 let dd = fraction(d, d, big1)
362353 let ddd = fraction(dd, d, big1)
363354 let dp = fraction(ddd, big1, xp0_xp1_n_n)
364355 fraction((ann_s + fraction(dp, big2, big1)), d, (fraction(ann_1, d, big1) + fraction(big3, dp, big1)))
365356 }
366357
367358 func calc (acc,i) = if (acc._2)
368359 then acc
369360 else {
370361 let d = acc._1
371362 let dNext = calcDNext(d)
372363 let dDiffRaw = (dNext - value(d))
373364 let dDiff = if ((big0 > dDiffRaw))
374365 then -(dDiffRaw)
375366 else dDiffRaw
376367 if ((big1 >= dDiff))
377368 then $Tuple2(dNext, true)
378369 else $Tuple2(dNext, false)
379370 }
380371
381- let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
382- let $t01289112939 = {
372+ let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
373+ let $t01270312751 = {
383374 let $l = arr
384375 let $s = size($l)
385376 let $acc0 = $Tuple2(s, false)
386377 func $f0_1 ($a,$i) = if (($i >= $s))
387378 then $a
388379 else calc($a, $l[$i])
389380
390381 func $f0_2 ($a,$i) = if (($i >= $s))
391382 then $a
392- else throw("List size exceeds 17")
383+ else throw("List size exceeds 18")
393384
394- $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)
385+ $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($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), 18)
395386 }
396- let d = $t01289112939._1
397- let found = $t01289112939._2
387+ let d = $t01270312751._1
388+ let found = $t01270312751._2
398389 if (found)
399390 then d
400391 else throw(("D calculation error, D = " + toString(d)))
401392 }
402393 }
403394
404395
405396 func ego (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
406397 let lpId = cfgLpAssetId
407398 let amId = toBase58String(value(cfgAmountAssetId))
408399 let prId = toBase58String(value(cfgPriceAssetId))
409400 let amDcm = cfgAmountAssetDecimals
410401 let prDcm = cfgPriceAssetDecimals
411402 let sts = toString(cfgPoolStatus)
412403 let lpEmiss = valueOrErrorMessage(assetInfo(lpId), "Wrong LP id").quantity
413404 if ((toBase58String(lpId) != pmtAssetId))
414405 then throw("Wrong pmt asset")
415406 else {
416407 let amBalance = getAccBalance(amId)
417408 let amBalanceX18 = t1(amBalance, amDcm)
418409 let prBalance = getAccBalance(prId)
419410 let prBalanceX18 = t1(prBalance, prDcm)
420411 let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
421412 let curPrice = f1(curPriceX18, scale8)
422413 let pmtLpAmtX18 = t1(pmtLpAmt, scale8)
423414 let lpEmissX18 = t1(lpEmiss, scale8)
424415 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissX18)
425416 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissX18)
426417 let outAmAmt = fromX18Round(outAmAmtX18, amDcm, FLOOR)
427418 let outPrAmt = fromX18Round(outPrAmtX18, prDcm, FLOOR)
428419 let state = if ((txId58 == ""))
429420 then nil
430421 else [ScriptTransfer(userAddress, outAmAmt, if ((amId == "WAVES"))
431422 then unit
432423 else fromBase58String(amId)), ScriptTransfer(userAddress, outPrAmt, if ((prId == "WAVES"))
433424 then unit
434425 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)]
435426 $Tuple10(outAmAmt, outPrAmt, amId, prId, amBalance, prBalance, lpEmiss, curPriceX18, sts, state)
436427 }
437428 }
438429
439430
440431 func epo (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEval,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = {
441432 let lpId = cfgLpAssetId
442433 let amIdStr = toBase58String(value(cfgAmountAssetId))
443434 let prIdStr = toBase58String(value(cfgPriceAssetId))
444435 let inAmIdStr = cfgInAmountAssedId
445436 let inPrIdStr = cfgInPriceAssetId
446437 let amtDcm = cfgAmountAssetDecimals
447438 let priceDcm = cfgPriceAssetDecimals
448439 let sts = toString(cfgPoolStatus)
449440 let lpEm = valueOrErrorMessage(assetInfo(lpId), "Wr lp as").quantity
450441 let amBalance = if (isEval)
451442 then getAccBalance(amIdStr)
452443 else if (if (isOneAsset)
453444 then (pmtId == amIdStr)
454445 else false)
455446 then (getAccBalance(amIdStr) - pmtAmt)
456447 else if (isOneAsset)
457448 then getAccBalance(amIdStr)
458449 else (getAccBalance(amIdStr) - inAmAmt)
459450 let prBalance = if (isEval)
460451 then getAccBalance(prIdStr)
461452 else if (if (isOneAsset)
462453 then (pmtId == prIdStr)
463454 else false)
464455 then (getAccBalance(prIdStr) - pmtAmt)
465456 else if (isOneAsset)
466457 then getAccBalance(prIdStr)
467458 else (getAccBalance(prIdStr) - inPrAmt)
468459 let inAmAssetAmtX18 = t1(inAmAmt, amtDcm)
469460 let inPrAssetAmtX18 = t1(inPrAmt, priceDcm)
470461 let userPriceX18 = cpbi(inPrAssetAmtX18, inAmAssetAmtX18)
471462 let amBalanceX18 = t1(amBalance, amtDcm)
472463 let prBalanceX18 = t1(prBalance, priceDcm)
473464 let D0 = getD([amBalanceX18, prBalanceX18])
474465 let r = if ((lpEm == 0))
475466 then {
476467 let D1 = getD([(amBalanceX18 + inAmAssetAmtX18), (prBalanceX18 + inPrAssetAmtX18)])
477468 let checkD = if ((D1 > D0))
478469 then true
479470 else throw("D1 should be greater than D0")
480471 if ((checkD == checkD))
481472 then {
482473 let curPriceX18 = zeroBigInt
483474 let slippageX18 = zeroBigInt
484475 let lpAmtX18 = D1
485476 $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
486477 }
487478 else throw("Strict value is not equal to itself.")
488479 }
489480 else {
490481 let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
491482 let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18)
492483 let slippageX18 = t1(slippage, scale8)
493484 if (if (if (validateSlippage)
494485 then (curPriceX18 != zeroBigInt)
495486 else false)
496487 then (slippageRealX18 > slippageX18)
497488 else false)
498489 then throw(((("Price slippage " + toString(slippageRealX18)) + " > ") + toString(slippageX18)))
499490 else {
500491 let lpEmissionX18 = t1(lpEm, scale8)
501492 let prViaAmX18 = fraction(inAmAssetAmtX18, cpbir(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING)
502493 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, cpbir(prBalanceX18, amBalanceX18, FLOOR), CEILING)
503494 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
504495 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
505496 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
506497 let expAmtAssetAmtX18 = expectedAmts._1
507498 let expPriceAssetAmtX18 = expectedAmts._2
508499 let D1 = getD([(amBalanceX18 + expAmtAssetAmtX18), (prBalanceX18 + expPriceAssetAmtX18)])
509500 let checkD = if ((D1 > D0))
510501 then true
511502 else throw("D1 should be greater than D0")
512503 if ((checkD == checkD))
513504 then {
514505 let lpAmtX18 = fraction(lpEmissionX18, (D1 - D0), D0)
515506 $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceDcm, CEILING), curPriceX18, slippageX18)
516507 }
517508 else throw("Strict value is not equal to itself.")
518509 }
519510 }
520511 let calcLpAmt = r._1
521512 let calcAmAssetPmt = r._2
522513 let calcPrAssetPmt = r._3
523514 let curPrice = f1(r._4, scale8)
524515 let slippageCalc = f1(r._5, scale8)
525516 if ((0 >= calcLpAmt))
526517 then throw("LP <= 0")
527518 else {
528519 let emitLpAmt = if (!(emitLp))
529520 then 0
530521 else calcLpAmt
531522 let amDiff = (inAmAmt - calcAmAssetPmt)
532523 let prDiff = (inPrAmt - calcPrAssetPmt)
533- let $t01992420117 = if (if (isOneAsset)
524+ let $t02059020935 = if (if (isOneAsset)
534525 then (pmtId == amIdStr)
535526 else false)
536527 then $Tuple2(pmtAmt, 0)
537528 else if (if (isOneAsset)
538529 then (pmtId == prIdStr)
539530 else false)
540531 then $Tuple2(0, pmtAmt)
541532 else $Tuple2(calcAmAssetPmt, calcPrAssetPmt)
542- let writeAmAmt = $t01992420117._1
543- let writePrAmt = $t01992420117._2
533+ let writeAmAmt = $t02059020935._1
534+ let writePrAmt = $t02059020935._2
544535 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))]
545536 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId)
546537 }
547538 }
548539
549540
550541 func getYD (xp,i,D) = {
551542 let n = big2
552543 let x = xp[if ((i == 0))
553544 then 1
554545 else 0]
555546 let aPrecision = parseBigIntValue(Amult)
556547 let a = (parseBigIntValue(A) * aPrecision)
557548 let s = x
558549 let ann = (a * n)
559550 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
560551 let b = ((s + ((D * aPrecision) / ann)) - D)
561552 func calc (acc,cur) = {
562- let $t02130821328 = acc
563- let y = $t02130821328._1
564- let found = $t02130821328._2
553+ let $t02213022150 = acc
554+ let y = $t02213022150._1
555+ let found = $t02213022150._2
565556 if ((found != unit))
566557 then acc
567558 else {
568559 let yNext = (((y * y) + c) / ((big2 * y) + b))
569560 let yDiff = absBigInt((yNext - value(y)))
570561 if ((big1 >= yDiff))
571562 then $Tuple2(yNext, cur)
572563 else $Tuple2(yNext, unit)
573564 }
574565 }
575566
576567 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
577- let $t02163521682 = {
568+ let $t02245722504 = {
578569 let $l = arr
579570 let $s = size($l)
580571 let $acc0 = $Tuple2(D, unit)
581572 func $f0_1 ($a,$i) = if (($i >= $s))
582573 then $a
583574 else calc($a, $l[$i])
584575
585576 func $f0_2 ($a,$i) = if (($i >= $s))
586577 then $a
587578 else throw("List size exceeds 15")
588579
589580 $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)
590581 }
591- let y = $t02163521682._1
592- let found = $t02163521682._2
582+ let y = $t02245722504._1
583+ let found = $t02245722504._2
593584 if ((found != unit))
594585 then y
595586 else throw(("Y calculation error, Y = " + toString(y)))
596587 }
597588
598589
599590 func calcDLp (amountBalance,priceBalance,lpEmission) = {
600591 let updatedDLp = fraction(getD([t1BigInt(amountBalance, toBigInt(cfgAmountAssetDecimals)), t1BigInt(priceBalance, toBigInt(cfgPriceAssetDecimals))]), scale18, lpEmission)
601592 if ((lpEmission == big0))
602593 then big0
603594 else updatedDLp
604595 }
605596
606597
607598 func calcCurrentDLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
608599 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
609600 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
610601 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
611602 let currentDLp = calcDLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
612603 currentDLp
613604 }
614605
615606
616607 func refreshDLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
617608 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
618609 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
619610 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
620611 let updatedDLp = calcDLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
621612 let actions = [IntegerEntry(keyDLpRefreshedHeight, height), StringEntry(keyDLp, toString(updatedDLp))]
622613 $Tuple2(actions, updatedDLp)
623614 }
624615
625616
626617 func validateUpdatedDLp (oldDLp,updatedDLp) = if ((updatedDLp >= oldDLp))
627618 then true
628619 else throwErr("updated DLp lower than current DLp")
629620
630621
631622 func validateMatcherOrderAllowed (order) = {
632623 let amountAssetBalance = getAccBalance(assetIdToString(cfgAmountAssetId))
633624 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
634625 let amountAssetAmount = order.amount
635626 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
636- let $t02388024092 = if ((order.orderType == Buy))
627+ let $t02470224914 = if ((order.orderType == Buy))
637628 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
638629 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
639- let amountAssetBalanceDelta = $t02388024092._1
640- let priceAssetBalanceDelta = $t02388024092._2
630+ let amountAssetBalanceDelta = $t02470224914._1
631+ let priceAssetBalanceDelta = $t02470224914._2
641632 if (if (if (igs())
642633 then true
643634 else (cfgPoolStatus == PoolMatcherDis))
644635 then true
645636 else (cfgPoolStatus == PoolShutdown))
646637 then throw("Admin blocked")
647638 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
648639 then true
649640 else (order.assetPair.priceAsset != cfgPriceAssetId))
650641 then throw("Wr assets")
651642 else {
652643 let dLp = parseBigIntValue(valueOrElse(getString(this, keyDLp), "0"))
653- let $t02443824538 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
654- let unusedActions = $t02443824538._1
655- let dLpNew = $t02443824538._2
644+ let $t02525625356 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
645+ let unusedActions = $t02525625356._1
646+ let dLpNew = $t02525625356._2
656647 let isOrderValid = (dLpNew >= dLp)
657648 let info = makeString(["dLp=", toString(dLp), " dLpNew=", toString(dLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "")
658649 $Tuple2(isOrderValid, info)
659650 }
660651 }
661652
662653
663654 func cg (i) = if ((size(i.payments) != 1))
664655 then throw("1 pmnt exp")
665656 else {
666657 let pmt = value(i.payments[0])
667658 let pmtAssetId = value(pmt.assetId)
668659 let pmtAmt = pmt.amount
669660 let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
670661 let outAmAmt = r._1
671662 let outPrAmt = r._2
672663 let sts = parseIntValue(r._9)
673664 let state = r._10
674665 if (if (igs())
675666 then true
676667 else (sts == PoolShutdown))
677668 then throw(("Admin blocked: " + toString(sts)))
678669 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
679670 }
680671
681672
682673 func cp (caller,txId,amAsPmt,prAsPmt,slippage,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = {
683674 let r = epo(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, (txId == ""), emitLp, isOneAsset, validateSlippage, pmtAmt, pmtId)
684675 let sts = parseIntValue(r._8)
685676 if (if (if (igs())
686677 then true
687678 else (sts == PoolPutDis))
688679 then true
689680 else (sts == PoolShutdown))
690681 then throw(("Blocked:" + toString(sts)))
691682 else r
692683 }
693684
694685
695686 func calcPutOneTkn (pmtAmtRaw,pmtAssetId,userAddress,txId,withTakeFee) = {
696687 let amId = toBase58String(value(cfgAmountAssetId))
697688 let prId = toBase58String(value(cfgPriceAssetId))
698689 let lpId = cfgLpAssetId
699690 let amtDcm = cfgAmountAssetDecimals
700691 let priceDcm = cfgPriceAssetDecimals
701692 let lpAssetEmission = toBigInt(valueOrErrorMessage(assetInfo(lpId), "invalid lp asset").quantity)
702693 let chechEmission = if ((lpAssetEmission > big0))
703694 then true
704695 else throw("initial deposit requires all coins")
705696 if ((chechEmission == chechEmission))
706697 then {
707698 let amBalance = getAccBalance(amId)
708699 let prBalance = getAccBalance(prId)
709- let $t02688627330 = if ((txId == ""))
700+ let $t02801228474 = if ((txId == ""))
710701 then $Tuple2(amBalance, prBalance)
711702 else if ((pmtAssetId == amId))
712703 then if ((pmtAmtRaw > amBalance))
713704 then throw("invalid payment amount")
714705 else $Tuple2((amBalance - pmtAmtRaw), prBalance)
715706 else if ((pmtAssetId == prId))
716707 then if ((pmtAmtRaw > prBalance))
717708 then throw("invalid payment amount")
718709 else $Tuple2(amBalance, (prBalance - pmtAmtRaw))
719710 else throw("wrong pmtAssetId")
720- let amBalanceOld = $t02688627330._1
721- let prBalanceOld = $t02688627330._2
722- let $t02733427510 = if ((pmtAssetId == amId))
711+ let amBalanceOld = $t02801228474._1
712+ let prBalanceOld = $t02801228474._2
713+ let $t02848028656 = if ((pmtAssetId == amId))
723714 then $Tuple2(pmtAmtRaw, 0)
724715 else if ((pmtAssetId == prId))
725716 then $Tuple2(0, pmtAmtRaw)
726717 else throw("invalid payment")
727- let amAmountRaw = $t02733427510._1
728- let prAmountRaw = $t02733427510._2
729- let $t02751427768 = if (withTakeFee)
718+ let amAmountRaw = $t02848028656._1
719+ let prAmountRaw = $t02848028656._2
720+ let $t02866028914 = if (withTakeFee)
730721 then $Tuple3(takeFee(amAmountRaw, inFee)._1, takeFee(prAmountRaw, inFee)._1, takeFee(pmtAmtRaw, inFee)._2)
731722 else $Tuple3(amAmountRaw, prAmountRaw, 0)
732- let amAmount = $t02751427768._1
733- let prAmount = $t02751427768._2
734- let feeAmount = $t02751427768._3
723+ let amAmount = $t02866028914._1
724+ let prAmount = $t02866028914._2
725+ let feeAmount = $t02866028914._3
735726 let amBalanceNew = (amBalanceOld + amAmount)
736727 let prBalanceNew = (prBalanceOld + prAmount)
737728 let D0 = getD([t1(amBalanceOld, cfgAmountAssetDecimals), t1(prBalanceOld, cfgPriceAssetDecimals)])
738729 let D1 = getD([t1(amBalanceNew, cfgAmountAssetDecimals), t1(prBalanceNew, cfgPriceAssetDecimals)])
739730 let checkD = if ((D1 > D0))
740731 then true
741732 else throw()
742733 if ((checkD == checkD))
743734 then {
744735 let lpAmount = fraction(lpAssetEmission, (D1 - D0), D0, FLOOR)
745736 let curPrice = f1(cpbi(t1(prBalanceNew, priceDcm), t1(amBalanceNew, amtDcm)), scale8)
746737 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))]
747738 let poolProportion = fraction(prBalanceOld, scale8, amBalanceOld)
748739 let amountAssetPart = fraction(pmtAmtRaw, scale8, (poolProportion + scale8))
749740 let priceAssetPart = (pmtAmtRaw - amountAssetPart)
750741 let lpAmtBoth = fraction(lpAssetEmission, toBigInt(priceAssetPart), toBigInt(prBalanceOld))
751742 let bonus = toInt(fraction((lpAmount - lpAmtBoth), scale8BigInt, lpAmtBoth))
752743 $Tuple4(toInt(lpAmount), commonState, feeAmount, bonus)
753744 }
754745 else throw("Strict value is not equal to itself.")
755746 }
756747 else throw("Strict value is not equal to itself.")
757748 }
758749
759750
760751 func getOneTknV2Internal (outAssetId,minOutAmount,payments,caller,originCaller,transactionId) = {
761752 let lpId = toBase58String(value(cfgLpAssetId))
762753 let amId = toBase58String(value(cfgAmountAssetId))
763754 let prId = toBase58String(value(cfgPriceAssetId))
764755 let amDecimals = cfgAmountAssetDecimals
765756 let prDecimals = cfgPriceAssetDecimals
766757 let poolStatus = cfgPoolStatus
767758 let userAddress = if ((caller == restContract))
768759 then originCaller
769760 else caller
770761 let pmt = value(payments[0])
771762 let pmtAssetId = value(pmt.assetId)
772763 let pmtAmt = pmt.amount
773764 let currentDLp = calcCurrentDLp(big0, big0, big0)
774765 if ((currentDLp == currentDLp))
775766 then {
776767 let txId58 = toBase58String(transactionId)
777768 if ((lpId != toBase58String(pmtAssetId)))
778769 then throw("Wrong LP")
779770 else {
780771 let amBalance = getAccBalance(amId)
781772 let prBalance = getAccBalance(prId)
782- let $t02988429995 = {
773+ let $t03102631137 = {
783774 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil)
784775 if ($isInstanceOf(@, "(Int, Int)"))
785776 then @
786777 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
787778 }
788- if (($t02988429995 == $t02988429995))
779+ if (($t03102631137 == $t03102631137))
789780 then {
790- let feeAmount = $t02988429995._2
791- let totalGet = $t02988429995._1
781+ let feeAmount = $t03102631137._2
782+ let totalGet = $t03102631137._1
792783 let totalAmount = if (if ((minOutAmount > 0))
793784 then (minOutAmount > totalGet)
794785 else false)
795786 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
796787 else totalGet
797- let $t03019330512 = if ((outAssetId == amId))
788+ let $t03132731634 = if ((outAssetId == amId))
798789 then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance)
799790 else if ((outAssetId == prId))
800791 then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount))
801792 else throw("invalid out asset id")
802- let outAm = $t03019330512._1
803- let outPr = $t03019330512._2
804- let amBalanceNew = $t03019330512._3
805- let prBalanceNew = $t03019330512._4
793+ let outAm = $t03132731634._1
794+ let outPr = $t03132731634._2
795+ let amBalanceNew = $t03132731634._3
796+ let prBalanceNew = $t03132731634._4
806797 let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals))
807798 let curPr = f1(curPrX18, scale8)
808799 let outAssetIdOrWaves = if ((outAssetId == "WAVES"))
809800 then unit
810801 else fromBase58String(outAssetId)
811802 let sendFeeToMatcher = if ((feeAmount > 0))
812803 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetIdOrWaves)]
813804 else nil
814805 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)
815806 if ((state == state))
816807 then {
817808 let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
818809 if ((burn == burn))
819810 then {
820- let $t03132731685 = {
811+ let $t03241932769 = {
821812 let feeAmountForCalc = if ((this == feeCollectorAddress))
822813 then 0
823814 else feeAmount
824815 let outInAmountAsset = if ((parseAssetId(outAssetId) == cfgAmountAssetId))
825816 then true
826817 else false
827818 if (outInAmountAsset)
828819 then $Tuple2(-((totalGet + feeAmountForCalc)), 0)
829820 else $Tuple2(0, -((totalGet + feeAmountForCalc)))
830821 }
831- let amountAssetBalanceDelta = $t03132731685._1
832- let priceAssetBalanceDelta = $t03132731685._2
833- let $t03169031798 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
834- let refreshDLpActions = $t03169031798._1
835- let updatedDLp = $t03169031798._2
822+ let amountAssetBalanceDelta = $t03241932769._1
823+ let priceAssetBalanceDelta = $t03241932769._2
824+ let $t03277232880 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
825+ let refreshDLpActions = $t03277232880._1
826+ let updatedDLp = $t03277232880._2
836827 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
837828 if ((isUpdatedDLpValid == isUpdatedDLpValid))
838829 then $Tuple2((state ++ refreshDLpActions), totalAmount)
839830 else throw("Strict value is not equal to itself.")
840831 }
841832 else throw("Strict value is not equal to itself.")
842833 }
843834 else throw("Strict value is not equal to itself.")
844835 }
845836 else throw("Strict value is not equal to itself.")
846837 }
847838 }
848839 else throw("Strict value is not equal to itself.")
849840 }
850841
851842
852843 func m () = match getString(mpk()) {
853844 case s: String =>
854845 fromBase58String(s)
855846 case _: Unit =>
856847 unit
857848 case _ =>
858849 throw("Match error")
859850 }
860851
861852
862853 func pm () = match getString(pmpk()) {
863854 case s: String =>
864855 fromBase58String(s)
865856 case _: Unit =>
866857 unit
867858 case _ =>
868859 throw("Match error")
869860 }
870861
871862
872863 let pd = throw("Permission denied")
873864
874865 func isManager (i) = match m() {
875866 case pk: ByteVector =>
876867 (i.callerPublicKey == pk)
877868 case _: Unit =>
878869 (i.caller == this)
879870 case _ =>
880871 throw("Match error")
881872 }
882873
883874
884875 func mm (i) = match m() {
885876 case pk: ByteVector =>
886877 if ((i.callerPublicKey == pk))
887878 then true
888879 else pd
889880 case _: Unit =>
890881 if ((i.caller == this))
891882 then true
892883 else pd
893884 case _ =>
894885 throw("Match error")
895886 }
896887
897888
898889 func getY (isReverse,D,poolAmountInBalance) = {
899890 let poolConfig = gpc()
900891 let amId = poolConfig[idxAmAsId]
901892 let prId = poolConfig[idxPrAsId]
902893 let n = big2
903894 let aPrecision = parseBigIntValue(Amult)
904895 let a = (parseBigIntValue(A) * aPrecision)
905896 let xp = if ((isReverse == false))
906897 then [(toBigInt(getAccBalance(amId)) + poolAmountInBalance), toBigInt(getAccBalance(prId))]
907898 else [(toBigInt(getAccBalance(prId)) + poolAmountInBalance), toBigInt(getAccBalance(amId))]
908899 let x = xp[0]
909900 let s = x
910901 let ann = (a * n)
911902 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
912903 let b = ((s + ((D * aPrecision) / ann)) - D)
913904 func calc (acc,cur) = {
914- let $t03324633266 = acc
915- let y = $t03324633266._1
916- let found = $t03324633266._2
905+ let $t03432734347 = acc
906+ let y = $t03432734347._1
907+ let found = $t03432734347._2
917908 if ((found != unit))
918909 then acc
919910 else {
920911 let yNext = (((y * y) + c) / ((big2 * y) + b))
921912 let yDiff = absBigInt((yNext - value(y)))
922913 if ((big1 >= yDiff))
923914 then $Tuple2(yNext, cur)
924915 else $Tuple2(yNext, unit)
925916 }
926917 }
927918
928919 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
929- let $t03357333620 = {
920+ let $t03467834725 = {
930921 let $l = arr
931922 let $s = size($l)
932923 let $acc0 = $Tuple2(D, unit)
933924 func $f0_1 ($a,$i) = if (($i >= $s))
934925 then $a
935926 else calc($a, $l[$i])
936927
937928 func $f0_2 ($a,$i) = if (($i >= $s))
938929 then $a
939930 else throw("List size exceeds 15")
940931
941932 $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)
942933 }
943- let y = $t03357333620._1
944- let found = $t03357333620._2
934+ let y = $t03467834725._1
935+ let found = $t03467834725._2
945936 if ((found != unit))
946937 then y
947938 else throw(("Y calculation error, Y = " + toString(y)))
948939 }
949940
950941
951-func skipOrderValidation () = valueOrElse(getBoolean(fca, keySkipOrderValidation(toString(this))), false)
952-
953-
954942 @Callable(i)
955943 func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = {
956- let $t03396134384 = if ((isReverse == false))
944+ let $t03496635390 = if ((isReverse == false))
957945 then {
958946 let assetOut = strf(this, pa())
959947 let poolAmountInBalance = (toBigInt(getAccBalance(strf(this, aa()))) + toBigInt(cleanAmountIn))
960948 $Tuple2(assetOut, poolAmountInBalance)
961949 }
962950 else {
963951 let assetOut = strf(this, aa())
964952 let poolAmountInBalance = (toBigInt(getAccBalance(strf(this, pa()))) + toBigInt(cleanAmountIn))
965953 $Tuple2(assetOut, poolAmountInBalance)
966954 }
967- let assetOut = $t03396134384._1
968- let poolAmountInBalance = $t03396134384._2
955+ let assetOut = $t03496635390._1
956+ let poolAmountInBalance = $t03496635390._2
969957 let poolConfig = gpc()
970958 let amId = poolConfig[idxAmAsId]
971959 let prId = poolConfig[idxPrAsId]
972960 let xp = [toBigInt(getAccBalance(amId)), toBigInt(getAccBalance(prId))]
973961 let D = getD(xp)
974962 let y = getY(isReverse, D, toBigInt(cleanAmountIn))
975963 let dy = ((toBigInt(getAccBalance(assetOut)) - y) - toBigInt(1))
976964 let totalGetRaw = max([0, toInt(dy)])
977965 let newXp = if ((isReverse == false))
978966 then [((toBigInt(getAccBalance(amId)) + toBigInt(cleanAmountIn)) + toBigInt(feePoolAmount)), (toBigInt(getAccBalance(prId)) - dy)]
979967 else [(toBigInt(getAccBalance(amId)) - dy), ((toBigInt(getAccBalance(prId)) + toBigInt(cleanAmountIn)) + toBigInt(feePoolAmount))]
980968 let newD = getD(newXp)
981969 let checkD = if ((newD >= D))
982970 then true
983971 else throw(makeString(["new D is fewer error", toString(D), toString(newD)], "__"))
984972 if ((checkD == checkD))
985973 then $Tuple2(nil, totalGetRaw)
986974 else throw("Strict value is not equal to itself.")
987975 }
988976
989977
990978
991979 @Callable(i)
992980 func calculateAmountOutForSwapAndSendTokens (cleanAmountIn,isReverse,amountOutMin,addressTo,feePoolAmount) = {
993981 let swapContact = {
994982 let @ = invoke(fca, "getSwapContractREADONLY", nil, nil)
995983 if ($isInstanceOf(@, "String"))
996984 then @
997985 else throw(($getType(@) + " couldn't be cast to String"))
998986 }
999987 let checks = [if ((value(i.payments[0]).amount >= cleanAmountIn))
1000988 then true
1001989 else throwErr("Wrong amount"), if ((i.caller == addressFromStringValue(swapContact)))
1002990 then true
1003991 else throwErr("Permission denied")]
1004992 if ((checks == checks))
1005993 then {
1006994 let pmt = value(i.payments[0])
1007995 let assetIn = assetIdToString(pmt.assetId)
1008- let $t03581336206 = if ((isReverse == false))
996+ let $t03682637220 = if ((isReverse == false))
1009997 then {
1010998 let assetOut = strf(this, pa())
1011999 let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
10121000 $Tuple2(assetOut, poolAmountInBalance)
10131001 }
10141002 else {
10151003 let assetOut = strf(this, aa())
10161004 let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
10171005 $Tuple2(assetOut, poolAmountInBalance)
10181006 }
1019- let assetOut = $t03581336206._1
1020- let poolAmountInBalance = $t03581336206._2
1007+ let assetOut = $t03682637220._1
1008+ let poolAmountInBalance = $t03682637220._2
10211009 let poolConfig = gpc()
10221010 let amId = poolConfig[idxAmAsId]
10231011 let prId = poolConfig[idxPrAsId]
10241012 let xp = if ((isReverse == false))
10251013 then [(toBigInt(getAccBalance(amId)) - toBigInt(value(i.payments[0]).amount)), toBigInt(getAccBalance(prId))]
10261014 else [toBigInt(getAccBalance(amId)), (toBigInt(getAccBalance(prId)) - toBigInt(value(i.payments[0]).amount))]
10271015 let D = getD(xp)
10281016 let y = getY(isReverse, D, toBigInt(0))
10291017 let dy = ((toBigInt(getAccBalance(assetOut)) - y) - toBigInt(1))
10301018 let totalGetRaw = max([0, toInt(dy)])
10311019 let checkMin = if ((totalGetRaw >= amountOutMin))
10321020 then true
10331021 else throw("Exchange result is fewer coins than expected")
10341022 if ((checkMin == checkMin))
10351023 then {
10361024 let newXp = if ((isReverse == false))
10371025 then [(toBigInt(getAccBalance(amId)) + toBigInt(feePoolAmount)), (toBigInt(getAccBalance(prId)) - dy)]
10381026 else [(toBigInt(getAccBalance(amId)) - dy), (toBigInt(getAccBalance(prId)) + toBigInt(feePoolAmount))]
10391027 let newD = getD(newXp)
10401028 let checkD = if ((newD >= D))
10411029 then true
10421030 else throw("new D is fewer error")
10431031 if ((checkD == checkD))
10441032 then $Tuple2([ScriptTransfer(addressFromStringValue(addressTo), totalGetRaw, parseAssetId(assetOut))], totalGetRaw)
10451033 else throw("Strict value is not equal to itself.")
10461034 }
10471035 else throw("Strict value is not equal to itself.")
10481036 }
10491037 else throw("Strict value is not equal to itself.")
10501038 }
10511039
10521040
10531041
10541042 @Callable(i)
10551043 func constructor (fc) = {
10561044 let c = mm(i)
10571045 if ((c == c))
10581046 then [StringEntry(fc(), fc)]
10591047 else throw("Strict value is not equal to itself.")
10601048 }
10611049
10621050
10631051
10641052 @Callable(i)
10651053 func setManager (pendingManagerPublicKey) = {
10661054 let c = mm(i)
10671055 if ((c == c))
10681056 then {
10691057 let cm = fromBase58String(pendingManagerPublicKey)
10701058 if ((cm == cm))
10711059 then [StringEntry(pmpk(), pendingManagerPublicKey)]
10721060 else throw("Strict value is not equal to itself.")
10731061 }
10741062 else throw("Strict value is not equal to itself.")
10751063 }
10761064
10771065
10781066
10791067 @Callable(i)
10801068 func confirmManager () = {
10811069 let p = pm()
10821070 let hpm = if (isDefined(p))
10831071 then true
10841072 else throw("No pending manager")
10851073 if ((hpm == hpm))
10861074 then {
10871075 let cpm = if ((i.callerPublicKey == value(p)))
10881076 then true
10891077 else throw("You are not pending manager")
10901078 if ((cpm == cpm))
10911079 then [StringEntry(mpk(), toBase58String(value(p))), DeleteEntry(pmpk())]
10921080 else throw("Strict value is not equal to itself.")
10931081 }
10941082 else throw("Strict value is not equal to itself.")
10951083 }
10961084
10971085
10981086
10991087 @Callable(i)
11001088 func put (slip,autoStake) = {
11011089 let factCfg = gfc()
11021090 let stakingCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactStakCntr]), "Wr st addr")
11031091 let slipCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactSlippCntr]), "Wr sl addr")
11041092 if ((0 > slip))
11051093 then throw("Wrong slippage")
11061094 else if ((size(i.payments) != 2))
11071095 then throw("2 pmnts expd")
11081096 else {
11091097 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
11101098 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
11111099 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amAssetPmt)
11121100 if ((amountAssetBalance == amountAssetBalance))
11131101 then {
11141102 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - prAssetPmt)
11151103 if ((priceAssetBalance == priceAssetBalance))
11161104 then {
11171105 let lpAssetEmission = toBigInt(value(assetInfo(cfgLpAssetId)).quantity)
11181106 if ((lpAssetEmission == lpAssetEmission))
11191107 then {
11201108 let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0))
11211109 if ((currentDLp == currentDLp))
11221110 then {
11231111 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, "")
11241112 let emitLpAmt = e._2
11251113 let lpAssetId = e._7
11261114 let state = e._9
11271115 let amDiff = e._10
11281116 let prDiff = e._11
11291117 let amId = e._12
11301118 let prId = e._13
11311119 let r = invoke(fca, "emit", [emitLpAmt], nil)
11321120 if ((r == r))
11331121 then {
11341122 let el = match r {
11351123 case legacy: Address =>
11361124 invoke(legacy, "emit", [emitLpAmt], nil)
11371125 case _ =>
11381126 unit
11391127 }
11401128 if ((el == el))
11411129 then {
11421130 let sa = if ((amDiff > 0))
11431131 then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)])
11441132 else nil
11451133 if ((sa == sa))
11461134 then {
11471135 let sp = if ((prDiff > 0))
11481136 then invoke(slipCntr, "put", nil, [AttachedPayment(prId, prDiff)])
11491137 else nil
11501138 if ((sp == sp))
11511139 then {
11521140 let lpTrnsfr = if (autoStake)
11531141 then {
11541142 let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
11551143 if ((ss == ss))
11561144 then nil
11571145 else throw("Strict value is not equal to itself.")
11581146 }
11591147 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
1160- let $t04060540747 = refreshDLpInternal(0, 0, 0)
1161- let refreshDLpActions = $t04060540747._1
1162- let updatedDLp = $t04060540747._2
1148+ let $t04183941981 = refreshDLpInternal(0, 0, 0)
1149+ let refreshDLpActions = $t04183941981._1
1150+ let updatedDLp = $t04183941981._2
11631151 let check = if ((updatedDLp >= currentDLp))
11641152 then true
11651153 else throwErr(makeString(["updated DLp lower than current DLp", toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentDLp), toString(updatedDLp), toString(amDiff), toString(prDiff)], " "))
11661154 if ((check == check))
11671155 then {
11681156 let lpAssetEmissionAfter = value(assetInfo(cfgLpAssetId)).quantity
11691157 if ((lpAssetEmissionAfter == lpAssetEmissionAfter))
11701158 then ((state ++ lpTrnsfr) ++ refreshDLpActions)
11711159 else throw("Strict value is not equal to itself.")
11721160 }
11731161 else throw("Strict value is not equal to itself.")
11741162 }
11751163 else throw("Strict value is not equal to itself.")
11761164 }
11771165 else throw("Strict value is not equal to itself.")
11781166 }
11791167 else throw("Strict value is not equal to itself.")
11801168 }
11811169 else throw("Strict value is not equal to itself.")
11821170 }
11831171 else throw("Strict value is not equal to itself.")
11841172 }
11851173 else throw("Strict value is not equal to itself.")
11861174 }
11871175 else throw("Strict value is not equal to itself.")
11881176 }
11891177 else throw("Strict value is not equal to itself.")
11901178 }
11911179 }
11921180
11931181
11941182
11951183 @Callable(i)
11961184 func putOneTknV2 (minOutAmount,autoStake) = {
11971185 let isPoolOneTokenOperationsDisabled = {
11981186 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
11991187 if ($isInstanceOf(@, "Boolean"))
12001188 then @
12011189 else throw(($getType(@) + " couldn't be cast to Boolean"))
12021190 }
12031191 let isPutDisabled = if (if (if (igs())
12041192 then true
12051193 else (cfgPoolStatus == PoolPutDis))
12061194 then true
12071195 else (cfgPoolStatus == PoolShutdown))
12081196 then true
12091197 else isPoolOneTokenOperationsDisabled
12101198 let checks = [if (if (!(isPutDisabled))
12111199 then true
12121200 else isManager(i))
12131201 then true
12141202 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
12151203 then true
12161204 else throwErr("exactly 1 payment are expected")]
12171205 if ((checks == checks))
12181206 then {
12191207 let amId = toBase58String(value(cfgAmountAssetId))
12201208 let prId = toBase58String(value(cfgPriceAssetId))
12211209 let lpId = cfgLpAssetId
12221210 let amDecimals = cfgAmountAssetDecimals
12231211 let prDecimals = cfgPriceAssetDecimals
12241212 let userAddress = if ((i.caller == this))
12251213 then i.originCaller
12261214 else i.caller
12271215 let pmt = value(i.payments[0])
12281216 let pmtAssetId = toBase58String(value(pmt.assetId))
12291217 let pmtAmt = pmt.amount
12301218 let currentDLp = if ((pmt.assetId == cfgAmountAssetId))
12311219 then calcCurrentDLp(toBigInt(pmtAmt), toBigInt(0), toBigInt(0))
12321220 else calcCurrentDLp(toBigInt(0), toBigInt(pmtAmt), toBigInt(0))
12331221 if ((currentDLp == currentDLp))
12341222 then {
1235- let $t04238842546 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1236- if (($t04238842546 == $t04238842546))
1223+ let $t04362243780 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1224+ if (($t04362243780 == $t04362243780))
12371225 then {
1238- let feeAmount = $t04238842546._3
1239- let state = $t04238842546._2
1240- let estimLP = $t04238842546._1
1226+ let feeAmount = $t04362243780._3
1227+ let state = $t04362243780._2
1228+ let estimLP = $t04362243780._1
12411229 let emitLpAmt = if (if ((minOutAmount > 0))
12421230 then (minOutAmount > estimLP)
12431231 else false)
12441232 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
12451233 else estimLP
12461234 let e = invoke(fca, "emit", [emitLpAmt], nil)
12471235 if ((e == e))
12481236 then {
12491237 let el = match e {
12501238 case legacy: Address =>
12511239 invoke(legacy, "emit", [emitLpAmt], nil)
12521240 case _ =>
12531241 unit
12541242 }
12551243 if ((el == el))
12561244 then {
12571245 let lpTrnsfr = if (autoStake)
12581246 then {
1259- let ss = invoke(stakingContract, "stakeFor", [toString(i.caller)], [AttachedPayment(lpId, emitLpAmt)])
1247+ let ss = invoke(stakingContract, "stake", nil, [AttachedPayment(lpId, emitLpAmt)])
12601248 if ((ss == ss))
12611249 then nil
12621250 else throw("Strict value is not equal to itself.")
12631251 }
12641252 else [ScriptTransfer(i.caller, emitLpAmt, lpId)]
12651253 let sendFeeToMatcher = if ((feeAmount > 0))
12661254 then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))]
12671255 else nil
1268- let $t04341543762 = if ((this == feeCollectorAddress))
1256+ let $t04459544944 = if ((this == feeCollectorAddress))
12691257 then $Tuple2(0, 0)
12701258 else {
12711259 let paymentInAmountAsset = if ((pmt.assetId == cfgAmountAssetId))
12721260 then true
12731261 else false
12741262 if (paymentInAmountAsset)
12751263 then $Tuple2(-(feeAmount), 0)
12761264 else $Tuple2(0, -(feeAmount))
12771265 }
1278- let amountAssetBalanceDelta = $t04341543762._1
1279- let priceAssetBalanceDelta = $t04341543762._2
1280- let $t04376543873 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1281- let refreshDLpActions = $t04376543873._1
1282- let updatedDLp = $t04376543873._2
1266+ let amountAssetBalanceDelta = $t04459544944._1
1267+ let priceAssetBalanceDelta = $t04459544944._2
1268+ let $t04494745055 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1269+ let refreshDLpActions = $t04494745055._1
1270+ let updatedDLp = $t04494745055._2
12831271 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
12841272 if ((isUpdatedDLpValid == isUpdatedDLpValid))
12851273 then $Tuple2((((state ++ lpTrnsfr) ++ sendFeeToMatcher) ++ refreshDLpActions), emitLpAmt)
12861274 else throw("Strict value is not equal to itself.")
12871275 }
12881276 else throw("Strict value is not equal to itself.")
12891277 }
12901278 else throw("Strict value is not equal to itself.")
12911279 }
12921280 else throw("Strict value is not equal to itself.")
12931281 }
12941282 else throw("Strict value is not equal to itself.")
12951283 }
12961284 else throw("Strict value is not equal to itself.")
12971285 }
12981286
12991287
13001288
13011289 @Callable(i)
13021290 func putForFree (maxSlpg) = if ((0 > maxSlpg))
13031291 then throw("Wrong slpg")
13041292 else if ((size(i.payments) != 2))
13051293 then throw("2 pmnts expd")
13061294 else {
13071295 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, "")
13081296 let state = estPut._9
13091297 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
13101298 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
13111299 let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0))
13121300 if ((currentDLp == currentDLp))
13131301 then {
1314- let $t04470544770 = refreshDLpInternal(0, 0, 0)
1315- let refreshDLpActions = $t04470544770._1
1316- let updatedDLp = $t04470544770._2
1302+ let $t04608546150 = refreshDLpInternal(0, 0, 0)
1303+ let refreshDLpActions = $t04608546150._1
1304+ let updatedDLp = $t04608546150._2
13171305 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
13181306 if ((isUpdatedDLpValid == isUpdatedDLpValid))
13191307 then (state ++ refreshDLpActions)
13201308 else throw("Strict value is not equal to itself.")
13211309 }
13221310 else throw("Strict value is not equal to itself.")
13231311 }
13241312
13251313
13261314
13271315 @Callable(i)
13281316 func get () = {
13291317 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0))
13301318 if ((currentDLp == currentDLp))
13311319 then {
13321320 let r = cg(i)
13331321 let outAmtAmt = r._1
13341322 let outPrAmt = r._2
13351323 let pmtAmt = r._3
13361324 let pmtAssetId = r._4
13371325 let state = r._5
13381326 let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
13391327 if ((b == b))
13401328 then {
1341- let $t04587345955 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1342- let refreshDLpActions = $t04587345955._1
1343- let updatedDLp = $t04587345955._2
1329+ let $t04732347405 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1330+ let refreshDLpActions = $t04732347405._1
1331+ let updatedDLp = $t04732347405._2
13441332 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
13451333 if ((isUpdatedDLpValid == isUpdatedDLpValid))
13461334 then (state ++ refreshDLpActions)
13471335 else throw("Strict value is not equal to itself.")
13481336 }
13491337 else throw("Strict value is not equal to itself.")
13501338 }
13511339 else throw("Strict value is not equal to itself.")
13521340 }
13531341
13541342
13551343
13561344 @Callable(i)
13571345 func getOneTknV2 (outAssetId,minOutAmount) = {
13581346 let isPoolOneTokenOperationsDisabled = {
13591347 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
13601348 if ($isInstanceOf(@, "Boolean"))
13611349 then @
13621350 else throw(($getType(@) + " couldn't be cast to Boolean"))
13631351 }
13641352 let isGetDisabled = if (if (igs())
13651353 then true
13661354 else (cfgPoolStatus == PoolShutdown))
13671355 then true
13681356 else isPoolOneTokenOperationsDisabled
13691357 let checks = [if (if (!(isGetDisabled))
13701358 then true
13711359 else isManager(i))
13721360 then true
13731361 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
13741362 then true
13751363 else throwErr("exactly 1 payment are expected")]
13761364 if ((checks == checks))
13771365 then {
1378- let $t04657346728 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1379- let state = $t04657346728._1
1380- let totalAmount = $t04657346728._2
1366+ let $t04802348178 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1367+ let state = $t04802348178._1
1368+ let totalAmount = $t04802348178._2
13811369 $Tuple2(state, totalAmount)
13821370 }
13831371 else throw("Strict value is not equal to itself.")
13841372 }
13851373
13861374
13871375
13881376 @Callable(i)
13891377 func refreshDLp () = {
13901378 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyDLpRefreshedHeight), 0)
13911379 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= dLpRefreshDelay))
13921380 then unit
13931381 else throwErr(makeString([toString(dLpRefreshDelay), " blocks have not passed since the previous call"], ""))
13941382 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
13951383 then {
13961384 let dLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyDLp), "0")), fmtErr("invalid dLp"))
1397- let $t04724647310 = refreshDLpInternal(0, 0, 0)
1398- let dLpUpdateActions = $t04724647310._1
1399- let updatedDLp = $t04724647310._2
1385+ let $t04870248766 = refreshDLpInternal(0, 0, 0)
1386+ let dLpUpdateActions = $t04870248766._1
1387+ let updatedDLp = $t04870248766._2
14001388 let actions = if ((dLp != updatedDLp))
14011389 then dLpUpdateActions
14021390 else throwErr("nothing to refresh")
14031391 $Tuple2(actions, toString(updatedDLp))
14041392 }
14051393 else throw("Strict value is not equal to itself.")
14061394 }
14071395
14081396
14091397
14101398 @Callable(i)
14111399 func getOneTknV2READONLY (outAssetId,lpAssetAmount) = {
14121400 let amId = toBase58String(value(cfgAmountAssetId))
14131401 let prId = toBase58String(value(cfgPriceAssetId))
14141402 let lpId = toBase58String(value(cfgLpAssetId))
14151403 let xp = [toBigInt(getAccBalance(amId)), toBigInt(getAccBalance(prId))]
14161404 let lpEmission = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "invalid lp asset").quantity)
14171405 let D0 = getD(xp)
14181406 let D1 = (D0 - fraction(toBigInt(lpAssetAmount), D0, lpEmission))
14191407 let index = if ((outAssetId == amId))
14201408 then 0
14211409 else if ((outAssetId == prId))
14221410 then 1
14231411 else throw("invalid out asset id")
14241412 let newY = getYD(xp, index, D1)
14251413 let dy = (xp[index] - newY)
14261414 let totalGetRaw = max([0, toInt((dy - big1))])
1427- let $t04832048375 = takeFee(totalGetRaw, outFee)
1428- let totalGet = $t04832048375._1
1429- let feeAmount = $t04832048375._2
1415+ let $t04977649831 = takeFee(totalGetRaw, outFee)
1416+ let totalGet = $t04977649831._1
1417+ let feeAmount = $t04977649831._2
14301418 $Tuple2(nil, $Tuple2(totalGet, feeAmount))
14311419 }
14321420
14331421
14341422
14351423 @Callable(i)
14361424 func getOneTknV2WithBonusREADONLY (outAssetId,lpAssetAmount) = {
14371425 let amId = toBase58String(value(cfgAmountAssetId))
14381426 let prId = toBase58String(value(cfgPriceAssetId))
14391427 let lpId = toBase58String(value(cfgLpAssetId))
14401428 let amBalance = getAccBalance(amId)
14411429 let prBalance = getAccBalance(prId)
1442- let $t04875048865 = {
1430+ let $t05020650321 = {
14431431 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil)
14441432 if ($isInstanceOf(@, "(Int, Int)"))
14451433 then @
14461434 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
14471435 }
1448- let totalGet = $t04875048865._1
1449- let feeAmount = $t04875048865._2
1436+ let totalGet = $t05020650321._1
1437+ let feeAmount = $t05020650321._2
14501438 let r = ego("", lpId, lpAssetAmount, this)
14511439 let outAmAmt = r._1
14521440 let outPrAmt = r._2
14531441 let sumOfGetAssets = (outAmAmt + outPrAmt)
14541442 let bonus = if ((sumOfGetAssets == 0))
14551443 then if ((totalGet == 0))
14561444 then 0
14571445 else throw("bonus calculation error")
14581446 else fraction((totalGet - sumOfGetAssets), scale8, sumOfGetAssets)
14591447 $Tuple2(nil, $Tuple3(totalGet, feeAmount, bonus))
14601448 }
14611449
14621450
14631451
14641452 @Callable(i)
14651453 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
14661454 let r = cg(i)
14671455 let outAmAmt = r._1
14681456 let outPrAmt = r._2
14691457 let pmtAmt = r._3
14701458 let pmtAssetId = r._4
14711459 let state = r._5
14721460 if ((noLessThenAmtAsset > outAmAmt))
14731461 then throw(((("Failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
14741462 else if ((noLessThenPriceAsset > outPrAmt))
14751463 then throw(((("Failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
14761464 else {
14771465 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0))
14781466 if ((currentDLp == currentDLp))
14791467 then {
14801468 let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14811469 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14821470 then {
1483- let $t04994550026 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1484- let refreshDLpActions = $t04994550026._1
1485- let updatedDLp = $t04994550026._2
1471+ let $t05148751568 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1472+ let refreshDLpActions = $t05148751568._1
1473+ let updatedDLp = $t05148751568._2
14861474 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
14871475 if ((isUpdatedDLpValid == isUpdatedDLpValid))
14881476 then (state ++ refreshDLpActions)
14891477 else throw("Strict value is not equal to itself.")
14901478 }
14911479 else throw("Strict value is not equal to itself.")
14921480 }
14931481 else throw("Strict value is not equal to itself.")
14941482 }
14951483 }
14961484
14971485
14981486
14991487 @Callable(i)
15001488 func unstakeAndGet (amount) = {
15011489 let checkPayments = if ((size(i.payments) != 0))
15021490 then throw("No pmnts expd")
15031491 else true
15041492 if ((checkPayments == checkPayments))
15051493 then {
15061494 let factoryCfg = gfc()
15071495 let lpAssetId = cfgLpAssetId
15081496 let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr")
15091497 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0))
15101498 if ((currentDLp == currentDLp))
15111499 then {
15121500 let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil)
15131501 if ((unstakeInv == unstakeInv))
15141502 then {
15151503 let r = ego(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
15161504 let outAmAmt = r._1
15171505 let outPrAmt = r._2
15181506 let sts = parseIntValue(r._9)
15191507 let state = r._10
15201508 let v = if (if (igs())
15211509 then true
15221510 else (sts == PoolShutdown))
15231511 then throw(("Blocked: " + toString(sts)))
15241512 else true
15251513 if ((v == v))
15261514 then {
15271515 let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
15281516 if ((burnA == burnA))
15291517 then {
1530- let $t05105751138 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1531- let refreshDLpActions = $t05105751138._1
1532- let updatedDLp = $t05105751138._2
1518+ let $t05259552676 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1519+ let refreshDLpActions = $t05259552676._1
1520+ let updatedDLp = $t05259552676._2
15331521 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
15341522 if ((isUpdatedDLpValid == isUpdatedDLpValid))
15351523 then (state ++ refreshDLpActions)
15361524 else throw("Strict value is not equal to itself.")
15371525 }
15381526 else throw("Strict value is not equal to itself.")
15391527 }
15401528 else throw("Strict value is not equal to itself.")
15411529 }
15421530 else throw("Strict value is not equal to itself.")
15431531 }
15441532 else throw("Strict value is not equal to itself.")
15451533 }
15461534 else throw("Strict value is not equal to itself.")
15471535 }
15481536
15491537
15501538
15511539 @Callable(i)
15521540 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
15531541 let isGetDisabled = if (igs())
15541542 then true
15551543 else (cfgPoolStatus == PoolShutdown)
15561544 let checks = [if (!(isGetDisabled))
15571545 then true
15581546 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
15591547 then true
15601548 else throw("no payments are expected")]
15611549 if ((checks == checks))
15621550 then {
15631551 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0))
15641552 if ((currentDLp == currentDLp))
15651553 then {
15661554 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
15671555 if ((unstakeInv == unstakeInv))
15681556 then {
15691557 let res = ego(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
15701558 let outAmAmt = res._1
15711559 let outPrAmt = res._2
15721560 let state = res._10
15731561 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
15741562 then true
15751563 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
15761564 then true
15771565 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
15781566 if ((checkAmounts == checkAmounts))
15791567 then {
15801568 let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
15811569 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15821570 then {
1583- let $t05238952470 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1584- let refreshDLpActions = $t05238952470._1
1585- let updatedDLp = $t05238952470._2
1571+ let $t05392754008 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1572+ let refreshDLpActions = $t05392754008._1
1573+ let updatedDLp = $t05392754008._2
15861574 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
15871575 if ((isUpdatedDLpValid == isUpdatedDLpValid))
15881576 then (state ++ refreshDLpActions)
15891577 else throw("Strict value is not equal to itself.")
15901578 }
15911579 else throw("Strict value is not equal to itself.")
15921580 }
15931581 else throw("Strict value is not equal to itself.")
15941582 }
15951583 else throw("Strict value is not equal to itself.")
15961584 }
15971585 else throw("Strict value is not equal to itself.")
15981586 }
15991587 else throw("Strict value is not equal to itself.")
16001588 }
16011589
16021590
16031591
16041592 @Callable(i)
16051593 func unstakeAndGetOneTknV2 (unstakeAmount,outAssetId,minOutAmount) = {
16061594 let isPoolOneTokenOperationsDisabled = {
16071595 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
16081596 if ($isInstanceOf(@, "Boolean"))
16091597 then @
16101598 else throw(($getType(@) + " couldn't be cast to Boolean"))
16111599 }
16121600 let isGetDisabled = if (if (igs())
16131601 then true
16141602 else (cfgPoolStatus == PoolShutdown))
16151603 then true
16161604 else isPoolOneTokenOperationsDisabled
16171605 let checks = [if (if (!(isGetDisabled))
16181606 then true
16191607 else isManager(i))
16201608 then true
16211609 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
16221610 then true
16231611 else throwErr("no payments are expected")]
16241612 if ((checks == checks))
16251613 then {
16261614 let factoryCfg = gfc()
16271615 let lpAssetId = cfgLpAssetId
16281616 let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr")
16291617 let userAddress = i.caller
16301618 let lpAssetRecipientAddress = this
16311619 let unstakeInv = invoke(staking, "unstakeINTERNAL", [lpAssetId, unstakeAmount, userAddress.bytes, lpAssetRecipientAddress.bytes], nil)
16321620 if ((unstakeInv == unstakeInv))
16331621 then {
1634- let $t05349253680 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1635- let state = $t05349253680._1
1636- let totalAmount = $t05349253680._2
1622+ let $t05503055218 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1623+ let state = $t05503055218._1
1624+ let totalAmount = $t05503055218._2
16371625 $Tuple2(state, totalAmount)
16381626 }
16391627 else throw("Strict value is not equal to itself.")
16401628 }
16411629 else throw("Strict value is not equal to itself.")
16421630 }
16431631
16441632
16451633
16461634 @Callable(i)
16471635 func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = {
1648- let $t05380853911 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1649- let lpAmount = $t05380853911._1
1650- let state = $t05380853911._2
1651- let feeAmount = $t05380853911._3
1652- let bonus = $t05380853911._4
1636+ let $t05534655449 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1637+ let lpAmount = $t05534655449._1
1638+ let state = $t05534655449._2
1639+ let feeAmount = $t05534655449._3
1640+ let bonus = $t05534655449._4
16531641 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
16541642 }
16551643
16561644
16571645
16581646 @Callable(i)
16591647 func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = {
1660- let $t05405954163 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1661- let lpAmount = $t05405954163._1
1662- let state = $t05405954163._2
1663- let feeAmount = $t05405954163._3
1664- let bonus = $t05405954163._4
1648+ let $t05559755701 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1649+ let lpAmount = $t05559755701._1
1650+ let state = $t05559755701._2
1651+ let feeAmount = $t05559755701._3
1652+ let bonus = $t05559755701._4
16651653 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
16661654 }
16671655
16681656
16691657
16701658 @Callable(i)
16711659 func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString(fca)))
16721660 then throw("denied")
16731661 else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr)], "success")
16741662
16751663
16761664
16771665 @Callable(i)
16781666 func setS (k,v) = if ((toString(i.caller) != strf(this, ada())))
16791667 then pd
16801668 else [StringEntry(k, v)]
16811669
16821670
16831671
16841672 @Callable(i)
16851673 func setI (k,v) = if ((toString(i.caller) != strf(this, ada())))
16861674 then pd
16871675 else [IntegerEntry(k, v)]
16881676
16891677
16901678
16911679 @Callable(i)
16921680 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, gpc())
16931681
16941682
16951683
16961684 @Callable(i)
16971685 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
16981686
16991687
17001688
17011689 @Callable(i)
17021690 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
17031691 let pr = calcPrices(amAmt, prAmt, lpAmt)
17041692 $Tuple2(nil, [toString(pr[0]), toString(pr[1]), toString(pr[2])])
17051693 }
17061694
17071695
17081696
17091697 @Callable(i)
17101698 func fromX18WrapperREADONLY (val,resScaleMult) = $Tuple2(nil, f1(parseBigIntValue(val), resScaleMult))
17111699
17121700
17131701
17141702 @Callable(i)
17151703 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(t1(origVal, origScaleMult)))
17161704
17171705
17181706
17191707 @Callable(i)
17201708 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(cpbi(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
17211709
17221710
17231711
17241712 @Callable(i)
17251713 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, ""))
17261714
17271715
17281716
17291717 @Callable(i)
17301718 func estimateGetOperationWrapperREADONLY (txId58,pmtAsId,pmtLpAmt,usrAddr) = {
17311719 let r = ego(txId58, pmtAsId, pmtLpAmt, addressFromStringValue(usrAddr))
17321720 $Tuple2(nil, $Tuple10(r._1, r._2, r._3, r._4, r._5, r._6, r._7, toString(r._8), r._9, r._10))
17331721 }
17341722
17351723
1736-
1737-@Callable(i)
1738-func changeAmp () = {
1739- let cfg = invoke(fca, "getChangeAmpConfigREADONLY", [toString(this)], nil)
1740- let $t05683057026 = match cfg {
1741- case list: List[Any] =>
1742- $Tuple3({
1743- let @ = list[0]
1744- if ($isInstanceOf(@, "Int"))
1745- then @
1746- else throw(($getType(@) + " couldn't be cast to Int"))
1747- }, {
1748- let @ = list[1]
1749- if ($isInstanceOf(@, "Int"))
1750- then @
1751- else throw(($getType(@) + " couldn't be cast to Int"))
1752- }, {
1753- let @ = list[2]
1754- if ($isInstanceOf(@, "Int"))
1755- then @
1756- else throw(($getType(@) + " couldn't be cast to Int"))
1757- })
1758- case _ =>
1759- throw("invalid entry type")
1760- }
1761- let delay = $t05683057026._1
1762- let delta = $t05683057026._2
1763- let target = $t05683057026._3
1764- let curAmp = parseIntValue(getStringValue(amp()))
1765- let newAmpRaw = (curAmp + delta)
1766- let newAmp = if ((0 > delta))
1767- then if ((target > newAmpRaw))
1768- then target
1769- else newAmpRaw
1770- else if ((newAmpRaw > target))
1771- then target
1772- else newAmpRaw
1773- let lastCall = valueOrElse(getInteger(keyChangeAmpLastCall()), 0)
1774- let wait = (lastCall + delay)
1775- let checks = [if ((height > wait))
1776- then true
1777- else throwErr("try again in few blocks"), if ((curAmp != newAmp))
1778- then true
1779- else throwErr("already reached target")]
1780- if ((checks == checks))
1781- then [IntegerEntry(keyChangeAmpLastCall(), height), StringEntry(amp(), toString(newAmp)), StringEntry(keyAmpHistory(height), toString(newAmp))]
1782- else throw("Strict value is not equal to itself.")
1783- }
1784-
1785-
17861724 @Verifier(tx)
17871725 func verify () = {
17881726 let targetPublicKey = match m() {
17891727 case pk: ByteVector =>
17901728 pk
17911729 case _: Unit =>
17921730 tx.senderPublicKey
17931731 case _ =>
17941732 throw("Match error")
17951733 }
17961734 match tx {
17971735 case order: Order =>
17981736 let matcherPub = mp()
1799- let $t05793858055 = if (skipOrderValidation())
1800- then $Tuple2(true, "")
1801- else validateMatcherOrderAllowed(order)
1802- let orderValid = $t05793858055._1
1803- let orderValidInfo = $t05793858055._2
1737+ let $t05849358562 = validateMatcherOrderAllowed(order)
1738+ let orderValid = $t05849358562._1
1739+ let orderValidInfo = $t05849358562._2
18041740 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
18051741 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
18061742 if (if (if (orderValid)
18071743 then senderValid
18081744 else false)
18091745 then matcherValid
18101746 else false)
18111747 then true
18121748 else throwOrderError(orderValid, orderValidInfo, senderValid, matcherValid)
18131749 case s: SetScriptTransaction =>
18141750 if (sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey))
18151751 then true
18161752 else {
18171753 let newHash = blake2b256(value(s.script))
18181754 let allowedHash = fromBase64String(value(getString(fca, keyAllowedLpStableScriptHash())))
18191755 let currentHash = scriptHash(this)
18201756 if ((allowedHash == newHash))
18211757 then (currentHash != newHash)
18221758 else false
18231759 }
18241760 case _ =>
18251761 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
18261762 }
18271763 }
18281764

github/deemru/w8io/026f985 
770.31 ms