tx · 6MAGgcmJKUnxYKh4SkorsRhj81XqXCMmpezMcc5NL3Nz

3MtP3m8hWMxYcyDxXB6n299KrsLLyT8ehni:  -0.03200000 Waves

2023.01.18 15:48 [2410387] smart account 3MtP3m8hWMxYcyDxXB6n299KrsLLyT8ehni > SELF 0.00000000 Waves

{ "type": 13, "id": "6MAGgcmJKUnxYKh4SkorsRhj81XqXCMmpezMcc5NL3Nz", "fee": 3200000, "feeAssetId": null, "timestamp": 1674046107748, "version": 1, "sender": "3MtP3m8hWMxYcyDxXB6n299KrsLLyT8ehni", "senderPublicKey": "BRyVaCURUMe7ssUbXucteig1g44bGwWirJQzugKahUQ1", "proofs": [ "5BkbTvFCfmtS3AqNqW2DAnCgV4U89DoPeUvgqe27b4FsdvvQRiDAfgwdcraui3Htc4hL2t71w7qMsXicwqXSL1fg" ], "script": "base64:BgKmIggCEgMKAQgSAwoBCBIAEgQKAgEEEgQKAgEEEgMKAQESABIECgIIARIECgIIARIECgIIARIECgIBARIDCgEBEgUKAwEBARIFCgMBCAESBAoCAQgSBAoCAQgSBAoCCAgSBAoCCAgSBAoCCAESABIDCgEIEgUKAwEBARIECgIIARIECgIBARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCCIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiCnNsaXBwYWdlNEQiC3dhdmVzU3RyaW5nIgVBbXVsdCIFRGNvbnYiA1NFUCIFRU1QVFkiClBvb2xBY3RpdmUiClBvb2xQdXREaXMiDlBvb2xNYXRjaGVyRGlzIgxQb29sU2h1dGRvd24iDmlkeFBvb2xBZGRyZXNzIglpZHhQb29sU3QiCWlkeExQQXNJZCIJaWR4QW1Bc0lkIglpZHhQckFzSWQiC2lkeEFtdEFzRGNtIg1pZHhQcmljZUFzRGNtIgtpZHhJQW10QXNJZCINaWR4SVByaWNlQXNJZCIPaWR4RmFjdFN0YWtDbnRyIhJpZHhGYW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QJhdgIFT3JkZXIEAmR6BQJhdgQCZ1EJAQJhSgAEAmdSCQECZHkBBQJkegQCZ1MJAPQDAwgFAmR6CWJvZHlCeXRlcwkAkQMCCAUCZHoGcHJvb2ZzAAAIBQJkeg9zZW5kZXJQdWJsaWNLZXkEAmdUCQD0AwMIBQJkeglib2R5Qnl0ZXMJAJEDAggFAmR6BnByb29mcwABBQJnUQMDAwUCZ1IFAmdTBwUCZ1QHBgkBAmFxAwUCZ1IFAmdTBQJnVAMJAAECBQJhdgIUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAmRaBQJhdgQCZ1UJAPYDAQkBBXZhbHVlAQgFAmRaBnNjcmlwdAQCZ1YJANsEAQkBBXZhbHVlAQkAnQgCBQJhRAkBAmFvAAQCZ1cJAPEHAQUEdGhpcwMDCQAAAgUCZ1YFAmdVCQECIT0CBQJnVwUCZ1UHBgkA9AMDCAUCZ04JYm9keUJ5dGVzCQCRAwIIBQJnTgZwcm9vZnMAAAUCZ1AJAPQDAwgFAmdOCWJvZHlCeXRlcwkAkQMCCAUCZ04GcHJvb2ZzAAAFAmdQf6Cfrw==", "chainId": 84, "height": 2410387, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EesZn56hr2F9f3wquQzz3WrdKUqNy4LXBZ4jd3vnRgKA Next: HdufFhuuc2qNzHT8hAg5pUXdAiLX94Frnc2fr2MWs54A Diff:
OldNewDifferences
115115 func ada () = "%s__addonAddr"
116116
117117
118-func swapContract () = "%s__swapContract"
119-
120-
121118 func fcfg () = "%s__factoryConfig"
122119
123120
148145 case _ =>
149146 throw("fail cast to String")
150147 }
151-
152-
153-func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined"))
154148
155149
156150 func strf (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
212206
213207 let poolConfigParsed = parsePoolConfig(gpc())
214208
215-let $t070867272 = poolConfigParsed
209+let $t069097095 = poolConfigParsed
216210
217-let cfgPoolAddress = $t070867272._1
211+let cfgPoolAddress = $t069097095._1
218212
219-let cfgPoolStatus = $t070867272._2
213+let cfgPoolStatus = $t069097095._2
220214
221-let cfgLpAssetId = $t070867272._3
215+let cfgLpAssetId = $t069097095._3
222216
223-let cfgAmountAssetId = $t070867272._4
217+let cfgAmountAssetId = $t069097095._4
224218
225-let cfgPriceAssetId = $t070867272._5
219+let cfgPriceAssetId = $t069097095._5
226220
227-let cfgAmountAssetDecimals = $t070867272._6
221+let cfgAmountAssetDecimals = $t069097095._6
228222
229-let cfgPriceAssetDecimals = $t070867272._7
223+let cfgPriceAssetDecimals = $t069097095._7
230224
231225 func gfc () = split(strf(fca, fcfg()), SEP)
232226
423417 else calcLpAmt
424418 let amDiff = (inAmAmt - calcAmAssetPmt)
425419 let prDiff = (inPrAmt - calcPrAssetPmt)
426- let $t01773918084 = if (if (isOneAsset)
420+ let $t01756217907 = if (if (isOneAsset)
427421 then (pmtId == amIdStr)
428422 else false)
429423 then $Tuple2(pmtAmt, 0)
432426 else false)
433427 then $Tuple2(0, pmtAmt)
434428 else $Tuple2(calcAmAssetPmt, calcPrAssetPmt)
435- let writeAmAmt = $t01773918084._1
436- let writePrAmt = $t01773918084._2
429+ let writeAmAmt = $t01756217907._1
430+ let writePrAmt = $t01756217907._2
437431 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))]
438432 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId)
439433 }
533527 let ann_aPrecision = (ann - aPrecision)
534528 let n1 = (n + big1)
535529 func calc (acc,cur) = {
536- let $t02263622656 = acc
537- let d = $t02263622656._1
538- let found = $t02263622656._2
530+ let $t02245922479 = acc
531+ let d = $t02245922479._1
532+ let found = $t02245922479._2
539533 if ((found != unit))
540534 then acc
541535 else {
549543 }
550544
551545 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
552- let $t02307723124 = {
546+ let $t02290022947 = {
553547 let $l = arr
554548 let $s = size($l)
555549 let $acc0 = $Tuple2(s, unit)
563557
564558 $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)
565559 }
566- let d = $t02307723124._1
567- let found = $t02307723124._2
560+ let d = $t02290022947._1
561+ let found = $t02290022947._2
568562 if ((found != unit))
569563 then d
570564 else throw(("D calculation error, D = " + toString(d)))
584578 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
585579 let b = ((s + ((D * aPrecision) / ann)) - D)
586580 func calc (acc,cur) = {
587- let $t02362423644 = acc
588- let y = $t02362423644._1
589- let found = $t02362423644._2
581+ let $t02344723467 = acc
582+ let y = $t02344723467._1
583+ let found = $t02344723467._2
590584 if ((found != unit))
591585 then acc
592586 else {
599593 }
600594
601595 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
602- let $t02395123998 = {
596+ let $t02377423821 = {
603597 let $l = arr
604598 let $s = size($l)
605599 let $acc0 = $Tuple2(D, unit)
613607
614608 $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)
615609 }
616- let y = $t02395123998._1
617- let found = $t02395123998._2
610+ let y = $t02377423821._1
611+ let found = $t02377423821._2
618612 if ((found != unit))
619613 then y
620614 else throw(("Y calculation error, Y = " + toString(y)))
636630 then {
637631 let amBalance = getAccBalance(amId)
638632 let prBalance = getAccBalance(prId)
639- let $t02478125243 = if ((txId == ""))
633+ let $t02460425066 = if ((txId == ""))
640634 then $Tuple2(amBalance, prBalance)
641635 else if ((pmtAssetId == amId))
642636 then if ((pmtAmtRaw > amBalance))
647641 then throw("invalid payment amount")
648642 else $Tuple2(amBalance, (prBalance - pmtAmtRaw))
649643 else throw("wrong pmtAssetId")
650- let amBalanceOld = $t02478125243._1
651- let prBalanceOld = $t02478125243._2
652- let $t02524925425 = if ((pmtAssetId == amId))
644+ let amBalanceOld = $t02460425066._1
645+ let prBalanceOld = $t02460425066._2
646+ let $t02507225248 = if ((pmtAssetId == amId))
653647 then $Tuple2(pmtAmtRaw, 0)
654648 else if ((pmtAssetId == prId))
655649 then $Tuple2(0, pmtAmtRaw)
656650 else throw("invalid payment")
657- let amAmountRaw = $t02524925425._1
658- let prAmountRaw = $t02524925425._2
659- let $t02542925683 = if (withTakeFee)
651+ let amAmountRaw = $t02507225248._1
652+ let prAmountRaw = $t02507225248._2
653+ let $t02525225506 = if (withTakeFee)
660654 then $Tuple3(takeFee(amAmountRaw, inFee)._1, takeFee(prAmountRaw, inFee)._1, takeFee(pmtAmtRaw, inFee)._2)
661655 else $Tuple3(amAmountRaw, prAmountRaw, 0)
662- let amAmount = $t02542925683._1
663- let prAmount = $t02542925683._2
664- let feeAmount = $t02542925683._3
656+ let amAmount = $t02525225506._1
657+ let prAmount = $t02525225506._2
658+ let feeAmount = $t02525225506._3
665659 let amBalanceNew = (amBalanceOld + amAmount)
666660 let prBalanceNew = (prBalanceOld + prAmount)
667661 let D0 = getD([toBigInt(amBalanceOld), toBigInt(prBalanceOld)])
707701 else {
708702 let amBalance = getAccBalance(amId)
709703 let prBalance = getAccBalance(prId)
710- let $t02768527796 = {
704+ let $t02750827619 = {
711705 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil)
712706 if ($isInstanceOf(@, "(Int, Int)"))
713707 then @
714708 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
715709 }
716- if (($t02768527796 == $t02768527796))
710+ if (($t02750827619 == $t02750827619))
717711 then {
718- let feeAmount = $t02768527796._2
719- let totalGet = $t02768527796._1
712+ let feeAmount = $t02750827619._2
713+ let totalGet = $t02750827619._1
720714 let totalAmount = if (if ((minOutAmount > 0))
721715 then (minOutAmount > totalGet)
722716 else false)
723717 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
724718 else totalGet
725- let $t02798628293 = if ((outAssetId == amId))
719+ let $t02780928116 = if ((outAssetId == amId))
726720 then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance)
727721 else if ((outAssetId == prId))
728722 then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount))
729723 else throw("invalid out asset id")
730- let outAm = $t02798628293._1
731- let outPr = $t02798628293._2
732- let amBalanceNew = $t02798628293._3
733- let prBalanceNew = $t02798628293._4
724+ let outAm = $t02780928116._1
725+ let outPr = $t02780928116._2
726+ let amBalanceNew = $t02780928116._3
727+ let prBalanceNew = $t02780928116._4
734728 let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals))
735729 let curPr = f1(curPrX18, scale8)
736730 let outAssetIdOrWaves = if ((outAssetId == "WAVES"))
798792 case _ =>
799793 throw("Match error")
800794 }
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-
910795
911796
912797 @Callable(i)
1051936 let pmt = value(i.payments[0])
1052937 let pmtAssetId = toBase58String(value(pmt.assetId))
1053938 let pmtAmt = pmt.amount
1054- let $t03668336841 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1055- if (($t03668336841 == $t03668336841))
939+ let $t03347833636 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
940+ if (($t03347833636 == $t03347833636))
1056941 then {
1057- let feeAmount = $t03668336841._3
1058- let state = $t03668336841._2
1059- let estimLP = $t03668336841._1
942+ let feeAmount = $t03347833636._3
943+ let state = $t03347833636._2
944+ let estimLP = $t03347833636._1
1060945 let emitLpAmt = if (if ((minOutAmount > 0))
1061946 then (minOutAmount > estimLP)
1062947 else false)
11471032 else throwErr("exactly 1 payment are expected")]
11481033 if ((checks == checks))
11491034 then {
1150- let $t03946339618 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1151- let state = $t03946339618._1
1152- let totalAmount = $t03946339618._2
1035+ let $t03625836413 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1036+ let state = $t03625836413._1
1037+ let totalAmount = $t03625836413._2
11531038 $Tuple2(state, totalAmount)
11541039 }
11551040 else throw("Strict value is not equal to itself.")
11751060 let newY = getYD(xp, index, D1)
11761061 let dy = (xp[index] - newY)
11771062 let totalGetRaw = max([0, toInt((dy - big1))])
1178- let $t04040840463 = takeFee(totalGetRaw, outFee)
1179- let totalGet = $t04040840463._1
1180- let feeAmount = $t04040840463._2
1063+ let $t03720337258 = takeFee(totalGetRaw, outFee)
1064+ let totalGet = $t03720337258._1
1065+ let feeAmount = $t03720337258._2
11811066 $Tuple2(nil, $Tuple2(totalGet, feeAmount))
11821067 }
11831068
11911076 let lpId = poolConfig[idxLPAsId]
11921077 let amBalance = getAccBalance(amId)
11931078 let prBalance = getAccBalance(prId)
1194- let $t04080840923 = {
1079+ let $t03760337718 = {
11951080 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil)
11961081 if ($isInstanceOf(@, "(Int, Int)"))
11971082 then @
11981083 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
11991084 }
1200- let totalGet = $t04080840923._1
1201- let feeAmount = $t04080840923._2
1085+ let totalGet = $t03760337718._1
1086+ let feeAmount = $t03760337718._2
12021087 let r = ego("", lpId, lpAssetAmount, this)
12031088 let outAmAmt = r._1
12041089 let outPrAmt = r._2
13421227 let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), unstakeAmount], nil)
13431228 if ((unstakeInv == unstakeInv))
13441229 then {
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
1230+ let $t04155641744 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1231+ let state = $t04155641744._1
1232+ let totalAmount = $t04155641744._2
13481233 $Tuple2(state, totalAmount)
13491234 }
13501235 else throw("Strict value is not equal to itself.")
13601245 let amId = poolConfig[idxAmAsId]
13611246 let prId = poolConfig[idxPrAsId]
13621247 let lpId = poolConfig[idxLPAsId]
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
1248+ let $t04200342106 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1249+ let lpAmount = $t04200342106._1
1250+ let state = $t04200342106._2
1251+ let feeAmount = $t04200342106._3
1252+ let bonus = $t04200342106._4
13681253 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
13691254 }
13701255
13761261 let amId = poolConfig[idxAmAsId]
13771262 let prId = poolConfig[idxPrAsId]
13781263 let lpId = poolConfig[idxLPAsId]
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
1264+ let $t04238542489 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1265+ let lpAmount = $t04238542489._1
1266+ let state = $t04238542489._2
1267+ let feeAmount = $t04238542489._3
1268+ let bonus = $t04238542489._4
13841269 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
13851270 }
13861271
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-
121118 func fcfg () = "%s__factoryConfig"
122119
123120
124121 func mtpk () = "%s%s__matcher__publicKey"
125122
126123
127124 func pc (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config")
128125
129126
130127 func mba (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr)
131128
132129
133130 func aps () = "%s__shutdown"
134131
135132
136133 func keyAllowedLpStableScriptHash () = "%s__allowedLpStableScriptHash"
137134
138135
139136 func keyFeeCollectorAddress () = "%s__feeCollectorAddress"
140137
141138
142139 func toe (orV,sendrV,matchV) = throw(((((("Failed: ordValid=" + toString(orV)) + " sndrValid=") + toString(sendrV)) + " mtchrValid=") + toString(matchV)))
143140
144141
145142 func str (val) = match val {
146143 case valStr: String =>
147144 valStr
148145 case _ =>
149146 throw("fail cast to String")
150147 }
151-
152-
153-func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined"))
154148
155149
156150 func strf (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
157151
158152
159153 func intf (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
160154
161155
162156 func throwErr (msg) = throw(makeString(["lp_stable.ride:", msg], " "))
163157
164158
165159 let fca = addressFromStringValue(strf(this, fc()))
166160
167161 let inFee = {
168162 let @ = invoke(fca, "getInFeeREADONLY", [toString(this)], nil)
169163 if ($isInstanceOf(@, "Int"))
170164 then @
171165 else throw(($getType(@) + " couldn't be cast to Int"))
172166 }
173167
174168 let outFee = {
175169 let @ = invoke(fca, "getOutFeeREADONLY", [toString(this)], nil)
176170 if ($isInstanceOf(@, "Int"))
177171 then @
178172 else throw(($getType(@) + " couldn't be cast to Int"))
179173 }
180174
181175 let A = strf(this, amp())
182176
183177 func igs () = valueOrElse(getBoolean(fca, aps()), false)
184178
185179
186180 func mp () = fromBase58String(strf(fca, mtpk()))
187181
188182
189183 let feeCollectorAddress = addressFromStringValue(strf(fca, keyFeeCollectorAddress()))
190184
191185 func gpc () = {
192186 let amtAs = strf(this, aa())
193187 let priceAs = strf(this, pa())
194188 let iPriceAs = intf(fca, mba(priceAs))
195189 let iAmtAs = intf(fca, mba(amtAs))
196190 split(strf(fca, pc(toString(iAmtAs), toString(iPriceAs))), SEP)
197191 }
198192
199193
200194 func parseAssetId (input) = if ((input == wavesString))
201195 then unit
202196 else fromBase58String(input)
203197
204198
205199 func assetIdToString (input) = if ((input == unit))
206200 then wavesString
207201 else toBase58String(value(input))
208202
209203
210204 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]))
211205
212206
213207 let poolConfigParsed = parsePoolConfig(gpc())
214208
215-let $t070867272 = poolConfigParsed
209+let $t069097095 = poolConfigParsed
216210
217-let cfgPoolAddress = $t070867272._1
211+let cfgPoolAddress = $t069097095._1
218212
219-let cfgPoolStatus = $t070867272._2
213+let cfgPoolStatus = $t069097095._2
220214
221-let cfgLpAssetId = $t070867272._3
215+let cfgLpAssetId = $t069097095._3
222216
223-let cfgAmountAssetId = $t070867272._4
217+let cfgAmountAssetId = $t069097095._4
224218
225-let cfgPriceAssetId = $t070867272._5
219+let cfgPriceAssetId = $t069097095._5
226220
227-let cfgAmountAssetDecimals = $t070867272._6
221+let cfgAmountAssetDecimals = $t069097095._6
228222
229-let cfgPriceAssetDecimals = $t070867272._7
223+let cfgPriceAssetDecimals = $t069097095._7
230224
231225 func gfc () = split(strf(fca, fcfg()), SEP)
232226
233227
234228 let factoryConfig = gfc()
235229
236230 let stakingContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactStakCntr]), "Invalid staking contract address")
237231
238232 let slipageContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactSlippCntr]), "Invalid slipage contract address")
239233
240234 let gwxContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactGwxRewCntr]), "Invalid gwx contract address")
241235
242236 let restContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactoryRestCntr]), "Invalid gwx contract address")
243237
244238 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)
245239
246240
247241 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)
248242
249243
250244 func getAccBalance (assetId) = if ((assetId == "WAVES"))
251245 then wavesBalance(this).available
252246 else assetBalance(this, fromBase58String(assetId))
253247
254248
255249 func cpbi (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
256250
257251
258252 func vad (A1,A2,slippage) = {
259253 let diff = fraction((A1 - A2), scale8BigInt, A2)
260254 let pass = ((slippage - abs(diff)) > zeroBigInt)
261255 if (!(pass))
262256 then throw(("Big slpg: " + toString(diff)))
263257 else $Tuple2(pass, min([A1, A2]))
264258 }
265259
266260
267261 func vd (D1,D0,slpg) = {
268262 let diff = fraction(D0, scale8BigInt, D1)
269263 let fail = (slpg > diff)
270264 if (if (fail)
271265 then true
272266 else (D0 > D1))
273267 then throw(((((((toString(D0) + " ") + toString(D1)) + " ") + toString(diff)) + " ") + toString(slpg)))
274268 else fail
275269 }
276270
277271
278272 func pcp (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
279273 let amtAsAmtX18 = t1(amAmt, amAssetDcm)
280274 let prAsAmtX18 = t1(prAmt, prAssetDcm)
281275 cpbi(prAsAmtX18, amtAsAmtX18)
282276 }
283277
284278
285279 func calcPrices (amAmt,prAmt,lpAmt) = {
286280 let cfg = gpc()
287281 let amtAsDcm = parseIntValue(cfg[idxAmtAsDcm])
288282 let prAsDcm = parseIntValue(cfg[idxPriceAsDcm])
289283 let priceX18 = pcp(amtAsDcm, prAsDcm, amAmt, prAmt)
290284 let amAmtX18 = t1(amAmt, amtAsDcm)
291285 let prAmtX18 = t1(prAmt, prAsDcm)
292286 let lpAmtX18 = t1(lpAmt, scale8)
293287 let lpPrInAmAsX18 = cpbi(amAmtX18, lpAmtX18)
294288 let lpPrInPrAsX18 = cpbi(prAmtX18, lpAmtX18)
295289 [priceX18, lpPrInAmAsX18, lpPrInPrAsX18]
296290 }
297291
298292
299293 func calculatePrices (amAmt,prAmt,lpAmt) = {
300294 let p = calcPrices(amAmt, prAmt, lpAmt)
301295 [f1(p[0], scale8), f1(p[1], scale8), f1(p[2], scale8)]
302296 }
303297
304298
305299 func takeFee (amount,fee) = {
306300 let feeAmount = if ((fee == 0))
307301 then 0
308302 else fraction(amount, fee, scale8)
309303 $Tuple2((amount - feeAmount), feeAmount)
310304 }
311305
312306
313307 func ego (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
314308 let cfg = gpc()
315309 let lpId = cfg[idxLPAsId]
316310 let amId = cfg[idxAmAsId]
317311 let prId = cfg[idxPrAsId]
318312 let amDcm = parseIntValue(cfg[idxAmtAsDcm])
319313 let prDcm = parseIntValue(cfg[idxPriceAsDcm])
320314 let sts = cfg[idxPoolSt]
321315 let lpEmiss = valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "Wrong LP id").quantity
322316 if ((lpId != pmtAssetId))
323317 then throw("Wrong pmt asset")
324318 else {
325319 let amBalance = getAccBalance(amId)
326320 let amBalanceX18 = t1(amBalance, amDcm)
327321 let prBalance = getAccBalance(prId)
328322 let prBalanceX18 = t1(prBalance, prDcm)
329323 let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
330324 let curPrice = f1(curPriceX18, scale8)
331325 let pmtLpAmtX18 = t1(pmtLpAmt, scale8)
332326 let lpEmissX18 = t1(lpEmiss, scale8)
333327 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissX18)
334328 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissX18)
335329 let outAmAmt = f1(outAmAmtX18, amDcm)
336330 let outPrAmt = f1(outPrAmtX18, prDcm)
337331 let state = if ((txId58 == ""))
338332 then nil
339333 else [ScriptTransfer(userAddress, outAmAmt, if ((amId == "WAVES"))
340334 then unit
341335 else fromBase58String(amId)), ScriptTransfer(userAddress, outPrAmt, if ((prId == "WAVES"))
342336 then unit
343337 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)]
344338 $Tuple10(outAmAmt, outPrAmt, amId, prId, amBalance, prBalance, lpEmiss, curPriceX18, sts, state)
345339 }
346340 }
347341
348342
349343 func epo (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEval,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = {
350344 let cfg = gpc()
351345 let lpId = fromBase58String(cfg[idxLPAsId])
352346 let amIdStr = cfg[idxAmAsId]
353347 let prIdStr = cfg[idxPrAsId]
354348 let inAmIdStr = cfg[idxIAmtAsId]
355349 let inPrIdStr = cfg[idxIPriceAsId]
356350 let amtDcm = parseIntValue(cfg[idxAmtAsDcm])
357351 let priceDcm = parseIntValue(cfg[idxPriceAsDcm])
358352 let sts = cfg[idxPoolSt]
359353 let lpEm = valueOrErrorMessage(assetInfo(lpId), "Wr lp as").quantity
360354 let amBalance = if (isEval)
361355 then getAccBalance(amIdStr)
362356 else if (if (isOneAsset)
363357 then (pmtId == amIdStr)
364358 else false)
365359 then (getAccBalance(amIdStr) - pmtAmt)
366360 else if (isOneAsset)
367361 then getAccBalance(amIdStr)
368362 else (getAccBalance(amIdStr) - inAmAmt)
369363 let prBalance = if (isEval)
370364 then getAccBalance(prIdStr)
371365 else if (if (isOneAsset)
372366 then (pmtId == prIdStr)
373367 else false)
374368 then (getAccBalance(prIdStr) - pmtAmt)
375369 else if (isOneAsset)
376370 then getAccBalance(prIdStr)
377371 else (getAccBalance(prIdStr) - inPrAmt)
378372 let inAmAssetAmtX18 = t1(inAmAmt, amtDcm)
379373 let inPrAssetAmtX18 = t1(inPrAmt, priceDcm)
380374 let userPriceX18 = cpbi(inPrAssetAmtX18, inAmAssetAmtX18)
381375 let amBalanceX18 = t1(amBalance, amtDcm)
382376 let prBalanceX18 = t1(prBalance, priceDcm)
383377 let r = if ((lpEm == 0))
384378 then {
385379 let curPriceX18 = zeroBigInt
386380 let slippageX18 = zeroBigInt
387381 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
388382 $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
389383 }
390384 else {
391385 let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
392386 let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18)
393387 let slippageX18 = t1(slippage, scale8)
394388 if (if (if (validateSlippage)
395389 then (curPriceX18 != zeroBigInt)
396390 else false)
397391 then (slippageRealX18 > slippageX18)
398392 else false)
399393 then throw(((("Price slippage " + toString(slippageRealX18)) + " > ") + toString(slippageX18)))
400394 else {
401395 let lpEmissionX18 = t1(lpEm, scale8)
402396 let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
403397 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
404398 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
405399 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
406400 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
407401 let expAmtAssetAmtX18 = expectedAmts._1
408402 let expPriceAssetAmtX18 = expectedAmts._2
409403 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18)
410404 $Tuple5(f1(lpAmtX18, scale8), f1(expAmtAssetAmtX18, amtDcm), f1(expPriceAssetAmtX18, priceDcm), curPriceX18, slippageX18)
411405 }
412406 }
413407 let calcLpAmt = r._1
414408 let calcAmAssetPmt = r._2
415409 let calcPrAssetPmt = r._3
416410 let curPrice = f1(r._4, scale8)
417411 let slippageCalc = f1(r._5, scale8)
418412 if ((0 >= calcLpAmt))
419413 then throw("LP <= 0")
420414 else {
421415 let emitLpAmt = if (!(emitLp))
422416 then 0
423417 else calcLpAmt
424418 let amDiff = (inAmAmt - calcAmAssetPmt)
425419 let prDiff = (inPrAmt - calcPrAssetPmt)
426- let $t01773918084 = if (if (isOneAsset)
420+ let $t01756217907 = if (if (isOneAsset)
427421 then (pmtId == amIdStr)
428422 else false)
429423 then $Tuple2(pmtAmt, 0)
430424 else if (if (isOneAsset)
431425 then (pmtId == prIdStr)
432426 else false)
433427 then $Tuple2(0, pmtAmt)
434428 else $Tuple2(calcAmAssetPmt, calcPrAssetPmt)
435- let writeAmAmt = $t01773918084._1
436- let writePrAmt = $t01773918084._2
429+ let writeAmAmt = $t01756217907._1
430+ let writePrAmt = $t01756217907._2
437431 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))]
438432 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId)
439433 }
440434 }
441435
442436
443437 func moa (order) = {
444438 let cfg = gpc()
445439 let amtAsId = cfg[idxAmAsId]
446440 let prAsId = cfg[idxPrAsId]
447441 let sts = parseIntValue(cfg[idxPoolSt])
448442 let amtAsDcm = parseIntValue(cfg[idxAmtAsDcm])
449443 let prAsDcm = parseIntValue(cfg[idxPriceAsDcm])
450444 let accAmtAsBalance = getAccBalance(amtAsId)
451445 let accPrAsBalance = getAccBalance(prAsId)
452446 let curPriceX18 = if ((order.orderType == Buy))
453447 then pcp(amtAsDcm, prAsDcm, (accAmtAsBalance + order.amount), accPrAsBalance)
454448 else pcp(amtAsDcm, prAsDcm, (accAmtAsBalance - order.amount), accPrAsBalance)
455449 let curPrice = f1(curPriceX18, scale8)
456450 if (if (if (igs())
457451 then true
458452 else (sts == PoolMatcherDis))
459453 then true
460454 else (sts == PoolShutdown))
461455 then throw("Admin blocked")
462456 else {
463457 let orAmtAsset = order.assetPair.amountAsset
464458 let orAmtAsStr = if ((orAmtAsset == unit))
465459 then "WAVES"
466460 else toBase58String(value(orAmtAsset))
467461 let orPrAsset = order.assetPair.priceAsset
468462 let orPrAsStr = if ((orPrAsset == unit))
469463 then "WAVES"
470464 else toBase58String(value(orPrAsset))
471465 if (if ((orAmtAsStr != amtAsId))
472466 then true
473467 else (orPrAsStr != prAsId))
474468 then throw("Wr assets")
475469 else {
476470 let orderPrice = order.price
477471 let priceDcm = fraction(scale8, prAsDcm, amtAsDcm)
478472 let castOrderPrice = ts(orderPrice, scale8, priceDcm)
479473 let isOrderPriceValid = if ((order.orderType == Buy))
480474 then (curPrice >= castOrderPrice)
481475 else (castOrderPrice >= curPrice)
482476 true
483477 }
484478 }
485479 }
486480
487481
488482 func cg (i) = if ((size(i.payments) != 1))
489483 then throw("1 pmnt exp")
490484 else {
491485 let pmt = value(i.payments[0])
492486 let pmtAssetId = value(pmt.assetId)
493487 let pmtAmt = pmt.amount
494488 let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
495489 let outAmAmt = r._1
496490 let outPrAmt = r._2
497491 let sts = parseIntValue(r._9)
498492 let state = r._10
499493 if (if (igs())
500494 then true
501495 else (sts == PoolShutdown))
502496 then throw(("Admin blocked: " + toString(sts)))
503497 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
504498 }
505499
506500
507501 func cp (caller,txId,amAsPmt,prAsPmt,slippage,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = {
508502 let r = epo(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, (txId == ""), emitLp, isOneAsset, validateSlippage, pmtAmt, pmtId)
509503 let sts = parseIntValue(r._8)
510504 if (if (if (igs())
511505 then true
512506 else (sts == PoolPutDis))
513507 then true
514508 else (sts == PoolShutdown))
515509 then throw(("Blocked:" + toString(sts)))
516510 else r
517511 }
518512
519513
520514 func getD (xp) = {
521515 let n = big2
522516 let xp0 = xp[0]
523517 let xp1 = xp[1]
524518 let aPrecision = parseBigIntValue(Amult)
525519 let a = (parseBigIntValue(A) * aPrecision)
526520 let s = (xp0 + xp1)
527521 if ((s == big0))
528522 then big0
529523 else {
530524 let ann = (a * n)
531525 let xp0_xp1_n_n = (((xp0 * xp1) * n) * n)
532526 let ann_s_aPrecision = ((ann * s) / aPrecision)
533527 let ann_aPrecision = (ann - aPrecision)
534528 let n1 = (n + big1)
535529 func calc (acc,cur) = {
536- let $t02263622656 = acc
537- let d = $t02263622656._1
538- let found = $t02263622656._2
530+ let $t02245922479 = acc
531+ let d = $t02245922479._1
532+ let found = $t02245922479._2
539533 if ((found != unit))
540534 then acc
541535 else {
542536 let dp = (((d * d) * d) / xp0_xp1_n_n)
543537 let dNext = (((ann_s_aPrecision + (dp * n)) * d) / (((ann_aPrecision * d) / aPrecision) + (n1 * dp)))
544538 let dDiff = absBigInt((dNext - value(d)))
545539 if ((big1 >= dDiff))
546540 then $Tuple2(dNext, cur)
547541 else $Tuple2(dNext, unit)
548542 }
549543 }
550544
551545 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
552- let $t02307723124 = {
546+ let $t02290022947 = {
553547 let $l = arr
554548 let $s = size($l)
555549 let $acc0 = $Tuple2(s, unit)
556550 func $f0_1 ($a,$i) = if (($i >= $s))
557551 then $a
558552 else calc($a, $l[$i])
559553
560554 func $f0_2 ($a,$i) = if (($i >= $s))
561555 then $a
562556 else throw("List size exceeds 15")
563557
564558 $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)
565559 }
566- let d = $t02307723124._1
567- let found = $t02307723124._2
560+ let d = $t02290022947._1
561+ let found = $t02290022947._2
568562 if ((found != unit))
569563 then d
570564 else throw(("D calculation error, D = " + toString(d)))
571565 }
572566 }
573567
574568
575569 func getYD (xp,i,D) = {
576570 let n = big2
577571 let x = xp[if ((i == 0))
578572 then 1
579573 else 0]
580574 let aPrecision = parseBigIntValue(Amult)
581575 let a = (parseBigIntValue(A) * aPrecision)
582576 let s = x
583577 let ann = (a * n)
584578 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
585579 let b = ((s + ((D * aPrecision) / ann)) - D)
586580 func calc (acc,cur) = {
587- let $t02362423644 = acc
588- let y = $t02362423644._1
589- let found = $t02362423644._2
581+ let $t02344723467 = acc
582+ let y = $t02344723467._1
583+ let found = $t02344723467._2
590584 if ((found != unit))
591585 then acc
592586 else {
593587 let yNext = (((y * y) + c) / ((big2 * y) + b))
594588 let yDiff = absBigInt((yNext - value(y)))
595589 if ((big1 >= yDiff))
596590 then $Tuple2(yNext, cur)
597591 else $Tuple2(yNext, unit)
598592 }
599593 }
600594
601595 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
602- let $t02395123998 = {
596+ let $t02377423821 = {
603597 let $l = arr
604598 let $s = size($l)
605599 let $acc0 = $Tuple2(D, unit)
606600 func $f0_1 ($a,$i) = if (($i >= $s))
607601 then $a
608602 else calc($a, $l[$i])
609603
610604 func $f0_2 ($a,$i) = if (($i >= $s))
611605 then $a
612606 else throw("List size exceeds 15")
613607
614608 $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)
615609 }
616- let y = $t02395123998._1
617- let found = $t02395123998._2
610+ let y = $t02377423821._1
611+ let found = $t02377423821._2
618612 if ((found != unit))
619613 then y
620614 else throw(("Y calculation error, Y = " + toString(y)))
621615 }
622616
623617
624618 func calcPutOneTkn (pmtAmtRaw,pmtAssetId,userAddress,txId,withTakeFee) = {
625619 let poolConfig = gpc()
626620 let amId = poolConfig[idxAmAsId]
627621 let prId = poolConfig[idxPrAsId]
628622 let lpId = poolConfig[idxLPAsId]
629623 let amtDcm = parseIntValue(poolConfig[idxAmtAsDcm])
630624 let priceDcm = parseIntValue(poolConfig[idxPriceAsDcm])
631625 let lpAssetEmission = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "invalid lp asset").quantity)
632626 let chechEmission = if ((lpAssetEmission > big0))
633627 then true
634628 else throw("initial deposit requires all coins")
635629 if ((chechEmission == chechEmission))
636630 then {
637631 let amBalance = getAccBalance(amId)
638632 let prBalance = getAccBalance(prId)
639- let $t02478125243 = if ((txId == ""))
633+ let $t02460425066 = if ((txId == ""))
640634 then $Tuple2(amBalance, prBalance)
641635 else if ((pmtAssetId == amId))
642636 then if ((pmtAmtRaw > amBalance))
643637 then throw("invalid payment amount")
644638 else $Tuple2((amBalance - pmtAmtRaw), prBalance)
645639 else if ((pmtAssetId == prId))
646640 then if ((pmtAmtRaw > prBalance))
647641 then throw("invalid payment amount")
648642 else $Tuple2(amBalance, (prBalance - pmtAmtRaw))
649643 else throw("wrong pmtAssetId")
650- let amBalanceOld = $t02478125243._1
651- let prBalanceOld = $t02478125243._2
652- let $t02524925425 = if ((pmtAssetId == amId))
644+ let amBalanceOld = $t02460425066._1
645+ let prBalanceOld = $t02460425066._2
646+ let $t02507225248 = if ((pmtAssetId == amId))
653647 then $Tuple2(pmtAmtRaw, 0)
654648 else if ((pmtAssetId == prId))
655649 then $Tuple2(0, pmtAmtRaw)
656650 else throw("invalid payment")
657- let amAmountRaw = $t02524925425._1
658- let prAmountRaw = $t02524925425._2
659- let $t02542925683 = if (withTakeFee)
651+ let amAmountRaw = $t02507225248._1
652+ let prAmountRaw = $t02507225248._2
653+ let $t02525225506 = if (withTakeFee)
660654 then $Tuple3(takeFee(amAmountRaw, inFee)._1, takeFee(prAmountRaw, inFee)._1, takeFee(pmtAmtRaw, inFee)._2)
661655 else $Tuple3(amAmountRaw, prAmountRaw, 0)
662- let amAmount = $t02542925683._1
663- let prAmount = $t02542925683._2
664- let feeAmount = $t02542925683._3
656+ let amAmount = $t02525225506._1
657+ let prAmount = $t02525225506._2
658+ let feeAmount = $t02525225506._3
665659 let amBalanceNew = (amBalanceOld + amAmount)
666660 let prBalanceNew = (prBalanceOld + prAmount)
667661 let D0 = getD([toBigInt(amBalanceOld), toBigInt(prBalanceOld)])
668662 let D1 = getD([toBigInt(amBalanceNew), toBigInt(prBalanceNew)])
669663 let checkD = if ((D1 > D0))
670664 then true
671665 else throw()
672666 if ((checkD == checkD))
673667 then {
674668 let lpAmount = fraction(lpAssetEmission, (D1 - D0), D0)
675669 let curPrice = f1(cpbi(t1(prBalanceNew, priceDcm), t1(amBalanceNew, amtDcm)), scale8)
676670 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))]
677671 let poolProportion = fraction(prBalanceOld, scale8, amBalanceOld)
678672 let amountAssetPart = fraction(pmtAmtRaw, scale8, (poolProportion + scale8))
679673 let priceAssetPart = (pmtAmtRaw - amountAssetPart)
680674 let lpAmtBoth = fraction(lpAssetEmission, toBigInt(priceAssetPart), toBigInt(prBalanceOld))
681675 let bonus = toInt(fraction((lpAmount - lpAmtBoth), scale8BigInt, lpAmtBoth))
682676 $Tuple4(toInt(lpAmount), commonState, feeAmount, bonus)
683677 }
684678 else throw("Strict value is not equal to itself.")
685679 }
686680 else throw("Strict value is not equal to itself.")
687681 }
688682
689683
690684 func getOneTknV2Internal (outAssetId,minOutAmount,payments,caller,originCaller,transactionId) = {
691685 let poolConfig = gpc()
692686 let lpId = poolConfig[idxLPAsId]
693687 let amId = poolConfig[idxAmAsId]
694688 let prId = poolConfig[idxPrAsId]
695689 let amDecimals = parseIntValue(poolConfig[idxAmtAsDcm])
696690 let prDecimals = parseIntValue(poolConfig[idxPriceAsDcm])
697691 let poolStatus = poolConfig[idxPoolSt]
698692 let userAddress = if ((caller == restContract))
699693 then originCaller
700694 else caller
701695 let pmt = value(payments[0])
702696 let pmtAssetId = value(pmt.assetId)
703697 let pmtAmt = pmt.amount
704698 let txId58 = toBase58String(transactionId)
705699 if ((lpId != toBase58String(pmtAssetId)))
706700 then throw("Wrong LP")
707701 else {
708702 let amBalance = getAccBalance(amId)
709703 let prBalance = getAccBalance(prId)
710- let $t02768527796 = {
704+ let $t02750827619 = {
711705 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil)
712706 if ($isInstanceOf(@, "(Int, Int)"))
713707 then @
714708 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
715709 }
716- if (($t02768527796 == $t02768527796))
710+ if (($t02750827619 == $t02750827619))
717711 then {
718- let feeAmount = $t02768527796._2
719- let totalGet = $t02768527796._1
712+ let feeAmount = $t02750827619._2
713+ let totalGet = $t02750827619._1
720714 let totalAmount = if (if ((minOutAmount > 0))
721715 then (minOutAmount > totalGet)
722716 else false)
723717 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
724718 else totalGet
725- let $t02798628293 = if ((outAssetId == amId))
719+ let $t02780928116 = if ((outAssetId == amId))
726720 then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance)
727721 else if ((outAssetId == prId))
728722 then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount))
729723 else throw("invalid out asset id")
730- let outAm = $t02798628293._1
731- let outPr = $t02798628293._2
732- let amBalanceNew = $t02798628293._3
733- let prBalanceNew = $t02798628293._4
724+ let outAm = $t02780928116._1
725+ let outPr = $t02780928116._2
726+ let amBalanceNew = $t02780928116._3
727+ let prBalanceNew = $t02780928116._4
734728 let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals))
735729 let curPr = f1(curPrX18, scale8)
736730 let outAssetIdOrWaves = if ((outAssetId == "WAVES"))
737731 then unit
738732 else fromBase58String(outAssetId)
739733 let sendFeeToMatcher = if ((feeAmount > 0))
740734 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetIdOrWaves)]
741735 else nil
742736 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)
743737 if ((state == state))
744738 then {
745739 let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
746740 if ((burn == burn))
747741 then $Tuple2(state, totalAmount)
748742 else throw("Strict value is not equal to itself.")
749743 }
750744 else throw("Strict value is not equal to itself.")
751745 }
752746 else throw("Strict value is not equal to itself.")
753747 }
754748 }
755749
756750
757751 func m () = match getString(mpk()) {
758752 case s: String =>
759753 fromBase58String(s)
760754 case _: Unit =>
761755 unit
762756 case _ =>
763757 throw("Match error")
764758 }
765759
766760
767761 func pm () = match getString(pmpk()) {
768762 case s: String =>
769763 fromBase58String(s)
770764 case _: Unit =>
771765 unit
772766 case _ =>
773767 throw("Match error")
774768 }
775769
776770
777771 let pd = throw("Permission denied")
778772
779773 func isManager (i) = match m() {
780774 case pk: ByteVector =>
781775 (i.callerPublicKey == pk)
782776 case _: Unit =>
783777 (i.caller == this)
784778 case _ =>
785779 throw("Match error")
786780 }
787781
788782
789783 func mm (i) = match m() {
790784 case pk: ByteVector =>
791785 if ((i.callerPublicKey == pk))
792786 then true
793787 else pd
794788 case _: Unit =>
795789 if ((i.caller == this))
796790 then true
797791 else pd
798792 case _ =>
799793 throw("Match error")
800794 }
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-
910795
911796
912797 @Callable(i)
913798 func constructor (fc) = {
914799 let c = mm(i)
915800 if ((c == c))
916801 then [StringEntry(fc(), fc)]
917802 else throw("Strict value is not equal to itself.")
918803 }
919804
920805
921806
922807 @Callable(i)
923808 func setManager (pendingManagerPublicKey) = {
924809 let c = mm(i)
925810 if ((c == c))
926811 then {
927812 let cm = fromBase58String(pendingManagerPublicKey)
928813 if ((cm == cm))
929814 then [StringEntry(pmpk(), pendingManagerPublicKey)]
930815 else throw("Strict value is not equal to itself.")
931816 }
932817 else throw("Strict value is not equal to itself.")
933818 }
934819
935820
936821
937822 @Callable(i)
938823 func confirmManager () = {
939824 let p = pm()
940825 let hpm = if (isDefined(p))
941826 then true
942827 else throw("No pending manager")
943828 if ((hpm == hpm))
944829 then {
945830 let cpm = if ((i.callerPublicKey == value(p)))
946831 then true
947832 else throw("You are not pending manager")
948833 if ((cpm == cpm))
949834 then [StringEntry(mpk(), toBase58String(value(p))), DeleteEntry(pmpk())]
950835 else throw("Strict value is not equal to itself.")
951836 }
952837 else throw("Strict value is not equal to itself.")
953838 }
954839
955840
956841
957842 @Callable(i)
958843 func put (slip,autoStake) = {
959844 let factCfg = gfc()
960845 let stakingCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactStakCntr]), "Wr st addr")
961846 let slipCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactSlippCntr]), "Wr sl addr")
962847 if ((0 > slip))
963848 then throw("Wrong slippage")
964849 else if ((size(i.payments) != 2))
965850 then throw("2 pmnts expd")
966851 else {
967852 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, "")
968853 let emitLpAmt = e._2
969854 let lpAssetId = e._7
970855 let state = e._9
971856 let amDiff = e._10
972857 let prDiff = e._11
973858 let amId = e._12
974859 let prId = e._13
975860 let r = invoke(fca, "emit", [emitLpAmt], nil)
976861 if ((r == r))
977862 then {
978863 let el = match r {
979864 case legacy: Address =>
980865 invoke(legacy, "emit", [emitLpAmt], nil)
981866 case _ =>
982867 unit
983868 }
984869 if ((el == el))
985870 then {
986871 let sa = if ((amDiff > 0))
987872 then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)])
988873 else nil
989874 if ((sa == sa))
990875 then {
991876 let sp = if ((prDiff > 0))
992877 then invoke(slipCntr, "put", nil, [AttachedPayment(prId, prDiff)])
993878 else nil
994879 if ((sp == sp))
995880 then {
996881 let lpTrnsfr = if (autoStake)
997882 then {
998883 let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
999884 if ((ss == ss))
1000885 then nil
1001886 else throw("Strict value is not equal to itself.")
1002887 }
1003888 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
1004889 (state ++ lpTrnsfr)
1005890 }
1006891 else throw("Strict value is not equal to itself.")
1007892 }
1008893 else throw("Strict value is not equal to itself.")
1009894 }
1010895 else throw("Strict value is not equal to itself.")
1011896 }
1012897 else throw("Strict value is not equal to itself.")
1013898 }
1014899 }
1015900
1016901
1017902
1018903 @Callable(i)
1019904 func putOneTknV2 (minOutAmount,autoStake) = {
1020905 let isPoolOneTokenOperationsDisabled = {
1021906 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
1022907 if ($isInstanceOf(@, "Boolean"))
1023908 then @
1024909 else throw(($getType(@) + " couldn't be cast to Boolean"))
1025910 }
1026911 let isPutDisabled = if (if (if (igs())
1027912 then true
1028913 else (cfgPoolStatus == PoolPutDis))
1029914 then true
1030915 else (cfgPoolStatus == PoolShutdown))
1031916 then true
1032917 else isPoolOneTokenOperationsDisabled
1033918 let checks = [if (if (!(isPutDisabled))
1034919 then true
1035920 else isManager(i))
1036921 then true
1037922 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
1038923 then true
1039924 else throwErr("exactly 1 payment are expected")]
1040925 if ((checks == checks))
1041926 then {
1042927 let poolConfig = gpc()
1043928 let amId = poolConfig[idxAmAsId]
1044929 let prId = poolConfig[idxPrAsId]
1045930 let lpId = fromBase58String(poolConfig[idxLPAsId])
1046931 let amDecimals = parseIntValue(poolConfig[idxAmtAsDcm])
1047932 let prDecimals = parseIntValue(poolConfig[idxPriceAsDcm])
1048933 let userAddress = if ((i.caller == this))
1049934 then i.originCaller
1050935 else i.caller
1051936 let pmt = value(i.payments[0])
1052937 let pmtAssetId = toBase58String(value(pmt.assetId))
1053938 let pmtAmt = pmt.amount
1054- let $t03668336841 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1055- if (($t03668336841 == $t03668336841))
939+ let $t03347833636 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
940+ if (($t03347833636 == $t03347833636))
1056941 then {
1057- let feeAmount = $t03668336841._3
1058- let state = $t03668336841._2
1059- let estimLP = $t03668336841._1
942+ let feeAmount = $t03347833636._3
943+ let state = $t03347833636._2
944+ let estimLP = $t03347833636._1
1060945 let emitLpAmt = if (if ((minOutAmount > 0))
1061946 then (minOutAmount > estimLP)
1062947 else false)
1063948 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
1064949 else estimLP
1065950 let e = invoke(fca, "emit", [emitLpAmt], nil)
1066951 if ((e == e))
1067952 then {
1068953 let el = match e {
1069954 case legacy: Address =>
1070955 invoke(legacy, "emit", [emitLpAmt], nil)
1071956 case _ =>
1072957 unit
1073958 }
1074959 if ((el == el))
1075960 then {
1076961 let lpTrnsfr = if (autoStake)
1077962 then {
1078963 let ss = invoke(stakingContract, "stake", nil, [AttachedPayment(lpId, emitLpAmt)])
1079964 if ((ss == ss))
1080965 then nil
1081966 else throw("Strict value is not equal to itself.")
1082967 }
1083968 else [ScriptTransfer(i.caller, emitLpAmt, lpId)]
1084969 let sendFeeToMatcher = if ((feeAmount > 0))
1085970 then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))]
1086971 else nil
1087972 $Tuple2(((state ++ lpTrnsfr) ++ sendFeeToMatcher), emitLpAmt)
1088973 }
1089974 else throw("Strict value is not equal to itself.")
1090975 }
1091976 else throw("Strict value is not equal to itself.")
1092977 }
1093978 else throw("Strict value is not equal to itself.")
1094979 }
1095980 else throw("Strict value is not equal to itself.")
1096981 }
1097982
1098983
1099984
1100985 @Callable(i)
1101986 func putForFree (maxSlpg) = if ((0 > maxSlpg))
1102987 then throw("Wrong slpg")
1103988 else if ((size(i.payments) != 2))
1104989 then throw("2 pmnts expd")
1105990 else {
1106991 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, "")
1107992 estPut._9
1108993 }
1109994
1110995
1111996
1112997 @Callable(i)
1113998 func get () = {
1114999 let r = cg(i)
11151000 let outAmtAmt = r._1
11161001 let outPrAmt = r._2
11171002 let pmtAmt = r._3
11181003 let pmtAssetId = r._4
11191004 let state = r._5
11201005 let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
11211006 if ((b == b))
11221007 then state
11231008 else throw("Strict value is not equal to itself.")
11241009 }
11251010
11261011
11271012
11281013 @Callable(i)
11291014 func getOneTknV2 (outAssetId,minOutAmount) = {
11301015 let isPoolOneTokenOperationsDisabled = {
11311016 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
11321017 if ($isInstanceOf(@, "Boolean"))
11331018 then @
11341019 else throw(($getType(@) + " couldn't be cast to Boolean"))
11351020 }
11361021 let isGetDisabled = if (if (igs())
11371022 then true
11381023 else (cfgPoolStatus == PoolShutdown))
11391024 then true
11401025 else isPoolOneTokenOperationsDisabled
11411026 let checks = [if (if (!(isGetDisabled))
11421027 then true
11431028 else isManager(i))
11441029 then true
11451030 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
11461031 then true
11471032 else throwErr("exactly 1 payment are expected")]
11481033 if ((checks == checks))
11491034 then {
1150- let $t03946339618 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1151- let state = $t03946339618._1
1152- let totalAmount = $t03946339618._2
1035+ let $t03625836413 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1036+ let state = $t03625836413._1
1037+ let totalAmount = $t03625836413._2
11531038 $Tuple2(state, totalAmount)
11541039 }
11551040 else throw("Strict value is not equal to itself.")
11561041 }
11571042
11581043
11591044
11601045 @Callable(i)
11611046 func getOneTknV2READONLY (outAssetId,lpAssetAmount) = {
11621047 let poolConfig = gpc()
11631048 let amId = poolConfig[idxAmAsId]
11641049 let prId = poolConfig[idxPrAsId]
11651050 let lpId = poolConfig[idxLPAsId]
11661051 let xp = [toBigInt(getAccBalance(amId)), toBigInt(getAccBalance(prId))]
11671052 let lpEmission = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "invalid lp asset").quantity)
11681053 let D0 = getD(xp)
11691054 let D1 = (D0 - fraction(toBigInt(lpAssetAmount), D0, lpEmission))
11701055 let index = if ((outAssetId == amId))
11711056 then 0
11721057 else if ((outAssetId == prId))
11731058 then 1
11741059 else throw("invalid out asset id")
11751060 let newY = getYD(xp, index, D1)
11761061 let dy = (xp[index] - newY)
11771062 let totalGetRaw = max([0, toInt((dy - big1))])
1178- let $t04040840463 = takeFee(totalGetRaw, outFee)
1179- let totalGet = $t04040840463._1
1180- let feeAmount = $t04040840463._2
1063+ let $t03720337258 = takeFee(totalGetRaw, outFee)
1064+ let totalGet = $t03720337258._1
1065+ let feeAmount = $t03720337258._2
11811066 $Tuple2(nil, $Tuple2(totalGet, feeAmount))
11821067 }
11831068
11841069
11851070
11861071 @Callable(i)
11871072 func getOneTknV2WithBonusREADONLY (outAssetId,lpAssetAmount) = {
11881073 let poolConfig = gpc()
11891074 let amId = poolConfig[idxAmAsId]
11901075 let prId = poolConfig[idxPrAsId]
11911076 let lpId = poolConfig[idxLPAsId]
11921077 let amBalance = getAccBalance(amId)
11931078 let prBalance = getAccBalance(prId)
1194- let $t04080840923 = {
1079+ let $t03760337718 = {
11951080 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil)
11961081 if ($isInstanceOf(@, "(Int, Int)"))
11971082 then @
11981083 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
11991084 }
1200- let totalGet = $t04080840923._1
1201- let feeAmount = $t04080840923._2
1085+ let totalGet = $t03760337718._1
1086+ let feeAmount = $t03760337718._2
12021087 let r = ego("", lpId, lpAssetAmount, this)
12031088 let outAmAmt = r._1
12041089 let outPrAmt = r._2
12051090 let sumOfGetAssets = (outAmAmt + outPrAmt)
12061091 let bonus = if ((sumOfGetAssets == 0))
12071092 then if ((totalGet == 0))
12081093 then 0
12091094 else throw("bonus calculation error")
12101095 else fraction((totalGet - sumOfGetAssets), scale8, sumOfGetAssets)
12111096 $Tuple2(nil, $Tuple3(totalGet, feeAmount, bonus))
12121097 }
12131098
12141099
12151100
12161101 @Callable(i)
12171102 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
12181103 let r = cg(i)
12191104 let outAmAmt = r._1
12201105 let outPrAmt = r._2
12211106 let pmtAmt = r._3
12221107 let pmtAssetId = r._4
12231108 let state = r._5
12241109 if ((noLessThenAmtAsset > outAmAmt))
12251110 then throw(((("Failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
12261111 else if ((noLessThenPriceAsset > outPrAmt))
12271112 then throw(((("Failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
12281113 else {
12291114 let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
12301115 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
12311116 then state
12321117 else throw("Strict value is not equal to itself.")
12331118 }
12341119 }
12351120
12361121
12371122
12381123 @Callable(i)
12391124 func unstakeAndGet (amount) = {
12401125 let checkPayments = if ((size(i.payments) != 0))
12411126 then throw("No pmnts expd")
12421127 else true
12431128 if ((checkPayments == checkPayments))
12441129 then {
12451130 let cfg = gpc()
12461131 let factoryCfg = gfc()
12471132 let lpAssetId = fromBase58String(cfg[idxLPAsId])
12481133 let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr")
12491134 let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil)
12501135 if ((unstakeInv == unstakeInv))
12511136 then {
12521137 let r = ego(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
12531138 let sts = parseIntValue(r._9)
12541139 let state = r._10
12551140 let v = if (if (igs())
12561141 then true
12571142 else (sts == PoolShutdown))
12581143 then throw(("Blocked: " + toString(sts)))
12591144 else true
12601145 if ((v == v))
12611146 then {
12621147 let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
12631148 if ((burnA == burnA))
12641149 then state
12651150 else throw("Strict value is not equal to itself.")
12661151 }
12671152 else throw("Strict value is not equal to itself.")
12681153 }
12691154 else throw("Strict value is not equal to itself.")
12701155 }
12711156 else throw("Strict value is not equal to itself.")
12721157 }
12731158
12741159
12751160
12761161 @Callable(i)
12771162 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
12781163 let isGetDisabled = if (igs())
12791164 then true
12801165 else (cfgPoolStatus == PoolShutdown)
12811166 let checks = [if (!(isGetDisabled))
12821167 then true
12831168 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
12841169 then true
12851170 else throw("no payments are expected")]
12861171 if ((checks == checks))
12871172 then {
12881173 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
12891174 if ((unstakeInv == unstakeInv))
12901175 then {
12911176 let res = ego(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
12921177 let outAmAmt = res._1
12931178 let outPrAmt = res._2
12941179 let state = res._10
12951180 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
12961181 then true
12971182 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
12981183 then true
12991184 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
13001185 if ((checkAmounts == checkAmounts))
13011186 then {
13021187 let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
13031188 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
13041189 then state
13051190 else throw("Strict value is not equal to itself.")
13061191 }
13071192 else throw("Strict value is not equal to itself.")
13081193 }
13091194 else throw("Strict value is not equal to itself.")
13101195 }
13111196 else throw("Strict value is not equal to itself.")
13121197 }
13131198
13141199
13151200
13161201 @Callable(i)
13171202 func unstakeAndGetOneTknV2 (unstakeAmount,outAssetId,minOutAmount) = {
13181203 let isPoolOneTokenOperationsDisabled = {
13191204 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
13201205 if ($isInstanceOf(@, "Boolean"))
13211206 then @
13221207 else throw(($getType(@) + " couldn't be cast to Boolean"))
13231208 }
13241209 let isGetDisabled = if (if (igs())
13251210 then true
13261211 else (cfgPoolStatus == PoolShutdown))
13271212 then true
13281213 else isPoolOneTokenOperationsDisabled
13291214 let checks = [if (if (!(isGetDisabled))
13301215 then true
13311216 else isManager(i))
13321217 then true
13331218 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
13341219 then true
13351220 else throwErr("no payments are expected")]
13361221 if ((checks == checks))
13371222 then {
13381223 let cfg = gpc()
13391224 let factoryCfg = gfc()
13401225 let lpAssetId = fromBase58String(cfg[idxLPAsId])
13411226 let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr")
13421227 let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), unstakeAmount], nil)
13431228 if ((unstakeInv == unstakeInv))
13441229 then {
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
1230+ let $t04155641744 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1231+ let state = $t04155641744._1
1232+ let totalAmount = $t04155641744._2
13481233 $Tuple2(state, totalAmount)
13491234 }
13501235 else throw("Strict value is not equal to itself.")
13511236 }
13521237 else throw("Strict value is not equal to itself.")
13531238 }
13541239
13551240
13561241
13571242 @Callable(i)
13581243 func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = {
13591244 let poolConfig = gpc()
13601245 let amId = poolConfig[idxAmAsId]
13611246 let prId = poolConfig[idxPrAsId]
13621247 let lpId = poolConfig[idxLPAsId]
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
1248+ let $t04200342106 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1249+ let lpAmount = $t04200342106._1
1250+ let state = $t04200342106._2
1251+ let feeAmount = $t04200342106._3
1252+ let bonus = $t04200342106._4
13681253 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
13691254 }
13701255
13711256
13721257
13731258 @Callable(i)
13741259 func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = {
13751260 let poolConfig = gpc()
13761261 let amId = poolConfig[idxAmAsId]
13771262 let prId = poolConfig[idxPrAsId]
13781263 let lpId = poolConfig[idxLPAsId]
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
1264+ let $t04238542489 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1265+ let lpAmount = $t04238542489._1
1266+ let state = $t04238542489._2
1267+ let feeAmount = $t04238542489._3
1268+ let bonus = $t04238542489._4
13841269 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
13851270 }
13861271
13871272
13881273
13891274 @Callable(i)
13901275 func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString(fca)))
13911276 then throw("denied")
13921277 else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr)], "success")
13931278
13941279
13951280
13961281 @Callable(i)
13971282 func setS (k,v) = if ((toString(i.caller) != strf(this, ada())))
13981283 then pd
13991284 else [StringEntry(k, v)]
14001285
14011286
14021287
14031288 @Callable(i)
14041289 func setI (k,v) = if ((toString(i.caller) != strf(this, ada())))
14051290 then pd
14061291 else [IntegerEntry(k, v)]
14071292
14081293
14091294
14101295 @Callable(i)
14111296 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, gpc())
14121297
14131298
14141299
14151300 @Callable(i)
14161301 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
14171302
14181303
14191304
14201305 @Callable(i)
14211306 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
14221307 let pr = calcPrices(amAmt, prAmt, lpAmt)
14231308 $Tuple2(nil, [toString(pr[0]), toString(pr[1]), toString(pr[2])])
14241309 }
14251310
14261311
14271312
14281313 @Callable(i)
14291314 func fromX18WrapperREADONLY (val,resScaleMult) = $Tuple2(nil, f1(parseBigIntValue(val), resScaleMult))
14301315
14311316
14321317
14331318 @Callable(i)
14341319 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(t1(origVal, origScaleMult)))
14351320
14361321
14371322
14381323 @Callable(i)
14391324 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(cpbi(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
14401325
14411326
14421327
14431328 @Callable(i)
14441329 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, ""))
14451330
14461331
14471332
14481333 @Callable(i)
14491334 func estimateGetOperationWrapperREADONLY (txId58,pmtAsId,pmtLpAmt,usrAddr) = {
14501335 let r = ego(txId58, pmtAsId, pmtLpAmt, addressFromStringValue(usrAddr))
14511336 $Tuple2(nil, $Tuple10(r._1, r._2, r._3, r._4, r._5, r._6, r._7, toString(r._8), r._9, r._10))
14521337 }
14531338
14541339
14551340 @Verifier(tx)
14561341 func verify () = {
14571342 let targetPublicKey = match m() {
14581343 case pk: ByteVector =>
14591344 pk
14601345 case _: Unit =>
14611346 tx.senderPublicKey
14621347 case _ =>
14631348 throw("Match error")
14641349 }
14651350 match tx {
14661351 case order: Order =>
14671352 let matcherPub = mp()
14681353 let orderValid = moa(order)
14691354 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
14701355 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
14711356 if (if (if (orderValid)
14721357 then senderValid
14731358 else false)
14741359 then matcherValid
14751360 else false)
14761361 then true
14771362 else toe(orderValid, senderValid, matcherValid)
14781363 case s: SetScriptTransaction =>
14791364 let newHash = blake2b256(value(s.script))
14801365 let allowedHash = fromBase64String(value(getString(fca, keyAllowedLpStableScriptHash())))
14811366 let currentHash = scriptHash(this)
14821367 if (if ((allowedHash == newHash))
14831368 then (currentHash != newHash)
14841369 else false)
14851370 then true
14861371 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
14871372 case _ =>
14881373 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
14891374 }
14901375 }
14911376

github/deemru/w8io/026f985 
166.11 ms