tx · 65c4X1HnxKDyDmn92xo6aZwyoDer8YyW6zkQNZKFhErk

3NBCeYr29WEMKPG9SvZHmSCGGwEd6PmiX6k:  -0.04100000 Waves

2023.07.19 14:41 [2672691] smart account 3NBCeYr29WEMKPG9SvZHmSCGGwEd6PmiX6k > SELF 0.00000000 Waves

{ "type": 13, "id": "65c4X1HnxKDyDmn92xo6aZwyoDer8YyW6zkQNZKFhErk", "fee": 4100000, "feeAssetId": null, "timestamp": 1689766971944, "version": 2, "chainId": 84, "sender": "3NBCeYr29WEMKPG9SvZHmSCGGwEd6PmiX6k", "senderPublicKey": "2znHcuxfG4M2jQxMq1T5P5KEV6ofYqpcdWRkzeVBLMHp", "proofs": [ "2kvMiMv4ZGdVtQoTnKhXxkzKvq4BFGQWBVnkWp2diKjzWyEiPRvtbsGoRAk5H3MnjoSyW2kM88HbcmUpqGnyxFRn" ], "script": "base64:BgKALQgCEgUKAwEEARIHCgUBBAEIARIDCgEIEgQKAgEEEgQKAgEEEgMKAQESABIECgIIARIAEgQKAggBEgQKAggBEgQKAgEBEgMKAQESBQoDAQEBEgUKAwEIARIECgIBCBIECgIBCBIECgIICBIAEgMKAQgSBQoDAQEBEgQKAggBEgQKAgEBEgQKAggIEgsKCQgBAQIBAggEBBIGCgQICAEIEgAiBnNjYWxlOCIMc2NhbGU4QmlnSW50IgdzY2FsZTE4Igp6ZXJvQmlnSW50IgRiaWcwIgRiaWcxIgRiaWcyIgRiaWczIgRiaWc0IgpzbGlwcGFnZTREIgt3YXZlc1N0cmluZyIKYW1wSW5pdGlhbCIFQW11bHQiBURjb252IgNTRVAiBUVNUFRZIgpQb29sQWN0aXZlIgpQb29sUHV0RGlzIg5Qb29sTWF0Y2hlckRpcyIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyIJaWR4UG9vbFN0IglpZHhMUEFzSWQiCWlkeEFtQXNJZCIJaWR4UHJBc0lkIgtpZHhBbXRBc0RjbSINaWR4UHJpY2VBc0RjbSILaWR4SUFt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dGVzCQCRAwIIBQJmZgZwcm9vZnMAAAgFAmZmD3NlbmRlclB1YmxpY0tleQQCYU4JAPQDAwgFAmZmCWJvZHlCeXRlcwkAkQMCCAUCZmYGcHJvb2ZzAAEFAml4AwMDBQJhSwUCYU0HBQJhTgcGCQECYUoEBQJhSwUCYUwFAmFNBQJhTgMJAAECBQJhUQIUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAmFWBQJhUQMJAPQDAwgFAml1CWJvZHlCeXRlcwkAkQMCCAUCaXUGcHJvb2ZzAAAFAml3BgQCaXoJAPYDAQkBBXZhbHVlAQgFAmFWBnNjcmlwdAQCaUEJANsEAQkBBXZhbHVlAQkAnQgCBQJhVQkBAmFGAAQCaUIJAPEHAQUEdGhpcwMJAAACBQJpQQUCaXoJAQIhPQIFAmlCBQJpegcJAPQDAwgFAml1CWJvZHlCeXRlcwkAkQMCCAUCaXUGcHJvb2ZzAAAFAml3UirlHw==", "height": 2672691, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: J8i4QJJvKu8C92ogEUxdAzd93bpd5AFy5T1qtxfefmJf Next: none Diff:
OldNewDifferences
103103 func fc () = "%s__factoryContract"
104104
105105
106-func mpk () = "%s__managerPublicKey"
106+func keyManagerPublicKey () = "%s__managerPublicKey"
107107
108108
109-func pmpk () = "%s__pendingManagerPublicKey"
109+func keyManagerVaultAddress () = "%s__managerVaultAddress"
110110
111111
112112 func pl () = "%s%s__price__last"
177177 func throwOrderError (orderValid,orderValidInfo,senderValid,matcherValid) = throw((((((((("order validation failed: orderValid=" + toString(orderValid)) + " (") + orderValidInfo) + ")") + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
178178
179179
180+func addressFromStringOrThis (addressString) = match addressFromString(addressString) {
181+ case a: Address =>
182+ a
183+ case _ =>
184+ this
185+}
186+
187+
188+func getManagerVaultAddressOrThis () = {
189+ let factoryAddress = match getString(fc()) {
190+ case fca: String =>
191+ addressFromStringOrThis(fca)
192+ case _ =>
193+ this
194+ }
195+ match getString(factoryAddress, keyManagerVaultAddress()) {
196+ case s: String =>
197+ addressFromStringOrThis(s)
198+ case _ =>
199+ this
200+ }
201+ }
202+
203+
180204 func strf (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
181205
182206
239263
240264 let poolConfigParsed = parsePoolConfig(gpc())
241265
242-let $t080878273 = poolConfigParsed
266+let $t086088794 = poolConfigParsed
243267
244-let cfgPoolAddress = $t080878273._1
268+let cfgPoolAddress = $t086088794._1
245269
246-let cfgPoolStatus = $t080878273._2
270+let cfgPoolStatus = $t086088794._2
247271
248-let cfgLpAssetId = $t080878273._3
272+let cfgLpAssetId = $t086088794._3
249273
250-let cfgAmountAssetId = $t080878273._4
274+let cfgAmountAssetId = $t086088794._4
251275
252-let cfgPriceAssetId = $t080878273._5
276+let cfgPriceAssetId = $t086088794._5
253277
254-let cfgAmountAssetDecimals = $t080878273._6
278+let cfgAmountAssetDecimals = $t086088794._6
255279
256-let cfgPriceAssetDecimals = $t080878273._7
280+let cfgPriceAssetDecimals = $t086088794._7
257281
258282 func gfc () = split(strf(fca, fcfg()), SEP)
259283
374398 }
375399
376400 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
377- let $t01277812826 = {
401+ let $t01329913347 = {
378402 let $l = arr
379403 let $s = size($l)
380404 let $acc0 = $Tuple2(s, false)
388412
389413 $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)
390414 }
391- let d = $t01277812826._1
392- let found = $t01277812826._2
415+ let d = $t01329913347._1
416+ let found = $t01329913347._2
393417 if (found)
394418 then d
395419 else throw(("D calculation error, D = " + toString(d)))
523547 else calcLpAmt
524548 let amDiff = (inAmAmt - calcAmAssetPmt)
525549 let prDiff = (inPrAmt - calcPrAssetPmt)
526- let $t02058820933 = if (if (isOneAsset)
550+ let $t02110921454 = if (if (isOneAsset)
527551 then (pmtId == amIdStr)
528552 else false)
529553 then $Tuple2(pmtAmt, 0)
532556 else false)
533557 then $Tuple2(0, pmtAmt)
534558 else $Tuple2(calcAmAssetPmt, calcPrAssetPmt)
535- let writeAmAmt = $t02058820933._1
536- let writePrAmt = $t02058820933._2
559+ let writeAmAmt = $t02110921454._1
560+ let writePrAmt = $t02110921454._2
537561 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))]
538562 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId)
539563 }
552576 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
553577 let b = ((s + ((D * aPrecision) / ann)) - D)
554578 func calc (acc,cur) = {
555- let $t02212822148 = acc
556- let y = $t02212822148._1
557- let found = $t02212822148._2
579+ let $t02264922669 = acc
580+ let y = $t02264922669._1
581+ let found = $t02264922669._2
558582 if ((found != unit))
559583 then acc
560584 else {
567591 }
568592
569593 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
570- let $t02245522502 = {
594+ let $t02297623023 = {
571595 let $l = arr
572596 let $s = size($l)
573597 let $acc0 = $Tuple2(D, unit)
581605
582606 $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)
583607 }
584- let y = $t02245522502._1
585- let found = $t02245522502._2
608+ let y = $t02297623023._1
609+ let found = $t02297623023._2
586610 if ((found != unit))
587611 then y
588612 else throw(("Y calculation error, Y = " + toString(y)))
626650 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
627651 let amountAssetAmount = order.amount
628652 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
629- let $t02470024912 = if ((order.orderType == Buy))
653+ let $t02522125433 = if ((order.orderType == Buy))
630654 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
631655 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
632- let amountAssetBalanceDelta = $t02470024912._1
633- let priceAssetBalanceDelta = $t02470024912._2
656+ let amountAssetBalanceDelta = $t02522125433._1
657+ let priceAssetBalanceDelta = $t02522125433._2
634658 if (if (if (igs())
635659 then true
636660 else (cfgPoolStatus == PoolMatcherDis))
643667 then throw("Wr assets")
644668 else {
645669 let dLp = parseBigIntValue(valueOrElse(getString(this, keyDLp), "0"))
646- let $t02525425354 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
647- let unusedActions = $t02525425354._1
648- let dLpNew = $t02525425354._2
670+ let $t02577525875 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
671+ let unusedActions = $t02577525875._1
672+ let dLpNew = $t02577525875._2
649673 let isOrderValid = (dLpNew >= dLp)
650674 let info = makeString(["dLp=", toString(dLp), " dLpNew=", toString(dLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "")
651675 $Tuple2(isOrderValid, info)
699723 then {
700724 let amBalance = getAccBalance(amId)
701725 let prBalance = getAccBalance(prId)
702- let $t02801028472 = if ((txId == ""))
726+ let $t02853128993 = if ((txId == ""))
703727 then $Tuple2(amBalance, prBalance)
704728 else if ((pmtAssetId == amId))
705729 then if ((pmtAmtRaw > amBalance))
710734 then throw("invalid payment amount")
711735 else $Tuple2(amBalance, (prBalance - pmtAmtRaw))
712736 else throw("wrong pmtAssetId")
713- let amBalanceOld = $t02801028472._1
714- let prBalanceOld = $t02801028472._2
715- let $t02847828654 = if ((pmtAssetId == amId))
737+ let amBalanceOld = $t02853128993._1
738+ let prBalanceOld = $t02853128993._2
739+ let $t02899929175 = if ((pmtAssetId == amId))
716740 then $Tuple2(pmtAmtRaw, 0)
717741 else if ((pmtAssetId == prId))
718742 then $Tuple2(0, pmtAmtRaw)
719743 else throw("invalid payment")
720- let amAmountRaw = $t02847828654._1
721- let prAmountRaw = $t02847828654._2
722- let $t02865828912 = if (withTakeFee)
744+ let amAmountRaw = $t02899929175._1
745+ let prAmountRaw = $t02899929175._2
746+ let $t02917929433 = if (withTakeFee)
723747 then $Tuple3(takeFee(amAmountRaw, inFee)._1, takeFee(prAmountRaw, inFee)._1, takeFee(pmtAmtRaw, inFee)._2)
724748 else $Tuple3(amAmountRaw, prAmountRaw, 0)
725- let amAmount = $t02865828912._1
726- let prAmount = $t02865828912._2
727- let feeAmount = $t02865828912._3
749+ let amAmount = $t02917929433._1
750+ let prAmount = $t02917929433._2
751+ let feeAmount = $t02917929433._3
728752 let amBalanceNew = (amBalanceOld + amAmount)
729753 let prBalanceNew = (prBalanceOld + prAmount)
730754 let D0 = getD([t1(amBalanceOld, cfgAmountAssetDecimals), t1(prBalanceOld, cfgPriceAssetDecimals)])
772796 else {
773797 let amBalance = getAccBalance(amId)
774798 let prBalance = getAccBalance(prId)
775- let $t03102431135 = {
799+ let $t03154531656 = {
776800 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil)
777801 if ($isInstanceOf(@, "(Int, Int)"))
778802 then @
779803 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
780804 }
781- if (($t03102431135 == $t03102431135))
805+ if (($t03154531656 == $t03154531656))
782806 then {
783- let feeAmount = $t03102431135._2
784- let totalGet = $t03102431135._1
807+ let feeAmount = $t03154531656._2
808+ let totalGet = $t03154531656._1
785809 let totalAmount = if (if ((minOutAmount > 0))
786810 then (minOutAmount > totalGet)
787811 else false)
788812 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
789813 else totalGet
790- let $t03132531632 = if ((outAssetId == amId))
814+ let $t03184632153 = if ((outAssetId == amId))
791815 then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance)
792816 else if ((outAssetId == prId))
793817 then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount))
794818 else throw("invalid out asset id")
795- let outAm = $t03132531632._1
796- let outPr = $t03132531632._2
797- let amBalanceNew = $t03132531632._3
798- let prBalanceNew = $t03132531632._4
819+ let outAm = $t03184632153._1
820+ let outPr = $t03184632153._2
821+ let amBalanceNew = $t03184632153._3
822+ let prBalanceNew = $t03184632153._4
799823 let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals))
800824 let curPr = f1(curPrX18, scale8)
801825 let outAssetIdOrWaves = if ((outAssetId == "WAVES"))
810834 let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
811835 if ((burn == burn))
812836 then {
813- let $t03241732767 = {
837+ let $t03293833288 = {
814838 let feeAmountForCalc = if ((this == feeCollectorAddress))
815839 then 0
816840 else feeAmount
821845 then $Tuple2(-((totalGet + feeAmountForCalc)), 0)
822846 else $Tuple2(0, -((totalGet + feeAmountForCalc)))
823847 }
824- let amountAssetBalanceDelta = $t03241732767._1
825- let priceAssetBalanceDelta = $t03241732767._2
826- let $t03277032878 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
827- let refreshDLpActions = $t03277032878._1
828- let updatedDLp = $t03277032878._2
848+ let amountAssetBalanceDelta = $t03293833288._1
849+ let priceAssetBalanceDelta = $t03293833288._2
850+ let $t03329133399 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
851+ let refreshDLpActions = $t03329133399._1
852+ let updatedDLp = $t03329133399._2
829853 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
830854 if ((isUpdatedDLpValid == isUpdatedDLpValid))
831855 then $Tuple2((state ++ refreshDLpActions), totalAmount)
842866 }
843867
844868
845-func m () = match getString(mpk()) {
846- case s: String =>
847- fromBase58String(s)
848- case _: Unit =>
849- unit
850- case _ =>
851- throw("Match error")
852-}
853-
854-
855-func pm () = match getString(pmpk()) {
856- case s: String =>
857- fromBase58String(s)
858- case _: Unit =>
859- unit
860- case _ =>
861- throw("Match error")
862-}
869+func managerPublicKeyOrUnit () = {
870+ let managerVaultAddress = getManagerVaultAddressOrThis()
871+ match getString(managerVaultAddress, keyManagerPublicKey()) {
872+ case s: String =>
873+ fromBase58String(s)
874+ case _: Unit =>
875+ unit
876+ case _ =>
877+ throw("Match error")
878+ }
879+ }
863880
864881
865882 let pd = throw("Permission denied")
866883
867-func isManager (i) = match m() {
884+func isManager (i) = match managerPublicKeyOrUnit() {
868885 case pk: ByteVector =>
869886 (i.callerPublicKey == pk)
870887 case _: Unit =>
874891 }
875892
876893
877-func mm (i) = match m() {
894+func mustManager (i) = match managerPublicKeyOrUnit() {
878895 case pk: ByteVector =>
879896 if ((i.callerPublicKey == pk))
880897 then true
904921 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
905922 let b = ((s + ((D * aPrecision) / ann)) - D)
906923 func calc (acc,cur) = {
907- let $t03432534345 = acc
908- let y = $t03432534345._1
909- let found = $t03432534345._2
924+ let $t03488634906 = acc
925+ let y = $t03488634906._1
926+ let found = $t03488634906._2
910927 if ((found != unit))
911928 then acc
912929 else {
919936 }
920937
921938 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
922- let $t03467634723 = {
939+ let $t03523735284 = {
923940 let $l = arr
924941 let $s = size($l)
925942 let $acc0 = $Tuple2(D, unit)
933950
934951 $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)
935952 }
936- let y = $t03467634723._1
937- let found = $t03467634723._2
953+ let y = $t03523735284._1
954+ let found = $t03523735284._2
938955 if ((found != unit))
939956 then y
940957 else throw(("Y calculation error, Y = " + toString(y)))
946963
947964 @Callable(i)
948965 func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = {
949- let $t03507535499 = if ((isReverse == false))
966+ let $t03563636060 = if ((isReverse == false))
950967 then {
951968 let assetOut = strf(this, pa())
952969 let poolAmountInBalance = (toBigInt(getAccBalance(strf(this, aa()))) + toBigInt(cleanAmountIn))
957974 let poolAmountInBalance = (toBigInt(getAccBalance(strf(this, pa()))) + toBigInt(cleanAmountIn))
958975 $Tuple2(assetOut, poolAmountInBalance)
959976 }
960- let assetOut = $t03507535499._1
961- let poolAmountInBalance = $t03507535499._2
977+ let assetOut = $t03563636060._1
978+ let poolAmountInBalance = $t03563636060._2
962979 let poolConfig = gpc()
963980 let amId = poolConfig[idxAmAsId]
964981 let prId = poolConfig[idxPrAsId]
9981015 then {
9991016 let pmt = value(i.payments[0])
10001017 let assetIn = assetIdToString(pmt.assetId)
1001- let $t03693537329 = if ((isReverse == false))
1018+ let $t03749637890 = if ((isReverse == false))
10021019 then {
10031020 let assetOut = strf(this, pa())
10041021 let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
10091026 let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
10101027 $Tuple2(assetOut, poolAmountInBalance)
10111028 }
1012- let assetOut = $t03693537329._1
1013- let poolAmountInBalance = $t03693537329._2
1029+ let assetOut = $t03749637890._1
1030+ let poolAmountInBalance = $t03749637890._2
10141031 let poolConfig = gpc()
10151032 let amId = poolConfig[idxAmAsId]
10161033 let prId = poolConfig[idxPrAsId]
10461063
10471064 @Callable(i)
10481065 func constructor (fc) = {
1049- let c = mm(i)
1066+ let c = mustManager(i)
10501067 if ((c == c))
10511068 then [StringEntry(fc(), fc)]
1052- else throw("Strict value is not equal to itself.")
1053- }
1054-
1055-
1056-
1057-@Callable(i)
1058-func setManager (pendingManagerPublicKey) = {
1059- let c = mm(i)
1060- if ((c == c))
1061- then {
1062- let cm = fromBase58String(pendingManagerPublicKey)
1063- if ((cm == cm))
1064- then [StringEntry(pmpk(), pendingManagerPublicKey)]
1065- else throw("Strict value is not equal to itself.")
1066- }
1067- else throw("Strict value is not equal to itself.")
1068- }
1069-
1070-
1071-
1072-@Callable(i)
1073-func confirmManager () = {
1074- let p = pm()
1075- let hpm = if (isDefined(p))
1076- then true
1077- else throw("No pending manager")
1078- if ((hpm == hpm))
1079- then {
1080- let cpm = if ((i.callerPublicKey == value(p)))
1081- then true
1082- else throw("You are not pending manager")
1083- if ((cpm == cpm))
1084- then [StringEntry(mpk(), toBase58String(value(p))), DeleteEntry(pmpk())]
1085- else throw("Strict value is not equal to itself.")
1086- }
10871069 else throw("Strict value is not equal to itself.")
10881070 }
10891071
11501132 else throw("Strict value is not equal to itself.")
11511133 }
11521134 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
1153- let $t04194842090 = refreshDLpInternal(0, 0, 0)
1154- let refreshDLpActions = $t04194842090._1
1155- let updatedDLp = $t04194842090._2
1135+ let $t04203442176 = refreshDLpInternal(0, 0, 0)
1136+ let refreshDLpActions = $t04203442176._1
1137+ let updatedDLp = $t04203442176._2
11561138 let check = if ((updatedDLp >= currentDLp))
11571139 then true
11581140 else throwErr(makeString(["updated DLp lower than current DLp", toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentDLp), toString(updatedDLp), toString(amDiff), toString(prDiff)], " "))
12251207 else calcCurrentDLp(toBigInt(0), toBigInt(pmtAmt), toBigInt(0))
12261208 if ((currentDLp == currentDLp))
12271209 then {
1228- let $t04373143889 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1229- if (($t04373143889 == $t04373143889))
1210+ let $t04381743975 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1211+ if (($t04381743975 == $t04381743975))
12301212 then {
1231- let feeAmount = $t04373143889._3
1232- let state = $t04373143889._2
1233- let estimLP = $t04373143889._1
1213+ let feeAmount = $t04381743975._3
1214+ let state = $t04381743975._2
1215+ let estimLP = $t04381743975._1
12341216 let emitLpAmt = if (if ((minOutAmount > 0))
12351217 then (minOutAmount > estimLP)
12361218 else false)
12581240 let sendFeeToMatcher = if ((feeAmount > 0))
12591241 then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))]
12601242 else nil
1261- let $t04477445123 = if ((this == feeCollectorAddress))
1243+ let $t04486045209 = if ((this == feeCollectorAddress))
12621244 then $Tuple2(0, 0)
12631245 else {
12641246 let paymentInAmountAsset = if ((pmt.assetId == cfgAmountAssetId))
12681250 then $Tuple2(-(feeAmount), 0)
12691251 else $Tuple2(0, -(feeAmount))
12701252 }
1271- let amountAssetBalanceDelta = $t04477445123._1
1272- let priceAssetBalanceDelta = $t04477445123._2
1273- let $t04512645234 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1274- let refreshDLpActions = $t04512645234._1
1275- let updatedDLp = $t04512645234._2
1253+ let amountAssetBalanceDelta = $t04486045209._1
1254+ let priceAssetBalanceDelta = $t04486045209._2
1255+ let $t04521245320 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1256+ let refreshDLpActions = $t04521245320._1
1257+ let updatedDLp = $t04521245320._2
12761258 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
12771259 if ((isUpdatedDLpValid == isUpdatedDLpValid))
12781260 then $Tuple2((((state ++ lpTrnsfr) ++ sendFeeToMatcher) ++ refreshDLpActions), emitLpAmt)
13041286 let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0))
13051287 if ((currentDLp == currentDLp))
13061288 then {
1307- let $t04626446329 = refreshDLpInternal(0, 0, 0)
1308- let refreshDLpActions = $t04626446329._1
1309- let updatedDLp = $t04626446329._2
1289+ let $t04635046415 = refreshDLpInternal(0, 0, 0)
1290+ let refreshDLpActions = $t04635046415._1
1291+ let updatedDLp = $t04635046415._2
13101292 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
13111293 if ((isUpdatedDLpValid == isUpdatedDLpValid))
13121294 then (state ++ refreshDLpActions)
13311313 let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
13321314 if ((b == b))
13331315 then {
1334- let $t04750247584 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1335- let refreshDLpActions = $t04750247584._1
1336- let updatedDLp = $t04750247584._2
1316+ let $t04758847670 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1317+ let refreshDLpActions = $t04758847670._1
1318+ let updatedDLp = $t04758847670._2
13371319 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
13381320 if ((isUpdatedDLpValid == isUpdatedDLpValid))
13391321 then (state ++ refreshDLpActions)
13681350 else throwErr("exactly 1 payment are expected")]
13691351 if ((checks == checks))
13701352 then {
1371- let $t04820248357 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1372- let state = $t04820248357._1
1373- let totalAmount = $t04820248357._2
1353+ let $t04828848443 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1354+ let state = $t04828848443._1
1355+ let totalAmount = $t04828848443._2
13741356 $Tuple2(state, totalAmount)
13751357 }
13761358 else throw("Strict value is not equal to itself.")
13871369 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
13881370 then {
13891371 let dLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyDLp), "0")), fmtErr("invalid dLp"))
1390- let $t04888148945 = refreshDLpInternal(0, 0, 0)
1391- let dLpUpdateActions = $t04888148945._1
1392- let updatedDLp = $t04888148945._2
1372+ let $t04896749031 = refreshDLpInternal(0, 0, 0)
1373+ let dLpUpdateActions = $t04896749031._1
1374+ let updatedDLp = $t04896749031._2
13931375 let actions = if ((dLp != updatedDLp))
13941376 then dLpUpdateActions
13951377 else throwErr("nothing to refresh")
14171399 let newY = getYD(xp, index, D1)
14181400 let dy = (xp[index] - newY)
14191401 let totalGetRaw = max([0, toInt((dy - big1))])
1420- let $t04995550010 = takeFee(totalGetRaw, outFee)
1421- let totalGet = $t04995550010._1
1422- let feeAmount = $t04995550010._2
1402+ let $t05004150096 = takeFee(totalGetRaw, outFee)
1403+ let totalGet = $t05004150096._1
1404+ let feeAmount = $t05004150096._2
14231405 $Tuple2(nil, $Tuple2(totalGet, feeAmount))
14241406 }
14251407
14321414 let lpId = toBase58String(value(cfgLpAssetId))
14331415 let amBalance = getAccBalance(amId)
14341416 let prBalance = getAccBalance(prId)
1435- let $t05038550500 = {
1417+ let $t05047150586 = {
14361418 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil)
14371419 if ($isInstanceOf(@, "(Int, Int)"))
14381420 then @
14391421 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
14401422 }
1441- let totalGet = $t05038550500._1
1442- let feeAmount = $t05038550500._2
1423+ let totalGet = $t05047150586._1
1424+ let feeAmount = $t05047150586._2
14431425 let r = ego("", lpId, lpAssetAmount, this)
14441426 let outAmAmt = r._1
14451427 let outPrAmt = r._2
14731455 let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14741456 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14751457 then {
1476- let $t05166651747 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1477- let refreshDLpActions = $t05166651747._1
1478- let updatedDLp = $t05166651747._2
1458+ let $t05175251833 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1459+ let refreshDLpActions = $t05175251833._1
1460+ let updatedDLp = $t05175251833._2
14791461 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
14801462 if ((isUpdatedDLpValid == isUpdatedDLpValid))
14811463 then (state ++ refreshDLpActions)
15201502 let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
15211503 if ((burnA == burnA))
15221504 then {
1523- let $t05277452855 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1524- let refreshDLpActions = $t05277452855._1
1525- let updatedDLp = $t05277452855._2
1505+ let $t05286052941 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1506+ let refreshDLpActions = $t05286052941._1
1507+ let updatedDLp = $t05286052941._2
15261508 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
15271509 if ((isUpdatedDLpValid == isUpdatedDLpValid))
15281510 then (state ++ refreshDLpActions)
15731555 let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
15741556 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15751557 then {
1576- let $t05410654187 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1577- let refreshDLpActions = $t05410654187._1
1578- let updatedDLp = $t05410654187._2
1558+ let $t05419254273 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1559+ let refreshDLpActions = $t05419254273._1
1560+ let updatedDLp = $t05419254273._2
15791561 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
15801562 if ((isUpdatedDLpValid == isUpdatedDLpValid))
15811563 then (state ++ refreshDLpActions)
16241606 let unstakeInv = invoke(staking, "unstakeINTERNAL", [lpAssetId, unstakeAmount, userAddress.bytes, lpAssetRecipientAddress.bytes], nil)
16251607 if ((unstakeInv == unstakeInv))
16261608 then {
1627- let $t05520955397 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1628- let state = $t05520955397._1
1629- let totalAmount = $t05520955397._2
1609+ let $t05529555483 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1610+ let state = $t05529555483._1
1611+ let totalAmount = $t05529555483._2
16301612 $Tuple2(state, totalAmount)
16311613 }
16321614 else throw("Strict value is not equal to itself.")
16381620
16391621 @Callable(i)
16401622 func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = {
1641- let $t05552555628 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1642- let lpAmount = $t05552555628._1
1643- let state = $t05552555628._2
1644- let feeAmount = $t05552555628._3
1645- let bonus = $t05552555628._4
1623+ let $t05561155714 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1624+ let lpAmount = $t05561155714._1
1625+ let state = $t05561155714._2
1626+ let feeAmount = $t05561155714._3
1627+ let bonus = $t05561155714._4
16461628 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
16471629 }
16481630
16501632
16511633 @Callable(i)
16521634 func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = {
1653- let $t05577655880 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1654- let lpAmount = $t05577655880._1
1655- let state = $t05577655880._2
1656- let feeAmount = $t05577655880._3
1657- let bonus = $t05577655880._4
1635+ let $t05586255966 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1636+ let lpAmount = $t05586255966._1
1637+ let state = $t05586255966._2
1638+ let feeAmount = $t05586255966._3
1639+ let bonus = $t05586255966._4
16581640 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
16591641 }
16601642
16631645 @Callable(i)
16641646 func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString(fca)))
16651647 then throw("denied")
1666- else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr), StringEntry(amp(), toString(ampInitial))], "success")
1648+ else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr), StringEntry(amp(), toString(ampInitial)), StringEntry(keyAmpHistory(height), toString(ampInitial))], "success")
16671649
16681650
16691651
17161698 @Callable(i)
17171699 func changeAmp () = {
17181700 let cfg = invoke(fca, "getChangeAmpConfigREADONLY", [toString(this)], nil)
1719- let $t05828958488 = match cfg {
1701+ let $t05844658645 = match cfg {
17201702 case list: List[Any] =>
17211703 $Tuple3({
17221704 let @ = list[0]
17371719 case _ =>
17381720 throwErr("invalid entry type")
17391721 }
1740- let delay = $t05828958488._1
1741- let delta = $t05828958488._2
1742- let target = $t05828958488._3
1722+ let delay = $t05844658645._1
1723+ let delta = $t05844658645._2
1724+ let target = $t05844658645._3
17431725 let curAmp = parseIntValue(getStringValue(amp()))
17441726 let newAmpRaw = (curAmp + delta)
17451727 let newAmp = if ((0 > delta))
17641746
17651747 @Verifier(tx)
17661748 func verify () = {
1767- let targetPublicKey = match m() {
1749+ let targetPublicKey = match managerPublicKeyOrUnit() {
17681750 case pk: ByteVector =>
17691751 pk
17701752 case _: Unit =>
17751757 match tx {
17761758 case order: Order =>
17771759 let matcherPub = mp()
1778- let $t05940059517 = if (skipOrderValidation())
1760+ let $t05957859695 = if (skipOrderValidation())
17791761 then $Tuple2(true, "")
17801762 else validateMatcherOrderAllowed(order)
1781- let orderValid = $t05940059517._1
1782- let orderValidInfo = $t05940059517._2
1763+ let orderValid = $t05957859695._1
1764+ let orderValidInfo = $t05957859695._2
17831765 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
17841766 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
17851767 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 ampInitial = 50
2727
2828 let Amult = "100"
2929
3030 let Dconv = "1"
3131
3232 let SEP = "__"
3333
3434 let EMPTY = ""
3535
3636 let PoolActive = 1
3737
3838 let PoolPutDis = 2
3939
4040 let PoolMatcherDis = 3
4141
4242 let PoolShutdown = 4
4343
4444 let idxPoolAddress = 1
4545
4646 let idxPoolSt = 2
4747
4848 let idxLPAsId = 3
4949
5050 let idxAmAsId = 4
5151
5252 let idxPrAsId = 5
5353
5454 let idxAmtAsDcm = 6
5555
5656 let idxPriceAsDcm = 7
5757
5858 let idxIAmtAsId = 8
5959
6060 let idxIPriceAsId = 9
6161
6262 let idxFactStakCntr = 1
6363
6464 let idxFactoryRestCntr = 6
6565
6666 let idxFactSlippCntr = 7
6767
6868 let idxFactGwxRewCntr = 10
6969
7070 let feeDefault = fraction(10, scale8, 10000)
7171
7272 func t1 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
7373
7474
7575 func t1BigInt (origVal,origScaleMult) = fraction(origVal, scale18, origScaleMult)
7676
7777
7878 func f1 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
7979
8080
8181 func fromX18Round (val,resultScaleMult,round) = toInt(fraction(val, toBigInt(resultScaleMult), scale18, round))
8282
8383
8484 func t2 (origVal,origScaleMult) = fraction(origVal, scale18, toBigInt(origScaleMult))
8585
8686
8787 func f2 (val,resultScaleMult) = fraction(val, toBigInt(resultScaleMult), scale18)
8888
8989
9090 func ts (amt,resScale,curScale) = fraction(amt, resScale, curScale)
9191
9292
9393 func abs (val) = if ((zeroBigInt > val))
9494 then -(val)
9595 else val
9696
9797
9898 func absBigInt (val) = if ((zeroBigInt > val))
9999 then -(val)
100100 else val
101101
102102
103103 func fc () = "%s__factoryContract"
104104
105105
106-func mpk () = "%s__managerPublicKey"
106+func keyManagerPublicKey () = "%s__managerPublicKey"
107107
108108
109-func pmpk () = "%s__pendingManagerPublicKey"
109+func keyManagerVaultAddress () = "%s__managerVaultAddress"
110110
111111
112112 func pl () = "%s%s__price__last"
113113
114114
115115 func ph (h,t) = makeString(["%s%s%d%d__price__history", toString(h), toString(t)], SEP)
116116
117117
118118 func pau (ua,txId) = ((("%s%s%s__P__" + ua) + "__") + txId)
119119
120120
121121 func gau (ua,txId) = ((("%s%s%s__G__" + ua) + "__") + txId)
122122
123123
124124 func aa () = "%s__amountAsset"
125125
126126
127127 func pa () = "%s__priceAsset"
128128
129129
130130 func amp () = "%s__amp"
131131
132132
133133 func keyAmpHistory (heightBlocks) = ("%s%d__amp__" + toString(heightBlocks))
134134
135135
136136 func keyChangeAmpLastCall () = "%s__changeAmpLastCall"
137137
138138
139139 let keyFee = "%s__fee"
140140
141141 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
142142
143143 let keyDLp = makeString(["%s", "dLp"], SEP)
144144
145145 let keyDLpRefreshedHeight = makeString(["%s", "dLpRefreshedHeight"], SEP)
146146
147147 let keyDLpRefreshDelay = makeString(["%s", "refreshDLpDelay"], SEP)
148148
149149 let dLpRefreshDelayDefault = 30
150150
151151 let dLpRefreshDelay = valueOrElse(getInteger(this, keyDLpRefreshDelay), dLpRefreshDelayDefault)
152152
153153 func fcfg () = "%s__factoryConfig"
154154
155155
156156 func mtpk () = "%s%s__matcher__publicKey"
157157
158158
159159 func pc (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config")
160160
161161
162162 func mba (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr)
163163
164164
165165 func aps () = "%s__shutdown"
166166
167167
168168 func keyAllowedLpStableScriptHash () = "%s__allowedLpStableScriptHash"
169169
170170
171171 func keyFeeCollectorAddress () = "%s__feeCollectorAddress"
172172
173173
174174 func keySkipOrderValidation (poolAddress) = ("%s%s__skipOrderValidation__" + poolAddress)
175175
176176
177177 func throwOrderError (orderValid,orderValidInfo,senderValid,matcherValid) = throw((((((((("order validation failed: orderValid=" + toString(orderValid)) + " (") + orderValidInfo) + ")") + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
178178
179179
180+func addressFromStringOrThis (addressString) = match addressFromString(addressString) {
181+ case a: Address =>
182+ a
183+ case _ =>
184+ this
185+}
186+
187+
188+func getManagerVaultAddressOrThis () = {
189+ let factoryAddress = match getString(fc()) {
190+ case fca: String =>
191+ addressFromStringOrThis(fca)
192+ case _ =>
193+ this
194+ }
195+ match getString(factoryAddress, keyManagerVaultAddress()) {
196+ case s: String =>
197+ addressFromStringOrThis(s)
198+ case _ =>
199+ this
200+ }
201+ }
202+
203+
180204 func strf (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
181205
182206
183207 func intf (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
184208
185209
186210 func throwErr (msg) = throw(makeString(["lp_stable.ride:", msg], " "))
187211
188212
189213 func fmtErr (msg) = makeString(["lp_stable.ride:", msg], " ")
190214
191215
192216 let fca = addressFromStringValue(strf(this, fc()))
193217
194218 let inFee = {
195219 let @ = invoke(fca, "getInFeeREADONLY", [toString(this)], nil)
196220 if ($isInstanceOf(@, "Int"))
197221 then @
198222 else throw(($getType(@) + " couldn't be cast to Int"))
199223 }
200224
201225 let outFee = {
202226 let @ = invoke(fca, "getOutFeeREADONLY", [toString(this)], nil)
203227 if ($isInstanceOf(@, "Int"))
204228 then @
205229 else throw(($getType(@) + " couldn't be cast to Int"))
206230 }
207231
208232 let A = strf(this, amp())
209233
210234 func igs () = valueOrElse(getBoolean(fca, aps()), false)
211235
212236
213237 func mp () = fromBase58String(strf(fca, mtpk()))
214238
215239
216240 let feeCollectorAddress = addressFromStringValue(strf(fca, keyFeeCollectorAddress()))
217241
218242 func gpc () = {
219243 let amtAs = strf(this, aa())
220244 let priceAs = strf(this, pa())
221245 let iPriceAs = intf(fca, mba(priceAs))
222246 let iAmtAs = intf(fca, mba(amtAs))
223247 split(strf(fca, pc(toString(iAmtAs), toString(iPriceAs))), SEP)
224248 }
225249
226250
227251 func parseAssetId (input) = if ((input == wavesString))
228252 then unit
229253 else fromBase58String(input)
230254
231255
232256 func assetIdToString (input) = if ((input == unit))
233257 then wavesString
234258 else toBase58String(value(input))
235259
236260
237261 func parsePoolConfig (poolConfig) = $Tuple7(addressFromStringValue(poolConfig[idxPoolAddress]), parseIntValue(poolConfig[idxPoolSt]), fromBase58String(poolConfig[idxLPAsId]), parseAssetId(poolConfig[idxAmAsId]), parseAssetId(poolConfig[idxPrAsId]), parseIntValue(poolConfig[idxAmtAsDcm]), parseIntValue(poolConfig[idxPriceAsDcm]))
238262
239263
240264 let poolConfigParsed = parsePoolConfig(gpc())
241265
242-let $t080878273 = poolConfigParsed
266+let $t086088794 = poolConfigParsed
243267
244-let cfgPoolAddress = $t080878273._1
268+let cfgPoolAddress = $t086088794._1
245269
246-let cfgPoolStatus = $t080878273._2
270+let cfgPoolStatus = $t086088794._2
247271
248-let cfgLpAssetId = $t080878273._3
272+let cfgLpAssetId = $t086088794._3
249273
250-let cfgAmountAssetId = $t080878273._4
274+let cfgAmountAssetId = $t086088794._4
251275
252-let cfgPriceAssetId = $t080878273._5
276+let cfgPriceAssetId = $t086088794._5
253277
254-let cfgAmountAssetDecimals = $t080878273._6
278+let cfgAmountAssetDecimals = $t086088794._6
255279
256-let cfgPriceAssetDecimals = $t080878273._7
280+let cfgPriceAssetDecimals = $t086088794._7
257281
258282 func gfc () = split(strf(fca, fcfg()), SEP)
259283
260284
261285 let factoryConfig = gfc()
262286
263287 let stakingContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactStakCntr]), "Invalid staking contract address")
264288
265289 let slipageContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactSlippCntr]), "Invalid slipage contract address")
266290
267291 let gwxContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactGwxRewCntr]), "Invalid gwx contract address")
268292
269293 let restContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactoryRestCntr]), "Invalid gwx contract address")
270294
271295 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)
272296
273297
274298 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)
275299
276300
277301 func getAccBalance (assetId) = if ((assetId == "WAVES"))
278302 then wavesBalance(this).available
279303 else assetBalance(this, fromBase58String(assetId))
280304
281305
282306 func cpbi (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
283307
284308
285309 func cpbir (prAmtX18,amAmtX18,round) = fraction(prAmtX18, scale18, amAmtX18, round)
286310
287311
288312 func vad (A1,A2,slippage) = {
289313 let diff = fraction((A1 - A2), scale8BigInt, A2)
290314 let pass = ((slippage - abs(diff)) > zeroBigInt)
291315 if (!(pass))
292316 then throw(("Big slpg: " + toString(diff)))
293317 else $Tuple2(pass, min([A1, A2]))
294318 }
295319
296320
297321 func vd (D1,D0,slpg) = {
298322 let diff = fraction(D0, scale8BigInt, D1)
299323 let fail = (slpg > diff)
300324 if (if (fail)
301325 then true
302326 else (D0 > D1))
303327 then throw(((((((toString(D0) + " ") + toString(D1)) + " ") + toString(diff)) + " ") + toString(slpg)))
304328 else fail
305329 }
306330
307331
308332 func pcp (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
309333 let amtAsAmtX18 = t1(amAmt, amAssetDcm)
310334 let prAsAmtX18 = t1(prAmt, prAssetDcm)
311335 cpbi(prAsAmtX18, amtAsAmtX18)
312336 }
313337
314338
315339 func calcPrices (amAmt,prAmt,lpAmt) = {
316340 let amtAsDcm = cfgAmountAssetDecimals
317341 let prAsDcm = cfgPriceAssetDecimals
318342 let priceX18 = pcp(amtAsDcm, prAsDcm, amAmt, prAmt)
319343 let amAmtX18 = t1(amAmt, amtAsDcm)
320344 let prAmtX18 = t1(prAmt, prAsDcm)
321345 let lpAmtX18 = t1(lpAmt, scale8)
322346 let lpPrInAmAsX18 = cpbi(amAmtX18, lpAmtX18)
323347 let lpPrInPrAsX18 = cpbi(prAmtX18, lpAmtX18)
324348 [priceX18, lpPrInAmAsX18, lpPrInPrAsX18]
325349 }
326350
327351
328352 func calculatePrices (amAmt,prAmt,lpAmt) = {
329353 let p = calcPrices(amAmt, prAmt, lpAmt)
330354 [f1(p[0], scale8), f1(p[1], scale8), f1(p[2], scale8)]
331355 }
332356
333357
334358 func takeFee (amount,fee) = {
335359 let feeAmount = if ((fee == 0))
336360 then 0
337361 else fraction(amount, fee, scale8)
338362 $Tuple2((amount - feeAmount), feeAmount)
339363 }
340364
341365
342366 func getD (xp) = {
343367 let xp0 = xp[0]
344368 let xp1 = xp[1]
345369 let s = (xp0 + xp1)
346370 if ((s == big0))
347371 then big0
348372 else {
349373 let a = parseIntValue(A)
350374 let ann = (a * 2)
351375 let p = fraction(xp0, xp1, big1)
352376 let xp0_xp1_n_n = fraction(p, big4, big1)
353377 let ann_s = fraction(toBigInt(ann), s, big1)
354378 let ann_1 = toBigInt((ann - 1))
355379 func calcDNext (d) = {
356380 let dd = fraction(d, d, big1)
357381 let ddd = fraction(dd, d, big1)
358382 let dp = fraction(ddd, big1, xp0_xp1_n_n)
359383 fraction((ann_s + fraction(dp, big2, big1)), d, (fraction(ann_1, d, big1) + fraction(big3, dp, big1)))
360384 }
361385
362386 func calc (acc,i) = if (acc._2)
363387 then acc
364388 else {
365389 let d = acc._1
366390 let dNext = calcDNext(d)
367391 let dDiffRaw = (dNext - value(d))
368392 let dDiff = if ((big0 > dDiffRaw))
369393 then -(dDiffRaw)
370394 else dDiffRaw
371395 if ((big1 >= dDiff))
372396 then $Tuple2(dNext, true)
373397 else $Tuple2(dNext, false)
374398 }
375399
376400 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
377- let $t01277812826 = {
401+ let $t01329913347 = {
378402 let $l = arr
379403 let $s = size($l)
380404 let $acc0 = $Tuple2(s, false)
381405 func $f0_1 ($a,$i) = if (($i >= $s))
382406 then $a
383407 else calc($a, $l[$i])
384408
385409 func $f0_2 ($a,$i) = if (($i >= $s))
386410 then $a
387411 else throw("List size exceeds 17")
388412
389413 $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)
390414 }
391- let d = $t01277812826._1
392- let found = $t01277812826._2
415+ let d = $t01329913347._1
416+ let found = $t01329913347._2
393417 if (found)
394418 then d
395419 else throw(("D calculation error, D = " + toString(d)))
396420 }
397421 }
398422
399423
400424 func ego (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
401425 let lpId = cfgLpAssetId
402426 let amId = toBase58String(value(cfgAmountAssetId))
403427 let prId = toBase58String(value(cfgPriceAssetId))
404428 let amDcm = cfgAmountAssetDecimals
405429 let prDcm = cfgPriceAssetDecimals
406430 let sts = toString(cfgPoolStatus)
407431 let lpEmiss = valueOrErrorMessage(assetInfo(lpId), "Wrong LP id").quantity
408432 if ((toBase58String(lpId) != pmtAssetId))
409433 then throw("Wrong pmt asset")
410434 else {
411435 let amBalance = getAccBalance(amId)
412436 let amBalanceX18 = t1(amBalance, amDcm)
413437 let prBalance = getAccBalance(prId)
414438 let prBalanceX18 = t1(prBalance, prDcm)
415439 let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
416440 let curPrice = f1(curPriceX18, scale8)
417441 let pmtLpAmtX18 = t1(pmtLpAmt, scale8)
418442 let lpEmissX18 = t1(lpEmiss, scale8)
419443 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissX18)
420444 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissX18)
421445 let outAmAmt = fromX18Round(outAmAmtX18, amDcm, FLOOR)
422446 let outPrAmt = fromX18Round(outPrAmtX18, prDcm, FLOOR)
423447 let state = if ((txId58 == ""))
424448 then nil
425449 else [ScriptTransfer(userAddress, outAmAmt, if ((amId == "WAVES"))
426450 then unit
427451 else fromBase58String(amId)), ScriptTransfer(userAddress, outPrAmt, if ((prId == "WAVES"))
428452 then unit
429453 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)]
430454 $Tuple10(outAmAmt, outPrAmt, amId, prId, amBalance, prBalance, lpEmiss, curPriceX18, sts, state)
431455 }
432456 }
433457
434458
435459 func epo (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEval,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = {
436460 let lpId = cfgLpAssetId
437461 let amIdStr = toBase58String(value(cfgAmountAssetId))
438462 let prIdStr = toBase58String(value(cfgPriceAssetId))
439463 let amtDcm = cfgAmountAssetDecimals
440464 let priceDcm = cfgPriceAssetDecimals
441465 let sts = toString(cfgPoolStatus)
442466 let lpEm = valueOrErrorMessage(assetInfo(lpId), "Wr lp as").quantity
443467 let amBalance = if (isEval)
444468 then getAccBalance(amIdStr)
445469 else if (if (isOneAsset)
446470 then (pmtId == amIdStr)
447471 else false)
448472 then (getAccBalance(amIdStr) - pmtAmt)
449473 else if (isOneAsset)
450474 then getAccBalance(amIdStr)
451475 else (getAccBalance(amIdStr) - inAmAmt)
452476 let prBalance = if (isEval)
453477 then getAccBalance(prIdStr)
454478 else if (if (isOneAsset)
455479 then (pmtId == prIdStr)
456480 else false)
457481 then (getAccBalance(prIdStr) - pmtAmt)
458482 else if (isOneAsset)
459483 then getAccBalance(prIdStr)
460484 else (getAccBalance(prIdStr) - inPrAmt)
461485 let inAmAssetAmtX18 = t1(inAmAmt, amtDcm)
462486 let inPrAssetAmtX18 = t1(inPrAmt, priceDcm)
463487 let userPriceX18 = cpbi(inPrAssetAmtX18, inAmAssetAmtX18)
464488 let amBalanceX18 = t1(amBalance, amtDcm)
465489 let prBalanceX18 = t1(prBalance, priceDcm)
466490 let D0 = getD([amBalanceX18, prBalanceX18])
467491 let r = if ((lpEm == 0))
468492 then {
469493 let D1 = getD([(amBalanceX18 + inAmAssetAmtX18), (prBalanceX18 + inPrAssetAmtX18)])
470494 let checkD = if ((D1 > D0))
471495 then true
472496 else throw("D1 should be greater than D0")
473497 if ((checkD == checkD))
474498 then {
475499 let curPriceX18 = zeroBigInt
476500 let slippageX18 = zeroBigInt
477501 let lpAmtX18 = D1
478502 $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
479503 }
480504 else throw("Strict value is not equal to itself.")
481505 }
482506 else {
483507 let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
484508 let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18)
485509 let slippageX18 = t1(slippage, scale8)
486510 if (if (if (validateSlippage)
487511 then (curPriceX18 != zeroBigInt)
488512 else false)
489513 then (slippageRealX18 > slippageX18)
490514 else false)
491515 then throw(((("Price slippage " + toString(slippageRealX18)) + " > ") + toString(slippageX18)))
492516 else {
493517 let lpEmissionX18 = t1(lpEm, scale8)
494518 let prViaAmX18 = fraction(inAmAssetAmtX18, cpbir(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING)
495519 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, cpbir(prBalanceX18, amBalanceX18, FLOOR), CEILING)
496520 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
497521 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
498522 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
499523 let expAmtAssetAmtX18 = expectedAmts._1
500524 let expPriceAssetAmtX18 = expectedAmts._2
501525 let D1 = getD([(amBalanceX18 + expAmtAssetAmtX18), (prBalanceX18 + expPriceAssetAmtX18)])
502526 let checkD = if ((D1 > D0))
503527 then true
504528 else throw("D1 should be greater than D0")
505529 if ((checkD == checkD))
506530 then {
507531 let lpAmtX18 = fraction(lpEmissionX18, (D1 - D0), D0)
508532 $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceDcm, CEILING), curPriceX18, slippageX18)
509533 }
510534 else throw("Strict value is not equal to itself.")
511535 }
512536 }
513537 let calcLpAmt = r._1
514538 let calcAmAssetPmt = r._2
515539 let calcPrAssetPmt = r._3
516540 let curPrice = f1(r._4, scale8)
517541 let slippageCalc = f1(r._5, scale8)
518542 if ((0 >= calcLpAmt))
519543 then throw("LP <= 0")
520544 else {
521545 let emitLpAmt = if (!(emitLp))
522546 then 0
523547 else calcLpAmt
524548 let amDiff = (inAmAmt - calcAmAssetPmt)
525549 let prDiff = (inPrAmt - calcPrAssetPmt)
526- let $t02058820933 = if (if (isOneAsset)
550+ let $t02110921454 = if (if (isOneAsset)
527551 then (pmtId == amIdStr)
528552 else false)
529553 then $Tuple2(pmtAmt, 0)
530554 else if (if (isOneAsset)
531555 then (pmtId == prIdStr)
532556 else false)
533557 then $Tuple2(0, pmtAmt)
534558 else $Tuple2(calcAmAssetPmt, calcPrAssetPmt)
535- let writeAmAmt = $t02058820933._1
536- let writePrAmt = $t02058820933._2
559+ let writeAmAmt = $t02110921454._1
560+ let writePrAmt = $t02110921454._2
537561 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))]
538562 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId)
539563 }
540564 }
541565
542566
543567 func getYD (xp,i,D) = {
544568 let n = big2
545569 let x = xp[if ((i == 0))
546570 then 1
547571 else 0]
548572 let aPrecision = parseBigIntValue(Amult)
549573 let a = (parseBigIntValue(A) * aPrecision)
550574 let s = x
551575 let ann = (a * n)
552576 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
553577 let b = ((s + ((D * aPrecision) / ann)) - D)
554578 func calc (acc,cur) = {
555- let $t02212822148 = acc
556- let y = $t02212822148._1
557- let found = $t02212822148._2
579+ let $t02264922669 = acc
580+ let y = $t02264922669._1
581+ let found = $t02264922669._2
558582 if ((found != unit))
559583 then acc
560584 else {
561585 let yNext = (((y * y) + c) / ((big2 * y) + b))
562586 let yDiff = absBigInt((yNext - value(y)))
563587 if ((big1 >= yDiff))
564588 then $Tuple2(yNext, cur)
565589 else $Tuple2(yNext, unit)
566590 }
567591 }
568592
569593 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
570- let $t02245522502 = {
594+ let $t02297623023 = {
571595 let $l = arr
572596 let $s = size($l)
573597 let $acc0 = $Tuple2(D, unit)
574598 func $f0_1 ($a,$i) = if (($i >= $s))
575599 then $a
576600 else calc($a, $l[$i])
577601
578602 func $f0_2 ($a,$i) = if (($i >= $s))
579603 then $a
580604 else throw("List size exceeds 15")
581605
582606 $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)
583607 }
584- let y = $t02245522502._1
585- let found = $t02245522502._2
608+ let y = $t02297623023._1
609+ let found = $t02297623023._2
586610 if ((found != unit))
587611 then y
588612 else throw(("Y calculation error, Y = " + toString(y)))
589613 }
590614
591615
592616 func calcDLp (amountBalance,priceBalance,lpEmission) = {
593617 let updatedDLp = fraction(getD([t1BigInt(amountBalance, toBigInt(cfgAmountAssetDecimals)), t1BigInt(priceBalance, toBigInt(cfgPriceAssetDecimals))]), scale18, lpEmission)
594618 if ((lpEmission == big0))
595619 then big0
596620 else updatedDLp
597621 }
598622
599623
600624 func calcCurrentDLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
601625 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
602626 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
603627 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
604628 let currentDLp = calcDLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
605629 currentDLp
606630 }
607631
608632
609633 func refreshDLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
610634 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
611635 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
612636 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
613637 let updatedDLp = calcDLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
614638 let actions = [IntegerEntry(keyDLpRefreshedHeight, height), StringEntry(keyDLp, toString(updatedDLp))]
615639 $Tuple2(actions, updatedDLp)
616640 }
617641
618642
619643 func validateUpdatedDLp (oldDLp,updatedDLp) = if ((updatedDLp >= oldDLp))
620644 then true
621645 else throwErr("updated DLp lower than current DLp")
622646
623647
624648 func validateMatcherOrderAllowed (order) = {
625649 let amountAssetBalance = getAccBalance(assetIdToString(cfgAmountAssetId))
626650 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
627651 let amountAssetAmount = order.amount
628652 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
629- let $t02470024912 = if ((order.orderType == Buy))
653+ let $t02522125433 = if ((order.orderType == Buy))
630654 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
631655 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
632- let amountAssetBalanceDelta = $t02470024912._1
633- let priceAssetBalanceDelta = $t02470024912._2
656+ let amountAssetBalanceDelta = $t02522125433._1
657+ let priceAssetBalanceDelta = $t02522125433._2
634658 if (if (if (igs())
635659 then true
636660 else (cfgPoolStatus == PoolMatcherDis))
637661 then true
638662 else (cfgPoolStatus == PoolShutdown))
639663 then throw("Admin blocked")
640664 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
641665 then true
642666 else (order.assetPair.priceAsset != cfgPriceAssetId))
643667 then throw("Wr assets")
644668 else {
645669 let dLp = parseBigIntValue(valueOrElse(getString(this, keyDLp), "0"))
646- let $t02525425354 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
647- let unusedActions = $t02525425354._1
648- let dLpNew = $t02525425354._2
670+ let $t02577525875 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
671+ let unusedActions = $t02577525875._1
672+ let dLpNew = $t02577525875._2
649673 let isOrderValid = (dLpNew >= dLp)
650674 let info = makeString(["dLp=", toString(dLp), " dLpNew=", toString(dLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "")
651675 $Tuple2(isOrderValid, info)
652676 }
653677 }
654678
655679
656680 func cg (i) = if ((size(i.payments) != 1))
657681 then throw("1 pmnt exp")
658682 else {
659683 let pmt = value(i.payments[0])
660684 let pmtAssetId = value(pmt.assetId)
661685 let pmtAmt = pmt.amount
662686 let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
663687 let outAmAmt = r._1
664688 let outPrAmt = r._2
665689 let sts = parseIntValue(r._9)
666690 let state = r._10
667691 if (if (igs())
668692 then true
669693 else (sts == PoolShutdown))
670694 then throw(("Admin blocked: " + toString(sts)))
671695 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
672696 }
673697
674698
675699 func cp (caller,txId,amAsPmt,prAsPmt,slippage,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = {
676700 let r = epo(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, (txId == ""), emitLp, isOneAsset, validateSlippage, pmtAmt, pmtId)
677701 let sts = parseIntValue(r._8)
678702 if (if (if (igs())
679703 then true
680704 else (sts == PoolPutDis))
681705 then true
682706 else (sts == PoolShutdown))
683707 then throw(("Blocked:" + toString(sts)))
684708 else r
685709 }
686710
687711
688712 func calcPutOneTkn (pmtAmtRaw,pmtAssetId,userAddress,txId,withTakeFee) = {
689713 let amId = toBase58String(value(cfgAmountAssetId))
690714 let prId = toBase58String(value(cfgPriceAssetId))
691715 let lpId = cfgLpAssetId
692716 let amtDcm = cfgAmountAssetDecimals
693717 let priceDcm = cfgPriceAssetDecimals
694718 let lpAssetEmission = toBigInt(valueOrErrorMessage(assetInfo(lpId), "invalid lp asset").quantity)
695719 let chechEmission = if ((lpAssetEmission > big0))
696720 then true
697721 else throw("initial deposit requires all coins")
698722 if ((chechEmission == chechEmission))
699723 then {
700724 let amBalance = getAccBalance(amId)
701725 let prBalance = getAccBalance(prId)
702- let $t02801028472 = if ((txId == ""))
726+ let $t02853128993 = if ((txId == ""))
703727 then $Tuple2(amBalance, prBalance)
704728 else if ((pmtAssetId == amId))
705729 then if ((pmtAmtRaw > amBalance))
706730 then throw("invalid payment amount")
707731 else $Tuple2((amBalance - pmtAmtRaw), prBalance)
708732 else if ((pmtAssetId == prId))
709733 then if ((pmtAmtRaw > prBalance))
710734 then throw("invalid payment amount")
711735 else $Tuple2(amBalance, (prBalance - pmtAmtRaw))
712736 else throw("wrong pmtAssetId")
713- let amBalanceOld = $t02801028472._1
714- let prBalanceOld = $t02801028472._2
715- let $t02847828654 = if ((pmtAssetId == amId))
737+ let amBalanceOld = $t02853128993._1
738+ let prBalanceOld = $t02853128993._2
739+ let $t02899929175 = if ((pmtAssetId == amId))
716740 then $Tuple2(pmtAmtRaw, 0)
717741 else if ((pmtAssetId == prId))
718742 then $Tuple2(0, pmtAmtRaw)
719743 else throw("invalid payment")
720- let amAmountRaw = $t02847828654._1
721- let prAmountRaw = $t02847828654._2
722- let $t02865828912 = if (withTakeFee)
744+ let amAmountRaw = $t02899929175._1
745+ let prAmountRaw = $t02899929175._2
746+ let $t02917929433 = if (withTakeFee)
723747 then $Tuple3(takeFee(amAmountRaw, inFee)._1, takeFee(prAmountRaw, inFee)._1, takeFee(pmtAmtRaw, inFee)._2)
724748 else $Tuple3(amAmountRaw, prAmountRaw, 0)
725- let amAmount = $t02865828912._1
726- let prAmount = $t02865828912._2
727- let feeAmount = $t02865828912._3
749+ let amAmount = $t02917929433._1
750+ let prAmount = $t02917929433._2
751+ let feeAmount = $t02917929433._3
728752 let amBalanceNew = (amBalanceOld + amAmount)
729753 let prBalanceNew = (prBalanceOld + prAmount)
730754 let D0 = getD([t1(amBalanceOld, cfgAmountAssetDecimals), t1(prBalanceOld, cfgPriceAssetDecimals)])
731755 let D1 = getD([t1(amBalanceNew, cfgAmountAssetDecimals), t1(prBalanceNew, cfgPriceAssetDecimals)])
732756 let checkD = if ((D1 > D0))
733757 then true
734758 else throw()
735759 if ((checkD == checkD))
736760 then {
737761 let lpAmount = fraction(lpAssetEmission, (D1 - D0), D0, FLOOR)
738762 let curPrice = f1(cpbi(t1(prBalanceNew, priceDcm), t1(amBalanceNew, amtDcm)), scale8)
739763 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))]
740764 let poolProportion = fraction(prBalanceOld, scale8, amBalanceOld)
741765 let amountAssetPart = fraction(pmtAmtRaw, scale8, (poolProportion + scale8))
742766 let priceAssetPart = (pmtAmtRaw - amountAssetPart)
743767 let lpAmtBoth = fraction(lpAssetEmission, toBigInt(priceAssetPart), toBigInt(prBalanceOld))
744768 let bonus = toInt(fraction((lpAmount - lpAmtBoth), scale8BigInt, lpAmtBoth))
745769 $Tuple4(toInt(lpAmount), commonState, feeAmount, bonus)
746770 }
747771 else throw("Strict value is not equal to itself.")
748772 }
749773 else throw("Strict value is not equal to itself.")
750774 }
751775
752776
753777 func getOneTknV2Internal (outAssetId,minOutAmount,payments,caller,originCaller,transactionId) = {
754778 let lpId = toBase58String(value(cfgLpAssetId))
755779 let amId = toBase58String(value(cfgAmountAssetId))
756780 let prId = toBase58String(value(cfgPriceAssetId))
757781 let amDecimals = cfgAmountAssetDecimals
758782 let prDecimals = cfgPriceAssetDecimals
759783 let poolStatus = cfgPoolStatus
760784 let userAddress = if ((caller == restContract))
761785 then originCaller
762786 else caller
763787 let pmt = value(payments[0])
764788 let pmtAssetId = value(pmt.assetId)
765789 let pmtAmt = pmt.amount
766790 let currentDLp = calcCurrentDLp(big0, big0, big0)
767791 if ((currentDLp == currentDLp))
768792 then {
769793 let txId58 = toBase58String(transactionId)
770794 if ((lpId != toBase58String(pmtAssetId)))
771795 then throw("Wrong LP")
772796 else {
773797 let amBalance = getAccBalance(amId)
774798 let prBalance = getAccBalance(prId)
775- let $t03102431135 = {
799+ let $t03154531656 = {
776800 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil)
777801 if ($isInstanceOf(@, "(Int, Int)"))
778802 then @
779803 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
780804 }
781- if (($t03102431135 == $t03102431135))
805+ if (($t03154531656 == $t03154531656))
782806 then {
783- let feeAmount = $t03102431135._2
784- let totalGet = $t03102431135._1
807+ let feeAmount = $t03154531656._2
808+ let totalGet = $t03154531656._1
785809 let totalAmount = if (if ((minOutAmount > 0))
786810 then (minOutAmount > totalGet)
787811 else false)
788812 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
789813 else totalGet
790- let $t03132531632 = if ((outAssetId == amId))
814+ let $t03184632153 = if ((outAssetId == amId))
791815 then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance)
792816 else if ((outAssetId == prId))
793817 then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount))
794818 else throw("invalid out asset id")
795- let outAm = $t03132531632._1
796- let outPr = $t03132531632._2
797- let amBalanceNew = $t03132531632._3
798- let prBalanceNew = $t03132531632._4
819+ let outAm = $t03184632153._1
820+ let outPr = $t03184632153._2
821+ let amBalanceNew = $t03184632153._3
822+ let prBalanceNew = $t03184632153._4
799823 let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals))
800824 let curPr = f1(curPrX18, scale8)
801825 let outAssetIdOrWaves = if ((outAssetId == "WAVES"))
802826 then unit
803827 else fromBase58String(outAssetId)
804828 let sendFeeToMatcher = if ((feeAmount > 0))
805829 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetIdOrWaves)]
806830 else nil
807831 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)
808832 if ((state == state))
809833 then {
810834 let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
811835 if ((burn == burn))
812836 then {
813- let $t03241732767 = {
837+ let $t03293833288 = {
814838 let feeAmountForCalc = if ((this == feeCollectorAddress))
815839 then 0
816840 else feeAmount
817841 let outInAmountAsset = if ((parseAssetId(outAssetId) == cfgAmountAssetId))
818842 then true
819843 else false
820844 if (outInAmountAsset)
821845 then $Tuple2(-((totalGet + feeAmountForCalc)), 0)
822846 else $Tuple2(0, -((totalGet + feeAmountForCalc)))
823847 }
824- let amountAssetBalanceDelta = $t03241732767._1
825- let priceAssetBalanceDelta = $t03241732767._2
826- let $t03277032878 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
827- let refreshDLpActions = $t03277032878._1
828- let updatedDLp = $t03277032878._2
848+ let amountAssetBalanceDelta = $t03293833288._1
849+ let priceAssetBalanceDelta = $t03293833288._2
850+ let $t03329133399 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
851+ let refreshDLpActions = $t03329133399._1
852+ let updatedDLp = $t03329133399._2
829853 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
830854 if ((isUpdatedDLpValid == isUpdatedDLpValid))
831855 then $Tuple2((state ++ refreshDLpActions), totalAmount)
832856 else throw("Strict value is not equal to itself.")
833857 }
834858 else throw("Strict value is not equal to itself.")
835859 }
836860 else throw("Strict value is not equal to itself.")
837861 }
838862 else throw("Strict value is not equal to itself.")
839863 }
840864 }
841865 else throw("Strict value is not equal to itself.")
842866 }
843867
844868
845-func m () = match getString(mpk()) {
846- case s: String =>
847- fromBase58String(s)
848- case _: Unit =>
849- unit
850- case _ =>
851- throw("Match error")
852-}
853-
854-
855-func pm () = match getString(pmpk()) {
856- case s: String =>
857- fromBase58String(s)
858- case _: Unit =>
859- unit
860- case _ =>
861- throw("Match error")
862-}
869+func managerPublicKeyOrUnit () = {
870+ let managerVaultAddress = getManagerVaultAddressOrThis()
871+ match getString(managerVaultAddress, keyManagerPublicKey()) {
872+ case s: String =>
873+ fromBase58String(s)
874+ case _: Unit =>
875+ unit
876+ case _ =>
877+ throw("Match error")
878+ }
879+ }
863880
864881
865882 let pd = throw("Permission denied")
866883
867-func isManager (i) = match m() {
884+func isManager (i) = match managerPublicKeyOrUnit() {
868885 case pk: ByteVector =>
869886 (i.callerPublicKey == pk)
870887 case _: Unit =>
871888 (i.caller == this)
872889 case _ =>
873890 throw("Match error")
874891 }
875892
876893
877-func mm (i) = match m() {
894+func mustManager (i) = match managerPublicKeyOrUnit() {
878895 case pk: ByteVector =>
879896 if ((i.callerPublicKey == pk))
880897 then true
881898 else pd
882899 case _: Unit =>
883900 if ((i.caller == this))
884901 then true
885902 else pd
886903 case _ =>
887904 throw("Match error")
888905 }
889906
890907
891908 func getY (isReverse,D,poolAmountInBalance) = {
892909 let poolConfig = gpc()
893910 let amId = poolConfig[idxAmAsId]
894911 let prId = poolConfig[idxPrAsId]
895912 let n = big2
896913 let aPrecision = parseBigIntValue(Amult)
897914 let a = (parseBigIntValue(A) * aPrecision)
898915 let xp = if ((isReverse == false))
899916 then [(toBigInt(getAccBalance(amId)) + poolAmountInBalance), toBigInt(getAccBalance(prId))]
900917 else [(toBigInt(getAccBalance(prId)) + poolAmountInBalance), toBigInt(getAccBalance(amId))]
901918 let x = xp[0]
902919 let s = x
903920 let ann = (a * n)
904921 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
905922 let b = ((s + ((D * aPrecision) / ann)) - D)
906923 func calc (acc,cur) = {
907- let $t03432534345 = acc
908- let y = $t03432534345._1
909- let found = $t03432534345._2
924+ let $t03488634906 = acc
925+ let y = $t03488634906._1
926+ let found = $t03488634906._2
910927 if ((found != unit))
911928 then acc
912929 else {
913930 let yNext = (((y * y) + c) / ((big2 * y) + b))
914931 let yDiff = absBigInt((yNext - value(y)))
915932 if ((big1 >= yDiff))
916933 then $Tuple2(yNext, cur)
917934 else $Tuple2(yNext, unit)
918935 }
919936 }
920937
921938 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
922- let $t03467634723 = {
939+ let $t03523735284 = {
923940 let $l = arr
924941 let $s = size($l)
925942 let $acc0 = $Tuple2(D, unit)
926943 func $f0_1 ($a,$i) = if (($i >= $s))
927944 then $a
928945 else calc($a, $l[$i])
929946
930947 func $f0_2 ($a,$i) = if (($i >= $s))
931948 then $a
932949 else throw("List size exceeds 15")
933950
934951 $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)
935952 }
936- let y = $t03467634723._1
937- let found = $t03467634723._2
953+ let y = $t03523735284._1
954+ let found = $t03523735284._2
938955 if ((found != unit))
939956 then y
940957 else throw(("Y calculation error, Y = " + toString(y)))
941958 }
942959
943960
944961 func skipOrderValidation () = valueOrElse(getBoolean(fca, keySkipOrderValidation(toString(this))), false)
945962
946963
947964 @Callable(i)
948965 func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = {
949- let $t03507535499 = if ((isReverse == false))
966+ let $t03563636060 = if ((isReverse == false))
950967 then {
951968 let assetOut = strf(this, pa())
952969 let poolAmountInBalance = (toBigInt(getAccBalance(strf(this, aa()))) + toBigInt(cleanAmountIn))
953970 $Tuple2(assetOut, poolAmountInBalance)
954971 }
955972 else {
956973 let assetOut = strf(this, aa())
957974 let poolAmountInBalance = (toBigInt(getAccBalance(strf(this, pa()))) + toBigInt(cleanAmountIn))
958975 $Tuple2(assetOut, poolAmountInBalance)
959976 }
960- let assetOut = $t03507535499._1
961- let poolAmountInBalance = $t03507535499._2
977+ let assetOut = $t03563636060._1
978+ let poolAmountInBalance = $t03563636060._2
962979 let poolConfig = gpc()
963980 let amId = poolConfig[idxAmAsId]
964981 let prId = poolConfig[idxPrAsId]
965982 let xp = [toBigInt(getAccBalance(amId)), toBigInt(getAccBalance(prId))]
966983 let D = getD(xp)
967984 let y = getY(isReverse, D, toBigInt(cleanAmountIn))
968985 let dy = ((toBigInt(getAccBalance(assetOut)) - y) - toBigInt(1))
969986 let totalGetRaw = max([0, toInt(dy)])
970987 let newXp = if ((isReverse == false))
971988 then [((toBigInt(getAccBalance(amId)) + toBigInt(cleanAmountIn)) + toBigInt(feePoolAmount)), (toBigInt(getAccBalance(prId)) - dy)]
972989 else [(toBigInt(getAccBalance(amId)) - dy), ((toBigInt(getAccBalance(prId)) + toBigInt(cleanAmountIn)) + toBigInt(feePoolAmount))]
973990 let newD = getD(newXp)
974991 let checkD = if ((newD >= D))
975992 then true
976993 else throw(makeString(["new D is fewer error", toString(D), toString(newD)], "__"))
977994 if ((checkD == checkD))
978995 then $Tuple2(nil, totalGetRaw)
979996 else throw("Strict value is not equal to itself.")
980997 }
981998
982999
9831000
9841001 @Callable(i)
9851002 func calculateAmountOutForSwapAndSendTokens (cleanAmountIn,isReverse,amountOutMin,addressTo,feePoolAmount) = {
9861003 let swapContact = {
9871004 let @ = invoke(fca, "getSwapContractREADONLY", nil, nil)
9881005 if ($isInstanceOf(@, "String"))
9891006 then @
9901007 else throw(($getType(@) + " couldn't be cast to String"))
9911008 }
9921009 let checks = [if ((value(i.payments[0]).amount >= cleanAmountIn))
9931010 then true
9941011 else throwErr("Wrong amount"), if ((i.caller == addressFromStringValue(swapContact)))
9951012 then true
9961013 else throwErr("Permission denied")]
9971014 if ((checks == checks))
9981015 then {
9991016 let pmt = value(i.payments[0])
10001017 let assetIn = assetIdToString(pmt.assetId)
1001- let $t03693537329 = if ((isReverse == false))
1018+ let $t03749637890 = if ((isReverse == false))
10021019 then {
10031020 let assetOut = strf(this, pa())
10041021 let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
10051022 $Tuple2(assetOut, poolAmountInBalance)
10061023 }
10071024 else {
10081025 let assetOut = strf(this, aa())
10091026 let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
10101027 $Tuple2(assetOut, poolAmountInBalance)
10111028 }
1012- let assetOut = $t03693537329._1
1013- let poolAmountInBalance = $t03693537329._2
1029+ let assetOut = $t03749637890._1
1030+ let poolAmountInBalance = $t03749637890._2
10141031 let poolConfig = gpc()
10151032 let amId = poolConfig[idxAmAsId]
10161033 let prId = poolConfig[idxPrAsId]
10171034 let xp = if ((isReverse == false))
10181035 then [(toBigInt(getAccBalance(amId)) - toBigInt(value(i.payments[0]).amount)), toBigInt(getAccBalance(prId))]
10191036 else [toBigInt(getAccBalance(amId)), (toBigInt(getAccBalance(prId)) - toBigInt(value(i.payments[0]).amount))]
10201037 let D = getD(xp)
10211038 let y = getY(isReverse, D, toBigInt(0))
10221039 let dy = ((toBigInt(getAccBalance(assetOut)) - y) - toBigInt(1))
10231040 let totalGetRaw = max([0, toInt(dy)])
10241041 let checkMin = if ((totalGetRaw >= amountOutMin))
10251042 then true
10261043 else throw("Exchange result is fewer coins than expected")
10271044 if ((checkMin == checkMin))
10281045 then {
10291046 let newXp = if ((isReverse == false))
10301047 then [(toBigInt(getAccBalance(amId)) + toBigInt(feePoolAmount)), (toBigInt(getAccBalance(prId)) - dy)]
10311048 else [(toBigInt(getAccBalance(amId)) - dy), (toBigInt(getAccBalance(prId)) + toBigInt(feePoolAmount))]
10321049 let newD = getD(newXp)
10331050 let checkD = if ((newD >= D))
10341051 then true
10351052 else throw("new D is fewer error")
10361053 if ((checkD == checkD))
10371054 then $Tuple2([ScriptTransfer(addressFromStringValue(addressTo), totalGetRaw, parseAssetId(assetOut))], totalGetRaw)
10381055 else throw("Strict value is not equal to itself.")
10391056 }
10401057 else throw("Strict value is not equal to itself.")
10411058 }
10421059 else throw("Strict value is not equal to itself.")
10431060 }
10441061
10451062
10461063
10471064 @Callable(i)
10481065 func constructor (fc) = {
1049- let c = mm(i)
1066+ let c = mustManager(i)
10501067 if ((c == c))
10511068 then [StringEntry(fc(), fc)]
1052- else throw("Strict value is not equal to itself.")
1053- }
1054-
1055-
1056-
1057-@Callable(i)
1058-func setManager (pendingManagerPublicKey) = {
1059- let c = mm(i)
1060- if ((c == c))
1061- then {
1062- let cm = fromBase58String(pendingManagerPublicKey)
1063- if ((cm == cm))
1064- then [StringEntry(pmpk(), pendingManagerPublicKey)]
1065- else throw("Strict value is not equal to itself.")
1066- }
1067- else throw("Strict value is not equal to itself.")
1068- }
1069-
1070-
1071-
1072-@Callable(i)
1073-func confirmManager () = {
1074- let p = pm()
1075- let hpm = if (isDefined(p))
1076- then true
1077- else throw("No pending manager")
1078- if ((hpm == hpm))
1079- then {
1080- let cpm = if ((i.callerPublicKey == value(p)))
1081- then true
1082- else throw("You are not pending manager")
1083- if ((cpm == cpm))
1084- then [StringEntry(mpk(), toBase58String(value(p))), DeleteEntry(pmpk())]
1085- else throw("Strict value is not equal to itself.")
1086- }
10871069 else throw("Strict value is not equal to itself.")
10881070 }
10891071
10901072
10911073
10921074 @Callable(i)
10931075 func put (slip,autoStake) = {
10941076 let factCfg = gfc()
10951077 let stakingCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactStakCntr]), "Wr st addr")
10961078 let slipCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactSlippCntr]), "Wr sl addr")
10971079 if ((0 > slip))
10981080 then throw("Wrong slippage")
10991081 else if ((size(i.payments) != 2))
11001082 then throw("2 pmnts expd")
11011083 else {
11021084 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
11031085 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
11041086 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amAssetPmt)
11051087 if ((amountAssetBalance == amountAssetBalance))
11061088 then {
11071089 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - prAssetPmt)
11081090 if ((priceAssetBalance == priceAssetBalance))
11091091 then {
11101092 let lpAssetEmission = toBigInt(value(assetInfo(cfgLpAssetId)).quantity)
11111093 if ((lpAssetEmission == lpAssetEmission))
11121094 then {
11131095 let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0))
11141096 if ((currentDLp == currentDLp))
11151097 then {
11161098 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, "")
11171099 let emitLpAmt = e._2
11181100 let lpAssetId = e._7
11191101 let state = e._9
11201102 let amDiff = e._10
11211103 let prDiff = e._11
11221104 let amId = e._12
11231105 let prId = e._13
11241106 let r = invoke(fca, "emit", [emitLpAmt], nil)
11251107 if ((r == r))
11261108 then {
11271109 let el = match r {
11281110 case legacy: Address =>
11291111 invoke(legacy, "emit", [emitLpAmt], nil)
11301112 case _ =>
11311113 unit
11321114 }
11331115 if ((el == el))
11341116 then {
11351117 let sa = if ((amDiff > 0))
11361118 then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)])
11371119 else nil
11381120 if ((sa == sa))
11391121 then {
11401122 let sp = if ((prDiff > 0))
11411123 then invoke(slipCntr, "put", nil, [AttachedPayment(prId, prDiff)])
11421124 else nil
11431125 if ((sp == sp))
11441126 then {
11451127 let lpTrnsfr = if (autoStake)
11461128 then {
11471129 let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
11481130 if ((ss == ss))
11491131 then nil
11501132 else throw("Strict value is not equal to itself.")
11511133 }
11521134 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
1153- let $t04194842090 = refreshDLpInternal(0, 0, 0)
1154- let refreshDLpActions = $t04194842090._1
1155- let updatedDLp = $t04194842090._2
1135+ let $t04203442176 = refreshDLpInternal(0, 0, 0)
1136+ let refreshDLpActions = $t04203442176._1
1137+ let updatedDLp = $t04203442176._2
11561138 let check = if ((updatedDLp >= currentDLp))
11571139 then true
11581140 else throwErr(makeString(["updated DLp lower than current DLp", toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentDLp), toString(updatedDLp), toString(amDiff), toString(prDiff)], " "))
11591141 if ((check == check))
11601142 then {
11611143 let lpAssetEmissionAfter = value(assetInfo(cfgLpAssetId)).quantity
11621144 if ((lpAssetEmissionAfter == lpAssetEmissionAfter))
11631145 then ((state ++ lpTrnsfr) ++ refreshDLpActions)
11641146 else throw("Strict value is not equal to itself.")
11651147 }
11661148 else throw("Strict value is not equal to itself.")
11671149 }
11681150 else throw("Strict value is not equal to itself.")
11691151 }
11701152 else throw("Strict value is not equal to itself.")
11711153 }
11721154 else throw("Strict value is not equal to itself.")
11731155 }
11741156 else throw("Strict value is not equal to itself.")
11751157 }
11761158 else throw("Strict value is not equal to itself.")
11771159 }
11781160 else throw("Strict value is not equal to itself.")
11791161 }
11801162 else throw("Strict value is not equal to itself.")
11811163 }
11821164 else throw("Strict value is not equal to itself.")
11831165 }
11841166 }
11851167
11861168
11871169
11881170 @Callable(i)
11891171 func putOneTknV2 (minOutAmount,autoStake) = {
11901172 let isPoolOneTokenOperationsDisabled = {
11911173 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
11921174 if ($isInstanceOf(@, "Boolean"))
11931175 then @
11941176 else throw(($getType(@) + " couldn't be cast to Boolean"))
11951177 }
11961178 let isPutDisabled = if (if (if (igs())
11971179 then true
11981180 else (cfgPoolStatus == PoolPutDis))
11991181 then true
12001182 else (cfgPoolStatus == PoolShutdown))
12011183 then true
12021184 else isPoolOneTokenOperationsDisabled
12031185 let checks = [if (if (!(isPutDisabled))
12041186 then true
12051187 else isManager(i))
12061188 then true
12071189 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
12081190 then true
12091191 else throwErr("exactly 1 payment are expected")]
12101192 if ((checks == checks))
12111193 then {
12121194 let amId = toBase58String(value(cfgAmountAssetId))
12131195 let prId = toBase58String(value(cfgPriceAssetId))
12141196 let lpId = cfgLpAssetId
12151197 let amDecimals = cfgAmountAssetDecimals
12161198 let prDecimals = cfgPriceAssetDecimals
12171199 let userAddress = if ((i.caller == this))
12181200 then i.originCaller
12191201 else i.caller
12201202 let pmt = value(i.payments[0])
12211203 let pmtAssetId = toBase58String(value(pmt.assetId))
12221204 let pmtAmt = pmt.amount
12231205 let currentDLp = if ((pmt.assetId == cfgAmountAssetId))
12241206 then calcCurrentDLp(toBigInt(pmtAmt), toBigInt(0), toBigInt(0))
12251207 else calcCurrentDLp(toBigInt(0), toBigInt(pmtAmt), toBigInt(0))
12261208 if ((currentDLp == currentDLp))
12271209 then {
1228- let $t04373143889 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1229- if (($t04373143889 == $t04373143889))
1210+ let $t04381743975 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1211+ if (($t04381743975 == $t04381743975))
12301212 then {
1231- let feeAmount = $t04373143889._3
1232- let state = $t04373143889._2
1233- let estimLP = $t04373143889._1
1213+ let feeAmount = $t04381743975._3
1214+ let state = $t04381743975._2
1215+ let estimLP = $t04381743975._1
12341216 let emitLpAmt = if (if ((minOutAmount > 0))
12351217 then (minOutAmount > estimLP)
12361218 else false)
12371219 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
12381220 else estimLP
12391221 let e = invoke(fca, "emit", [emitLpAmt], nil)
12401222 if ((e == e))
12411223 then {
12421224 let el = match e {
12431225 case legacy: Address =>
12441226 invoke(legacy, "emit", [emitLpAmt], nil)
12451227 case _ =>
12461228 unit
12471229 }
12481230 if ((el == el))
12491231 then {
12501232 let lpTrnsfr = if (autoStake)
12511233 then {
12521234 let ss = invoke(stakingContract, "stakeFor", [toString(i.caller)], [AttachedPayment(lpId, emitLpAmt)])
12531235 if ((ss == ss))
12541236 then nil
12551237 else throw("Strict value is not equal to itself.")
12561238 }
12571239 else [ScriptTransfer(i.caller, emitLpAmt, lpId)]
12581240 let sendFeeToMatcher = if ((feeAmount > 0))
12591241 then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))]
12601242 else nil
1261- let $t04477445123 = if ((this == feeCollectorAddress))
1243+ let $t04486045209 = if ((this == feeCollectorAddress))
12621244 then $Tuple2(0, 0)
12631245 else {
12641246 let paymentInAmountAsset = if ((pmt.assetId == cfgAmountAssetId))
12651247 then true
12661248 else false
12671249 if (paymentInAmountAsset)
12681250 then $Tuple2(-(feeAmount), 0)
12691251 else $Tuple2(0, -(feeAmount))
12701252 }
1271- let amountAssetBalanceDelta = $t04477445123._1
1272- let priceAssetBalanceDelta = $t04477445123._2
1273- let $t04512645234 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1274- let refreshDLpActions = $t04512645234._1
1275- let updatedDLp = $t04512645234._2
1253+ let amountAssetBalanceDelta = $t04486045209._1
1254+ let priceAssetBalanceDelta = $t04486045209._2
1255+ let $t04521245320 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1256+ let refreshDLpActions = $t04521245320._1
1257+ let updatedDLp = $t04521245320._2
12761258 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
12771259 if ((isUpdatedDLpValid == isUpdatedDLpValid))
12781260 then $Tuple2((((state ++ lpTrnsfr) ++ sendFeeToMatcher) ++ refreshDLpActions), emitLpAmt)
12791261 else throw("Strict value is not equal to itself.")
12801262 }
12811263 else throw("Strict value is not equal to itself.")
12821264 }
12831265 else throw("Strict value is not equal to itself.")
12841266 }
12851267 else throw("Strict value is not equal to itself.")
12861268 }
12871269 else throw("Strict value is not equal to itself.")
12881270 }
12891271 else throw("Strict value is not equal to itself.")
12901272 }
12911273
12921274
12931275
12941276 @Callable(i)
12951277 func putForFree (maxSlpg) = if ((0 > maxSlpg))
12961278 then throw("Wrong slpg")
12971279 else if ((size(i.payments) != 2))
12981280 then throw("2 pmnts expd")
12991281 else {
13001282 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, "")
13011283 let state = estPut._9
13021284 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
13031285 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
13041286 let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0))
13051287 if ((currentDLp == currentDLp))
13061288 then {
1307- let $t04626446329 = refreshDLpInternal(0, 0, 0)
1308- let refreshDLpActions = $t04626446329._1
1309- let updatedDLp = $t04626446329._2
1289+ let $t04635046415 = refreshDLpInternal(0, 0, 0)
1290+ let refreshDLpActions = $t04635046415._1
1291+ let updatedDLp = $t04635046415._2
13101292 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
13111293 if ((isUpdatedDLpValid == isUpdatedDLpValid))
13121294 then (state ++ refreshDLpActions)
13131295 else throw("Strict value is not equal to itself.")
13141296 }
13151297 else throw("Strict value is not equal to itself.")
13161298 }
13171299
13181300
13191301
13201302 @Callable(i)
13211303 func get () = {
13221304 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0))
13231305 if ((currentDLp == currentDLp))
13241306 then {
13251307 let r = cg(i)
13261308 let outAmtAmt = r._1
13271309 let outPrAmt = r._2
13281310 let pmtAmt = r._3
13291311 let pmtAssetId = r._4
13301312 let state = r._5
13311313 let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
13321314 if ((b == b))
13331315 then {
1334- let $t04750247584 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1335- let refreshDLpActions = $t04750247584._1
1336- let updatedDLp = $t04750247584._2
1316+ let $t04758847670 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1317+ let refreshDLpActions = $t04758847670._1
1318+ let updatedDLp = $t04758847670._2
13371319 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
13381320 if ((isUpdatedDLpValid == isUpdatedDLpValid))
13391321 then (state ++ refreshDLpActions)
13401322 else throw("Strict value is not equal to itself.")
13411323 }
13421324 else throw("Strict value is not equal to itself.")
13431325 }
13441326 else throw("Strict value is not equal to itself.")
13451327 }
13461328
13471329
13481330
13491331 @Callable(i)
13501332 func getOneTknV2 (outAssetId,minOutAmount) = {
13511333 let isPoolOneTokenOperationsDisabled = {
13521334 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
13531335 if ($isInstanceOf(@, "Boolean"))
13541336 then @
13551337 else throw(($getType(@) + " couldn't be cast to Boolean"))
13561338 }
13571339 let isGetDisabled = if (if (igs())
13581340 then true
13591341 else (cfgPoolStatus == PoolShutdown))
13601342 then true
13611343 else isPoolOneTokenOperationsDisabled
13621344 let checks = [if (if (!(isGetDisabled))
13631345 then true
13641346 else isManager(i))
13651347 then true
13661348 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
13671349 then true
13681350 else throwErr("exactly 1 payment are expected")]
13691351 if ((checks == checks))
13701352 then {
1371- let $t04820248357 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1372- let state = $t04820248357._1
1373- let totalAmount = $t04820248357._2
1353+ let $t04828848443 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1354+ let state = $t04828848443._1
1355+ let totalAmount = $t04828848443._2
13741356 $Tuple2(state, totalAmount)
13751357 }
13761358 else throw("Strict value is not equal to itself.")
13771359 }
13781360
13791361
13801362
13811363 @Callable(i)
13821364 func refreshDLp () = {
13831365 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyDLpRefreshedHeight), 0)
13841366 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= dLpRefreshDelay))
13851367 then unit
13861368 else throwErr(makeString([toString(dLpRefreshDelay), " blocks have not passed since the previous call"], ""))
13871369 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
13881370 then {
13891371 let dLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyDLp), "0")), fmtErr("invalid dLp"))
1390- let $t04888148945 = refreshDLpInternal(0, 0, 0)
1391- let dLpUpdateActions = $t04888148945._1
1392- let updatedDLp = $t04888148945._2
1372+ let $t04896749031 = refreshDLpInternal(0, 0, 0)
1373+ let dLpUpdateActions = $t04896749031._1
1374+ let updatedDLp = $t04896749031._2
13931375 let actions = if ((dLp != updatedDLp))
13941376 then dLpUpdateActions
13951377 else throwErr("nothing to refresh")
13961378 $Tuple2(actions, toString(updatedDLp))
13971379 }
13981380 else throw("Strict value is not equal to itself.")
13991381 }
14001382
14011383
14021384
14031385 @Callable(i)
14041386 func getOneTknV2READONLY (outAssetId,lpAssetAmount) = {
14051387 let amId = toBase58String(value(cfgAmountAssetId))
14061388 let prId = toBase58String(value(cfgPriceAssetId))
14071389 let lpId = toBase58String(value(cfgLpAssetId))
14081390 let xp = [toBigInt(getAccBalance(amId)), toBigInt(getAccBalance(prId))]
14091391 let lpEmission = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "invalid lp asset").quantity)
14101392 let D0 = getD(xp)
14111393 let D1 = (D0 - fraction(toBigInt(lpAssetAmount), D0, lpEmission))
14121394 let index = if ((outAssetId == amId))
14131395 then 0
14141396 else if ((outAssetId == prId))
14151397 then 1
14161398 else throw("invalid out asset id")
14171399 let newY = getYD(xp, index, D1)
14181400 let dy = (xp[index] - newY)
14191401 let totalGetRaw = max([0, toInt((dy - big1))])
1420- let $t04995550010 = takeFee(totalGetRaw, outFee)
1421- let totalGet = $t04995550010._1
1422- let feeAmount = $t04995550010._2
1402+ let $t05004150096 = takeFee(totalGetRaw, outFee)
1403+ let totalGet = $t05004150096._1
1404+ let feeAmount = $t05004150096._2
14231405 $Tuple2(nil, $Tuple2(totalGet, feeAmount))
14241406 }
14251407
14261408
14271409
14281410 @Callable(i)
14291411 func getOneTknV2WithBonusREADONLY (outAssetId,lpAssetAmount) = {
14301412 let amId = toBase58String(value(cfgAmountAssetId))
14311413 let prId = toBase58String(value(cfgPriceAssetId))
14321414 let lpId = toBase58String(value(cfgLpAssetId))
14331415 let amBalance = getAccBalance(amId)
14341416 let prBalance = getAccBalance(prId)
1435- let $t05038550500 = {
1417+ let $t05047150586 = {
14361418 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil)
14371419 if ($isInstanceOf(@, "(Int, Int)"))
14381420 then @
14391421 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
14401422 }
1441- let totalGet = $t05038550500._1
1442- let feeAmount = $t05038550500._2
1423+ let totalGet = $t05047150586._1
1424+ let feeAmount = $t05047150586._2
14431425 let r = ego("", lpId, lpAssetAmount, this)
14441426 let outAmAmt = r._1
14451427 let outPrAmt = r._2
14461428 let sumOfGetAssets = (outAmAmt + outPrAmt)
14471429 let bonus = if ((sumOfGetAssets == 0))
14481430 then if ((totalGet == 0))
14491431 then 0
14501432 else throw("bonus calculation error")
14511433 else fraction((totalGet - sumOfGetAssets), scale8, sumOfGetAssets)
14521434 $Tuple2(nil, $Tuple3(totalGet, feeAmount, bonus))
14531435 }
14541436
14551437
14561438
14571439 @Callable(i)
14581440 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
14591441 let r = cg(i)
14601442 let outAmAmt = r._1
14611443 let outPrAmt = r._2
14621444 let pmtAmt = r._3
14631445 let pmtAssetId = r._4
14641446 let state = r._5
14651447 if ((noLessThenAmtAsset > outAmAmt))
14661448 then throw(((("Failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
14671449 else if ((noLessThenPriceAsset > outPrAmt))
14681450 then throw(((("Failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
14691451 else {
14701452 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0))
14711453 if ((currentDLp == currentDLp))
14721454 then {
14731455 let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14741456 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14751457 then {
1476- let $t05166651747 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1477- let refreshDLpActions = $t05166651747._1
1478- let updatedDLp = $t05166651747._2
1458+ let $t05175251833 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1459+ let refreshDLpActions = $t05175251833._1
1460+ let updatedDLp = $t05175251833._2
14791461 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
14801462 if ((isUpdatedDLpValid == isUpdatedDLpValid))
14811463 then (state ++ refreshDLpActions)
14821464 else throw("Strict value is not equal to itself.")
14831465 }
14841466 else throw("Strict value is not equal to itself.")
14851467 }
14861468 else throw("Strict value is not equal to itself.")
14871469 }
14881470 }
14891471
14901472
14911473
14921474 @Callable(i)
14931475 func unstakeAndGet (amount) = {
14941476 let checkPayments = if ((size(i.payments) != 0))
14951477 then throw("No pmnts expd")
14961478 else true
14971479 if ((checkPayments == checkPayments))
14981480 then {
14991481 let factoryCfg = gfc()
15001482 let lpAssetId = cfgLpAssetId
15011483 let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr")
15021484 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0))
15031485 if ((currentDLp == currentDLp))
15041486 then {
15051487 let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil)
15061488 if ((unstakeInv == unstakeInv))
15071489 then {
15081490 let r = ego(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
15091491 let outAmAmt = r._1
15101492 let outPrAmt = r._2
15111493 let sts = parseIntValue(r._9)
15121494 let state = r._10
15131495 let v = if (if (igs())
15141496 then true
15151497 else (sts == PoolShutdown))
15161498 then throw(("Blocked: " + toString(sts)))
15171499 else true
15181500 if ((v == v))
15191501 then {
15201502 let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
15211503 if ((burnA == burnA))
15221504 then {
1523- let $t05277452855 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1524- let refreshDLpActions = $t05277452855._1
1525- let updatedDLp = $t05277452855._2
1505+ let $t05286052941 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1506+ let refreshDLpActions = $t05286052941._1
1507+ let updatedDLp = $t05286052941._2
15261508 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
15271509 if ((isUpdatedDLpValid == isUpdatedDLpValid))
15281510 then (state ++ refreshDLpActions)
15291511 else throw("Strict value is not equal to itself.")
15301512 }
15311513 else throw("Strict value is not equal to itself.")
15321514 }
15331515 else throw("Strict value is not equal to itself.")
15341516 }
15351517 else throw("Strict value is not equal to itself.")
15361518 }
15371519 else throw("Strict value is not equal to itself.")
15381520 }
15391521 else throw("Strict value is not equal to itself.")
15401522 }
15411523
15421524
15431525
15441526 @Callable(i)
15451527 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
15461528 let isGetDisabled = if (igs())
15471529 then true
15481530 else (cfgPoolStatus == PoolShutdown)
15491531 let checks = [if (!(isGetDisabled))
15501532 then true
15511533 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
15521534 then true
15531535 else throw("no payments are expected")]
15541536 if ((checks == checks))
15551537 then {
15561538 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0))
15571539 if ((currentDLp == currentDLp))
15581540 then {
15591541 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
15601542 if ((unstakeInv == unstakeInv))
15611543 then {
15621544 let res = ego(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
15631545 let outAmAmt = res._1
15641546 let outPrAmt = res._2
15651547 let state = res._10
15661548 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
15671549 then true
15681550 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
15691551 then true
15701552 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
15711553 if ((checkAmounts == checkAmounts))
15721554 then {
15731555 let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
15741556 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15751557 then {
1576- let $t05410654187 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1577- let refreshDLpActions = $t05410654187._1
1578- let updatedDLp = $t05410654187._2
1558+ let $t05419254273 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1559+ let refreshDLpActions = $t05419254273._1
1560+ let updatedDLp = $t05419254273._2
15791561 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
15801562 if ((isUpdatedDLpValid == isUpdatedDLpValid))
15811563 then (state ++ refreshDLpActions)
15821564 else throw("Strict value is not equal to itself.")
15831565 }
15841566 else throw("Strict value is not equal to itself.")
15851567 }
15861568 else throw("Strict value is not equal to itself.")
15871569 }
15881570 else throw("Strict value is not equal to itself.")
15891571 }
15901572 else throw("Strict value is not equal to itself.")
15911573 }
15921574 else throw("Strict value is not equal to itself.")
15931575 }
15941576
15951577
15961578
15971579 @Callable(i)
15981580 func unstakeAndGetOneTknV2 (unstakeAmount,outAssetId,minOutAmount) = {
15991581 let isPoolOneTokenOperationsDisabled = {
16001582 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
16011583 if ($isInstanceOf(@, "Boolean"))
16021584 then @
16031585 else throw(($getType(@) + " couldn't be cast to Boolean"))
16041586 }
16051587 let isGetDisabled = if (if (igs())
16061588 then true
16071589 else (cfgPoolStatus == PoolShutdown))
16081590 then true
16091591 else isPoolOneTokenOperationsDisabled
16101592 let checks = [if (if (!(isGetDisabled))
16111593 then true
16121594 else isManager(i))
16131595 then true
16141596 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
16151597 then true
16161598 else throwErr("no payments are expected")]
16171599 if ((checks == checks))
16181600 then {
16191601 let factoryCfg = gfc()
16201602 let lpAssetId = cfgLpAssetId
16211603 let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr")
16221604 let userAddress = i.caller
16231605 let lpAssetRecipientAddress = this
16241606 let unstakeInv = invoke(staking, "unstakeINTERNAL", [lpAssetId, unstakeAmount, userAddress.bytes, lpAssetRecipientAddress.bytes], nil)
16251607 if ((unstakeInv == unstakeInv))
16261608 then {
1627- let $t05520955397 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1628- let state = $t05520955397._1
1629- let totalAmount = $t05520955397._2
1609+ let $t05529555483 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1610+ let state = $t05529555483._1
1611+ let totalAmount = $t05529555483._2
16301612 $Tuple2(state, totalAmount)
16311613 }
16321614 else throw("Strict value is not equal to itself.")
16331615 }
16341616 else throw("Strict value is not equal to itself.")
16351617 }
16361618
16371619
16381620
16391621 @Callable(i)
16401622 func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = {
1641- let $t05552555628 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1642- let lpAmount = $t05552555628._1
1643- let state = $t05552555628._2
1644- let feeAmount = $t05552555628._3
1645- let bonus = $t05552555628._4
1623+ let $t05561155714 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1624+ let lpAmount = $t05561155714._1
1625+ let state = $t05561155714._2
1626+ let feeAmount = $t05561155714._3
1627+ let bonus = $t05561155714._4
16461628 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
16471629 }
16481630
16491631
16501632
16511633 @Callable(i)
16521634 func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = {
1653- let $t05577655880 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1654- let lpAmount = $t05577655880._1
1655- let state = $t05577655880._2
1656- let feeAmount = $t05577655880._3
1657- let bonus = $t05577655880._4
1635+ let $t05586255966 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1636+ let lpAmount = $t05586255966._1
1637+ let state = $t05586255966._2
1638+ let feeAmount = $t05586255966._3
1639+ let bonus = $t05586255966._4
16581640 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
16591641 }
16601642
16611643
16621644
16631645 @Callable(i)
16641646 func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString(fca)))
16651647 then throw("denied")
1666- else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr), StringEntry(amp(), toString(ampInitial))], "success")
1648+ else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr), StringEntry(amp(), toString(ampInitial)), StringEntry(keyAmpHistory(height), toString(ampInitial))], "success")
16671649
16681650
16691651
16701652 @Callable(i)
16711653 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, gpc())
16721654
16731655
16741656
16751657 @Callable(i)
16761658 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
16771659
16781660
16791661
16801662 @Callable(i)
16811663 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
16821664 let pr = calcPrices(amAmt, prAmt, lpAmt)
16831665 $Tuple2(nil, [toString(pr[0]), toString(pr[1]), toString(pr[2])])
16841666 }
16851667
16861668
16871669
16881670 @Callable(i)
16891671 func fromX18WrapperREADONLY (val,resScaleMult) = $Tuple2(nil, f1(parseBigIntValue(val), resScaleMult))
16901672
16911673
16921674
16931675 @Callable(i)
16941676 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(t1(origVal, origScaleMult)))
16951677
16961678
16971679
16981680 @Callable(i)
16991681 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(cpbi(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
17001682
17011683
17021684
17031685 @Callable(i)
17041686 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, ""))
17051687
17061688
17071689
17081690 @Callable(i)
17091691 func estimateGetOperationWrapperREADONLY (txId58,pmtAsId,pmtLpAmt,usrAddr) = {
17101692 let r = ego(txId58, pmtAsId, pmtLpAmt, addressFromStringValue(usrAddr))
17111693 $Tuple2(nil, $Tuple10(r._1, r._2, r._3, r._4, r._5, r._6, r._7, toString(r._8), r._9, r._10))
17121694 }
17131695
17141696
17151697
17161698 @Callable(i)
17171699 func changeAmp () = {
17181700 let cfg = invoke(fca, "getChangeAmpConfigREADONLY", [toString(this)], nil)
1719- let $t05828958488 = match cfg {
1701+ let $t05844658645 = match cfg {
17201702 case list: List[Any] =>
17211703 $Tuple3({
17221704 let @ = list[0]
17231705 if ($isInstanceOf(@, "Int"))
17241706 then @
17251707 else throw(($getType(@) + " couldn't be cast to Int"))
17261708 }, {
17271709 let @ = list[1]
17281710 if ($isInstanceOf(@, "Int"))
17291711 then @
17301712 else throw(($getType(@) + " couldn't be cast to Int"))
17311713 }, {
17321714 let @ = list[2]
17331715 if ($isInstanceOf(@, "Int"))
17341716 then @
17351717 else throw(($getType(@) + " couldn't be cast to Int"))
17361718 })
17371719 case _ =>
17381720 throwErr("invalid entry type")
17391721 }
1740- let delay = $t05828958488._1
1741- let delta = $t05828958488._2
1742- let target = $t05828958488._3
1722+ let delay = $t05844658645._1
1723+ let delta = $t05844658645._2
1724+ let target = $t05844658645._3
17431725 let curAmp = parseIntValue(getStringValue(amp()))
17441726 let newAmpRaw = (curAmp + delta)
17451727 let newAmp = if ((0 > delta))
17461728 then if ((target > newAmpRaw))
17471729 then target
17481730 else newAmpRaw
17491731 else if ((newAmpRaw > target))
17501732 then target
17511733 else newAmpRaw
17521734 let lastCall = valueOrElse(getInteger(keyChangeAmpLastCall()), 0)
17531735 let wait = (lastCall + delay)
17541736 let checks = [if ((height > wait))
17551737 then true
17561738 else throwErr("try again in few blocks"), if ((curAmp != newAmp))
17571739 then true
17581740 else throwErr("already reached target")]
17591741 if ((checks == checks))
17601742 then [IntegerEntry(keyChangeAmpLastCall(), height), StringEntry(amp(), toString(newAmp)), StringEntry(keyAmpHistory(height), toString(newAmp))]
17611743 else throw("Strict value is not equal to itself.")
17621744 }
17631745
17641746
17651747 @Verifier(tx)
17661748 func verify () = {
1767- let targetPublicKey = match m() {
1749+ let targetPublicKey = match managerPublicKeyOrUnit() {
17681750 case pk: ByteVector =>
17691751 pk
17701752 case _: Unit =>
17711753 tx.senderPublicKey
17721754 case _ =>
17731755 throw("Match error")
17741756 }
17751757 match tx {
17761758 case order: Order =>
17771759 let matcherPub = mp()
1778- let $t05940059517 = if (skipOrderValidation())
1760+ let $t05957859695 = if (skipOrderValidation())
17791761 then $Tuple2(true, "")
17801762 else validateMatcherOrderAllowed(order)
1781- let orderValid = $t05940059517._1
1782- let orderValidInfo = $t05940059517._2
1763+ let orderValid = $t05957859695._1
1764+ let orderValidInfo = $t05957859695._2
17831765 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
17841766 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
17851767 if (if (if (orderValid)
17861768 then senderValid
17871769 else false)
17881770 then matcherValid
17891771 else false)
17901772 then true
17911773 else throwOrderError(orderValid, orderValidInfo, senderValid, matcherValid)
17921774 case s: SetScriptTransaction =>
17931775 if (sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey))
17941776 then true
17951777 else {
17961778 let newHash = blake2b256(value(s.script))
17971779 let allowedHash = fromBase64String(value(getString(fca, keyAllowedLpStableScriptHash())))
17981780 let currentHash = scriptHash(this)
17991781 if ((allowedHash == newHash))
18001782 then (currentHash != newHash)
18011783 else false
18021784 }
18031785 case _ =>
18041786 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
18051787 }
18061788 }
18071789

github/deemru/w8io/fabc49c 
293.24 ms