tx · ASAAGHZyM5rSntq681qtfsq8R4v3RaxqhPDdPQWKJPFe

3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA:  -0.03400000 Waves

2023.01.17 13:50 [2408829] smart account 3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA > SELF 0.00000000 Waves

{ "type": 13, "id": "ASAAGHZyM5rSntq681qtfsq8R4v3RaxqhPDdPQWKJPFe", "fee": 3400000, "feeAssetId": null, "timestamp": 1673952631111, "version": 1, "sender": "3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA", "senderPublicKey": "35yd3qw1gxKDxKwGAykHN9fANbXNWwseaUwbWDj24o3x", "proofs": [ "3EqvSS87MAXSWhMPWSXnAMJYMRnJx1vuvM6Mb11Kqrbh3zRqUSfRGwrTEGfQRWEbNLojtb5sppBeZ7EzjY5B7Q5T" ], "script": "base64:BgKCJAgCEgYKBAEEAQgSAwoBCBIDCgEIEgMKAQgSABIECgIBBBIECgIBBBIDCgEBEgASBAoCCAESBAoCCAESBAoCCAESBAoCAQESAwoBARIFCgMBAQESBQoDAQgBEgQKAgEIEgQKAgEIEgQKAggIEgQKAggIEgQKAggBEgASAwoBCBIFCgMBAQESBAoCCAESBAoCAQESBAoCCAgSCwoJCAEBAgECCAQEEgYKBAgIAQgiBnNjYWxlOCIMc2NhbGU4QmlnSW50IgdzY2FsZTE4Igp6ZXJvQmlnSW50IgRiaWcwIgRiaWcxIgRiaWcyIgpzbGlwcGFnZTREIgt3YXZlc1N0cmluZyIFQW11bHQiBURjb252IgNTRVAiBUVNUFRZIgpQb29sQWN0aXZlIgpQb29sUHV0RGlzIg5Qb29sTWF0Y2hlckRpcyIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyIJaWR4UG9vbFN0IglpZHhMUEFzSWQiCWlkeEFtQXNJZCIJaWR4UHJBc0lkIgtpZHhBbXRBc0RjbSINaWR4UHJpY2VBc0RjbSILaWR4SUFtdEFzSWQiDWlkeElQcmljZUFzSW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FAmRnAl80CAUCZGcCXzUIBQJkZwJfNggFAmRnAl83CQCmAwEIBQJkZwJfOAgFAmRnAl85CAUCZGcDXzEwAQJoZAECaGUABAJoZgQCYXcJAQJmQQADCQABAgUCYXcCCkJ5dGVWZWN0b3IEAmZFBQJhdwUCZkUDCQABAgUCYXcCBFVuaXQIBQJoZA9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgQCYXcFAmhkAwkAAQIFAmF3AgVPcmRlcgQCZEIFAmF3BAJoZwkBAmFMAAQCaGgJAQJkQQEFAmRCBAJoaQkA9AMDCAUCZEIJYm9keUJ5dGVzCQCRAwIIBQJkQgZwcm9vZnMAAAgFAmRCD3NlbmRlclB1YmxpY0tleQQCaGoJAPQDAwgFAmRCCWJvZHlCeXRlcwkAkQMCCAUCZEIGcHJvb2ZzAAEFAmhnAwMDBQJoaAUCaGkHBQJoagcGCQECYXIDBQJoaAUCaGkFAmhqAwkAAQIFAmF3AhRTZXRTY3JpcHRUcmFuc2FjdGlvbgQCZWIFAmF3BAJoawkA9gMBCQEFdmFsdWUBCAUCZWIGc2NyaXB0BAJobAkA2wQBCQEFdmFsdWUBCQCdCAIFAmFGCQECYXAABAJobQkA8QcBBQR0aGlzAwMJAAACBQJobAUCaGsJAQIhPQIFAmhtBQJoawcGCQD0AwMIBQJoZAlib2R5Qnl0ZXMJAJEDAggFAmhkBnByb29mcwAABQJoZgkA9AMDCAUCaGQJYm9keUJ5dGVzCQCRAwIIBQJoZAZwcm9vZnMAAAUCaGYMAnlH", "chainId": 84, "height": 2408829, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: A11g2KZKrFVUaRkTBrXML2droNDVrLU2E94bthSVX56S Next: G8os4y3tFkDVyQcyiMe3tmNQriSde5gfgqKGog2rNvQY Diff:
OldNewDifferences
115115 func ada () = "%s__addonAddr"
116116
117117
118+func swapContract () = "%s__swapContract"
119+
120+
118121 func fcfg () = "%s__factoryConfig"
119122
120123
145148 case _ =>
146149 throw("fail cast to String")
147150 }
151+
152+
153+func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined"))
148154
149155
150156 func strf (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
206212
207213 let poolConfigParsed = parsePoolConfig(gpc())
208214
209-let $t069097095 = poolConfigParsed
215+let $t070867272 = poolConfigParsed
210216
211-let cfgPoolAddress = $t069097095._1
217+let cfgPoolAddress = $t070867272._1
212218
213-let cfgPoolStatus = $t069097095._2
219+let cfgPoolStatus = $t070867272._2
214220
215-let cfgLpAssetId = $t069097095._3
221+let cfgLpAssetId = $t070867272._3
216222
217-let cfgAmountAssetId = $t069097095._4
223+let cfgAmountAssetId = $t070867272._4
218224
219-let cfgPriceAssetId = $t069097095._5
225+let cfgPriceAssetId = $t070867272._5
220226
221-let cfgAmountAssetDecimals = $t069097095._6
227+let cfgAmountAssetDecimals = $t070867272._6
222228
223-let cfgPriceAssetDecimals = $t069097095._7
229+let cfgPriceAssetDecimals = $t070867272._7
224230
225231 func gfc () = split(strf(fca, fcfg()), SEP)
226232
417423 else calcLpAmt
418424 let amDiff = (inAmAmt - calcAmAssetPmt)
419425 let prDiff = (inPrAmt - calcPrAssetPmt)
420- let $t01756217907 = if (if (isOneAsset)
426+ let $t01773918084 = if (if (isOneAsset)
421427 then (pmtId == amIdStr)
422428 else false)
423429 then $Tuple2(pmtAmt, 0)
426432 else false)
427433 then $Tuple2(0, pmtAmt)
428434 else $Tuple2(calcAmAssetPmt, calcPrAssetPmt)
429- let writeAmAmt = $t01756217907._1
430- let writePrAmt = $t01756217907._2
435+ let writeAmAmt = $t01773918084._1
436+ let writePrAmt = $t01773918084._2
431437 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))]
432438 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId)
433439 }
527533 let ann_aPrecision = (ann - aPrecision)
528534 let n1 = (n + big1)
529535 func calc (acc,cur) = {
530- let $t02245922479 = acc
531- let d = $t02245922479._1
532- let found = $t02245922479._2
536+ let $t02263622656 = acc
537+ let d = $t02263622656._1
538+ let found = $t02263622656._2
533539 if ((found != unit))
534540 then acc
535541 else {
543549 }
544550
545551 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
546- let $t02290022947 = {
552+ let $t02307723124 = {
547553 let $l = arr
548554 let $s = size($l)
549555 let $acc0 = $Tuple2(s, unit)
557563
558564 $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)
559565 }
560- let d = $t02290022947._1
561- let found = $t02290022947._2
566+ let d = $t02307723124._1
567+ let found = $t02307723124._2
562568 if ((found != unit))
563569 then d
564570 else throw(("D calculation error, D = " + toString(d)))
578584 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
579585 let b = ((s + ((D * aPrecision) / ann)) - D)
580586 func calc (acc,cur) = {
581- let $t02344723467 = acc
582- let y = $t02344723467._1
583- let found = $t02344723467._2
587+ let $t02362423644 = acc
588+ let y = $t02362423644._1
589+ let found = $t02362423644._2
584590 if ((found != unit))
585591 then acc
586592 else {
593599 }
594600
595601 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
596- let $t02377423821 = {
602+ let $t02395123998 = {
597603 let $l = arr
598604 let $s = size($l)
599605 let $acc0 = $Tuple2(D, unit)
607613
608614 $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)
609615 }
610- let y = $t02377423821._1
611- let found = $t02377423821._2
616+ let y = $t02395123998._1
617+ let found = $t02395123998._2
612618 if ((found != unit))
613619 then y
614620 else throw(("Y calculation error, Y = " + toString(y)))
630636 then {
631637 let amBalance = getAccBalance(amId)
632638 let prBalance = getAccBalance(prId)
633- let $t02460425066 = if ((txId == ""))
639+ let $t02478125243 = if ((txId == ""))
634640 then $Tuple2(amBalance, prBalance)
635641 else if ((pmtAssetId == amId))
636642 then if ((pmtAmtRaw > amBalance))
641647 then throw("invalid payment amount")
642648 else $Tuple2(amBalance, (prBalance - pmtAmtRaw))
643649 else throw("wrong pmtAssetId")
644- let amBalanceOld = $t02460425066._1
645- let prBalanceOld = $t02460425066._2
646- let $t02507225248 = if ((pmtAssetId == amId))
650+ let amBalanceOld = $t02478125243._1
651+ let prBalanceOld = $t02478125243._2
652+ let $t02524925425 = if ((pmtAssetId == amId))
647653 then $Tuple2(pmtAmtRaw, 0)
648654 else if ((pmtAssetId == prId))
649655 then $Tuple2(0, pmtAmtRaw)
650656 else throw("invalid payment")
651- let amAmountRaw = $t02507225248._1
652- let prAmountRaw = $t02507225248._2
653- let $t02525225506 = if (withTakeFee)
657+ let amAmountRaw = $t02524925425._1
658+ let prAmountRaw = $t02524925425._2
659+ let $t02542925683 = if (withTakeFee)
654660 then $Tuple3(takeFee(amAmountRaw, inFee)._1, takeFee(prAmountRaw, inFee)._1, takeFee(pmtAmtRaw, inFee)._2)
655661 else $Tuple3(amAmountRaw, prAmountRaw, 0)
656- let amAmount = $t02525225506._1
657- let prAmount = $t02525225506._2
658- let feeAmount = $t02525225506._3
662+ let amAmount = $t02542925683._1
663+ let prAmount = $t02542925683._2
664+ let feeAmount = $t02542925683._3
659665 let amBalanceNew = (amBalanceOld + amAmount)
660666 let prBalanceNew = (prBalanceOld + prAmount)
661667 let D0 = getD([toBigInt(amBalanceOld), toBigInt(prBalanceOld)])
701707 else {
702708 let amBalance = getAccBalance(amId)
703709 let prBalance = getAccBalance(prId)
704- let $t02750827619 = {
710+ let $t02768527796 = {
705711 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil)
706712 if ($isInstanceOf(@, "(Int, Int)"))
707713 then @
708714 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
709715 }
710- if (($t02750827619 == $t02750827619))
716+ if (($t02768527796 == $t02768527796))
711717 then {
712- let feeAmount = $t02750827619._2
713- let totalGet = $t02750827619._1
718+ let feeAmount = $t02768527796._2
719+ let totalGet = $t02768527796._1
714720 let totalAmount = if (if ((minOutAmount > 0))
715721 then (minOutAmount > totalGet)
716722 else false)
717723 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
718724 else totalGet
719- let $t02780928116 = if ((outAssetId == amId))
725+ let $t02798628293 = if ((outAssetId == amId))
720726 then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance)
721727 else if ((outAssetId == prId))
722728 then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount))
723729 else throw("invalid out asset id")
724- let outAm = $t02780928116._1
725- let outPr = $t02780928116._2
726- let amBalanceNew = $t02780928116._3
727- let prBalanceNew = $t02780928116._4
730+ let outAm = $t02798628293._1
731+ let outPr = $t02798628293._2
732+ let amBalanceNew = $t02798628293._3
733+ let prBalanceNew = $t02798628293._4
728734 let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals))
729735 let curPr = f1(curPrX18, scale8)
730736 let outAssetIdOrWaves = if ((outAssetId == "WAVES"))
792798 case _ =>
793799 throw("Match error")
794800 }
801+
802+
803+func getY (isReverse,D,poolAmountInBalance) = {
804+ let poolConfig = gpc()
805+ let amId = poolConfig[idxAmAsId]
806+ let prId = poolConfig[idxPrAsId]
807+ let n = big2
808+ let aPrecision = parseBigIntValue(Amult)
809+ let a = (parseBigIntValue(A) * aPrecision)
810+ let xp = if ((isReverse == false))
811+ then [(toBigInt(getAccBalance(amId)) - poolAmountInBalance), toBigInt(getAccBalance(prId))]
812+ else [(toBigInt(getAccBalance(prId)) - poolAmountInBalance), toBigInt(getAccBalance(amId))]
813+ let x = xp[0]
814+ let s = x
815+ let ann = (a * n)
816+ let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
817+ let b = ((s + ((D * aPrecision) / ann)) - D)
818+ func calc (acc,cur) = {
819+ let $t03043030450 = acc
820+ let y = $t03043030450._1
821+ let found = $t03043030450._2
822+ if ((found != unit))
823+ then acc
824+ else {
825+ let yNext = (((y * y) + c) / ((big2 * y) + b))
826+ let yDiff = absBigInt((yNext - value(y)))
827+ if ((big1 >= yDiff))
828+ then $Tuple2(yNext, cur)
829+ else $Tuple2(yNext, unit)
830+ }
831+ }
832+
833+ let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
834+ let $t03078130828 = {
835+ let $l = arr
836+ let $s = size($l)
837+ let $acc0 = $Tuple2(D, unit)
838+ func $f0_1 ($a,$i) = if (($i >= $s))
839+ then $a
840+ else calc($a, $l[$i])
841+
842+ func $f0_2 ($a,$i) = if (($i >= $s))
843+ then $a
844+ else throw("List size exceeds 15")
845+
846+ $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)
847+ }
848+ let y = $t03078130828._1
849+ let found = $t03078130828._2
850+ if ((found != unit))
851+ then y
852+ else throw(("Y calculation error, Y = " + toString(y)))
853+ }
854+
855+
856+@Callable(i)
857+func calculateAmountOutForSwapAndSendTokens (cleanAmountIn,isReverse,amountOutMin,addressTo) = {
858+ let checks = [if ((value(i.payments[0]).amount >= cleanAmountIn))
859+ then true
860+ else throwErr("Wrong amount"), if ((i.caller == addressFromStringValue(getStringOrFail(swapContract()))))
861+ then true
862+ else throwErr("Permission denied")]
863+ if ((checks == checks))
864+ then {
865+ let pmt = value(i.payments[0])
866+ let assetIn = toBase58String(value(pmt.assetId))
867+ let $t03138931852 = if ((isReverse == false))
868+ then {
869+ let index = 1
870+ let assetOut = getStringOrFail(pa())
871+ let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
872+ $Tuple3(assetOut, index, poolAmountInBalance)
873+ }
874+ else {
875+ let index = 0
876+ let assetOut = getStringOrFail(aa())
877+ let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
878+ $Tuple3(assetOut, index, poolAmountInBalance)
879+ }
880+ let assetOut = $t03138931852._1
881+ let index = $t03138931852._2
882+ let poolAmountInBalance = $t03138931852._3
883+ let poolConfig = gpc()
884+ let amId = poolConfig[idxAmAsId]
885+ let prId = poolConfig[idxPrAsId]
886+ let xp = [(toBigInt(getAccBalance(amId)) - toBigInt(value(i.payments[0]).amount)), toBigInt(getAccBalance(prId))]
887+ let D = getD(xp)
888+ let y = getY(isReverse, D, toBigInt(poolAmountInBalance))
889+ let x = (toBigInt(poolAmountInBalance) + toBigInt(cleanAmountIn))
890+ let dy = ((toBigInt(getAccBalance(assetOut)) - y) - toBigInt(1))
891+ let totalGetRaw = max([0, toInt(dy)])
892+ let checkMin = [(amountOutMin >= totalGetRaw), throw("Exchange resulted in fewer coins than expected")]
893+ if ((checkMin == checkMin))
894+ then [ScriptTransfer(addressFromStringValue(addressTo), toInt(dy), fromBase58String(assetOut))]
895+ else throw("Strict value is not equal to itself.")
896+ }
897+ else throw("Strict value is not equal to itself.")
898+ }
899+
900+
901+
902+@Callable(i)
903+func setSwapContract (swappAddr) = {
904+ let checkCaller = mm(i)
905+ if ((checkCaller == checkCaller))
906+ then [StringEntry(swapContract(), swappAddr)]
907+ else throw("Strict value is not equal to itself.")
908+ }
909+
795910
796911
797912 @Callable(i)
9361051 let pmt = value(i.payments[0])
9371052 let pmtAssetId = toBase58String(value(pmt.assetId))
9381053 let pmtAmt = pmt.amount
939- let $t03347833636 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
940- if (($t03347833636 == $t03347833636))
1054+ let $t03668336841 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1055+ if (($t03668336841 == $t03668336841))
9411056 then {
942- let feeAmount = $t03347833636._3
943- let state = $t03347833636._2
944- let estimLP = $t03347833636._1
1057+ let feeAmount = $t03668336841._3
1058+ let state = $t03668336841._2
1059+ let estimLP = $t03668336841._1
9451060 let emitLpAmt = if (if ((minOutAmount > 0))
9461061 then (minOutAmount > estimLP)
9471062 else false)
10321147 else throwErr("exactly 1 payment are expected")]
10331148 if ((checks == checks))
10341149 then {
1035- let $t03625836413 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1036- let state = $t03625836413._1
1037- let totalAmount = $t03625836413._2
1150+ let $t03946339618 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1151+ let state = $t03946339618._1
1152+ let totalAmount = $t03946339618._2
10381153 $Tuple2(state, totalAmount)
10391154 }
10401155 else throw("Strict value is not equal to itself.")
10601175 let newY = getYD(xp, index, D1)
10611176 let dy = (xp[index] - newY)
10621177 let totalGetRaw = max([0, toInt((dy - big1))])
1063- let $t03720337258 = takeFee(totalGetRaw, outFee)
1064- let totalGet = $t03720337258._1
1065- let feeAmount = $t03720337258._2
1178+ let $t04040840463 = takeFee(totalGetRaw, outFee)
1179+ let totalGet = $t04040840463._1
1180+ let feeAmount = $t04040840463._2
10661181 $Tuple2(nil, $Tuple2(totalGet, feeAmount))
10671182 }
10681183
10761191 let lpId = poolConfig[idxLPAsId]
10771192 let amBalance = getAccBalance(amId)
10781193 let prBalance = getAccBalance(prId)
1079- let $t03760337718 = {
1194+ let $t04080840923 = {
10801195 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil)
10811196 if ($isInstanceOf(@, "(Int, Int)"))
10821197 then @
10831198 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
10841199 }
1085- let totalGet = $t03760337718._1
1086- let feeAmount = $t03760337718._2
1200+ let totalGet = $t04080840923._1
1201+ let feeAmount = $t04080840923._2
10871202 let r = ego("", lpId, lpAssetAmount, this)
10881203 let outAmAmt = r._1
10891204 let outPrAmt = r._2
12241339 let factoryCfg = gfc()
12251340 let lpAssetId = fromBase58String(cfg[idxLPAsId])
12261341 let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr")
1227- let userAddress = i.caller
1228- let lpAssetRecipientAddress = this
1229- let unstakeInv = invoke(staking, "unstakeINTERNAL", [lpAssetId, unstakeAmount, userAddress.bytes, lpAssetRecipientAddress.bytes], nil)
1342+ let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), unstakeAmount], nil)
12301343 if ((unstakeInv == unstakeInv))
12311344 then {
1232- let $t04168341871 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1233- let state = $t04168341871._1
1234- let totalAmount = $t04168341871._2
1345+ let $t04476144949 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1346+ let state = $t04476144949._1
1347+ let totalAmount = $t04476144949._2
12351348 $Tuple2(state, totalAmount)
12361349 }
12371350 else throw("Strict value is not equal to itself.")
12471360 let amId = poolConfig[idxAmAsId]
12481361 let prId = poolConfig[idxPrAsId]
12491362 let lpId = poolConfig[idxLPAsId]
1250- let $t04213042233 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1251- let lpAmount = $t04213042233._1
1252- let state = $t04213042233._2
1253- let feeAmount = $t04213042233._3
1254- let bonus = $t04213042233._4
1363+ let $t04520845311 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1364+ let lpAmount = $t04520845311._1
1365+ let state = $t04520845311._2
1366+ let feeAmount = $t04520845311._3
1367+ let bonus = $t04520845311._4
12551368 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
12561369 }
12571370
12631376 let amId = poolConfig[idxAmAsId]
12641377 let prId = poolConfig[idxPrAsId]
12651378 let lpId = poolConfig[idxLPAsId]
1266- let $t04251242616 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1267- let lpAmount = $t04251242616._1
1268- let state = $t04251242616._2
1269- let feeAmount = $t04251242616._3
1270- let bonus = $t04251242616._4
1379+ let $t04559045694 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1380+ let lpAmount = $t04559045694._1
1381+ let state = $t04559045694._2
1382+ let feeAmount = $t04559045694._3
1383+ let bonus = $t04559045694._4
12711384 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
12721385 }
12731386
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 slippage4D = toBigInt((scale8 - ((scale8 * 1) / scale8)))
1919
2020 let wavesString = "WAVES"
2121
2222 let Amult = "100"
2323
2424 let Dconv = "1"
2525
2626 let SEP = "__"
2727
2828 let EMPTY = ""
2929
3030 let PoolActive = 1
3131
3232 let PoolPutDis = 2
3333
3434 let PoolMatcherDis = 3
3535
3636 let PoolShutdown = 4
3737
3838 let idxPoolAddress = 1
3939
4040 let idxPoolSt = 2
4141
4242 let idxLPAsId = 3
4343
4444 let idxAmAsId = 4
4545
4646 let idxPrAsId = 5
4747
4848 let idxAmtAsDcm = 6
4949
5050 let idxPriceAsDcm = 7
5151
5252 let idxIAmtAsId = 8
5353
5454 let idxIPriceAsId = 9
5555
5656 let idxFactStakCntr = 1
5757
5858 let idxFactoryRestCntr = 6
5959
6060 let idxFactSlippCntr = 7
6161
6262 let idxFactGwxRewCntr = 10
6363
6464 let feeDefault = fraction(10, scale8, 10000)
6565
6666 func t1 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
6767
6868
6969 func f1 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
7070
7171
7272 func ts (amt,resScale,curScale) = fraction(amt, resScale, curScale)
7373
7474
7575 func abs (val) = if ((zeroBigInt > val))
7676 then -(val)
7777 else val
7878
7979
8080 func absBigInt (val) = if ((zeroBigInt > val))
8181 then -(val)
8282 else val
8383
8484
8585 func fc () = "%s__factoryContract"
8686
8787
8888 func mpk () = "%s__managerPublicKey"
8989
9090
9191 func pmpk () = "%s__pendingManagerPublicKey"
9292
9393
9494 func pl () = "%s%s__price__last"
9595
9696
9797 func ph (h,t) = makeString(["%s%s%d%d__price__history", toString(h), toString(t)], SEP)
9898
9999
100100 func pau (ua,txId) = ((("%s%s%s__P__" + ua) + "__") + txId)
101101
102102
103103 func gau (ua,txId) = ((("%s%s%s__G__" + ua) + "__") + txId)
104104
105105
106106 func aa () = "%s__amountAsset"
107107
108108
109109 func pa () = "%s__priceAsset"
110110
111111
112112 func amp () = "%s__amp"
113113
114114
115115 func ada () = "%s__addonAddr"
116116
117117
118+func swapContract () = "%s__swapContract"
119+
120+
118121 func fcfg () = "%s__factoryConfig"
119122
120123
121124 func mtpk () = "%s%s__matcher__publicKey"
122125
123126
124127 func pc (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config")
125128
126129
127130 func mba (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr)
128131
129132
130133 func aps () = "%s__shutdown"
131134
132135
133136 func keyAllowedLpStableScriptHash () = "%s__allowedLpStableScriptHash"
134137
135138
136139 func keyFeeCollectorAddress () = "%s__feeCollectorAddress"
137140
138141
139142 func toe (orV,sendrV,matchV) = throw(((((("Failed: ordValid=" + toString(orV)) + " sndrValid=") + toString(sendrV)) + " mtchrValid=") + toString(matchV)))
140143
141144
142145 func str (val) = match val {
143146 case valStr: String =>
144147 valStr
145148 case _ =>
146149 throw("fail cast to String")
147150 }
151+
152+
153+func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined"))
148154
149155
150156 func strf (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
151157
152158
153159 func intf (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
154160
155161
156162 func throwErr (msg) = throw(makeString(["lp_stable.ride:", msg], " "))
157163
158164
159165 let fca = addressFromStringValue(strf(this, fc()))
160166
161167 let inFee = {
162168 let @ = invoke(fca, "getInFeeREADONLY", [toString(this)], nil)
163169 if ($isInstanceOf(@, "Int"))
164170 then @
165171 else throw(($getType(@) + " couldn't be cast to Int"))
166172 }
167173
168174 let outFee = {
169175 let @ = invoke(fca, "getOutFeeREADONLY", [toString(this)], nil)
170176 if ($isInstanceOf(@, "Int"))
171177 then @
172178 else throw(($getType(@) + " couldn't be cast to Int"))
173179 }
174180
175181 let A = strf(this, amp())
176182
177183 func igs () = valueOrElse(getBoolean(fca, aps()), false)
178184
179185
180186 func mp () = fromBase58String(strf(fca, mtpk()))
181187
182188
183189 let feeCollectorAddress = addressFromStringValue(strf(fca, keyFeeCollectorAddress()))
184190
185191 func gpc () = {
186192 let amtAs = strf(this, aa())
187193 let priceAs = strf(this, pa())
188194 let iPriceAs = intf(fca, mba(priceAs))
189195 let iAmtAs = intf(fca, mba(amtAs))
190196 split(strf(fca, pc(toString(iAmtAs), toString(iPriceAs))), SEP)
191197 }
192198
193199
194200 func parseAssetId (input) = if ((input == wavesString))
195201 then unit
196202 else fromBase58String(input)
197203
198204
199205 func assetIdToString (input) = if ((input == unit))
200206 then wavesString
201207 else toBase58String(value(input))
202208
203209
204210 func parsePoolConfig (poolConfig) = $Tuple7(addressFromStringValue(poolConfig[idxPoolAddress]), parseIntValue(poolConfig[idxPoolSt]), fromBase58String(poolConfig[idxLPAsId]), parseAssetId(poolConfig[idxAmAsId]), parseAssetId(poolConfig[idxPrAsId]), parseIntValue(poolConfig[idxAmtAsDcm]), parseIntValue(poolConfig[idxPriceAsDcm]))
205211
206212
207213 let poolConfigParsed = parsePoolConfig(gpc())
208214
209-let $t069097095 = poolConfigParsed
215+let $t070867272 = poolConfigParsed
210216
211-let cfgPoolAddress = $t069097095._1
217+let cfgPoolAddress = $t070867272._1
212218
213-let cfgPoolStatus = $t069097095._2
219+let cfgPoolStatus = $t070867272._2
214220
215-let cfgLpAssetId = $t069097095._3
221+let cfgLpAssetId = $t070867272._3
216222
217-let cfgAmountAssetId = $t069097095._4
223+let cfgAmountAssetId = $t070867272._4
218224
219-let cfgPriceAssetId = $t069097095._5
225+let cfgPriceAssetId = $t070867272._5
220226
221-let cfgAmountAssetDecimals = $t069097095._6
227+let cfgAmountAssetDecimals = $t070867272._6
222228
223-let cfgPriceAssetDecimals = $t069097095._7
229+let cfgPriceAssetDecimals = $t070867272._7
224230
225231 func gfc () = split(strf(fca, fcfg()), SEP)
226232
227233
228234 let factoryConfig = gfc()
229235
230236 let stakingContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactStakCntr]), "Invalid staking contract address")
231237
232238 let slipageContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactSlippCntr]), "Invalid slipage contract address")
233239
234240 let gwxContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactGwxRewCntr]), "Invalid gwx contract address")
235241
236242 let restContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactoryRestCntr]), "Invalid gwx contract address")
237243
238244 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)
239245
240246
241247 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)
242248
243249
244250 func getAccBalance (assetId) = if ((assetId == "WAVES"))
245251 then wavesBalance(this).available
246252 else assetBalance(this, fromBase58String(assetId))
247253
248254
249255 func cpbi (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
250256
251257
252258 func vad (A1,A2,slippage) = {
253259 let diff = fraction((A1 - A2), scale8BigInt, A2)
254260 let pass = ((slippage - abs(diff)) > zeroBigInt)
255261 if (!(pass))
256262 then throw(("Big slpg: " + toString(diff)))
257263 else $Tuple2(pass, min([A1, A2]))
258264 }
259265
260266
261267 func vd (D1,D0,slpg) = {
262268 let diff = fraction(D0, scale8BigInt, D1)
263269 let fail = (slpg > diff)
264270 if (if (fail)
265271 then true
266272 else (D0 > D1))
267273 then throw(((((((toString(D0) + " ") + toString(D1)) + " ") + toString(diff)) + " ") + toString(slpg)))
268274 else fail
269275 }
270276
271277
272278 func pcp (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
273279 let amtAsAmtX18 = t1(amAmt, amAssetDcm)
274280 let prAsAmtX18 = t1(prAmt, prAssetDcm)
275281 cpbi(prAsAmtX18, amtAsAmtX18)
276282 }
277283
278284
279285 func calcPrices (amAmt,prAmt,lpAmt) = {
280286 let cfg = gpc()
281287 let amtAsDcm = parseIntValue(cfg[idxAmtAsDcm])
282288 let prAsDcm = parseIntValue(cfg[idxPriceAsDcm])
283289 let priceX18 = pcp(amtAsDcm, prAsDcm, amAmt, prAmt)
284290 let amAmtX18 = t1(amAmt, amtAsDcm)
285291 let prAmtX18 = t1(prAmt, prAsDcm)
286292 let lpAmtX18 = t1(lpAmt, scale8)
287293 let lpPrInAmAsX18 = cpbi(amAmtX18, lpAmtX18)
288294 let lpPrInPrAsX18 = cpbi(prAmtX18, lpAmtX18)
289295 [priceX18, lpPrInAmAsX18, lpPrInPrAsX18]
290296 }
291297
292298
293299 func calculatePrices (amAmt,prAmt,lpAmt) = {
294300 let p = calcPrices(amAmt, prAmt, lpAmt)
295301 [f1(p[0], scale8), f1(p[1], scale8), f1(p[2], scale8)]
296302 }
297303
298304
299305 func takeFee (amount,fee) = {
300306 let feeAmount = if ((fee == 0))
301307 then 0
302308 else fraction(amount, fee, scale8)
303309 $Tuple2((amount - feeAmount), feeAmount)
304310 }
305311
306312
307313 func ego (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
308314 let cfg = gpc()
309315 let lpId = cfg[idxLPAsId]
310316 let amId = cfg[idxAmAsId]
311317 let prId = cfg[idxPrAsId]
312318 let amDcm = parseIntValue(cfg[idxAmtAsDcm])
313319 let prDcm = parseIntValue(cfg[idxPriceAsDcm])
314320 let sts = cfg[idxPoolSt]
315321 let lpEmiss = valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "Wrong LP id").quantity
316322 if ((lpId != pmtAssetId))
317323 then throw("Wrong pmt asset")
318324 else {
319325 let amBalance = getAccBalance(amId)
320326 let amBalanceX18 = t1(amBalance, amDcm)
321327 let prBalance = getAccBalance(prId)
322328 let prBalanceX18 = t1(prBalance, prDcm)
323329 let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
324330 let curPrice = f1(curPriceX18, scale8)
325331 let pmtLpAmtX18 = t1(pmtLpAmt, scale8)
326332 let lpEmissX18 = t1(lpEmiss, scale8)
327333 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissX18)
328334 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissX18)
329335 let outAmAmt = f1(outAmAmtX18, amDcm)
330336 let outPrAmt = f1(outPrAmtX18, prDcm)
331337 let state = if ((txId58 == ""))
332338 then nil
333339 else [ScriptTransfer(userAddress, outAmAmt, if ((amId == "WAVES"))
334340 then unit
335341 else fromBase58String(amId)), ScriptTransfer(userAddress, outPrAmt, if ((prId == "WAVES"))
336342 then unit
337343 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)]
338344 $Tuple10(outAmAmt, outPrAmt, amId, prId, amBalance, prBalance, lpEmiss, curPriceX18, sts, state)
339345 }
340346 }
341347
342348
343349 func epo (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEval,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = {
344350 let cfg = gpc()
345351 let lpId = fromBase58String(cfg[idxLPAsId])
346352 let amIdStr = cfg[idxAmAsId]
347353 let prIdStr = cfg[idxPrAsId]
348354 let inAmIdStr = cfg[idxIAmtAsId]
349355 let inPrIdStr = cfg[idxIPriceAsId]
350356 let amtDcm = parseIntValue(cfg[idxAmtAsDcm])
351357 let priceDcm = parseIntValue(cfg[idxPriceAsDcm])
352358 let sts = cfg[idxPoolSt]
353359 let lpEm = valueOrErrorMessage(assetInfo(lpId), "Wr lp as").quantity
354360 let amBalance = if (isEval)
355361 then getAccBalance(amIdStr)
356362 else if (if (isOneAsset)
357363 then (pmtId == amIdStr)
358364 else false)
359365 then (getAccBalance(amIdStr) - pmtAmt)
360366 else if (isOneAsset)
361367 then getAccBalance(amIdStr)
362368 else (getAccBalance(amIdStr) - inAmAmt)
363369 let prBalance = if (isEval)
364370 then getAccBalance(prIdStr)
365371 else if (if (isOneAsset)
366372 then (pmtId == prIdStr)
367373 else false)
368374 then (getAccBalance(prIdStr) - pmtAmt)
369375 else if (isOneAsset)
370376 then getAccBalance(prIdStr)
371377 else (getAccBalance(prIdStr) - inPrAmt)
372378 let inAmAssetAmtX18 = t1(inAmAmt, amtDcm)
373379 let inPrAssetAmtX18 = t1(inPrAmt, priceDcm)
374380 let userPriceX18 = cpbi(inPrAssetAmtX18, inAmAssetAmtX18)
375381 let amBalanceX18 = t1(amBalance, amtDcm)
376382 let prBalanceX18 = t1(prBalance, priceDcm)
377383 let r = if ((lpEm == 0))
378384 then {
379385 let curPriceX18 = zeroBigInt
380386 let slippageX18 = zeroBigInt
381387 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
382388 $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
383389 }
384390 else {
385391 let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
386392 let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18)
387393 let slippageX18 = t1(slippage, scale8)
388394 if (if (if (validateSlippage)
389395 then (curPriceX18 != zeroBigInt)
390396 else false)
391397 then (slippageRealX18 > slippageX18)
392398 else false)
393399 then throw(((("Price slippage " + toString(slippageRealX18)) + " > ") + toString(slippageX18)))
394400 else {
395401 let lpEmissionX18 = t1(lpEm, scale8)
396402 let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
397403 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
398404 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
399405 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
400406 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
401407 let expAmtAssetAmtX18 = expectedAmts._1
402408 let expPriceAssetAmtX18 = expectedAmts._2
403409 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18)
404410 $Tuple5(f1(lpAmtX18, scale8), f1(expAmtAssetAmtX18, amtDcm), f1(expPriceAssetAmtX18, priceDcm), curPriceX18, slippageX18)
405411 }
406412 }
407413 let calcLpAmt = r._1
408414 let calcAmAssetPmt = r._2
409415 let calcPrAssetPmt = r._3
410416 let curPrice = f1(r._4, scale8)
411417 let slippageCalc = f1(r._5, scale8)
412418 if ((0 >= calcLpAmt))
413419 then throw("LP <= 0")
414420 else {
415421 let emitLpAmt = if (!(emitLp))
416422 then 0
417423 else calcLpAmt
418424 let amDiff = (inAmAmt - calcAmAssetPmt)
419425 let prDiff = (inPrAmt - calcPrAssetPmt)
420- let $t01756217907 = if (if (isOneAsset)
426+ let $t01773918084 = if (if (isOneAsset)
421427 then (pmtId == amIdStr)
422428 else false)
423429 then $Tuple2(pmtAmt, 0)
424430 else if (if (isOneAsset)
425431 then (pmtId == prIdStr)
426432 else false)
427433 then $Tuple2(0, pmtAmt)
428434 else $Tuple2(calcAmAssetPmt, calcPrAssetPmt)
429- let writeAmAmt = $t01756217907._1
430- let writePrAmt = $t01756217907._2
435+ let writeAmAmt = $t01773918084._1
436+ let writePrAmt = $t01773918084._2
431437 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))]
432438 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId)
433439 }
434440 }
435441
436442
437443 func moa (order) = {
438444 let cfg = gpc()
439445 let amtAsId = cfg[idxAmAsId]
440446 let prAsId = cfg[idxPrAsId]
441447 let sts = parseIntValue(cfg[idxPoolSt])
442448 let amtAsDcm = parseIntValue(cfg[idxAmtAsDcm])
443449 let prAsDcm = parseIntValue(cfg[idxPriceAsDcm])
444450 let accAmtAsBalance = getAccBalance(amtAsId)
445451 let accPrAsBalance = getAccBalance(prAsId)
446452 let curPriceX18 = if ((order.orderType == Buy))
447453 then pcp(amtAsDcm, prAsDcm, (accAmtAsBalance + order.amount), accPrAsBalance)
448454 else pcp(amtAsDcm, prAsDcm, (accAmtAsBalance - order.amount), accPrAsBalance)
449455 let curPrice = f1(curPriceX18, scale8)
450456 if (if (if (igs())
451457 then true
452458 else (sts == PoolMatcherDis))
453459 then true
454460 else (sts == PoolShutdown))
455461 then throw("Admin blocked")
456462 else {
457463 let orAmtAsset = order.assetPair.amountAsset
458464 let orAmtAsStr = if ((orAmtAsset == unit))
459465 then "WAVES"
460466 else toBase58String(value(orAmtAsset))
461467 let orPrAsset = order.assetPair.priceAsset
462468 let orPrAsStr = if ((orPrAsset == unit))
463469 then "WAVES"
464470 else toBase58String(value(orPrAsset))
465471 if (if ((orAmtAsStr != amtAsId))
466472 then true
467473 else (orPrAsStr != prAsId))
468474 then throw("Wr assets")
469475 else {
470476 let orderPrice = order.price
471477 let priceDcm = fraction(scale8, prAsDcm, amtAsDcm)
472478 let castOrderPrice = ts(orderPrice, scale8, priceDcm)
473479 let isOrderPriceValid = if ((order.orderType == Buy))
474480 then (curPrice >= castOrderPrice)
475481 else (castOrderPrice >= curPrice)
476482 true
477483 }
478484 }
479485 }
480486
481487
482488 func cg (i) = if ((size(i.payments) != 1))
483489 then throw("1 pmnt exp")
484490 else {
485491 let pmt = value(i.payments[0])
486492 let pmtAssetId = value(pmt.assetId)
487493 let pmtAmt = pmt.amount
488494 let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
489495 let outAmAmt = r._1
490496 let outPrAmt = r._2
491497 let sts = parseIntValue(r._9)
492498 let state = r._10
493499 if (if (igs())
494500 then true
495501 else (sts == PoolShutdown))
496502 then throw(("Admin blocked: " + toString(sts)))
497503 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
498504 }
499505
500506
501507 func cp (caller,txId,amAsPmt,prAsPmt,slippage,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = {
502508 let r = epo(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, (txId == ""), emitLp, isOneAsset, validateSlippage, pmtAmt, pmtId)
503509 let sts = parseIntValue(r._8)
504510 if (if (if (igs())
505511 then true
506512 else (sts == PoolPutDis))
507513 then true
508514 else (sts == PoolShutdown))
509515 then throw(("Blocked:" + toString(sts)))
510516 else r
511517 }
512518
513519
514520 func getD (xp) = {
515521 let n = big2
516522 let xp0 = xp[0]
517523 let xp1 = xp[1]
518524 let aPrecision = parseBigIntValue(Amult)
519525 let a = (parseBigIntValue(A) * aPrecision)
520526 let s = (xp0 + xp1)
521527 if ((s == big0))
522528 then big0
523529 else {
524530 let ann = (a * n)
525531 let xp0_xp1_n_n = (((xp0 * xp1) * n) * n)
526532 let ann_s_aPrecision = ((ann * s) / aPrecision)
527533 let ann_aPrecision = (ann - aPrecision)
528534 let n1 = (n + big1)
529535 func calc (acc,cur) = {
530- let $t02245922479 = acc
531- let d = $t02245922479._1
532- let found = $t02245922479._2
536+ let $t02263622656 = acc
537+ let d = $t02263622656._1
538+ let found = $t02263622656._2
533539 if ((found != unit))
534540 then acc
535541 else {
536542 let dp = (((d * d) * d) / xp0_xp1_n_n)
537543 let dNext = (((ann_s_aPrecision + (dp * n)) * d) / (((ann_aPrecision * d) / aPrecision) + (n1 * dp)))
538544 let dDiff = absBigInt((dNext - value(d)))
539545 if ((big1 >= dDiff))
540546 then $Tuple2(dNext, cur)
541547 else $Tuple2(dNext, unit)
542548 }
543549 }
544550
545551 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
546- let $t02290022947 = {
552+ let $t02307723124 = {
547553 let $l = arr
548554 let $s = size($l)
549555 let $acc0 = $Tuple2(s, unit)
550556 func $f0_1 ($a,$i) = if (($i >= $s))
551557 then $a
552558 else calc($a, $l[$i])
553559
554560 func $f0_2 ($a,$i) = if (($i >= $s))
555561 then $a
556562 else throw("List size exceeds 15")
557563
558564 $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)
559565 }
560- let d = $t02290022947._1
561- let found = $t02290022947._2
566+ let d = $t02307723124._1
567+ let found = $t02307723124._2
562568 if ((found != unit))
563569 then d
564570 else throw(("D calculation error, D = " + toString(d)))
565571 }
566572 }
567573
568574
569575 func getYD (xp,i,D) = {
570576 let n = big2
571577 let x = xp[if ((i == 0))
572578 then 1
573579 else 0]
574580 let aPrecision = parseBigIntValue(Amult)
575581 let a = (parseBigIntValue(A) * aPrecision)
576582 let s = x
577583 let ann = (a * n)
578584 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
579585 let b = ((s + ((D * aPrecision) / ann)) - D)
580586 func calc (acc,cur) = {
581- let $t02344723467 = acc
582- let y = $t02344723467._1
583- let found = $t02344723467._2
587+ let $t02362423644 = acc
588+ let y = $t02362423644._1
589+ let found = $t02362423644._2
584590 if ((found != unit))
585591 then acc
586592 else {
587593 let yNext = (((y * y) + c) / ((big2 * y) + b))
588594 let yDiff = absBigInt((yNext - value(y)))
589595 if ((big1 >= yDiff))
590596 then $Tuple2(yNext, cur)
591597 else $Tuple2(yNext, unit)
592598 }
593599 }
594600
595601 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
596- let $t02377423821 = {
602+ let $t02395123998 = {
597603 let $l = arr
598604 let $s = size($l)
599605 let $acc0 = $Tuple2(D, unit)
600606 func $f0_1 ($a,$i) = if (($i >= $s))
601607 then $a
602608 else calc($a, $l[$i])
603609
604610 func $f0_2 ($a,$i) = if (($i >= $s))
605611 then $a
606612 else throw("List size exceeds 15")
607613
608614 $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)
609615 }
610- let y = $t02377423821._1
611- let found = $t02377423821._2
616+ let y = $t02395123998._1
617+ let found = $t02395123998._2
612618 if ((found != unit))
613619 then y
614620 else throw(("Y calculation error, Y = " + toString(y)))
615621 }
616622
617623
618624 func calcPutOneTkn (pmtAmtRaw,pmtAssetId,userAddress,txId,withTakeFee) = {
619625 let poolConfig = gpc()
620626 let amId = poolConfig[idxAmAsId]
621627 let prId = poolConfig[idxPrAsId]
622628 let lpId = poolConfig[idxLPAsId]
623629 let amtDcm = parseIntValue(poolConfig[idxAmtAsDcm])
624630 let priceDcm = parseIntValue(poolConfig[idxPriceAsDcm])
625631 let lpAssetEmission = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "invalid lp asset").quantity)
626632 let chechEmission = if ((lpAssetEmission > big0))
627633 then true
628634 else throw("initial deposit requires all coins")
629635 if ((chechEmission == chechEmission))
630636 then {
631637 let amBalance = getAccBalance(amId)
632638 let prBalance = getAccBalance(prId)
633- let $t02460425066 = if ((txId == ""))
639+ let $t02478125243 = if ((txId == ""))
634640 then $Tuple2(amBalance, prBalance)
635641 else if ((pmtAssetId == amId))
636642 then if ((pmtAmtRaw > amBalance))
637643 then throw("invalid payment amount")
638644 else $Tuple2((amBalance - pmtAmtRaw), prBalance)
639645 else if ((pmtAssetId == prId))
640646 then if ((pmtAmtRaw > prBalance))
641647 then throw("invalid payment amount")
642648 else $Tuple2(amBalance, (prBalance - pmtAmtRaw))
643649 else throw("wrong pmtAssetId")
644- let amBalanceOld = $t02460425066._1
645- let prBalanceOld = $t02460425066._2
646- let $t02507225248 = if ((pmtAssetId == amId))
650+ let amBalanceOld = $t02478125243._1
651+ let prBalanceOld = $t02478125243._2
652+ let $t02524925425 = if ((pmtAssetId == amId))
647653 then $Tuple2(pmtAmtRaw, 0)
648654 else if ((pmtAssetId == prId))
649655 then $Tuple2(0, pmtAmtRaw)
650656 else throw("invalid payment")
651- let amAmountRaw = $t02507225248._1
652- let prAmountRaw = $t02507225248._2
653- let $t02525225506 = if (withTakeFee)
657+ let amAmountRaw = $t02524925425._1
658+ let prAmountRaw = $t02524925425._2
659+ let $t02542925683 = if (withTakeFee)
654660 then $Tuple3(takeFee(amAmountRaw, inFee)._1, takeFee(prAmountRaw, inFee)._1, takeFee(pmtAmtRaw, inFee)._2)
655661 else $Tuple3(amAmountRaw, prAmountRaw, 0)
656- let amAmount = $t02525225506._1
657- let prAmount = $t02525225506._2
658- let feeAmount = $t02525225506._3
662+ let amAmount = $t02542925683._1
663+ let prAmount = $t02542925683._2
664+ let feeAmount = $t02542925683._3
659665 let amBalanceNew = (amBalanceOld + amAmount)
660666 let prBalanceNew = (prBalanceOld + prAmount)
661667 let D0 = getD([toBigInt(amBalanceOld), toBigInt(prBalanceOld)])
662668 let D1 = getD([toBigInt(amBalanceNew), toBigInt(prBalanceNew)])
663669 let checkD = if ((D1 > D0))
664670 then true
665671 else throw()
666672 if ((checkD == checkD))
667673 then {
668674 let lpAmount = fraction(lpAssetEmission, (D1 - D0), D0)
669675 let curPrice = f1(cpbi(t1(prBalanceNew, priceDcm), t1(amBalanceNew, amtDcm)), scale8)
670676 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))]
671677 let poolProportion = fraction(prBalanceOld, scale8, amBalanceOld)
672678 let amountAssetPart = fraction(pmtAmtRaw, scale8, (poolProportion + scale8))
673679 let priceAssetPart = (pmtAmtRaw - amountAssetPart)
674680 let lpAmtBoth = fraction(lpAssetEmission, toBigInt(priceAssetPart), toBigInt(prBalanceOld))
675681 let bonus = toInt(fraction((lpAmount - lpAmtBoth), scale8BigInt, lpAmtBoth))
676682 $Tuple4(toInt(lpAmount), commonState, feeAmount, bonus)
677683 }
678684 else throw("Strict value is not equal to itself.")
679685 }
680686 else throw("Strict value is not equal to itself.")
681687 }
682688
683689
684690 func getOneTknV2Internal (outAssetId,minOutAmount,payments,caller,originCaller,transactionId) = {
685691 let poolConfig = gpc()
686692 let lpId = poolConfig[idxLPAsId]
687693 let amId = poolConfig[idxAmAsId]
688694 let prId = poolConfig[idxPrAsId]
689695 let amDecimals = parseIntValue(poolConfig[idxAmtAsDcm])
690696 let prDecimals = parseIntValue(poolConfig[idxPriceAsDcm])
691697 let poolStatus = poolConfig[idxPoolSt]
692698 let userAddress = if ((caller == restContract))
693699 then originCaller
694700 else caller
695701 let pmt = value(payments[0])
696702 let pmtAssetId = value(pmt.assetId)
697703 let pmtAmt = pmt.amount
698704 let txId58 = toBase58String(transactionId)
699705 if ((lpId != toBase58String(pmtAssetId)))
700706 then throw("Wrong LP")
701707 else {
702708 let amBalance = getAccBalance(amId)
703709 let prBalance = getAccBalance(prId)
704- let $t02750827619 = {
710+ let $t02768527796 = {
705711 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil)
706712 if ($isInstanceOf(@, "(Int, Int)"))
707713 then @
708714 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
709715 }
710- if (($t02750827619 == $t02750827619))
716+ if (($t02768527796 == $t02768527796))
711717 then {
712- let feeAmount = $t02750827619._2
713- let totalGet = $t02750827619._1
718+ let feeAmount = $t02768527796._2
719+ let totalGet = $t02768527796._1
714720 let totalAmount = if (if ((minOutAmount > 0))
715721 then (minOutAmount > totalGet)
716722 else false)
717723 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
718724 else totalGet
719- let $t02780928116 = if ((outAssetId == amId))
725+ let $t02798628293 = if ((outAssetId == amId))
720726 then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance)
721727 else if ((outAssetId == prId))
722728 then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount))
723729 else throw("invalid out asset id")
724- let outAm = $t02780928116._1
725- let outPr = $t02780928116._2
726- let amBalanceNew = $t02780928116._3
727- let prBalanceNew = $t02780928116._4
730+ let outAm = $t02798628293._1
731+ let outPr = $t02798628293._2
732+ let amBalanceNew = $t02798628293._3
733+ let prBalanceNew = $t02798628293._4
728734 let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals))
729735 let curPr = f1(curPrX18, scale8)
730736 let outAssetIdOrWaves = if ((outAssetId == "WAVES"))
731737 then unit
732738 else fromBase58String(outAssetId)
733739 let sendFeeToMatcher = if ((feeAmount > 0))
734740 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetIdOrWaves)]
735741 else nil
736742 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)
737743 if ((state == state))
738744 then {
739745 let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
740746 if ((burn == burn))
741747 then $Tuple2(state, totalAmount)
742748 else throw("Strict value is not equal to itself.")
743749 }
744750 else throw("Strict value is not equal to itself.")
745751 }
746752 else throw("Strict value is not equal to itself.")
747753 }
748754 }
749755
750756
751757 func m () = match getString(mpk()) {
752758 case s: String =>
753759 fromBase58String(s)
754760 case _: Unit =>
755761 unit
756762 case _ =>
757763 throw("Match error")
758764 }
759765
760766
761767 func pm () = match getString(pmpk()) {
762768 case s: String =>
763769 fromBase58String(s)
764770 case _: Unit =>
765771 unit
766772 case _ =>
767773 throw("Match error")
768774 }
769775
770776
771777 let pd = throw("Permission denied")
772778
773779 func isManager (i) = match m() {
774780 case pk: ByteVector =>
775781 (i.callerPublicKey == pk)
776782 case _: Unit =>
777783 (i.caller == this)
778784 case _ =>
779785 throw("Match error")
780786 }
781787
782788
783789 func mm (i) = match m() {
784790 case pk: ByteVector =>
785791 if ((i.callerPublicKey == pk))
786792 then true
787793 else pd
788794 case _: Unit =>
789795 if ((i.caller == this))
790796 then true
791797 else pd
792798 case _ =>
793799 throw("Match error")
794800 }
801+
802+
803+func getY (isReverse,D,poolAmountInBalance) = {
804+ let poolConfig = gpc()
805+ let amId = poolConfig[idxAmAsId]
806+ let prId = poolConfig[idxPrAsId]
807+ let n = big2
808+ let aPrecision = parseBigIntValue(Amult)
809+ let a = (parseBigIntValue(A) * aPrecision)
810+ let xp = if ((isReverse == false))
811+ then [(toBigInt(getAccBalance(amId)) - poolAmountInBalance), toBigInt(getAccBalance(prId))]
812+ else [(toBigInt(getAccBalance(prId)) - poolAmountInBalance), toBigInt(getAccBalance(amId))]
813+ let x = xp[0]
814+ let s = x
815+ let ann = (a * n)
816+ let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
817+ let b = ((s + ((D * aPrecision) / ann)) - D)
818+ func calc (acc,cur) = {
819+ let $t03043030450 = acc
820+ let y = $t03043030450._1
821+ let found = $t03043030450._2
822+ if ((found != unit))
823+ then acc
824+ else {
825+ let yNext = (((y * y) + c) / ((big2 * y) + b))
826+ let yDiff = absBigInt((yNext - value(y)))
827+ if ((big1 >= yDiff))
828+ then $Tuple2(yNext, cur)
829+ else $Tuple2(yNext, unit)
830+ }
831+ }
832+
833+ let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
834+ let $t03078130828 = {
835+ let $l = arr
836+ let $s = size($l)
837+ let $acc0 = $Tuple2(D, unit)
838+ func $f0_1 ($a,$i) = if (($i >= $s))
839+ then $a
840+ else calc($a, $l[$i])
841+
842+ func $f0_2 ($a,$i) = if (($i >= $s))
843+ then $a
844+ else throw("List size exceeds 15")
845+
846+ $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)
847+ }
848+ let y = $t03078130828._1
849+ let found = $t03078130828._2
850+ if ((found != unit))
851+ then y
852+ else throw(("Y calculation error, Y = " + toString(y)))
853+ }
854+
855+
856+@Callable(i)
857+func calculateAmountOutForSwapAndSendTokens (cleanAmountIn,isReverse,amountOutMin,addressTo) = {
858+ let checks = [if ((value(i.payments[0]).amount >= cleanAmountIn))
859+ then true
860+ else throwErr("Wrong amount"), if ((i.caller == addressFromStringValue(getStringOrFail(swapContract()))))
861+ then true
862+ else throwErr("Permission denied")]
863+ if ((checks == checks))
864+ then {
865+ let pmt = value(i.payments[0])
866+ let assetIn = toBase58String(value(pmt.assetId))
867+ let $t03138931852 = if ((isReverse == false))
868+ then {
869+ let index = 1
870+ let assetOut = getStringOrFail(pa())
871+ let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
872+ $Tuple3(assetOut, index, poolAmountInBalance)
873+ }
874+ else {
875+ let index = 0
876+ let assetOut = getStringOrFail(aa())
877+ let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
878+ $Tuple3(assetOut, index, poolAmountInBalance)
879+ }
880+ let assetOut = $t03138931852._1
881+ let index = $t03138931852._2
882+ let poolAmountInBalance = $t03138931852._3
883+ let poolConfig = gpc()
884+ let amId = poolConfig[idxAmAsId]
885+ let prId = poolConfig[idxPrAsId]
886+ let xp = [(toBigInt(getAccBalance(amId)) - toBigInt(value(i.payments[0]).amount)), toBigInt(getAccBalance(prId))]
887+ let D = getD(xp)
888+ let y = getY(isReverse, D, toBigInt(poolAmountInBalance))
889+ let x = (toBigInt(poolAmountInBalance) + toBigInt(cleanAmountIn))
890+ let dy = ((toBigInt(getAccBalance(assetOut)) - y) - toBigInt(1))
891+ let totalGetRaw = max([0, toInt(dy)])
892+ let checkMin = [(amountOutMin >= totalGetRaw), throw("Exchange resulted in fewer coins than expected")]
893+ if ((checkMin == checkMin))
894+ then [ScriptTransfer(addressFromStringValue(addressTo), toInt(dy), fromBase58String(assetOut))]
895+ else throw("Strict value is not equal to itself.")
896+ }
897+ else throw("Strict value is not equal to itself.")
898+ }
899+
900+
901+
902+@Callable(i)
903+func setSwapContract (swappAddr) = {
904+ let checkCaller = mm(i)
905+ if ((checkCaller == checkCaller))
906+ then [StringEntry(swapContract(), swappAddr)]
907+ else throw("Strict value is not equal to itself.")
908+ }
909+
795910
796911
797912 @Callable(i)
798913 func constructor (fc) = {
799914 let c = mm(i)
800915 if ((c == c))
801916 then [StringEntry(fc(), fc)]
802917 else throw("Strict value is not equal to itself.")
803918 }
804919
805920
806921
807922 @Callable(i)
808923 func setManager (pendingManagerPublicKey) = {
809924 let c = mm(i)
810925 if ((c == c))
811926 then {
812927 let cm = fromBase58String(pendingManagerPublicKey)
813928 if ((cm == cm))
814929 then [StringEntry(pmpk(), pendingManagerPublicKey)]
815930 else throw("Strict value is not equal to itself.")
816931 }
817932 else throw("Strict value is not equal to itself.")
818933 }
819934
820935
821936
822937 @Callable(i)
823938 func confirmManager () = {
824939 let p = pm()
825940 let hpm = if (isDefined(p))
826941 then true
827942 else throw("No pending manager")
828943 if ((hpm == hpm))
829944 then {
830945 let cpm = if ((i.callerPublicKey == value(p)))
831946 then true
832947 else throw("You are not pending manager")
833948 if ((cpm == cpm))
834949 then [StringEntry(mpk(), toBase58String(value(p))), DeleteEntry(pmpk())]
835950 else throw("Strict value is not equal to itself.")
836951 }
837952 else throw("Strict value is not equal to itself.")
838953 }
839954
840955
841956
842957 @Callable(i)
843958 func put (slip,autoStake) = {
844959 let factCfg = gfc()
845960 let stakingCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactStakCntr]), "Wr st addr")
846961 let slipCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactSlippCntr]), "Wr sl addr")
847962 if ((0 > slip))
848963 then throw("Wrong slippage")
849964 else if ((size(i.payments) != 2))
850965 then throw("2 pmnts expd")
851966 else {
852967 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, "")
853968 let emitLpAmt = e._2
854969 let lpAssetId = e._7
855970 let state = e._9
856971 let amDiff = e._10
857972 let prDiff = e._11
858973 let amId = e._12
859974 let prId = e._13
860975 let r = invoke(fca, "emit", [emitLpAmt], nil)
861976 if ((r == r))
862977 then {
863978 let el = match r {
864979 case legacy: Address =>
865980 invoke(legacy, "emit", [emitLpAmt], nil)
866981 case _ =>
867982 unit
868983 }
869984 if ((el == el))
870985 then {
871986 let sa = if ((amDiff > 0))
872987 then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)])
873988 else nil
874989 if ((sa == sa))
875990 then {
876991 let sp = if ((prDiff > 0))
877992 then invoke(slipCntr, "put", nil, [AttachedPayment(prId, prDiff)])
878993 else nil
879994 if ((sp == sp))
880995 then {
881996 let lpTrnsfr = if (autoStake)
882997 then {
883998 let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
884999 if ((ss == ss))
8851000 then nil
8861001 else throw("Strict value is not equal to itself.")
8871002 }
8881003 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
8891004 (state ++ lpTrnsfr)
8901005 }
8911006 else throw("Strict value is not equal to itself.")
8921007 }
8931008 else throw("Strict value is not equal to itself.")
8941009 }
8951010 else throw("Strict value is not equal to itself.")
8961011 }
8971012 else throw("Strict value is not equal to itself.")
8981013 }
8991014 }
9001015
9011016
9021017
9031018 @Callable(i)
9041019 func putOneTknV2 (minOutAmount,autoStake) = {
9051020 let isPoolOneTokenOperationsDisabled = {
9061021 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
9071022 if ($isInstanceOf(@, "Boolean"))
9081023 then @
9091024 else throw(($getType(@) + " couldn't be cast to Boolean"))
9101025 }
9111026 let isPutDisabled = if (if (if (igs())
9121027 then true
9131028 else (cfgPoolStatus == PoolPutDis))
9141029 then true
9151030 else (cfgPoolStatus == PoolShutdown))
9161031 then true
9171032 else isPoolOneTokenOperationsDisabled
9181033 let checks = [if (if (!(isPutDisabled))
9191034 then true
9201035 else isManager(i))
9211036 then true
9221037 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
9231038 then true
9241039 else throwErr("exactly 1 payment are expected")]
9251040 if ((checks == checks))
9261041 then {
9271042 let poolConfig = gpc()
9281043 let amId = poolConfig[idxAmAsId]
9291044 let prId = poolConfig[idxPrAsId]
9301045 let lpId = fromBase58String(poolConfig[idxLPAsId])
9311046 let amDecimals = parseIntValue(poolConfig[idxAmtAsDcm])
9321047 let prDecimals = parseIntValue(poolConfig[idxPriceAsDcm])
9331048 let userAddress = if ((i.caller == this))
9341049 then i.originCaller
9351050 else i.caller
9361051 let pmt = value(i.payments[0])
9371052 let pmtAssetId = toBase58String(value(pmt.assetId))
9381053 let pmtAmt = pmt.amount
939- let $t03347833636 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
940- if (($t03347833636 == $t03347833636))
1054+ let $t03668336841 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1055+ if (($t03668336841 == $t03668336841))
9411056 then {
942- let feeAmount = $t03347833636._3
943- let state = $t03347833636._2
944- let estimLP = $t03347833636._1
1057+ let feeAmount = $t03668336841._3
1058+ let state = $t03668336841._2
1059+ let estimLP = $t03668336841._1
9451060 let emitLpAmt = if (if ((minOutAmount > 0))
9461061 then (minOutAmount > estimLP)
9471062 else false)
9481063 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
9491064 else estimLP
9501065 let e = invoke(fca, "emit", [emitLpAmt], nil)
9511066 if ((e == e))
9521067 then {
9531068 let el = match e {
9541069 case legacy: Address =>
9551070 invoke(legacy, "emit", [emitLpAmt], nil)
9561071 case _ =>
9571072 unit
9581073 }
9591074 if ((el == el))
9601075 then {
9611076 let lpTrnsfr = if (autoStake)
9621077 then {
9631078 let ss = invoke(stakingContract, "stake", nil, [AttachedPayment(lpId, emitLpAmt)])
9641079 if ((ss == ss))
9651080 then nil
9661081 else throw("Strict value is not equal to itself.")
9671082 }
9681083 else [ScriptTransfer(i.caller, emitLpAmt, lpId)]
9691084 let sendFeeToMatcher = if ((feeAmount > 0))
9701085 then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))]
9711086 else nil
9721087 $Tuple2(((state ++ lpTrnsfr) ++ sendFeeToMatcher), emitLpAmt)
9731088 }
9741089 else throw("Strict value is not equal to itself.")
9751090 }
9761091 else throw("Strict value is not equal to itself.")
9771092 }
9781093 else throw("Strict value is not equal to itself.")
9791094 }
9801095 else throw("Strict value is not equal to itself.")
9811096 }
9821097
9831098
9841099
9851100 @Callable(i)
9861101 func putForFree (maxSlpg) = if ((0 > maxSlpg))
9871102 then throw("Wrong slpg")
9881103 else if ((size(i.payments) != 2))
9891104 then throw("2 pmnts expd")
9901105 else {
9911106 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, "")
9921107 estPut._9
9931108 }
9941109
9951110
9961111
9971112 @Callable(i)
9981113 func get () = {
9991114 let r = cg(i)
10001115 let outAmtAmt = r._1
10011116 let outPrAmt = r._2
10021117 let pmtAmt = r._3
10031118 let pmtAssetId = r._4
10041119 let state = r._5
10051120 let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10061121 if ((b == b))
10071122 then state
10081123 else throw("Strict value is not equal to itself.")
10091124 }
10101125
10111126
10121127
10131128 @Callable(i)
10141129 func getOneTknV2 (outAssetId,minOutAmount) = {
10151130 let isPoolOneTokenOperationsDisabled = {
10161131 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
10171132 if ($isInstanceOf(@, "Boolean"))
10181133 then @
10191134 else throw(($getType(@) + " couldn't be cast to Boolean"))
10201135 }
10211136 let isGetDisabled = if (if (igs())
10221137 then true
10231138 else (cfgPoolStatus == PoolShutdown))
10241139 then true
10251140 else isPoolOneTokenOperationsDisabled
10261141 let checks = [if (if (!(isGetDisabled))
10271142 then true
10281143 else isManager(i))
10291144 then true
10301145 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
10311146 then true
10321147 else throwErr("exactly 1 payment are expected")]
10331148 if ((checks == checks))
10341149 then {
1035- let $t03625836413 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1036- let state = $t03625836413._1
1037- let totalAmount = $t03625836413._2
1150+ let $t03946339618 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1151+ let state = $t03946339618._1
1152+ let totalAmount = $t03946339618._2
10381153 $Tuple2(state, totalAmount)
10391154 }
10401155 else throw("Strict value is not equal to itself.")
10411156 }
10421157
10431158
10441159
10451160 @Callable(i)
10461161 func getOneTknV2READONLY (outAssetId,lpAssetAmount) = {
10471162 let poolConfig = gpc()
10481163 let amId = poolConfig[idxAmAsId]
10491164 let prId = poolConfig[idxPrAsId]
10501165 let lpId = poolConfig[idxLPAsId]
10511166 let xp = [toBigInt(getAccBalance(amId)), toBigInt(getAccBalance(prId))]
10521167 let lpEmission = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "invalid lp asset").quantity)
10531168 let D0 = getD(xp)
10541169 let D1 = (D0 - fraction(toBigInt(lpAssetAmount), D0, lpEmission))
10551170 let index = if ((outAssetId == amId))
10561171 then 0
10571172 else if ((outAssetId == prId))
10581173 then 1
10591174 else throw("invalid out asset id")
10601175 let newY = getYD(xp, index, D1)
10611176 let dy = (xp[index] - newY)
10621177 let totalGetRaw = max([0, toInt((dy - big1))])
1063- let $t03720337258 = takeFee(totalGetRaw, outFee)
1064- let totalGet = $t03720337258._1
1065- let feeAmount = $t03720337258._2
1178+ let $t04040840463 = takeFee(totalGetRaw, outFee)
1179+ let totalGet = $t04040840463._1
1180+ let feeAmount = $t04040840463._2
10661181 $Tuple2(nil, $Tuple2(totalGet, feeAmount))
10671182 }
10681183
10691184
10701185
10711186 @Callable(i)
10721187 func getOneTknV2WithBonusREADONLY (outAssetId,lpAssetAmount) = {
10731188 let poolConfig = gpc()
10741189 let amId = poolConfig[idxAmAsId]
10751190 let prId = poolConfig[idxPrAsId]
10761191 let lpId = poolConfig[idxLPAsId]
10771192 let amBalance = getAccBalance(amId)
10781193 let prBalance = getAccBalance(prId)
1079- let $t03760337718 = {
1194+ let $t04080840923 = {
10801195 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil)
10811196 if ($isInstanceOf(@, "(Int, Int)"))
10821197 then @
10831198 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
10841199 }
1085- let totalGet = $t03760337718._1
1086- let feeAmount = $t03760337718._2
1200+ let totalGet = $t04080840923._1
1201+ let feeAmount = $t04080840923._2
10871202 let r = ego("", lpId, lpAssetAmount, this)
10881203 let outAmAmt = r._1
10891204 let outPrAmt = r._2
10901205 let sumOfGetAssets = (outAmAmt + outPrAmt)
10911206 let bonus = if ((sumOfGetAssets == 0))
10921207 then if ((totalGet == 0))
10931208 then 0
10941209 else throw("bonus calculation error")
10951210 else fraction((totalGet - sumOfGetAssets), scale8, sumOfGetAssets)
10961211 $Tuple2(nil, $Tuple3(totalGet, feeAmount, bonus))
10971212 }
10981213
10991214
11001215
11011216 @Callable(i)
11021217 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
11031218 let r = cg(i)
11041219 let outAmAmt = r._1
11051220 let outPrAmt = r._2
11061221 let pmtAmt = r._3
11071222 let pmtAssetId = r._4
11081223 let state = r._5
11091224 if ((noLessThenAmtAsset > outAmAmt))
11101225 then throw(((("Failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
11111226 else if ((noLessThenPriceAsset > outPrAmt))
11121227 then throw(((("Failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
11131228 else {
11141229 let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
11151230 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11161231 then state
11171232 else throw("Strict value is not equal to itself.")
11181233 }
11191234 }
11201235
11211236
11221237
11231238 @Callable(i)
11241239 func unstakeAndGet (amount) = {
11251240 let checkPayments = if ((size(i.payments) != 0))
11261241 then throw("No pmnts expd")
11271242 else true
11281243 if ((checkPayments == checkPayments))
11291244 then {
11301245 let cfg = gpc()
11311246 let factoryCfg = gfc()
11321247 let lpAssetId = fromBase58String(cfg[idxLPAsId])
11331248 let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr")
11341249 let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil)
11351250 if ((unstakeInv == unstakeInv))
11361251 then {
11371252 let r = ego(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
11381253 let sts = parseIntValue(r._9)
11391254 let state = r._10
11401255 let v = if (if (igs())
11411256 then true
11421257 else (sts == PoolShutdown))
11431258 then throw(("Blocked: " + toString(sts)))
11441259 else true
11451260 if ((v == v))
11461261 then {
11471262 let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
11481263 if ((burnA == burnA))
11491264 then state
11501265 else throw("Strict value is not equal to itself.")
11511266 }
11521267 else throw("Strict value is not equal to itself.")
11531268 }
11541269 else throw("Strict value is not equal to itself.")
11551270 }
11561271 else throw("Strict value is not equal to itself.")
11571272 }
11581273
11591274
11601275
11611276 @Callable(i)
11621277 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
11631278 let isGetDisabled = if (igs())
11641279 then true
11651280 else (cfgPoolStatus == PoolShutdown)
11661281 let checks = [if (!(isGetDisabled))
11671282 then true
11681283 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
11691284 then true
11701285 else throw("no payments are expected")]
11711286 if ((checks == checks))
11721287 then {
11731288 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
11741289 if ((unstakeInv == unstakeInv))
11751290 then {
11761291 let res = ego(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
11771292 let outAmAmt = res._1
11781293 let outPrAmt = res._2
11791294 let state = res._10
11801295 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
11811296 then true
11821297 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
11831298 then true
11841299 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
11851300 if ((checkAmounts == checkAmounts))
11861301 then {
11871302 let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
11881303 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11891304 then state
11901305 else throw("Strict value is not equal to itself.")
11911306 }
11921307 else throw("Strict value is not equal to itself.")
11931308 }
11941309 else throw("Strict value is not equal to itself.")
11951310 }
11961311 else throw("Strict value is not equal to itself.")
11971312 }
11981313
11991314
12001315
12011316 @Callable(i)
12021317 func unstakeAndGetOneTknV2 (unstakeAmount,outAssetId,minOutAmount) = {
12031318 let isPoolOneTokenOperationsDisabled = {
12041319 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
12051320 if ($isInstanceOf(@, "Boolean"))
12061321 then @
12071322 else throw(($getType(@) + " couldn't be cast to Boolean"))
12081323 }
12091324 let isGetDisabled = if (if (igs())
12101325 then true
12111326 else (cfgPoolStatus == PoolShutdown))
12121327 then true
12131328 else isPoolOneTokenOperationsDisabled
12141329 let checks = [if (if (!(isGetDisabled))
12151330 then true
12161331 else isManager(i))
12171332 then true
12181333 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
12191334 then true
12201335 else throwErr("no payments are expected")]
12211336 if ((checks == checks))
12221337 then {
12231338 let cfg = gpc()
12241339 let factoryCfg = gfc()
12251340 let lpAssetId = fromBase58String(cfg[idxLPAsId])
12261341 let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr")
1227- let userAddress = i.caller
1228- let lpAssetRecipientAddress = this
1229- let unstakeInv = invoke(staking, "unstakeINTERNAL", [lpAssetId, unstakeAmount, userAddress.bytes, lpAssetRecipientAddress.bytes], nil)
1342+ let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), unstakeAmount], nil)
12301343 if ((unstakeInv == unstakeInv))
12311344 then {
1232- let $t04168341871 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1233- let state = $t04168341871._1
1234- let totalAmount = $t04168341871._2
1345+ let $t04476144949 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1346+ let state = $t04476144949._1
1347+ let totalAmount = $t04476144949._2
12351348 $Tuple2(state, totalAmount)
12361349 }
12371350 else throw("Strict value is not equal to itself.")
12381351 }
12391352 else throw("Strict value is not equal to itself.")
12401353 }
12411354
12421355
12431356
12441357 @Callable(i)
12451358 func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = {
12461359 let poolConfig = gpc()
12471360 let amId = poolConfig[idxAmAsId]
12481361 let prId = poolConfig[idxPrAsId]
12491362 let lpId = poolConfig[idxLPAsId]
1250- let $t04213042233 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1251- let lpAmount = $t04213042233._1
1252- let state = $t04213042233._2
1253- let feeAmount = $t04213042233._3
1254- let bonus = $t04213042233._4
1363+ let $t04520845311 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1364+ let lpAmount = $t04520845311._1
1365+ let state = $t04520845311._2
1366+ let feeAmount = $t04520845311._3
1367+ let bonus = $t04520845311._4
12551368 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
12561369 }
12571370
12581371
12591372
12601373 @Callable(i)
12611374 func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = {
12621375 let poolConfig = gpc()
12631376 let amId = poolConfig[idxAmAsId]
12641377 let prId = poolConfig[idxPrAsId]
12651378 let lpId = poolConfig[idxLPAsId]
1266- let $t04251242616 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1267- let lpAmount = $t04251242616._1
1268- let state = $t04251242616._2
1269- let feeAmount = $t04251242616._3
1270- let bonus = $t04251242616._4
1379+ let $t04559045694 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1380+ let lpAmount = $t04559045694._1
1381+ let state = $t04559045694._2
1382+ let feeAmount = $t04559045694._3
1383+ let bonus = $t04559045694._4
12711384 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
12721385 }
12731386
12741387
12751388
12761389 @Callable(i)
12771390 func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString(fca)))
12781391 then throw("denied")
12791392 else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr)], "success")
12801393
12811394
12821395
12831396 @Callable(i)
12841397 func setS (k,v) = if ((toString(i.caller) != strf(this, ada())))
12851398 then pd
12861399 else [StringEntry(k, v)]
12871400
12881401
12891402
12901403 @Callable(i)
12911404 func setI (k,v) = if ((toString(i.caller) != strf(this, ada())))
12921405 then pd
12931406 else [IntegerEntry(k, v)]
12941407
12951408
12961409
12971410 @Callable(i)
12981411 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, gpc())
12991412
13001413
13011414
13021415 @Callable(i)
13031416 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
13041417
13051418
13061419
13071420 @Callable(i)
13081421 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
13091422 let pr = calcPrices(amAmt, prAmt, lpAmt)
13101423 $Tuple2(nil, [toString(pr[0]), toString(pr[1]), toString(pr[2])])
13111424 }
13121425
13131426
13141427
13151428 @Callable(i)
13161429 func fromX18WrapperREADONLY (val,resScaleMult) = $Tuple2(nil, f1(parseBigIntValue(val), resScaleMult))
13171430
13181431
13191432
13201433 @Callable(i)
13211434 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(t1(origVal, origScaleMult)))
13221435
13231436
13241437
13251438 @Callable(i)
13261439 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(cpbi(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
13271440
13281441
13291442
13301443 @Callable(i)
13311444 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, ""))
13321445
13331446
13341447
13351448 @Callable(i)
13361449 func estimateGetOperationWrapperREADONLY (txId58,pmtAsId,pmtLpAmt,usrAddr) = {
13371450 let r = ego(txId58, pmtAsId, pmtLpAmt, addressFromStringValue(usrAddr))
13381451 $Tuple2(nil, $Tuple10(r._1, r._2, r._3, r._4, r._5, r._6, r._7, toString(r._8), r._9, r._10))
13391452 }
13401453
13411454
13421455 @Verifier(tx)
13431456 func verify () = {
13441457 let targetPublicKey = match m() {
13451458 case pk: ByteVector =>
13461459 pk
13471460 case _: Unit =>
13481461 tx.senderPublicKey
13491462 case _ =>
13501463 throw("Match error")
13511464 }
13521465 match tx {
13531466 case order: Order =>
13541467 let matcherPub = mp()
13551468 let orderValid = moa(order)
13561469 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
13571470 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
13581471 if (if (if (orderValid)
13591472 then senderValid
13601473 else false)
13611474 then matcherValid
13621475 else false)
13631476 then true
13641477 else toe(orderValid, senderValid, matcherValid)
13651478 case s: SetScriptTransaction =>
13661479 let newHash = blake2b256(value(s.script))
13671480 let allowedHash = fromBase64String(value(getString(fca, keyAllowedLpStableScriptHash())))
13681481 let currentHash = scriptHash(this)
13691482 if (if ((allowedHash == newHash))
13701483 then (currentHash != newHash)
13711484 else false)
13721485 then true
13731486 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
13741487 case _ =>
13751488 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
13761489 }
13771490 }
13781491

github/deemru/w8io/026f985 
174.57 ms