tx · 7BJiHH1qQiA4gD1dkNzJsk8Pavkw6FnSDgPHVhNoX5Mx

3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT:  -0.04100000 Waves

2023.05.10 13:15 [2571654] smart account 3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT > SELF 0.00000000 Waves

{ "type": 13, "id": "7BJiHH1qQiA4gD1dkNzJsk8Pavkw6FnSDgPHVhNoX5Mx", "fee": 4100000, "feeAssetId": null, "timestamp": 1683713688855, "version": 2, "chainId": 84, "sender": "3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT", "senderPublicKey": "D1BL65meykxFZTCuq7jq9HSGLLnWvQamQPUNrguW5w39", "proofs": [ "5MkAyepUuAWuiCi8NTANV8xTx4UzbgX6bjJT6nRQkrUxtSxE7METZa3jiGqe1Q2RPQvhGySGJpg6KP5MMd9TEgkY" ], "script": "base64:BgKxLQgCEgUKAwEEARIHCgUBBAEIARIDCgEIEgQKAgEEEgQKAgEEEgMKAQESABIECgIIARIAEgQKAggBEgQKAggBEgQKAgEBEgMKAQESBQoDAQEBEgUKAwEIARIECgIBCBIECgIBCBIECgIICBIAEgMKAQgSBQoDAQEBEgQKAggBEgQKAgEBEgQKAggIEgsKCQgBAQIBAggEBBIGCgQICAEIEgAiBnNjYWxlOCIMc2NhbGU4QmlnSW50IgdzY2FsZTE4Igp6ZXJvQmlnSW50IgRiaWcwIgRiaWcxIgRiaWcyIgRiaWczIgRiaWc0IgpzbGlwcGFnZTREIgt3YXZlc1N0cmluZyIFQW11bHQiBURjb252IgNTRVAiBUVNUFRZIgpQb29sQWN0aXZlIgpQb29sUHV0RGlzIg5Qb29sTWF0Y2hlckRpcyIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyIJaWR4UG9vbFN0IglpZHhMUEFzSWQiCWlkeEFtQXNJZCIJaWR4UHJBc0lkIgtpZHhBbXRBc0RjbSINaWR4UHJpY2VBc0RjbSILaWR4SUFtdEFzSWQiDWlkeElQcmljZ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8xBAJhSwgFAmlCAl8yBAJhTAkA9AMDCAUCZmkJYm9keUJ5dGVzCQCRAwIIBQJmaQZwcm9vZnMAAAgFAmZpD3NlbmRlclB1YmxpY0tleQQCYU0JAPQDAwgFAmZpCWJvZHlCeXRlcwkAkQMCCAUCZmkGcHJvb2ZzAAEFAmlBAwMDBQJhSgUCYUwHBQJhTQcGCQECYUkEBQJhSgUCYUsFAmFMBQJhTQMJAAECBQJhUAIUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAmFVBQJhUAMJAPQDAwgFAml4CWJvZHlCeXRlcwkAkQMCCAUCaXgGcHJvb2ZzAAAFAml6BgQCaUMJAPYDAQkBBXZhbHVlAQgFAmFVBnNjcmlwdAQCaUQJANsEAQkBBXZhbHVlAQkAnQgCBQJhVAkBAmFFAAQCaUUJAPEHAQUEdGhpcwMJAAACBQJpRAUCaUMJAQIhPQIFAmlFBQJpQwcJAPQDAwgFAml4CWJvZHlCeXRlcwkAkQMCCAUCaXgGcHJvb2ZzAAAFAml6CFKkNA==", "height": 2571654, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8VC9TU7P6uhQTkta7oti1VYZe7dN5UpBri166An8kncz Next: 4NLcA3oeRiKPnhYjWAupGhstGp4CtsGsvUX6bcv2gNSq Diff:
OldNewDifferences
101101 func fc () = "%s__factoryContract"
102102
103103
104-func mpk () = "%s__managerPublicKey"
104+func keyManagerPublicKey () = "%s__managerPublicKey"
105105
106106
107-func pmpk () = "%s__pendingManagerPublicKey"
107+func keyManagerVaultAddress () = "%s__managerVaultAddress"
108108
109109
110110 func pl () = "%s%s__price__last"
175175 func throwOrderError (orderValid,orderValidInfo,senderValid,matcherValid) = throw((((((((("order validation failed: orderValid=" + toString(orderValid)) + " (") + orderValidInfo) + ")") + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
176176
177177
178+func addressFromStringOrThis (addressString) = match addressFromString(addressString) {
179+ case a: Address =>
180+ a
181+ case _ =>
182+ this
183+}
184+
185+
186+func getManagerVaultAddressOrThis () = {
187+ let factoryAddress = match addressFromStringOrThis(fc()) {
188+ case fca: Address =>
189+ fca
190+ case _ =>
191+ this
192+ }
193+ match getString(factoryAddress, keyManagerVaultAddress()) {
194+ case s: String =>
195+ addressFromStringOrThis(s)
196+ case _ =>
197+ this
198+ }
199+ }
200+
201+
178202 func strf (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
179203
180204
237261
238262 let poolConfigParsed = parsePoolConfig(gpc())
239263
240-let $t081658394 = poolConfigParsed
264+let $t086768905 = poolConfigParsed
241265
242-let cfgPoolAddress = $t081658394._1
266+let cfgPoolAddress = $t086768905._1
243267
244-let cfgPoolStatus = $t081658394._2
268+let cfgPoolStatus = $t086768905._2
245269
246-let cfgLpAssetId = $t081658394._3
270+let cfgLpAssetId = $t086768905._3
247271
248-let cfgAmountAssetId = $t081658394._4
272+let cfgAmountAssetId = $t086768905._4
249273
250-let cfgPriceAssetId = $t081658394._5
274+let cfgPriceAssetId = $t086768905._5
251275
252-let cfgAmountAssetDecimals = $t081658394._6
276+let cfgAmountAssetDecimals = $t086768905._6
253277
254-let cfgPriceAssetDecimals = $t081658394._7
278+let cfgPriceAssetDecimals = $t086768905._7
255279
256-let cfgInAmountAssedId = $t081658394._8
280+let cfgInAmountAssedId = $t086768905._8
257281
258-let cfgInPriceAssetId = $t081658394._9
282+let cfgInPriceAssetId = $t086768905._9
259283
260284 func gfc () = split(strf(fca, fcfg()), SEP)
261285
376400 }
377401
378402 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
379- let $t01289912947 = {
403+ let $t01341013458 = {
380404 let $l = arr
381405 let $s = size($l)
382406 let $acc0 = $Tuple2(s, false)
390414
391415 $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)
392416 }
393- let d = $t01289912947._1
394- let found = $t01289912947._2
417+ let d = $t01341013458._1
418+ let found = $t01341013458._2
395419 if (found)
396420 then d
397421 else throw(("D calculation error, D = " + toString(d)))
527551 else calcLpAmt
528552 let amDiff = (inAmAmt - calcAmAssetPmt)
529553 let prDiff = (inPrAmt - calcPrAssetPmt)
530- let $t02078621131 = if (if (isOneAsset)
554+ let $t02129721642 = if (if (isOneAsset)
531555 then (pmtId == amIdStr)
532556 else false)
533557 then $Tuple2(pmtAmt, 0)
536560 else false)
537561 then $Tuple2(0, pmtAmt)
538562 else $Tuple2(calcAmAssetPmt, calcPrAssetPmt)
539- let writeAmAmt = $t02078621131._1
540- let writePrAmt = $t02078621131._2
563+ let writeAmAmt = $t02129721642._1
564+ let writePrAmt = $t02129721642._2
541565 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))]
542566 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId)
543567 }
556580 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
557581 let b = ((s + ((D * aPrecision) / ann)) - D)
558582 func calc (acc,cur) = {
559- let $t02232622346 = acc
560- let y = $t02232622346._1
561- let found = $t02232622346._2
583+ let $t02283722857 = acc
584+ let y = $t02283722857._1
585+ let found = $t02283722857._2
562586 if ((found != unit))
563587 then acc
564588 else {
571595 }
572596
573597 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
574- let $t02265322700 = {
598+ let $t02316423211 = {
575599 let $l = arr
576600 let $s = size($l)
577601 let $acc0 = $Tuple2(D, unit)
585609
586610 $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)
587611 }
588- let y = $t02265322700._1
589- let found = $t02265322700._2
612+ let y = $t02316423211._1
613+ let found = $t02316423211._2
590614 if ((found != unit))
591615 then y
592616 else throw(("Y calculation error, Y = " + toString(y)))
630654 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
631655 let amountAssetAmount = order.amount
632656 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
633- let $t02489825110 = if ((order.orderType == Buy))
657+ let $t02540925621 = if ((order.orderType == Buy))
634658 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
635659 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
636- let amountAssetBalanceDelta = $t02489825110._1
637- let priceAssetBalanceDelta = $t02489825110._2
660+ let amountAssetBalanceDelta = $t02540925621._1
661+ let priceAssetBalanceDelta = $t02540925621._2
638662 if (if (if (igs())
639663 then true
640664 else (cfgPoolStatus == PoolMatcherDis))
647671 then throw("Wr assets")
648672 else {
649673 let dLp = parseBigIntValue(valueOrElse(getString(this, keyDLp), "0"))
650- let $t02545225552 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
651- let unusedActions = $t02545225552._1
652- let dLpNew = $t02545225552._2
674+ let $t02596326063 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
675+ let unusedActions = $t02596326063._1
676+ let dLpNew = $t02596326063._2
653677 let isOrderValid = (dLpNew >= dLp)
654678 let info = makeString(["dLp=", toString(dLp), " dLpNew=", toString(dLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "")
655679 $Tuple2(isOrderValid, info)
703727 then {
704728 let amBalance = getAccBalance(amId)
705729 let prBalance = getAccBalance(prId)
706- let $t02820828670 = if ((txId == ""))
730+ let $t02871929181 = if ((txId == ""))
707731 then $Tuple2(amBalance, prBalance)
708732 else if ((pmtAssetId == amId))
709733 then if ((pmtAmtRaw > amBalance))
714738 then throw("invalid payment amount")
715739 else $Tuple2(amBalance, (prBalance - pmtAmtRaw))
716740 else throw("wrong pmtAssetId")
717- let amBalanceOld = $t02820828670._1
718- let prBalanceOld = $t02820828670._2
719- let $t02867628852 = if ((pmtAssetId == amId))
741+ let amBalanceOld = $t02871929181._1
742+ let prBalanceOld = $t02871929181._2
743+ let $t02918729363 = if ((pmtAssetId == amId))
720744 then $Tuple2(pmtAmtRaw, 0)
721745 else if ((pmtAssetId == prId))
722746 then $Tuple2(0, pmtAmtRaw)
723747 else throw("invalid payment")
724- let amAmountRaw = $t02867628852._1
725- let prAmountRaw = $t02867628852._2
726- let $t02885629110 = if (withTakeFee)
748+ let amAmountRaw = $t02918729363._1
749+ let prAmountRaw = $t02918729363._2
750+ let $t02936729621 = if (withTakeFee)
727751 then $Tuple3(takeFee(amAmountRaw, inFee)._1, takeFee(prAmountRaw, inFee)._1, takeFee(pmtAmtRaw, inFee)._2)
728752 else $Tuple3(amAmountRaw, prAmountRaw, 0)
729- let amAmount = $t02885629110._1
730- let prAmount = $t02885629110._2
731- let feeAmount = $t02885629110._3
753+ let amAmount = $t02936729621._1
754+ let prAmount = $t02936729621._2
755+ let feeAmount = $t02936729621._3
732756 let amBalanceNew = (amBalanceOld + amAmount)
733757 let prBalanceNew = (prBalanceOld + prAmount)
734758 let D0 = getD([t1(amBalanceOld, cfgAmountAssetDecimals), t1(prBalanceOld, cfgPriceAssetDecimals)])
776800 else {
777801 let amBalance = getAccBalance(amId)
778802 let prBalance = getAccBalance(prId)
779- let $t03122231333 = {
803+ let $t03173331844 = {
780804 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil)
781805 if ($isInstanceOf(@, "(Int, Int)"))
782806 then @
783807 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
784808 }
785- if (($t03122231333 == $t03122231333))
809+ if (($t03173331844 == $t03173331844))
786810 then {
787- let feeAmount = $t03122231333._2
788- let totalGet = $t03122231333._1
811+ let feeAmount = $t03173331844._2
812+ let totalGet = $t03173331844._1
789813 let totalAmount = if (if ((minOutAmount > 0))
790814 then (minOutAmount > totalGet)
791815 else false)
792816 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
793817 else totalGet
794- let $t03152331830 = if ((outAssetId == amId))
818+ let $t03203432341 = if ((outAssetId == amId))
795819 then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance)
796820 else if ((outAssetId == prId))
797821 then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount))
798822 else throw("invalid out asset id")
799- let outAm = $t03152331830._1
800- let outPr = $t03152331830._2
801- let amBalanceNew = $t03152331830._3
802- let prBalanceNew = $t03152331830._4
823+ let outAm = $t03203432341._1
824+ let outPr = $t03203432341._2
825+ let amBalanceNew = $t03203432341._3
826+ let prBalanceNew = $t03203432341._4
803827 let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals))
804828 let curPr = f1(curPrX18, scale8)
805829 let outAssetIdOrWaves = if ((outAssetId == "WAVES"))
814838 let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
815839 if ((burn == burn))
816840 then {
817- let $t03261532965 = {
841+ let $t03312633476 = {
818842 let feeAmountForCalc = if ((this == feeCollectorAddress))
819843 then 0
820844 else feeAmount
825849 then $Tuple2(-((totalGet + feeAmountForCalc)), 0)
826850 else $Tuple2(0, -((totalGet + feeAmountForCalc)))
827851 }
828- let amountAssetBalanceDelta = $t03261532965._1
829- let priceAssetBalanceDelta = $t03261532965._2
830- let $t03296833076 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
831- let refreshDLpActions = $t03296833076._1
832- let updatedDLp = $t03296833076._2
852+ let amountAssetBalanceDelta = $t03312633476._1
853+ let priceAssetBalanceDelta = $t03312633476._2
854+ let $t03347933587 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
855+ let refreshDLpActions = $t03347933587._1
856+ let updatedDLp = $t03347933587._2
833857 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
834858 if ((isUpdatedDLpValid == isUpdatedDLpValid))
835859 then $Tuple2((state ++ refreshDLpActions), totalAmount)
846870 }
847871
848872
849-func m () = match getString(mpk()) {
850- case s: String =>
851- fromBase58String(s)
852- case _: Unit =>
853- unit
854- case _ =>
855- throw("Match error")
856-}
857-
858-
859-func pm () = match getString(pmpk()) {
860- case s: String =>
861- fromBase58String(s)
862- case _: Unit =>
863- unit
864- case _ =>
865- throw("Match error")
866-}
873+func managerPublicKeyOrUnit () = {
874+ let managerVaultAddress = getManagerVaultAddressOrThis()
875+ match getString(managerVaultAddress, keyManagerPublicKey()) {
876+ case s: String =>
877+ fromBase58String(s)
878+ case _: Unit =>
879+ unit
880+ case _ =>
881+ throw("Match error")
882+ }
883+ }
867884
868885
869886 let pd = throw("Permission denied")
870887
871-func isManager (i) = match m() {
888+func isManager (i) = match managerPublicKeyOrUnit() {
872889 case pk: ByteVector =>
873890 (i.callerPublicKey == pk)
874891 case _: Unit =>
878895 }
879896
880897
881-func mm (i) = match m() {
898+func mustManager (i) = match managerPublicKeyOrUnit() {
882899 case pk: ByteVector =>
883900 if ((i.callerPublicKey == pk))
884901 then true
908925 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
909926 let b = ((s + ((D * aPrecision) / ann)) - D)
910927 func calc (acc,cur) = {
911- let $t03452334543 = acc
912- let y = $t03452334543._1
913- let found = $t03452334543._2
928+ let $t03507435094 = acc
929+ let y = $t03507435094._1
930+ let found = $t03507435094._2
914931 if ((found != unit))
915932 then acc
916933 else {
923940 }
924941
925942 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
926- let $t03487434921 = {
943+ let $t03542535472 = {
927944 let $l = arr
928945 let $s = size($l)
929946 let $acc0 = $Tuple2(D, unit)
937954
938955 $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)
939956 }
940- let y = $t03487434921._1
941- let found = $t03487434921._2
957+ let y = $t03542535472._1
958+ let found = $t03542535472._2
942959 if ((found != unit))
943960 then y
944961 else throw(("Y calculation error, Y = " + toString(y)))
950967
951968 @Callable(i)
952969 func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = {
953- let $t03527335697 = if ((isReverse == false))
970+ let $t03582436248 = if ((isReverse == false))
954971 then {
955972 let assetOut = strf(this, pa())
956973 let poolAmountInBalance = (toBigInt(getAccBalance(strf(this, aa()))) + toBigInt(cleanAmountIn))
961978 let poolAmountInBalance = (toBigInt(getAccBalance(strf(this, pa()))) + toBigInt(cleanAmountIn))
962979 $Tuple2(assetOut, poolAmountInBalance)
963980 }
964- let assetOut = $t03527335697._1
965- let poolAmountInBalance = $t03527335697._2
981+ let assetOut = $t03582436248._1
982+ let poolAmountInBalance = $t03582436248._2
966983 let poolConfig = gpc()
967984 let amId = poolConfig[idxAmAsId]
968985 let prId = poolConfig[idxPrAsId]
10021019 then {
10031020 let pmt = value(i.payments[0])
10041021 let assetIn = assetIdToString(pmt.assetId)
1005- let $t03713337527 = if ((isReverse == false))
1022+ let $t03768438078 = if ((isReverse == false))
10061023 then {
10071024 let assetOut = strf(this, pa())
10081025 let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
10131030 let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
10141031 $Tuple2(assetOut, poolAmountInBalance)
10151032 }
1016- let assetOut = $t03713337527._1
1017- let poolAmountInBalance = $t03713337527._2
1033+ let assetOut = $t03768438078._1
1034+ let poolAmountInBalance = $t03768438078._2
10181035 let poolConfig = gpc()
10191036 let amId = poolConfig[idxAmAsId]
10201037 let prId = poolConfig[idxPrAsId]
10501067
10511068 @Callable(i)
10521069 func constructor (fc) = {
1053- let c = mm(i)
1070+ let c = mustManager(i)
10541071 if ((c == c))
10551072 then [StringEntry(fc(), fc)]
1056- else throw("Strict value is not equal to itself.")
1057- }
1058-
1059-
1060-
1061-@Callable(i)
1062-func setManager (pendingManagerPublicKey) = {
1063- let c = mm(i)
1064- if ((c == c))
1065- then {
1066- let cm = fromBase58String(pendingManagerPublicKey)
1067- if ((cm == cm))
1068- then [StringEntry(pmpk(), pendingManagerPublicKey)]
1069- else throw("Strict value is not equal to itself.")
1070- }
1071- else throw("Strict value is not equal to itself.")
1072- }
1073-
1074-
1075-
1076-@Callable(i)
1077-func confirmManager () = {
1078- let p = pm()
1079- let hpm = if (isDefined(p))
1080- then true
1081- else throw("No pending manager")
1082- if ((hpm == hpm))
1083- then {
1084- let cpm = if ((i.callerPublicKey == value(p)))
1085- then true
1086- else throw("You are not pending manager")
1087- if ((cpm == cpm))
1088- then [StringEntry(mpk(), toBase58String(value(p))), DeleteEntry(pmpk())]
1089- else throw("Strict value is not equal to itself.")
1090- }
10911073 else throw("Strict value is not equal to itself.")
10921074 }
10931075
11541136 else throw("Strict value is not equal to itself.")
11551137 }
11561138 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
1157- let $t04214642288 = refreshDLpInternal(0, 0, 0)
1158- let refreshDLpActions = $t04214642288._1
1159- let updatedDLp = $t04214642288._2
1139+ let $t04222242364 = refreshDLpInternal(0, 0, 0)
1140+ let refreshDLpActions = $t04222242364._1
1141+ let updatedDLp = $t04222242364._2
11601142 let check = if ((updatedDLp >= currentDLp))
11611143 then true
11621144 else throwErr(makeString(["updated DLp lower than current DLp", toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentDLp), toString(updatedDLp), toString(amDiff), toString(prDiff)], " "))
12291211 else calcCurrentDLp(toBigInt(0), toBigInt(pmtAmt), toBigInt(0))
12301212 if ((currentDLp == currentDLp))
12311213 then {
1232- let $t04392944087 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1233- if (($t04392944087 == $t04392944087))
1214+ let $t04400544163 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1215+ if (($t04400544163 == $t04400544163))
12341216 then {
1235- let feeAmount = $t04392944087._3
1236- let state = $t04392944087._2
1237- let estimLP = $t04392944087._1
1217+ let feeAmount = $t04400544163._3
1218+ let state = $t04400544163._2
1219+ let estimLP = $t04400544163._1
12381220 let emitLpAmt = if (if ((minOutAmount > 0))
12391221 then (minOutAmount > estimLP)
12401222 else false)
12621244 let sendFeeToMatcher = if ((feeAmount > 0))
12631245 then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))]
12641246 else nil
1265- let $t04497245321 = if ((this == feeCollectorAddress))
1247+ let $t04504845397 = if ((this == feeCollectorAddress))
12661248 then $Tuple2(0, 0)
12671249 else {
12681250 let paymentInAmountAsset = if ((pmt.assetId == cfgAmountAssetId))
12721254 then $Tuple2(-(feeAmount), 0)
12731255 else $Tuple2(0, -(feeAmount))
12741256 }
1275- let amountAssetBalanceDelta = $t04497245321._1
1276- let priceAssetBalanceDelta = $t04497245321._2
1277- let $t04532445432 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1278- let refreshDLpActions = $t04532445432._1
1279- let updatedDLp = $t04532445432._2
1257+ let amountAssetBalanceDelta = $t04504845397._1
1258+ let priceAssetBalanceDelta = $t04504845397._2
1259+ let $t04540045508 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1260+ let refreshDLpActions = $t04540045508._1
1261+ let updatedDLp = $t04540045508._2
12801262 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
12811263 if ((isUpdatedDLpValid == isUpdatedDLpValid))
12821264 then $Tuple2((((state ++ lpTrnsfr) ++ sendFeeToMatcher) ++ refreshDLpActions), emitLpAmt)
13081290 let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0))
13091291 if ((currentDLp == currentDLp))
13101292 then {
1311- let $t04646246527 = refreshDLpInternal(0, 0, 0)
1312- let refreshDLpActions = $t04646246527._1
1313- let updatedDLp = $t04646246527._2
1293+ let $t04653846603 = refreshDLpInternal(0, 0, 0)
1294+ let refreshDLpActions = $t04653846603._1
1295+ let updatedDLp = $t04653846603._2
13141296 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
13151297 if ((isUpdatedDLpValid == isUpdatedDLpValid))
13161298 then (state ++ refreshDLpActions)
13351317 let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
13361318 if ((b == b))
13371319 then {
1338- let $t04770047782 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1339- let refreshDLpActions = $t04770047782._1
1340- let updatedDLp = $t04770047782._2
1320+ let $t04777647858 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1321+ let refreshDLpActions = $t04777647858._1
1322+ let updatedDLp = $t04777647858._2
13411323 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
13421324 if ((isUpdatedDLpValid == isUpdatedDLpValid))
13431325 then (state ++ refreshDLpActions)
13721354 else throwErr("exactly 1 payment are expected")]
13731355 if ((checks == checks))
13741356 then {
1375- let $t04840048555 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1376- let state = $t04840048555._1
1377- let totalAmount = $t04840048555._2
1357+ let $t04847648631 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1358+ let state = $t04847648631._1
1359+ let totalAmount = $t04847648631._2
13781360 $Tuple2(state, totalAmount)
13791361 }
13801362 else throw("Strict value is not equal to itself.")
13911373 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
13921374 then {
13931375 let dLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyDLp), "0")), fmtErr("invalid dLp"))
1394- let $t04907949143 = refreshDLpInternal(0, 0, 0)
1395- let dLpUpdateActions = $t04907949143._1
1396- let updatedDLp = $t04907949143._2
1376+ let $t04915549219 = refreshDLpInternal(0, 0, 0)
1377+ let dLpUpdateActions = $t04915549219._1
1378+ let updatedDLp = $t04915549219._2
13971379 let actions = if ((dLp != updatedDLp))
13981380 then dLpUpdateActions
13991381 else throwErr("nothing to refresh")
14211403 let newY = getYD(xp, index, D1)
14221404 let dy = (xp[index] - newY)
14231405 let totalGetRaw = max([0, toInt((dy - big1))])
1424- let $t05015350208 = takeFee(totalGetRaw, outFee)
1425- let totalGet = $t05015350208._1
1426- let feeAmount = $t05015350208._2
1406+ let $t05022950284 = takeFee(totalGetRaw, outFee)
1407+ let totalGet = $t05022950284._1
1408+ let feeAmount = $t05022950284._2
14271409 $Tuple2(nil, $Tuple2(totalGet, feeAmount))
14281410 }
14291411
14361418 let lpId = toBase58String(value(cfgLpAssetId))
14371419 let amBalance = getAccBalance(amId)
14381420 let prBalance = getAccBalance(prId)
1439- let $t05058350698 = {
1421+ let $t05065950774 = {
14401422 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil)
14411423 if ($isInstanceOf(@, "(Int, Int)"))
14421424 then @
14431425 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
14441426 }
1445- let totalGet = $t05058350698._1
1446- let feeAmount = $t05058350698._2
1427+ let totalGet = $t05065950774._1
1428+ let feeAmount = $t05065950774._2
14471429 let r = ego("", lpId, lpAssetAmount, this)
14481430 let outAmAmt = r._1
14491431 let outPrAmt = r._2
14771459 let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14781460 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14791461 then {
1480- let $t05186451945 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1481- let refreshDLpActions = $t05186451945._1
1482- let updatedDLp = $t05186451945._2
1462+ let $t05194052021 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1463+ let refreshDLpActions = $t05194052021._1
1464+ let updatedDLp = $t05194052021._2
14831465 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
14841466 if ((isUpdatedDLpValid == isUpdatedDLpValid))
14851467 then (state ++ refreshDLpActions)
15241506 let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
15251507 if ((burnA == burnA))
15261508 then {
1527- let $t05297253053 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1528- let refreshDLpActions = $t05297253053._1
1529- let updatedDLp = $t05297253053._2
1509+ let $t05304853129 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1510+ let refreshDLpActions = $t05304853129._1
1511+ let updatedDLp = $t05304853129._2
15301512 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
15311513 if ((isUpdatedDLpValid == isUpdatedDLpValid))
15321514 then (state ++ refreshDLpActions)
15771559 let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
15781560 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15791561 then {
1580- let $t05430454385 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1581- let refreshDLpActions = $t05430454385._1
1582- let updatedDLp = $t05430454385._2
1562+ let $t05438054461 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1563+ let refreshDLpActions = $t05438054461._1
1564+ let updatedDLp = $t05438054461._2
15831565 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
15841566 if ((isUpdatedDLpValid == isUpdatedDLpValid))
15851567 then (state ++ refreshDLpActions)
16281610 let unstakeInv = invoke(staking, "unstakeINTERNAL", [lpAssetId, unstakeAmount, userAddress.bytes, lpAssetRecipientAddress.bytes], nil)
16291611 if ((unstakeInv == unstakeInv))
16301612 then {
1631- let $t05540755595 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1632- let state = $t05540755595._1
1633- let totalAmount = $t05540755595._2
1613+ let $t05548355671 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1614+ let state = $t05548355671._1
1615+ let totalAmount = $t05548355671._2
16341616 $Tuple2(state, totalAmount)
16351617 }
16361618 else throw("Strict value is not equal to itself.")
16421624
16431625 @Callable(i)
16441626 func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = {
1645- let $t05572355826 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1646- let lpAmount = $t05572355826._1
1647- let state = $t05572355826._2
1648- let feeAmount = $t05572355826._3
1649- let bonus = $t05572355826._4
1627+ let $t05579955902 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1628+ let lpAmount = $t05579955902._1
1629+ let state = $t05579955902._2
1630+ let feeAmount = $t05579955902._3
1631+ let bonus = $t05579955902._4
16501632 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
16511633 }
16521634
16541636
16551637 @Callable(i)
16561638 func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = {
1657- let $t05597456078 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1658- let lpAmount = $t05597456078._1
1659- let state = $t05597456078._2
1660- let feeAmount = $t05597456078._3
1661- let bonus = $t05597456078._4
1639+ let $t05605056154 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1640+ let lpAmount = $t05605056154._1
1641+ let state = $t05605056154._2
1642+ let feeAmount = $t05605056154._3
1643+ let bonus = $t05605056154._4
16621644 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
16631645 }
16641646
17201702 @Callable(i)
17211703 func changeAmp () = {
17221704 let cfg = invoke(fca, "getChangeAmpConfigREADONLY", [toString(this)], nil)
1723- let $t05843258631 = match cfg {
1705+ let $t05850858707 = match cfg {
17241706 case list: List[Any] =>
17251707 $Tuple3({
17261708 let @ = list[0]
17411723 case _ =>
17421724 throwErr("invalid entry type")
17431725 }
1744- let delay = $t05843258631._1
1745- let delta = $t05843258631._2
1746- let target = $t05843258631._3
1726+ let delay = $t05850858707._1
1727+ let delta = $t05850858707._2
1728+ let target = $t05850858707._3
17471729 let curAmp = parseIntValue(getStringValue(amp()))
17481730 let newAmpRaw = (curAmp + delta)
17491731 let newAmp = if ((0 > delta))
17681750
17691751 @Verifier(tx)
17701752 func verify () = {
1771- let targetPublicKey = match m() {
1753+ let targetPublicKey = match managerPublicKeyOrUnit() {
17721754 case pk: ByteVector =>
17731755 pk
17741756 case _: Unit =>
17791761 match tx {
17801762 case order: Order =>
17811763 let matcherPub = mp()
1782- let $t05954359660 = if (skipOrderValidation())
1764+ let $t05964059757 = if (skipOrderValidation())
17831765 then $Tuple2(true, "")
17841766 else validateMatcherOrderAllowed(order)
1785- let orderValid = $t05954359660._1
1786- let orderValidInfo = $t05954359660._2
1767+ let orderValid = $t05964059757._1
1768+ let orderValidInfo = $t05964059757._2
17871769 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
17881770 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
17891771 if (if (if (orderValid)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let scale8 = 100000000
55
66 let scale8BigInt = toBigInt(100000000)
77
88 let scale18 = toBigInt(1000000000000000000)
99
1010 let zeroBigInt = toBigInt(0)
1111
1212 let big0 = toBigInt(0)
1313
1414 let big1 = toBigInt(1)
1515
1616 let big2 = toBigInt(2)
1717
1818 let big3 = toBigInt(3)
1919
2020 let big4 = toBigInt(4)
2121
2222 let slippage4D = toBigInt((scale8 - ((scale8 * 1) / scale8)))
2323
2424 let wavesString = "WAVES"
2525
2626 let Amult = "100"
2727
2828 let Dconv = "1"
2929
3030 let SEP = "__"
3131
3232 let EMPTY = ""
3333
3434 let PoolActive = 1
3535
3636 let PoolPutDis = 2
3737
3838 let PoolMatcherDis = 3
3939
4040 let PoolShutdown = 4
4141
4242 let idxPoolAddress = 1
4343
4444 let idxPoolSt = 2
4545
4646 let idxLPAsId = 3
4747
4848 let idxAmAsId = 4
4949
5050 let idxPrAsId = 5
5151
5252 let idxAmtAsDcm = 6
5353
5454 let idxPriceAsDcm = 7
5555
5656 let idxIAmtAsId = 8
5757
5858 let idxIPriceAsId = 9
5959
6060 let idxFactStakCntr = 1
6161
6262 let idxFactoryRestCntr = 6
6363
6464 let idxFactSlippCntr = 7
6565
6666 let idxFactGwxRewCntr = 10
6767
6868 let feeDefault = fraction(10, scale8, 10000)
6969
7070 func t1 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
7171
7272
7373 func t1BigInt (origVal,origScaleMult) = fraction(origVal, scale18, origScaleMult)
7474
7575
7676 func f1 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
7777
7878
7979 func fromX18Round (val,resultScaleMult,round) = toInt(fraction(val, toBigInt(resultScaleMult), scale18, round))
8080
8181
8282 func t2 (origVal,origScaleMult) = fraction(origVal, scale18, toBigInt(origScaleMult))
8383
8484
8585 func f2 (val,resultScaleMult) = fraction(val, toBigInt(resultScaleMult), scale18)
8686
8787
8888 func ts (amt,resScale,curScale) = fraction(amt, resScale, curScale)
8989
9090
9191 func abs (val) = if ((zeroBigInt > val))
9292 then -(val)
9393 else val
9494
9595
9696 func absBigInt (val) = if ((zeroBigInt > val))
9797 then -(val)
9898 else val
9999
100100
101101 func fc () = "%s__factoryContract"
102102
103103
104-func mpk () = "%s__managerPublicKey"
104+func keyManagerPublicKey () = "%s__managerPublicKey"
105105
106106
107-func pmpk () = "%s__pendingManagerPublicKey"
107+func keyManagerVaultAddress () = "%s__managerVaultAddress"
108108
109109
110110 func pl () = "%s%s__price__last"
111111
112112
113113 func ph (h,t) = makeString(["%s%s%d%d__price__history", toString(h), toString(t)], SEP)
114114
115115
116116 func pau (ua,txId) = ((("%s%s%s__P__" + ua) + "__") + txId)
117117
118118
119119 func gau (ua,txId) = ((("%s%s%s__G__" + ua) + "__") + txId)
120120
121121
122122 func aa () = "%s__amountAsset"
123123
124124
125125 func pa () = "%s__priceAsset"
126126
127127
128128 func amp () = "%s__amp"
129129
130130
131131 func keyAmpHistory (heightBlocks) = ("%s%d__amp__" + toString(heightBlocks))
132132
133133
134134 func keyChangeAmpLastCall () = "%s__changeAmpLastCall"
135135
136136
137137 let keyFee = "%s__fee"
138138
139139 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
140140
141141 let keyDLp = makeString(["%s", "dLp"], SEP)
142142
143143 let keyDLpRefreshedHeight = makeString(["%s", "dLpRefreshedHeight"], SEP)
144144
145145 let keyDLpRefreshDelay = makeString(["%s", "refreshDLpDelay"], SEP)
146146
147147 let dLpRefreshDelayDefault = 30
148148
149149 let dLpRefreshDelay = valueOrElse(getInteger(this, keyDLpRefreshDelay), dLpRefreshDelayDefault)
150150
151151 func fcfg () = "%s__factoryConfig"
152152
153153
154154 func mtpk () = "%s%s__matcher__publicKey"
155155
156156
157157 func pc (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config")
158158
159159
160160 func mba (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr)
161161
162162
163163 func aps () = "%s__shutdown"
164164
165165
166166 func keyAllowedLpStableScriptHash () = "%s__allowedLpStableScriptHash"
167167
168168
169169 func keyFeeCollectorAddress () = "%s__feeCollectorAddress"
170170
171171
172172 func keySkipOrderValidation (poolAddress) = ("%s%s__skipOrderValidation__" + poolAddress)
173173
174174
175175 func throwOrderError (orderValid,orderValidInfo,senderValid,matcherValid) = throw((((((((("order validation failed: orderValid=" + toString(orderValid)) + " (") + orderValidInfo) + ")") + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
176176
177177
178+func addressFromStringOrThis (addressString) = match addressFromString(addressString) {
179+ case a: Address =>
180+ a
181+ case _ =>
182+ this
183+}
184+
185+
186+func getManagerVaultAddressOrThis () = {
187+ let factoryAddress = match addressFromStringOrThis(fc()) {
188+ case fca: Address =>
189+ fca
190+ case _ =>
191+ this
192+ }
193+ match getString(factoryAddress, keyManagerVaultAddress()) {
194+ case s: String =>
195+ addressFromStringOrThis(s)
196+ case _ =>
197+ this
198+ }
199+ }
200+
201+
178202 func strf (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
179203
180204
181205 func intf (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
182206
183207
184208 func throwErr (msg) = throw(makeString(["lp_stable.ride:", msg], " "))
185209
186210
187211 func fmtErr (msg) = makeString(["lp_stable.ride:", msg], " ")
188212
189213
190214 let fca = addressFromStringValue(strf(this, fc()))
191215
192216 let inFee = {
193217 let @ = invoke(fca, "getInFeeREADONLY", [toString(this)], nil)
194218 if ($isInstanceOf(@, "Int"))
195219 then @
196220 else throw(($getType(@) + " couldn't be cast to Int"))
197221 }
198222
199223 let outFee = {
200224 let @ = invoke(fca, "getOutFeeREADONLY", [toString(this)], nil)
201225 if ($isInstanceOf(@, "Int"))
202226 then @
203227 else throw(($getType(@) + " couldn't be cast to Int"))
204228 }
205229
206230 let A = strf(this, amp())
207231
208232 func igs () = valueOrElse(getBoolean(fca, aps()), false)
209233
210234
211235 func mp () = fromBase58String(strf(fca, mtpk()))
212236
213237
214238 let feeCollectorAddress = addressFromStringValue(strf(fca, keyFeeCollectorAddress()))
215239
216240 func gpc () = {
217241 let amtAs = strf(this, aa())
218242 let priceAs = strf(this, pa())
219243 let iPriceAs = intf(fca, mba(priceAs))
220244 let iAmtAs = intf(fca, mba(amtAs))
221245 split(strf(fca, pc(toString(iAmtAs), toString(iPriceAs))), SEP)
222246 }
223247
224248
225249 func parseAssetId (input) = if ((input == wavesString))
226250 then unit
227251 else fromBase58String(input)
228252
229253
230254 func assetIdToString (input) = if ((input == unit))
231255 then wavesString
232256 else toBase58String(value(input))
233257
234258
235259 func parsePoolConfig (poolConfig) = $Tuple9(addressFromStringValue(poolConfig[idxPoolAddress]), parseIntValue(poolConfig[idxPoolSt]), fromBase58String(poolConfig[idxLPAsId]), parseAssetId(poolConfig[idxAmAsId]), parseAssetId(poolConfig[idxPrAsId]), parseIntValue(poolConfig[idxAmtAsDcm]), parseIntValue(poolConfig[idxPriceAsDcm]), fromBase58String(poolConfig[idxIAmtAsId]), fromBase58String(poolConfig[idxIPriceAsId]))
236260
237261
238262 let poolConfigParsed = parsePoolConfig(gpc())
239263
240-let $t081658394 = poolConfigParsed
264+let $t086768905 = poolConfigParsed
241265
242-let cfgPoolAddress = $t081658394._1
266+let cfgPoolAddress = $t086768905._1
243267
244-let cfgPoolStatus = $t081658394._2
268+let cfgPoolStatus = $t086768905._2
245269
246-let cfgLpAssetId = $t081658394._3
270+let cfgLpAssetId = $t086768905._3
247271
248-let cfgAmountAssetId = $t081658394._4
272+let cfgAmountAssetId = $t086768905._4
249273
250-let cfgPriceAssetId = $t081658394._5
274+let cfgPriceAssetId = $t086768905._5
251275
252-let cfgAmountAssetDecimals = $t081658394._6
276+let cfgAmountAssetDecimals = $t086768905._6
253277
254-let cfgPriceAssetDecimals = $t081658394._7
278+let cfgPriceAssetDecimals = $t086768905._7
255279
256-let cfgInAmountAssedId = $t081658394._8
280+let cfgInAmountAssedId = $t086768905._8
257281
258-let cfgInPriceAssetId = $t081658394._9
282+let cfgInPriceAssetId = $t086768905._9
259283
260284 func gfc () = split(strf(fca, fcfg()), SEP)
261285
262286
263287 let factoryConfig = gfc()
264288
265289 let stakingContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactStakCntr]), "Invalid staking contract address")
266290
267291 let slipageContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactSlippCntr]), "Invalid slipage contract address")
268292
269293 let gwxContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactGwxRewCntr]), "Invalid gwx contract address")
270294
271295 let restContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactoryRestCntr]), "Invalid gwx contract address")
272296
273297 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)
274298
275299
276300 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)
277301
278302
279303 func getAccBalance (assetId) = if ((assetId == "WAVES"))
280304 then wavesBalance(this).available
281305 else assetBalance(this, fromBase58String(assetId))
282306
283307
284308 func cpbi (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
285309
286310
287311 func cpbir (prAmtX18,amAmtX18,round) = fraction(prAmtX18, scale18, amAmtX18, round)
288312
289313
290314 func vad (A1,A2,slippage) = {
291315 let diff = fraction((A1 - A2), scale8BigInt, A2)
292316 let pass = ((slippage - abs(diff)) > zeroBigInt)
293317 if (!(pass))
294318 then throw(("Big slpg: " + toString(diff)))
295319 else $Tuple2(pass, min([A1, A2]))
296320 }
297321
298322
299323 func vd (D1,D0,slpg) = {
300324 let diff = fraction(D0, scale8BigInt, D1)
301325 let fail = (slpg > diff)
302326 if (if (fail)
303327 then true
304328 else (D0 > D1))
305329 then throw(((((((toString(D0) + " ") + toString(D1)) + " ") + toString(diff)) + " ") + toString(slpg)))
306330 else fail
307331 }
308332
309333
310334 func pcp (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
311335 let amtAsAmtX18 = t1(amAmt, amAssetDcm)
312336 let prAsAmtX18 = t1(prAmt, prAssetDcm)
313337 cpbi(prAsAmtX18, amtAsAmtX18)
314338 }
315339
316340
317341 func calcPrices (amAmt,prAmt,lpAmt) = {
318342 let amtAsDcm = cfgAmountAssetDecimals
319343 let prAsDcm = cfgPriceAssetDecimals
320344 let priceX18 = pcp(amtAsDcm, prAsDcm, amAmt, prAmt)
321345 let amAmtX18 = t1(amAmt, amtAsDcm)
322346 let prAmtX18 = t1(prAmt, prAsDcm)
323347 let lpAmtX18 = t1(lpAmt, scale8)
324348 let lpPrInAmAsX18 = cpbi(amAmtX18, lpAmtX18)
325349 let lpPrInPrAsX18 = cpbi(prAmtX18, lpAmtX18)
326350 [priceX18, lpPrInAmAsX18, lpPrInPrAsX18]
327351 }
328352
329353
330354 func calculatePrices (amAmt,prAmt,lpAmt) = {
331355 let p = calcPrices(amAmt, prAmt, lpAmt)
332356 [f1(p[0], scale8), f1(p[1], scale8), f1(p[2], scale8)]
333357 }
334358
335359
336360 func takeFee (amount,fee) = {
337361 let feeAmount = if ((fee == 0))
338362 then 0
339363 else fraction(amount, fee, scale8)
340364 $Tuple2((amount - feeAmount), feeAmount)
341365 }
342366
343367
344368 func getD (xp) = {
345369 let xp0 = xp[0]
346370 let xp1 = xp[1]
347371 let s = (xp0 + xp1)
348372 if ((s == big0))
349373 then big0
350374 else {
351375 let a = parseIntValue(A)
352376 let ann = (a * 2)
353377 let p = fraction(xp0, xp1, big1)
354378 let xp0_xp1_n_n = fraction(p, big4, big1)
355379 let ann_s = fraction(toBigInt(ann), s, big1)
356380 let ann_1 = toBigInt((ann - 1))
357381 func calcDNext (d) = {
358382 let dd = fraction(d, d, big1)
359383 let ddd = fraction(dd, d, big1)
360384 let dp = fraction(ddd, big1, xp0_xp1_n_n)
361385 fraction((ann_s + fraction(dp, big2, big1)), d, (fraction(ann_1, d, big1) + fraction(big3, dp, big1)))
362386 }
363387
364388 func calc (acc,i) = if (acc._2)
365389 then acc
366390 else {
367391 let d = acc._1
368392 let dNext = calcDNext(d)
369393 let dDiffRaw = (dNext - value(d))
370394 let dDiff = if ((big0 > dDiffRaw))
371395 then -(dDiffRaw)
372396 else dDiffRaw
373397 if ((big1 >= dDiff))
374398 then $Tuple2(dNext, true)
375399 else $Tuple2(dNext, false)
376400 }
377401
378402 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
379- let $t01289912947 = {
403+ let $t01341013458 = {
380404 let $l = arr
381405 let $s = size($l)
382406 let $acc0 = $Tuple2(s, false)
383407 func $f0_1 ($a,$i) = if (($i >= $s))
384408 then $a
385409 else calc($a, $l[$i])
386410
387411 func $f0_2 ($a,$i) = if (($i >= $s))
388412 then $a
389413 else throw("List size exceeds 17")
390414
391415 $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)
392416 }
393- let d = $t01289912947._1
394- let found = $t01289912947._2
417+ let d = $t01341013458._1
418+ let found = $t01341013458._2
395419 if (found)
396420 then d
397421 else throw(("D calculation error, D = " + toString(d)))
398422 }
399423 }
400424
401425
402426 func ego (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
403427 let lpId = cfgLpAssetId
404428 let amId = toBase58String(value(cfgAmountAssetId))
405429 let prId = toBase58String(value(cfgPriceAssetId))
406430 let amDcm = cfgAmountAssetDecimals
407431 let prDcm = cfgPriceAssetDecimals
408432 let sts = toString(cfgPoolStatus)
409433 let lpEmiss = valueOrErrorMessage(assetInfo(lpId), "Wrong LP id").quantity
410434 if ((toBase58String(lpId) != pmtAssetId))
411435 then throw("Wrong pmt asset")
412436 else {
413437 let amBalance = getAccBalance(amId)
414438 let amBalanceX18 = t1(amBalance, amDcm)
415439 let prBalance = getAccBalance(prId)
416440 let prBalanceX18 = t1(prBalance, prDcm)
417441 let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
418442 let curPrice = f1(curPriceX18, scale8)
419443 let pmtLpAmtX18 = t1(pmtLpAmt, scale8)
420444 let lpEmissX18 = t1(lpEmiss, scale8)
421445 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissX18)
422446 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissX18)
423447 let outAmAmt = fromX18Round(outAmAmtX18, amDcm, FLOOR)
424448 let outPrAmt = fromX18Round(outPrAmtX18, prDcm, FLOOR)
425449 let state = if ((txId58 == ""))
426450 then nil
427451 else [ScriptTransfer(userAddress, outAmAmt, if ((amId == "WAVES"))
428452 then unit
429453 else fromBase58String(amId)), ScriptTransfer(userAddress, outPrAmt, if ((prId == "WAVES"))
430454 then unit
431455 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)]
432456 $Tuple10(outAmAmt, outPrAmt, amId, prId, amBalance, prBalance, lpEmiss, curPriceX18, sts, state)
433457 }
434458 }
435459
436460
437461 func epo (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEval,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = {
438462 let lpId = cfgLpAssetId
439463 let amIdStr = toBase58String(value(cfgAmountAssetId))
440464 let prIdStr = toBase58String(value(cfgPriceAssetId))
441465 let inAmIdStr = cfgInAmountAssedId
442466 let inPrIdStr = cfgInPriceAssetId
443467 let amtDcm = cfgAmountAssetDecimals
444468 let priceDcm = cfgPriceAssetDecimals
445469 let sts = toString(cfgPoolStatus)
446470 let lpEm = valueOrErrorMessage(assetInfo(lpId), "Wr lp as").quantity
447471 let amBalance = if (isEval)
448472 then getAccBalance(amIdStr)
449473 else if (if (isOneAsset)
450474 then (pmtId == amIdStr)
451475 else false)
452476 then (getAccBalance(amIdStr) - pmtAmt)
453477 else if (isOneAsset)
454478 then getAccBalance(amIdStr)
455479 else (getAccBalance(amIdStr) - inAmAmt)
456480 let prBalance = if (isEval)
457481 then getAccBalance(prIdStr)
458482 else if (if (isOneAsset)
459483 then (pmtId == prIdStr)
460484 else false)
461485 then (getAccBalance(prIdStr) - pmtAmt)
462486 else if (isOneAsset)
463487 then getAccBalance(prIdStr)
464488 else (getAccBalance(prIdStr) - inPrAmt)
465489 let inAmAssetAmtX18 = t1(inAmAmt, amtDcm)
466490 let inPrAssetAmtX18 = t1(inPrAmt, priceDcm)
467491 let userPriceX18 = cpbi(inPrAssetAmtX18, inAmAssetAmtX18)
468492 let amBalanceX18 = t1(amBalance, amtDcm)
469493 let prBalanceX18 = t1(prBalance, priceDcm)
470494 let D0 = getD([amBalanceX18, prBalanceX18])
471495 let r = if ((lpEm == 0))
472496 then {
473497 let D1 = getD([(amBalanceX18 + inAmAssetAmtX18), (prBalanceX18 + inPrAssetAmtX18)])
474498 let checkD = if ((D1 > D0))
475499 then true
476500 else throw("D1 should be greater than D0")
477501 if ((checkD == checkD))
478502 then {
479503 let curPriceX18 = zeroBigInt
480504 let slippageX18 = zeroBigInt
481505 let lpAmtX18 = D1
482506 $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
483507 }
484508 else throw("Strict value is not equal to itself.")
485509 }
486510 else {
487511 let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
488512 let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18)
489513 let slippageX18 = t1(slippage, scale8)
490514 if (if (if (validateSlippage)
491515 then (curPriceX18 != zeroBigInt)
492516 else false)
493517 then (slippageRealX18 > slippageX18)
494518 else false)
495519 then throw(((("Price slippage " + toString(slippageRealX18)) + " > ") + toString(slippageX18)))
496520 else {
497521 let lpEmissionX18 = t1(lpEm, scale8)
498522 let prViaAmX18 = fraction(inAmAssetAmtX18, cpbir(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING)
499523 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, cpbir(prBalanceX18, amBalanceX18, FLOOR), CEILING)
500524 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
501525 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
502526 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
503527 let expAmtAssetAmtX18 = expectedAmts._1
504528 let expPriceAssetAmtX18 = expectedAmts._2
505529 let D1 = getD([(amBalanceX18 + expAmtAssetAmtX18), (prBalanceX18 + expPriceAssetAmtX18)])
506530 let checkD = if ((D1 > D0))
507531 then true
508532 else throw("D1 should be greater than D0")
509533 if ((checkD == checkD))
510534 then {
511535 let lpAmtX18 = fraction(lpEmissionX18, (D1 - D0), D0)
512536 $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceDcm, CEILING), curPriceX18, slippageX18)
513537 }
514538 else throw("Strict value is not equal to itself.")
515539 }
516540 }
517541 let calcLpAmt = r._1
518542 let calcAmAssetPmt = r._2
519543 let calcPrAssetPmt = r._3
520544 let curPrice = f1(r._4, scale8)
521545 let slippageCalc = f1(r._5, scale8)
522546 if ((0 >= calcLpAmt))
523547 then throw("LP <= 0")
524548 else {
525549 let emitLpAmt = if (!(emitLp))
526550 then 0
527551 else calcLpAmt
528552 let amDiff = (inAmAmt - calcAmAssetPmt)
529553 let prDiff = (inPrAmt - calcPrAssetPmt)
530- let $t02078621131 = if (if (isOneAsset)
554+ let $t02129721642 = if (if (isOneAsset)
531555 then (pmtId == amIdStr)
532556 else false)
533557 then $Tuple2(pmtAmt, 0)
534558 else if (if (isOneAsset)
535559 then (pmtId == prIdStr)
536560 else false)
537561 then $Tuple2(0, pmtAmt)
538562 else $Tuple2(calcAmAssetPmt, calcPrAssetPmt)
539- let writeAmAmt = $t02078621131._1
540- let writePrAmt = $t02078621131._2
563+ let writeAmAmt = $t02129721642._1
564+ let writePrAmt = $t02129721642._2
541565 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))]
542566 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId)
543567 }
544568 }
545569
546570
547571 func getYD (xp,i,D) = {
548572 let n = big2
549573 let x = xp[if ((i == 0))
550574 then 1
551575 else 0]
552576 let aPrecision = parseBigIntValue(Amult)
553577 let a = (parseBigIntValue(A) * aPrecision)
554578 let s = x
555579 let ann = (a * n)
556580 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
557581 let b = ((s + ((D * aPrecision) / ann)) - D)
558582 func calc (acc,cur) = {
559- let $t02232622346 = acc
560- let y = $t02232622346._1
561- let found = $t02232622346._2
583+ let $t02283722857 = acc
584+ let y = $t02283722857._1
585+ let found = $t02283722857._2
562586 if ((found != unit))
563587 then acc
564588 else {
565589 let yNext = (((y * y) + c) / ((big2 * y) + b))
566590 let yDiff = absBigInt((yNext - value(y)))
567591 if ((big1 >= yDiff))
568592 then $Tuple2(yNext, cur)
569593 else $Tuple2(yNext, unit)
570594 }
571595 }
572596
573597 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
574- let $t02265322700 = {
598+ let $t02316423211 = {
575599 let $l = arr
576600 let $s = size($l)
577601 let $acc0 = $Tuple2(D, unit)
578602 func $f0_1 ($a,$i) = if (($i >= $s))
579603 then $a
580604 else calc($a, $l[$i])
581605
582606 func $f0_2 ($a,$i) = if (($i >= $s))
583607 then $a
584608 else throw("List size exceeds 15")
585609
586610 $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)
587611 }
588- let y = $t02265322700._1
589- let found = $t02265322700._2
612+ let y = $t02316423211._1
613+ let found = $t02316423211._2
590614 if ((found != unit))
591615 then y
592616 else throw(("Y calculation error, Y = " + toString(y)))
593617 }
594618
595619
596620 func calcDLp (amountBalance,priceBalance,lpEmission) = {
597621 let updatedDLp = fraction(getD([t1BigInt(amountBalance, toBigInt(cfgAmountAssetDecimals)), t1BigInt(priceBalance, toBigInt(cfgPriceAssetDecimals))]), scale18, lpEmission)
598622 if ((lpEmission == big0))
599623 then big0
600624 else updatedDLp
601625 }
602626
603627
604628 func calcCurrentDLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
605629 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
606630 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
607631 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
608632 let currentDLp = calcDLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
609633 currentDLp
610634 }
611635
612636
613637 func refreshDLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
614638 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
615639 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
616640 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
617641 let updatedDLp = calcDLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
618642 let actions = [IntegerEntry(keyDLpRefreshedHeight, height), StringEntry(keyDLp, toString(updatedDLp))]
619643 $Tuple2(actions, updatedDLp)
620644 }
621645
622646
623647 func validateUpdatedDLp (oldDLp,updatedDLp) = if ((updatedDLp >= oldDLp))
624648 then true
625649 else throwErr("updated DLp lower than current DLp")
626650
627651
628652 func validateMatcherOrderAllowed (order) = {
629653 let amountAssetBalance = getAccBalance(assetIdToString(cfgAmountAssetId))
630654 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
631655 let amountAssetAmount = order.amount
632656 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
633- let $t02489825110 = if ((order.orderType == Buy))
657+ let $t02540925621 = if ((order.orderType == Buy))
634658 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
635659 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
636- let amountAssetBalanceDelta = $t02489825110._1
637- let priceAssetBalanceDelta = $t02489825110._2
660+ let amountAssetBalanceDelta = $t02540925621._1
661+ let priceAssetBalanceDelta = $t02540925621._2
638662 if (if (if (igs())
639663 then true
640664 else (cfgPoolStatus == PoolMatcherDis))
641665 then true
642666 else (cfgPoolStatus == PoolShutdown))
643667 then throw("Admin blocked")
644668 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
645669 then true
646670 else (order.assetPair.priceAsset != cfgPriceAssetId))
647671 then throw("Wr assets")
648672 else {
649673 let dLp = parseBigIntValue(valueOrElse(getString(this, keyDLp), "0"))
650- let $t02545225552 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
651- let unusedActions = $t02545225552._1
652- let dLpNew = $t02545225552._2
674+ let $t02596326063 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
675+ let unusedActions = $t02596326063._1
676+ let dLpNew = $t02596326063._2
653677 let isOrderValid = (dLpNew >= dLp)
654678 let info = makeString(["dLp=", toString(dLp), " dLpNew=", toString(dLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "")
655679 $Tuple2(isOrderValid, info)
656680 }
657681 }
658682
659683
660684 func cg (i) = if ((size(i.payments) != 1))
661685 then throw("1 pmnt exp")
662686 else {
663687 let pmt = value(i.payments[0])
664688 let pmtAssetId = value(pmt.assetId)
665689 let pmtAmt = pmt.amount
666690 let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
667691 let outAmAmt = r._1
668692 let outPrAmt = r._2
669693 let sts = parseIntValue(r._9)
670694 let state = r._10
671695 if (if (igs())
672696 then true
673697 else (sts == PoolShutdown))
674698 then throw(("Admin blocked: " + toString(sts)))
675699 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
676700 }
677701
678702
679703 func cp (caller,txId,amAsPmt,prAsPmt,slippage,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = {
680704 let r = epo(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, (txId == ""), emitLp, isOneAsset, validateSlippage, pmtAmt, pmtId)
681705 let sts = parseIntValue(r._8)
682706 if (if (if (igs())
683707 then true
684708 else (sts == PoolPutDis))
685709 then true
686710 else (sts == PoolShutdown))
687711 then throw(("Blocked:" + toString(sts)))
688712 else r
689713 }
690714
691715
692716 func calcPutOneTkn (pmtAmtRaw,pmtAssetId,userAddress,txId,withTakeFee) = {
693717 let amId = toBase58String(value(cfgAmountAssetId))
694718 let prId = toBase58String(value(cfgPriceAssetId))
695719 let lpId = cfgLpAssetId
696720 let amtDcm = cfgAmountAssetDecimals
697721 let priceDcm = cfgPriceAssetDecimals
698722 let lpAssetEmission = toBigInt(valueOrErrorMessage(assetInfo(lpId), "invalid lp asset").quantity)
699723 let chechEmission = if ((lpAssetEmission > big0))
700724 then true
701725 else throw("initial deposit requires all coins")
702726 if ((chechEmission == chechEmission))
703727 then {
704728 let amBalance = getAccBalance(amId)
705729 let prBalance = getAccBalance(prId)
706- let $t02820828670 = if ((txId == ""))
730+ let $t02871929181 = if ((txId == ""))
707731 then $Tuple2(amBalance, prBalance)
708732 else if ((pmtAssetId == amId))
709733 then if ((pmtAmtRaw > amBalance))
710734 then throw("invalid payment amount")
711735 else $Tuple2((amBalance - pmtAmtRaw), prBalance)
712736 else if ((pmtAssetId == prId))
713737 then if ((pmtAmtRaw > prBalance))
714738 then throw("invalid payment amount")
715739 else $Tuple2(amBalance, (prBalance - pmtAmtRaw))
716740 else throw("wrong pmtAssetId")
717- let amBalanceOld = $t02820828670._1
718- let prBalanceOld = $t02820828670._2
719- let $t02867628852 = if ((pmtAssetId == amId))
741+ let amBalanceOld = $t02871929181._1
742+ let prBalanceOld = $t02871929181._2
743+ let $t02918729363 = if ((pmtAssetId == amId))
720744 then $Tuple2(pmtAmtRaw, 0)
721745 else if ((pmtAssetId == prId))
722746 then $Tuple2(0, pmtAmtRaw)
723747 else throw("invalid payment")
724- let amAmountRaw = $t02867628852._1
725- let prAmountRaw = $t02867628852._2
726- let $t02885629110 = if (withTakeFee)
748+ let amAmountRaw = $t02918729363._1
749+ let prAmountRaw = $t02918729363._2
750+ let $t02936729621 = if (withTakeFee)
727751 then $Tuple3(takeFee(amAmountRaw, inFee)._1, takeFee(prAmountRaw, inFee)._1, takeFee(pmtAmtRaw, inFee)._2)
728752 else $Tuple3(amAmountRaw, prAmountRaw, 0)
729- let amAmount = $t02885629110._1
730- let prAmount = $t02885629110._2
731- let feeAmount = $t02885629110._3
753+ let amAmount = $t02936729621._1
754+ let prAmount = $t02936729621._2
755+ let feeAmount = $t02936729621._3
732756 let amBalanceNew = (amBalanceOld + amAmount)
733757 let prBalanceNew = (prBalanceOld + prAmount)
734758 let D0 = getD([t1(amBalanceOld, cfgAmountAssetDecimals), t1(prBalanceOld, cfgPriceAssetDecimals)])
735759 let D1 = getD([t1(amBalanceNew, cfgAmountAssetDecimals), t1(prBalanceNew, cfgPriceAssetDecimals)])
736760 let checkD = if ((D1 > D0))
737761 then true
738762 else throw()
739763 if ((checkD == checkD))
740764 then {
741765 let lpAmount = fraction(lpAssetEmission, (D1 - D0), D0, FLOOR)
742766 let curPrice = f1(cpbi(t1(prBalanceNew, priceDcm), t1(amBalanceNew, amtDcm)), scale8)
743767 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))]
744768 let poolProportion = fraction(prBalanceOld, scale8, amBalanceOld)
745769 let amountAssetPart = fraction(pmtAmtRaw, scale8, (poolProportion + scale8))
746770 let priceAssetPart = (pmtAmtRaw - amountAssetPart)
747771 let lpAmtBoth = fraction(lpAssetEmission, toBigInt(priceAssetPart), toBigInt(prBalanceOld))
748772 let bonus = toInt(fraction((lpAmount - lpAmtBoth), scale8BigInt, lpAmtBoth))
749773 $Tuple4(toInt(lpAmount), commonState, feeAmount, bonus)
750774 }
751775 else throw("Strict value is not equal to itself.")
752776 }
753777 else throw("Strict value is not equal to itself.")
754778 }
755779
756780
757781 func getOneTknV2Internal (outAssetId,minOutAmount,payments,caller,originCaller,transactionId) = {
758782 let lpId = toBase58String(value(cfgLpAssetId))
759783 let amId = toBase58String(value(cfgAmountAssetId))
760784 let prId = toBase58String(value(cfgPriceAssetId))
761785 let amDecimals = cfgAmountAssetDecimals
762786 let prDecimals = cfgPriceAssetDecimals
763787 let poolStatus = cfgPoolStatus
764788 let userAddress = if ((caller == restContract))
765789 then originCaller
766790 else caller
767791 let pmt = value(payments[0])
768792 let pmtAssetId = value(pmt.assetId)
769793 let pmtAmt = pmt.amount
770794 let currentDLp = calcCurrentDLp(big0, big0, big0)
771795 if ((currentDLp == currentDLp))
772796 then {
773797 let txId58 = toBase58String(transactionId)
774798 if ((lpId != toBase58String(pmtAssetId)))
775799 then throw("Wrong LP")
776800 else {
777801 let amBalance = getAccBalance(amId)
778802 let prBalance = getAccBalance(prId)
779- let $t03122231333 = {
803+ let $t03173331844 = {
780804 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil)
781805 if ($isInstanceOf(@, "(Int, Int)"))
782806 then @
783807 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
784808 }
785- if (($t03122231333 == $t03122231333))
809+ if (($t03173331844 == $t03173331844))
786810 then {
787- let feeAmount = $t03122231333._2
788- let totalGet = $t03122231333._1
811+ let feeAmount = $t03173331844._2
812+ let totalGet = $t03173331844._1
789813 let totalAmount = if (if ((minOutAmount > 0))
790814 then (minOutAmount > totalGet)
791815 else false)
792816 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
793817 else totalGet
794- let $t03152331830 = if ((outAssetId == amId))
818+ let $t03203432341 = if ((outAssetId == amId))
795819 then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance)
796820 else if ((outAssetId == prId))
797821 then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount))
798822 else throw("invalid out asset id")
799- let outAm = $t03152331830._1
800- let outPr = $t03152331830._2
801- let amBalanceNew = $t03152331830._3
802- let prBalanceNew = $t03152331830._4
823+ let outAm = $t03203432341._1
824+ let outPr = $t03203432341._2
825+ let amBalanceNew = $t03203432341._3
826+ let prBalanceNew = $t03203432341._4
803827 let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals))
804828 let curPr = f1(curPrX18, scale8)
805829 let outAssetIdOrWaves = if ((outAssetId == "WAVES"))
806830 then unit
807831 else fromBase58String(outAssetId)
808832 let sendFeeToMatcher = if ((feeAmount > 0))
809833 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetIdOrWaves)]
810834 else nil
811835 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)
812836 if ((state == state))
813837 then {
814838 let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
815839 if ((burn == burn))
816840 then {
817- let $t03261532965 = {
841+ let $t03312633476 = {
818842 let feeAmountForCalc = if ((this == feeCollectorAddress))
819843 then 0
820844 else feeAmount
821845 let outInAmountAsset = if ((parseAssetId(outAssetId) == cfgAmountAssetId))
822846 then true
823847 else false
824848 if (outInAmountAsset)
825849 then $Tuple2(-((totalGet + feeAmountForCalc)), 0)
826850 else $Tuple2(0, -((totalGet + feeAmountForCalc)))
827851 }
828- let amountAssetBalanceDelta = $t03261532965._1
829- let priceAssetBalanceDelta = $t03261532965._2
830- let $t03296833076 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
831- let refreshDLpActions = $t03296833076._1
832- let updatedDLp = $t03296833076._2
852+ let amountAssetBalanceDelta = $t03312633476._1
853+ let priceAssetBalanceDelta = $t03312633476._2
854+ let $t03347933587 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
855+ let refreshDLpActions = $t03347933587._1
856+ let updatedDLp = $t03347933587._2
833857 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
834858 if ((isUpdatedDLpValid == isUpdatedDLpValid))
835859 then $Tuple2((state ++ refreshDLpActions), totalAmount)
836860 else throw("Strict value is not equal to itself.")
837861 }
838862 else throw("Strict value is not equal to itself.")
839863 }
840864 else throw("Strict value is not equal to itself.")
841865 }
842866 else throw("Strict value is not equal to itself.")
843867 }
844868 }
845869 else throw("Strict value is not equal to itself.")
846870 }
847871
848872
849-func m () = match getString(mpk()) {
850- case s: String =>
851- fromBase58String(s)
852- case _: Unit =>
853- unit
854- case _ =>
855- throw("Match error")
856-}
857-
858-
859-func pm () = match getString(pmpk()) {
860- case s: String =>
861- fromBase58String(s)
862- case _: Unit =>
863- unit
864- case _ =>
865- throw("Match error")
866-}
873+func managerPublicKeyOrUnit () = {
874+ let managerVaultAddress = getManagerVaultAddressOrThis()
875+ match getString(managerVaultAddress, keyManagerPublicKey()) {
876+ case s: String =>
877+ fromBase58String(s)
878+ case _: Unit =>
879+ unit
880+ case _ =>
881+ throw("Match error")
882+ }
883+ }
867884
868885
869886 let pd = throw("Permission denied")
870887
871-func isManager (i) = match m() {
888+func isManager (i) = match managerPublicKeyOrUnit() {
872889 case pk: ByteVector =>
873890 (i.callerPublicKey == pk)
874891 case _: Unit =>
875892 (i.caller == this)
876893 case _ =>
877894 throw("Match error")
878895 }
879896
880897
881-func mm (i) = match m() {
898+func mustManager (i) = match managerPublicKeyOrUnit() {
882899 case pk: ByteVector =>
883900 if ((i.callerPublicKey == pk))
884901 then true
885902 else pd
886903 case _: Unit =>
887904 if ((i.caller == this))
888905 then true
889906 else pd
890907 case _ =>
891908 throw("Match error")
892909 }
893910
894911
895912 func getY (isReverse,D,poolAmountInBalance) = {
896913 let poolConfig = gpc()
897914 let amId = poolConfig[idxAmAsId]
898915 let prId = poolConfig[idxPrAsId]
899916 let n = big2
900917 let aPrecision = parseBigIntValue(Amult)
901918 let a = (parseBigIntValue(A) * aPrecision)
902919 let xp = if ((isReverse == false))
903920 then [(toBigInt(getAccBalance(amId)) + poolAmountInBalance), toBigInt(getAccBalance(prId))]
904921 else [(toBigInt(getAccBalance(prId)) + poolAmountInBalance), toBigInt(getAccBalance(amId))]
905922 let x = xp[0]
906923 let s = x
907924 let ann = (a * n)
908925 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
909926 let b = ((s + ((D * aPrecision) / ann)) - D)
910927 func calc (acc,cur) = {
911- let $t03452334543 = acc
912- let y = $t03452334543._1
913- let found = $t03452334543._2
928+ let $t03507435094 = acc
929+ let y = $t03507435094._1
930+ let found = $t03507435094._2
914931 if ((found != unit))
915932 then acc
916933 else {
917934 let yNext = (((y * y) + c) / ((big2 * y) + b))
918935 let yDiff = absBigInt((yNext - value(y)))
919936 if ((big1 >= yDiff))
920937 then $Tuple2(yNext, cur)
921938 else $Tuple2(yNext, unit)
922939 }
923940 }
924941
925942 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
926- let $t03487434921 = {
943+ let $t03542535472 = {
927944 let $l = arr
928945 let $s = size($l)
929946 let $acc0 = $Tuple2(D, unit)
930947 func $f0_1 ($a,$i) = if (($i >= $s))
931948 then $a
932949 else calc($a, $l[$i])
933950
934951 func $f0_2 ($a,$i) = if (($i >= $s))
935952 then $a
936953 else throw("List size exceeds 15")
937954
938955 $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)
939956 }
940- let y = $t03487434921._1
941- let found = $t03487434921._2
957+ let y = $t03542535472._1
958+ let found = $t03542535472._2
942959 if ((found != unit))
943960 then y
944961 else throw(("Y calculation error, Y = " + toString(y)))
945962 }
946963
947964
948965 func skipOrderValidation () = valueOrElse(getBoolean(fca, keySkipOrderValidation(toString(this))), false)
949966
950967
951968 @Callable(i)
952969 func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = {
953- let $t03527335697 = if ((isReverse == false))
970+ let $t03582436248 = if ((isReverse == false))
954971 then {
955972 let assetOut = strf(this, pa())
956973 let poolAmountInBalance = (toBigInt(getAccBalance(strf(this, aa()))) + toBigInt(cleanAmountIn))
957974 $Tuple2(assetOut, poolAmountInBalance)
958975 }
959976 else {
960977 let assetOut = strf(this, aa())
961978 let poolAmountInBalance = (toBigInt(getAccBalance(strf(this, pa()))) + toBigInt(cleanAmountIn))
962979 $Tuple2(assetOut, poolAmountInBalance)
963980 }
964- let assetOut = $t03527335697._1
965- let poolAmountInBalance = $t03527335697._2
981+ let assetOut = $t03582436248._1
982+ let poolAmountInBalance = $t03582436248._2
966983 let poolConfig = gpc()
967984 let amId = poolConfig[idxAmAsId]
968985 let prId = poolConfig[idxPrAsId]
969986 let xp = [toBigInt(getAccBalance(amId)), toBigInt(getAccBalance(prId))]
970987 let D = getD(xp)
971988 let y = getY(isReverse, D, toBigInt(cleanAmountIn))
972989 let dy = ((toBigInt(getAccBalance(assetOut)) - y) - toBigInt(1))
973990 let totalGetRaw = max([0, toInt(dy)])
974991 let newXp = if ((isReverse == false))
975992 then [((toBigInt(getAccBalance(amId)) + toBigInt(cleanAmountIn)) + toBigInt(feePoolAmount)), (toBigInt(getAccBalance(prId)) - dy)]
976993 else [(toBigInt(getAccBalance(amId)) - dy), ((toBigInt(getAccBalance(prId)) + toBigInt(cleanAmountIn)) + toBigInt(feePoolAmount))]
977994 let newD = getD(newXp)
978995 let checkD = if ((newD >= D))
979996 then true
980997 else throw(makeString(["new D is fewer error", toString(D), toString(newD)], "__"))
981998 if ((checkD == checkD))
982999 then $Tuple2(nil, totalGetRaw)
9831000 else throw("Strict value is not equal to itself.")
9841001 }
9851002
9861003
9871004
9881005 @Callable(i)
9891006 func calculateAmountOutForSwapAndSendTokens (cleanAmountIn,isReverse,amountOutMin,addressTo,feePoolAmount) = {
9901007 let swapContact = {
9911008 let @ = invoke(fca, "getSwapContractREADONLY", nil, nil)
9921009 if ($isInstanceOf(@, "String"))
9931010 then @
9941011 else throw(($getType(@) + " couldn't be cast to String"))
9951012 }
9961013 let checks = [if ((value(i.payments[0]).amount >= cleanAmountIn))
9971014 then true
9981015 else throwErr("Wrong amount"), if ((i.caller == addressFromStringValue(swapContact)))
9991016 then true
10001017 else throwErr("Permission denied")]
10011018 if ((checks == checks))
10021019 then {
10031020 let pmt = value(i.payments[0])
10041021 let assetIn = assetIdToString(pmt.assetId)
1005- let $t03713337527 = if ((isReverse == false))
1022+ let $t03768438078 = if ((isReverse == false))
10061023 then {
10071024 let assetOut = strf(this, pa())
10081025 let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
10091026 $Tuple2(assetOut, poolAmountInBalance)
10101027 }
10111028 else {
10121029 let assetOut = strf(this, aa())
10131030 let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
10141031 $Tuple2(assetOut, poolAmountInBalance)
10151032 }
1016- let assetOut = $t03713337527._1
1017- let poolAmountInBalance = $t03713337527._2
1033+ let assetOut = $t03768438078._1
1034+ let poolAmountInBalance = $t03768438078._2
10181035 let poolConfig = gpc()
10191036 let amId = poolConfig[idxAmAsId]
10201037 let prId = poolConfig[idxPrAsId]
10211038 let xp = if ((isReverse == false))
10221039 then [(toBigInt(getAccBalance(amId)) - toBigInt(value(i.payments[0]).amount)), toBigInt(getAccBalance(prId))]
10231040 else [toBigInt(getAccBalance(amId)), (toBigInt(getAccBalance(prId)) - toBigInt(value(i.payments[0]).amount))]
10241041 let D = getD(xp)
10251042 let y = getY(isReverse, D, toBigInt(0))
10261043 let dy = ((toBigInt(getAccBalance(assetOut)) - y) - toBigInt(1))
10271044 let totalGetRaw = max([0, toInt(dy)])
10281045 let checkMin = if ((totalGetRaw >= amountOutMin))
10291046 then true
10301047 else throw("Exchange result is fewer coins than expected")
10311048 if ((checkMin == checkMin))
10321049 then {
10331050 let newXp = if ((isReverse == false))
10341051 then [(toBigInt(getAccBalance(amId)) + toBigInt(feePoolAmount)), (toBigInt(getAccBalance(prId)) - dy)]
10351052 else [(toBigInt(getAccBalance(amId)) - dy), (toBigInt(getAccBalance(prId)) + toBigInt(feePoolAmount))]
10361053 let newD = getD(newXp)
10371054 let checkD = if ((newD >= D))
10381055 then true
10391056 else throw("new D is fewer error")
10401057 if ((checkD == checkD))
10411058 then $Tuple2([ScriptTransfer(addressFromStringValue(addressTo), totalGetRaw, parseAssetId(assetOut))], totalGetRaw)
10421059 else throw("Strict value is not equal to itself.")
10431060 }
10441061 else throw("Strict value is not equal to itself.")
10451062 }
10461063 else throw("Strict value is not equal to itself.")
10471064 }
10481065
10491066
10501067
10511068 @Callable(i)
10521069 func constructor (fc) = {
1053- let c = mm(i)
1070+ let c = mustManager(i)
10541071 if ((c == c))
10551072 then [StringEntry(fc(), fc)]
1056- else throw("Strict value is not equal to itself.")
1057- }
1058-
1059-
1060-
1061-@Callable(i)
1062-func setManager (pendingManagerPublicKey) = {
1063- let c = mm(i)
1064- if ((c == c))
1065- then {
1066- let cm = fromBase58String(pendingManagerPublicKey)
1067- if ((cm == cm))
1068- then [StringEntry(pmpk(), pendingManagerPublicKey)]
1069- else throw("Strict value is not equal to itself.")
1070- }
1071- else throw("Strict value is not equal to itself.")
1072- }
1073-
1074-
1075-
1076-@Callable(i)
1077-func confirmManager () = {
1078- let p = pm()
1079- let hpm = if (isDefined(p))
1080- then true
1081- else throw("No pending manager")
1082- if ((hpm == hpm))
1083- then {
1084- let cpm = if ((i.callerPublicKey == value(p)))
1085- then true
1086- else throw("You are not pending manager")
1087- if ((cpm == cpm))
1088- then [StringEntry(mpk(), toBase58String(value(p))), DeleteEntry(pmpk())]
1089- else throw("Strict value is not equal to itself.")
1090- }
10911073 else throw("Strict value is not equal to itself.")
10921074 }
10931075
10941076
10951077
10961078 @Callable(i)
10971079 func put (slip,autoStake) = {
10981080 let factCfg = gfc()
10991081 let stakingCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactStakCntr]), "Wr st addr")
11001082 let slipCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactSlippCntr]), "Wr sl addr")
11011083 if ((0 > slip))
11021084 then throw("Wrong slippage")
11031085 else if ((size(i.payments) != 2))
11041086 then throw("2 pmnts expd")
11051087 else {
11061088 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
11071089 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
11081090 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amAssetPmt)
11091091 if ((amountAssetBalance == amountAssetBalance))
11101092 then {
11111093 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - prAssetPmt)
11121094 if ((priceAssetBalance == priceAssetBalance))
11131095 then {
11141096 let lpAssetEmission = toBigInt(value(assetInfo(cfgLpAssetId)).quantity)
11151097 if ((lpAssetEmission == lpAssetEmission))
11161098 then {
11171099 let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0))
11181100 if ((currentDLp == currentDLp))
11191101 then {
11201102 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, "")
11211103 let emitLpAmt = e._2
11221104 let lpAssetId = e._7
11231105 let state = e._9
11241106 let amDiff = e._10
11251107 let prDiff = e._11
11261108 let amId = e._12
11271109 let prId = e._13
11281110 let r = invoke(fca, "emit", [emitLpAmt], nil)
11291111 if ((r == r))
11301112 then {
11311113 let el = match r {
11321114 case legacy: Address =>
11331115 invoke(legacy, "emit", [emitLpAmt], nil)
11341116 case _ =>
11351117 unit
11361118 }
11371119 if ((el == el))
11381120 then {
11391121 let sa = if ((amDiff > 0))
11401122 then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)])
11411123 else nil
11421124 if ((sa == sa))
11431125 then {
11441126 let sp = if ((prDiff > 0))
11451127 then invoke(slipCntr, "put", nil, [AttachedPayment(prId, prDiff)])
11461128 else nil
11471129 if ((sp == sp))
11481130 then {
11491131 let lpTrnsfr = if (autoStake)
11501132 then {
11511133 let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
11521134 if ((ss == ss))
11531135 then nil
11541136 else throw("Strict value is not equal to itself.")
11551137 }
11561138 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
1157- let $t04214642288 = refreshDLpInternal(0, 0, 0)
1158- let refreshDLpActions = $t04214642288._1
1159- let updatedDLp = $t04214642288._2
1139+ let $t04222242364 = refreshDLpInternal(0, 0, 0)
1140+ let refreshDLpActions = $t04222242364._1
1141+ let updatedDLp = $t04222242364._2
11601142 let check = if ((updatedDLp >= currentDLp))
11611143 then true
11621144 else throwErr(makeString(["updated DLp lower than current DLp", toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentDLp), toString(updatedDLp), toString(amDiff), toString(prDiff)], " "))
11631145 if ((check == check))
11641146 then {
11651147 let lpAssetEmissionAfter = value(assetInfo(cfgLpAssetId)).quantity
11661148 if ((lpAssetEmissionAfter == lpAssetEmissionAfter))
11671149 then ((state ++ lpTrnsfr) ++ refreshDLpActions)
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 else throw("Strict value is not equal to itself.")
11851167 }
11861168 else throw("Strict value is not equal to itself.")
11871169 }
11881170 }
11891171
11901172
11911173
11921174 @Callable(i)
11931175 func putOneTknV2 (minOutAmount,autoStake) = {
11941176 let isPoolOneTokenOperationsDisabled = {
11951177 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
11961178 if ($isInstanceOf(@, "Boolean"))
11971179 then @
11981180 else throw(($getType(@) + " couldn't be cast to Boolean"))
11991181 }
12001182 let isPutDisabled = if (if (if (igs())
12011183 then true
12021184 else (cfgPoolStatus == PoolPutDis))
12031185 then true
12041186 else (cfgPoolStatus == PoolShutdown))
12051187 then true
12061188 else isPoolOneTokenOperationsDisabled
12071189 let checks = [if (if (!(isPutDisabled))
12081190 then true
12091191 else isManager(i))
12101192 then true
12111193 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
12121194 then true
12131195 else throwErr("exactly 1 payment are expected")]
12141196 if ((checks == checks))
12151197 then {
12161198 let amId = toBase58String(value(cfgAmountAssetId))
12171199 let prId = toBase58String(value(cfgPriceAssetId))
12181200 let lpId = cfgLpAssetId
12191201 let amDecimals = cfgAmountAssetDecimals
12201202 let prDecimals = cfgPriceAssetDecimals
12211203 let userAddress = if ((i.caller == this))
12221204 then i.originCaller
12231205 else i.caller
12241206 let pmt = value(i.payments[0])
12251207 let pmtAssetId = toBase58String(value(pmt.assetId))
12261208 let pmtAmt = pmt.amount
12271209 let currentDLp = if ((pmt.assetId == cfgAmountAssetId))
12281210 then calcCurrentDLp(toBigInt(pmtAmt), toBigInt(0), toBigInt(0))
12291211 else calcCurrentDLp(toBigInt(0), toBigInt(pmtAmt), toBigInt(0))
12301212 if ((currentDLp == currentDLp))
12311213 then {
1232- let $t04392944087 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1233- if (($t04392944087 == $t04392944087))
1214+ let $t04400544163 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1215+ if (($t04400544163 == $t04400544163))
12341216 then {
1235- let feeAmount = $t04392944087._3
1236- let state = $t04392944087._2
1237- let estimLP = $t04392944087._1
1217+ let feeAmount = $t04400544163._3
1218+ let state = $t04400544163._2
1219+ let estimLP = $t04400544163._1
12381220 let emitLpAmt = if (if ((minOutAmount > 0))
12391221 then (minOutAmount > estimLP)
12401222 else false)
12411223 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
12421224 else estimLP
12431225 let e = invoke(fca, "emit", [emitLpAmt], nil)
12441226 if ((e == e))
12451227 then {
12461228 let el = match e {
12471229 case legacy: Address =>
12481230 invoke(legacy, "emit", [emitLpAmt], nil)
12491231 case _ =>
12501232 unit
12511233 }
12521234 if ((el == el))
12531235 then {
12541236 let lpTrnsfr = if (autoStake)
12551237 then {
12561238 let ss = invoke(stakingContract, "stakeFor", [toString(i.caller)], [AttachedPayment(lpId, emitLpAmt)])
12571239 if ((ss == ss))
12581240 then nil
12591241 else throw("Strict value is not equal to itself.")
12601242 }
12611243 else [ScriptTransfer(i.caller, emitLpAmt, lpId)]
12621244 let sendFeeToMatcher = if ((feeAmount > 0))
12631245 then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))]
12641246 else nil
1265- let $t04497245321 = if ((this == feeCollectorAddress))
1247+ let $t04504845397 = if ((this == feeCollectorAddress))
12661248 then $Tuple2(0, 0)
12671249 else {
12681250 let paymentInAmountAsset = if ((pmt.assetId == cfgAmountAssetId))
12691251 then true
12701252 else false
12711253 if (paymentInAmountAsset)
12721254 then $Tuple2(-(feeAmount), 0)
12731255 else $Tuple2(0, -(feeAmount))
12741256 }
1275- let amountAssetBalanceDelta = $t04497245321._1
1276- let priceAssetBalanceDelta = $t04497245321._2
1277- let $t04532445432 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1278- let refreshDLpActions = $t04532445432._1
1279- let updatedDLp = $t04532445432._2
1257+ let amountAssetBalanceDelta = $t04504845397._1
1258+ let priceAssetBalanceDelta = $t04504845397._2
1259+ let $t04540045508 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1260+ let refreshDLpActions = $t04540045508._1
1261+ let updatedDLp = $t04540045508._2
12801262 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
12811263 if ((isUpdatedDLpValid == isUpdatedDLpValid))
12821264 then $Tuple2((((state ++ lpTrnsfr) ++ sendFeeToMatcher) ++ refreshDLpActions), emitLpAmt)
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 else throw("Strict value is not equal to itself.")
12921274 }
12931275 else throw("Strict value is not equal to itself.")
12941276 }
12951277
12961278
12971279
12981280 @Callable(i)
12991281 func putForFree (maxSlpg) = if ((0 > maxSlpg))
13001282 then throw("Wrong slpg")
13011283 else if ((size(i.payments) != 2))
13021284 then throw("2 pmnts expd")
13031285 else {
13041286 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, "")
13051287 let state = estPut._9
13061288 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
13071289 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
13081290 let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0))
13091291 if ((currentDLp == currentDLp))
13101292 then {
1311- let $t04646246527 = refreshDLpInternal(0, 0, 0)
1312- let refreshDLpActions = $t04646246527._1
1313- let updatedDLp = $t04646246527._2
1293+ let $t04653846603 = refreshDLpInternal(0, 0, 0)
1294+ let refreshDLpActions = $t04653846603._1
1295+ let updatedDLp = $t04653846603._2
13141296 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
13151297 if ((isUpdatedDLpValid == isUpdatedDLpValid))
13161298 then (state ++ refreshDLpActions)
13171299 else throw("Strict value is not equal to itself.")
13181300 }
13191301 else throw("Strict value is not equal to itself.")
13201302 }
13211303
13221304
13231305
13241306 @Callable(i)
13251307 func get () = {
13261308 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0))
13271309 if ((currentDLp == currentDLp))
13281310 then {
13291311 let r = cg(i)
13301312 let outAmtAmt = r._1
13311313 let outPrAmt = r._2
13321314 let pmtAmt = r._3
13331315 let pmtAssetId = r._4
13341316 let state = r._5
13351317 let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
13361318 if ((b == b))
13371319 then {
1338- let $t04770047782 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1339- let refreshDLpActions = $t04770047782._1
1340- let updatedDLp = $t04770047782._2
1320+ let $t04777647858 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1321+ let refreshDLpActions = $t04777647858._1
1322+ let updatedDLp = $t04777647858._2
13411323 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
13421324 if ((isUpdatedDLpValid == isUpdatedDLpValid))
13431325 then (state ++ refreshDLpActions)
13441326 else throw("Strict value is not equal to itself.")
13451327 }
13461328 else throw("Strict value is not equal to itself.")
13471329 }
13481330 else throw("Strict value is not equal to itself.")
13491331 }
13501332
13511333
13521334
13531335 @Callable(i)
13541336 func getOneTknV2 (outAssetId,minOutAmount) = {
13551337 let isPoolOneTokenOperationsDisabled = {
13561338 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
13571339 if ($isInstanceOf(@, "Boolean"))
13581340 then @
13591341 else throw(($getType(@) + " couldn't be cast to Boolean"))
13601342 }
13611343 let isGetDisabled = if (if (igs())
13621344 then true
13631345 else (cfgPoolStatus == PoolShutdown))
13641346 then true
13651347 else isPoolOneTokenOperationsDisabled
13661348 let checks = [if (if (!(isGetDisabled))
13671349 then true
13681350 else isManager(i))
13691351 then true
13701352 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
13711353 then true
13721354 else throwErr("exactly 1 payment are expected")]
13731355 if ((checks == checks))
13741356 then {
1375- let $t04840048555 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1376- let state = $t04840048555._1
1377- let totalAmount = $t04840048555._2
1357+ let $t04847648631 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1358+ let state = $t04847648631._1
1359+ let totalAmount = $t04847648631._2
13781360 $Tuple2(state, totalAmount)
13791361 }
13801362 else throw("Strict value is not equal to itself.")
13811363 }
13821364
13831365
13841366
13851367 @Callable(i)
13861368 func refreshDLp () = {
13871369 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyDLpRefreshedHeight), 0)
13881370 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= dLpRefreshDelay))
13891371 then unit
13901372 else throwErr(makeString([toString(dLpRefreshDelay), " blocks have not passed since the previous call"], ""))
13911373 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
13921374 then {
13931375 let dLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyDLp), "0")), fmtErr("invalid dLp"))
1394- let $t04907949143 = refreshDLpInternal(0, 0, 0)
1395- let dLpUpdateActions = $t04907949143._1
1396- let updatedDLp = $t04907949143._2
1376+ let $t04915549219 = refreshDLpInternal(0, 0, 0)
1377+ let dLpUpdateActions = $t04915549219._1
1378+ let updatedDLp = $t04915549219._2
13971379 let actions = if ((dLp != updatedDLp))
13981380 then dLpUpdateActions
13991381 else throwErr("nothing to refresh")
14001382 $Tuple2(actions, toString(updatedDLp))
14011383 }
14021384 else throw("Strict value is not equal to itself.")
14031385 }
14041386
14051387
14061388
14071389 @Callable(i)
14081390 func getOneTknV2READONLY (outAssetId,lpAssetAmount) = {
14091391 let amId = toBase58String(value(cfgAmountAssetId))
14101392 let prId = toBase58String(value(cfgPriceAssetId))
14111393 let lpId = toBase58String(value(cfgLpAssetId))
14121394 let xp = [toBigInt(getAccBalance(amId)), toBigInt(getAccBalance(prId))]
14131395 let lpEmission = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "invalid lp asset").quantity)
14141396 let D0 = getD(xp)
14151397 let D1 = (D0 - fraction(toBigInt(lpAssetAmount), D0, lpEmission))
14161398 let index = if ((outAssetId == amId))
14171399 then 0
14181400 else if ((outAssetId == prId))
14191401 then 1
14201402 else throw("invalid out asset id")
14211403 let newY = getYD(xp, index, D1)
14221404 let dy = (xp[index] - newY)
14231405 let totalGetRaw = max([0, toInt((dy - big1))])
1424- let $t05015350208 = takeFee(totalGetRaw, outFee)
1425- let totalGet = $t05015350208._1
1426- let feeAmount = $t05015350208._2
1406+ let $t05022950284 = takeFee(totalGetRaw, outFee)
1407+ let totalGet = $t05022950284._1
1408+ let feeAmount = $t05022950284._2
14271409 $Tuple2(nil, $Tuple2(totalGet, feeAmount))
14281410 }
14291411
14301412
14311413
14321414 @Callable(i)
14331415 func getOneTknV2WithBonusREADONLY (outAssetId,lpAssetAmount) = {
14341416 let amId = toBase58String(value(cfgAmountAssetId))
14351417 let prId = toBase58String(value(cfgPriceAssetId))
14361418 let lpId = toBase58String(value(cfgLpAssetId))
14371419 let amBalance = getAccBalance(amId)
14381420 let prBalance = getAccBalance(prId)
1439- let $t05058350698 = {
1421+ let $t05065950774 = {
14401422 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil)
14411423 if ($isInstanceOf(@, "(Int, Int)"))
14421424 then @
14431425 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
14441426 }
1445- let totalGet = $t05058350698._1
1446- let feeAmount = $t05058350698._2
1427+ let totalGet = $t05065950774._1
1428+ let feeAmount = $t05065950774._2
14471429 let r = ego("", lpId, lpAssetAmount, this)
14481430 let outAmAmt = r._1
14491431 let outPrAmt = r._2
14501432 let sumOfGetAssets = (outAmAmt + outPrAmt)
14511433 let bonus = if ((sumOfGetAssets == 0))
14521434 then if ((totalGet == 0))
14531435 then 0
14541436 else throw("bonus calculation error")
14551437 else fraction((totalGet - sumOfGetAssets), scale8, sumOfGetAssets)
14561438 $Tuple2(nil, $Tuple3(totalGet, feeAmount, bonus))
14571439 }
14581440
14591441
14601442
14611443 @Callable(i)
14621444 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
14631445 let r = cg(i)
14641446 let outAmAmt = r._1
14651447 let outPrAmt = r._2
14661448 let pmtAmt = r._3
14671449 let pmtAssetId = r._4
14681450 let state = r._5
14691451 if ((noLessThenAmtAsset > outAmAmt))
14701452 then throw(((("Failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
14711453 else if ((noLessThenPriceAsset > outPrAmt))
14721454 then throw(((("Failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
14731455 else {
14741456 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0))
14751457 if ((currentDLp == currentDLp))
14761458 then {
14771459 let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14781460 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14791461 then {
1480- let $t05186451945 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1481- let refreshDLpActions = $t05186451945._1
1482- let updatedDLp = $t05186451945._2
1462+ let $t05194052021 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1463+ let refreshDLpActions = $t05194052021._1
1464+ let updatedDLp = $t05194052021._2
14831465 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
14841466 if ((isUpdatedDLpValid == isUpdatedDLpValid))
14851467 then (state ++ refreshDLpActions)
14861468 else throw("Strict value is not equal to itself.")
14871469 }
14881470 else throw("Strict value is not equal to itself.")
14891471 }
14901472 else throw("Strict value is not equal to itself.")
14911473 }
14921474 }
14931475
14941476
14951477
14961478 @Callable(i)
14971479 func unstakeAndGet (amount) = {
14981480 let checkPayments = if ((size(i.payments) != 0))
14991481 then throw("No pmnts expd")
15001482 else true
15011483 if ((checkPayments == checkPayments))
15021484 then {
15031485 let factoryCfg = gfc()
15041486 let lpAssetId = cfgLpAssetId
15051487 let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr")
15061488 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0))
15071489 if ((currentDLp == currentDLp))
15081490 then {
15091491 let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil)
15101492 if ((unstakeInv == unstakeInv))
15111493 then {
15121494 let r = ego(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
15131495 let outAmAmt = r._1
15141496 let outPrAmt = r._2
15151497 let sts = parseIntValue(r._9)
15161498 let state = r._10
15171499 let v = if (if (igs())
15181500 then true
15191501 else (sts == PoolShutdown))
15201502 then throw(("Blocked: " + toString(sts)))
15211503 else true
15221504 if ((v == v))
15231505 then {
15241506 let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
15251507 if ((burnA == burnA))
15261508 then {
1527- let $t05297253053 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1528- let refreshDLpActions = $t05297253053._1
1529- let updatedDLp = $t05297253053._2
1509+ let $t05304853129 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1510+ let refreshDLpActions = $t05304853129._1
1511+ let updatedDLp = $t05304853129._2
15301512 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
15311513 if ((isUpdatedDLpValid == isUpdatedDLpValid))
15321514 then (state ++ refreshDLpActions)
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 else throw("Strict value is not equal to itself.")
15421524 }
15431525 else throw("Strict value is not equal to itself.")
15441526 }
15451527
15461528
15471529
15481530 @Callable(i)
15491531 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
15501532 let isGetDisabled = if (igs())
15511533 then true
15521534 else (cfgPoolStatus == PoolShutdown)
15531535 let checks = [if (!(isGetDisabled))
15541536 then true
15551537 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
15561538 then true
15571539 else throw("no payments are expected")]
15581540 if ((checks == checks))
15591541 then {
15601542 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0))
15611543 if ((currentDLp == currentDLp))
15621544 then {
15631545 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
15641546 if ((unstakeInv == unstakeInv))
15651547 then {
15661548 let res = ego(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
15671549 let outAmAmt = res._1
15681550 let outPrAmt = res._2
15691551 let state = res._10
15701552 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
15711553 then true
15721554 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
15731555 then true
15741556 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
15751557 if ((checkAmounts == checkAmounts))
15761558 then {
15771559 let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
15781560 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15791561 then {
1580- let $t05430454385 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1581- let refreshDLpActions = $t05430454385._1
1582- let updatedDLp = $t05430454385._2
1562+ let $t05438054461 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1563+ let refreshDLpActions = $t05438054461._1
1564+ let updatedDLp = $t05438054461._2
15831565 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
15841566 if ((isUpdatedDLpValid == isUpdatedDLpValid))
15851567 then (state ++ refreshDLpActions)
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 else throw("Strict value is not equal to itself.")
15951577 }
15961578 else throw("Strict value is not equal to itself.")
15971579 }
15981580
15991581
16001582
16011583 @Callable(i)
16021584 func unstakeAndGetOneTknV2 (unstakeAmount,outAssetId,minOutAmount) = {
16031585 let isPoolOneTokenOperationsDisabled = {
16041586 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
16051587 if ($isInstanceOf(@, "Boolean"))
16061588 then @
16071589 else throw(($getType(@) + " couldn't be cast to Boolean"))
16081590 }
16091591 let isGetDisabled = if (if (igs())
16101592 then true
16111593 else (cfgPoolStatus == PoolShutdown))
16121594 then true
16131595 else isPoolOneTokenOperationsDisabled
16141596 let checks = [if (if (!(isGetDisabled))
16151597 then true
16161598 else isManager(i))
16171599 then true
16181600 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
16191601 then true
16201602 else throwErr("no payments are expected")]
16211603 if ((checks == checks))
16221604 then {
16231605 let factoryCfg = gfc()
16241606 let lpAssetId = cfgLpAssetId
16251607 let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr")
16261608 let userAddress = i.caller
16271609 let lpAssetRecipientAddress = this
16281610 let unstakeInv = invoke(staking, "unstakeINTERNAL", [lpAssetId, unstakeAmount, userAddress.bytes, lpAssetRecipientAddress.bytes], nil)
16291611 if ((unstakeInv == unstakeInv))
16301612 then {
1631- let $t05540755595 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1632- let state = $t05540755595._1
1633- let totalAmount = $t05540755595._2
1613+ let $t05548355671 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1614+ let state = $t05548355671._1
1615+ let totalAmount = $t05548355671._2
16341616 $Tuple2(state, totalAmount)
16351617 }
16361618 else throw("Strict value is not equal to itself.")
16371619 }
16381620 else throw("Strict value is not equal to itself.")
16391621 }
16401622
16411623
16421624
16431625 @Callable(i)
16441626 func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = {
1645- let $t05572355826 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1646- let lpAmount = $t05572355826._1
1647- let state = $t05572355826._2
1648- let feeAmount = $t05572355826._3
1649- let bonus = $t05572355826._4
1627+ let $t05579955902 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1628+ let lpAmount = $t05579955902._1
1629+ let state = $t05579955902._2
1630+ let feeAmount = $t05579955902._3
1631+ let bonus = $t05579955902._4
16501632 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
16511633 }
16521634
16531635
16541636
16551637 @Callable(i)
16561638 func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = {
1657- let $t05597456078 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1658- let lpAmount = $t05597456078._1
1659- let state = $t05597456078._2
1660- let feeAmount = $t05597456078._3
1661- let bonus = $t05597456078._4
1639+ let $t05605056154 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1640+ let lpAmount = $t05605056154._1
1641+ let state = $t05605056154._2
1642+ let feeAmount = $t05605056154._3
1643+ let bonus = $t05605056154._4
16621644 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
16631645 }
16641646
16651647
16661648
16671649 @Callable(i)
16681650 func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString(fca)))
16691651 then throw("denied")
16701652 else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr)], "success")
16711653
16721654
16731655
16741656 @Callable(i)
16751657 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, gpc())
16761658
16771659
16781660
16791661 @Callable(i)
16801662 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
16811663
16821664
16831665
16841666 @Callable(i)
16851667 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
16861668 let pr = calcPrices(amAmt, prAmt, lpAmt)
16871669 $Tuple2(nil, [toString(pr[0]), toString(pr[1]), toString(pr[2])])
16881670 }
16891671
16901672
16911673
16921674 @Callable(i)
16931675 func fromX18WrapperREADONLY (val,resScaleMult) = $Tuple2(nil, f1(parseBigIntValue(val), resScaleMult))
16941676
16951677
16961678
16971679 @Callable(i)
16981680 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(t1(origVal, origScaleMult)))
16991681
17001682
17011683
17021684 @Callable(i)
17031685 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(cpbi(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
17041686
17051687
17061688
17071689 @Callable(i)
17081690 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, ""))
17091691
17101692
17111693
17121694 @Callable(i)
17131695 func estimateGetOperationWrapperREADONLY (txId58,pmtAsId,pmtLpAmt,usrAddr) = {
17141696 let r = ego(txId58, pmtAsId, pmtLpAmt, addressFromStringValue(usrAddr))
17151697 $Tuple2(nil, $Tuple10(r._1, r._2, r._3, r._4, r._5, r._6, r._7, toString(r._8), r._9, r._10))
17161698 }
17171699
17181700
17191701
17201702 @Callable(i)
17211703 func changeAmp () = {
17221704 let cfg = invoke(fca, "getChangeAmpConfigREADONLY", [toString(this)], nil)
1723- let $t05843258631 = match cfg {
1705+ let $t05850858707 = match cfg {
17241706 case list: List[Any] =>
17251707 $Tuple3({
17261708 let @ = list[0]
17271709 if ($isInstanceOf(@, "Int"))
17281710 then @
17291711 else throw(($getType(@) + " couldn't be cast to Int"))
17301712 }, {
17311713 let @ = list[1]
17321714 if ($isInstanceOf(@, "Int"))
17331715 then @
17341716 else throw(($getType(@) + " couldn't be cast to Int"))
17351717 }, {
17361718 let @ = list[2]
17371719 if ($isInstanceOf(@, "Int"))
17381720 then @
17391721 else throw(($getType(@) + " couldn't be cast to Int"))
17401722 })
17411723 case _ =>
17421724 throwErr("invalid entry type")
17431725 }
1744- let delay = $t05843258631._1
1745- let delta = $t05843258631._2
1746- let target = $t05843258631._3
1726+ let delay = $t05850858707._1
1727+ let delta = $t05850858707._2
1728+ let target = $t05850858707._3
17471729 let curAmp = parseIntValue(getStringValue(amp()))
17481730 let newAmpRaw = (curAmp + delta)
17491731 let newAmp = if ((0 > delta))
17501732 then if ((target > newAmpRaw))
17511733 then target
17521734 else newAmpRaw
17531735 else if ((newAmpRaw > target))
17541736 then target
17551737 else newAmpRaw
17561738 let lastCall = valueOrElse(getInteger(keyChangeAmpLastCall()), 0)
17571739 let wait = (lastCall + delay)
17581740 let checks = [if ((height > wait))
17591741 then true
17601742 else throwErr("try again in few blocks"), if ((curAmp != newAmp))
17611743 then true
17621744 else throwErr("already reached target")]
17631745 if ((checks == checks))
17641746 then [IntegerEntry(keyChangeAmpLastCall(), height), StringEntry(amp(), toString(newAmp)), StringEntry(keyAmpHistory(height), toString(newAmp))]
17651747 else throw("Strict value is not equal to itself.")
17661748 }
17671749
17681750
17691751 @Verifier(tx)
17701752 func verify () = {
1771- let targetPublicKey = match m() {
1753+ let targetPublicKey = match managerPublicKeyOrUnit() {
17721754 case pk: ByteVector =>
17731755 pk
17741756 case _: Unit =>
17751757 tx.senderPublicKey
17761758 case _ =>
17771759 throw("Match error")
17781760 }
17791761 match tx {
17801762 case order: Order =>
17811763 let matcherPub = mp()
1782- let $t05954359660 = if (skipOrderValidation())
1764+ let $t05964059757 = if (skipOrderValidation())
17831765 then $Tuple2(true, "")
17841766 else validateMatcherOrderAllowed(order)
1785- let orderValid = $t05954359660._1
1786- let orderValidInfo = $t05954359660._2
1767+ let orderValid = $t05964059757._1
1768+ let orderValidInfo = $t05964059757._2
17871769 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
17881770 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
17891771 if (if (if (orderValid)
17901772 then senderValid
17911773 else false)
17921774 then matcherValid
17931775 else false)
17941776 then true
17951777 else throwOrderError(orderValid, orderValidInfo, senderValid, matcherValid)
17961778 case s: SetScriptTransaction =>
17971779 if (sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey))
17981780 then true
17991781 else {
18001782 let newHash = blake2b256(value(s.script))
18011783 let allowedHash = fromBase64String(value(getString(fca, keyAllowedLpStableScriptHash())))
18021784 let currentHash = scriptHash(this)
18031785 if ((allowedHash == newHash))
18041786 then (currentHash != newHash)
18051787 else false
18061788 }
18071789 case _ =>
18081790 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
18091791 }
18101792 }
18111793

github/deemru/w8io/026f985 
262.21 ms