tx · E51Pwd7r8uoDJ4ZMcoj2dNUfVymVa3bN15ZknETmx5qT

3N8cKL8uHT2sFedwsSdD7u7zFPD7iM2WSo4:  -0.02900000 Waves

2022.10.26 12:57 [2289238] smart account 3N8cKL8uHT2sFedwsSdD7u7zFPD7iM2WSo4 > SELF 0.00000000 Waves

{ "type": 13, "id": "E51Pwd7r8uoDJ4ZMcoj2dNUfVymVa3bN15ZknETmx5qT", "fee": 2900000, "feeAssetId": null, "timestamp": 1666778211931, "version": 1, "sender": "3N8cKL8uHT2sFedwsSdD7u7zFPD7iM2WSo4", "senderPublicKey": "5uqTFe1tdb9qAXgGRerTFeiZvA8oaXqKKAHGzaHKAnwu", "proofs": [ "3a5tBnXkJQuuuW4ZrvcupqXcBtAS5oSX1py1tD3XxfL5NsAAEWhmitbRYZe3BWWovVUHU34Jr7n3Hnvey275QLa9" ], "script": "base64:BgLJJggCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBAoCCAgSABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFzc2V0SWQiEGlkeElQcmljZUFzc2V0SWQiDWlkeExQQXNzZXRE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XJQdWJsaWNLZXkEAmF3CQD0AwMIBQJjUglib2R5Qnl0ZXMJAJEDAggFAmNSBnByb29mcwABBQJmRQMDAwUCYXUFAmF2BwUCYXcHBgkBAmF0AwUCYXUFAmF2BQJhdwMJAAECBQJkcQIUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAmVyBQJkcQQCZkYJAPYDAQkBBXZhbHVlAQgFAmVyBnNjcmlwdAQCZkcJANsEAQkBBXZhbHVlAQkAnQgCBQJhRAkBAmFyAAQCZkgJAPEHAQUEdGhpcwMDCQAAAgUCZkcFAmZGCQECIT0CBQJmSAUCZkYHBgkA9AMDCAUCZkIJYm9keUJ5dGVzCQCRAwIIBQJmQgZwcm9vZnMAAAUCZkQJAPQDAwgFAmZCCWJvZHlCeXRlcwkAkQMCCAUCZkIGcHJvb2ZzAAAFAmZE+JLASw==", "chainId": 84, "height": 2289238, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CmhdDfFZAP1ipEw9uKdXLRXj7sFHpfDCTm5wpePp4GyQ Next: 9BjCNSz7EFEBanuP3k9MMTGUYN31tW9WYJLF5VjrkzjK Diff:
OldNewDifferences
467467
468468 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
469469 let isEval = (txId == unit)
470- let $t02223222410 = parsePoolConfig(getPoolConfig())
471- let poolAddress = $t02223222410._1
472- let poolStatus = $t02223222410._2
473- let lpAssetId = $t02223222410._3
474- let amountAssetId = $t02223222410._4
475- let priceAssetId = $t02223222410._5
476- let amountAssetDecimals = $t02223222410._6
477- let priceAssetDecimals = $t02223222410._7
478- let amountBalanceRaw = getAccBalance(assetIdToString(amountAssetId))
479- let priceBalanceRaw = getAccBalance(assetIdToString(priceAssetId))
480- let paymentInAmountAsset = if ((paymentAssetId == amountAssetId))
470+ let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
471+ let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
472+ let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
481473 then true
482- else if ((paymentAssetId == priceAssetId))
474+ else if ((paymentAssetId == cfgPriceAssetId))
483475 then false
484476 else throwErr("invalid asset")
485- let $t02274023033 = if (isEval)
477+ let $t02257022863 = if (isEval)
486478 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
487479 else if (paymentInAmountAsset)
488480 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
489481 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
490- let amountBalanceOld = $t02274023033._1
491- let priceBalanceOld = $t02274023033._2
492- let $t02303723186 = if (paymentInAmountAsset)
482+ let amountBalanceOld = $t02257022863._1
483+ let priceBalanceOld = $t02257022863._2
484+ let $t02286723016 = if (paymentInAmountAsset)
493485 then $Tuple2(paymentAmountRaw, 0)
494486 else $Tuple2(0, paymentAmountRaw)
495- let amountAssetAmountRaw = $t02303723186._1
496- let priceAssetAmountRaw = $t02303723186._2
487+ let amountAssetAmountRaw = $t02286723016._1
488+ let priceAssetAmountRaw = $t02286723016._2
497489 let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
498490 let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
499- let $t02330823367 = takeFee(paymentAmountRaw)
500- let paymentAmount = $t02330823367._1
501- let feeAmount = $t02330823367._2
491+ let $t02313823197 = takeFee(paymentAmountRaw)
492+ let paymentAmount = $t02313823197._1
493+ let feeAmount = $t02313823197._2
502494 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
503495 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
504- let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, priceAssetDecimals), toX18(amountBalanceNew, amountAssetDecimals))
496+ let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
505497 let priceNew = fromX18(priceNewX18, scale8)
506498 let paymentBalance = if (paymentInAmountAsset)
507499 then amountBalanceOld
508500 else priceBalanceOld
509501 let paymentBalanceBigInt = toBigInt(paymentBalance)
510- let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(lpAssetId), (("asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity)
502+ let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
511503 let chechSupply = if ((supplyBigInt > big0))
512504 then true
513505 else throwErr("initial deposit requires all coins")
518510 let commonState = if (isEval)
519511 then nil
520512 else [IntegerEntry(pl(), priceNew), IntegerEntry(ph(height, lastBlock.timestamp), priceNew), StringEntry(pau(toString(value(userAddress)), toBase58String(value(txId))), dataPutActionInfo(amountAssetAmountRaw, priceAssetAmountRaw, issueAmount, priceNew, 0, 0, height, lastBlock.timestamp, 0, 0))]
521- let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, priceAssetDecimals), toX18(amountBalanceOld, amountAssetDecimals))
513+ let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
522514 let priceOld = fromX18(priceOldX18, scale8)
523515 let priceImpact = abs((((priceNew - priceOld) * scale8) / priceOld))
524516 $Tuple4(issueAmount, commonState, feeAmount, priceImpact)
529521
530522 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
531523 let isEval = (txId == unit)
532- let $t02518925350 = parsePoolConfig(getPoolConfig())
533- let poolAddress = $t02518925350._1
534- let poolStatus = $t02518925350._2
535- let lpAssetId = $t02518925350._3
536- let amountAssetId = $t02518925350._4
537- let priceAssetId = $t02518925350._5
538- let amDecimals = $t02518925350._6
539- let prDecimals = $t02518925350._7
540- let checks = [if ((paymentAssetId == lpAssetId))
524+ let checks = [if ((paymentAssetId == cfgLpAssetId))
541525 then true
542526 else throwErr("invalid lp asset")]
543527 if ((checks == checks))
544528 then {
545- let outInAmountAsset = if ((outAssetId == amountAssetId))
529+ let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
546530 then true
547- else if ((outAssetId == priceAssetId))
531+ else if ((outAssetId == cfgPriceAssetId))
548532 then false
549533 else throwErr("invalid asset")
550534 let balanceBigInt = if (outInAmountAsset)
551- then toBigInt(getAccBalance(assetIdToString(amountAssetId)))
552- else toBigInt(getAccBalance(assetIdToString(priceAssetId)))
553- let amBalanceOld = getAccBalance(assetIdToString(amountAssetId))
554- let prBalanceOld = getAccBalance(assetIdToString(priceAssetId))
535+ then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
536+ else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
537+ let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
538+ let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
555539 let outBalance = if (outInAmountAsset)
556540 then amBalanceOld
557541 else prBalanceOld
558542 let outBalanceBigInt = toBigInt(outBalance)
559- let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(lpAssetId), (("asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity)
543+ let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
560544 let redeemedBigInt = toBigInt(paymentAmount)
561545 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
562- let $t02642526475 = takeFee(amountRaw)
563- let totalAmount = $t02642526475._1
564- let feeAmount = $t02642526475._2
565- let $t02647926705 = if (outInAmountAsset)
546+ let $t02613526185 = takeFee(amountRaw)
547+ let totalAmount = $t02613526185._1
548+ let feeAmount = $t02613526185._2
549+ let $t02618926415 = if (outInAmountAsset)
566550 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
567551 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
568- let outAmAmount = $t02647926705._1
569- let outPrAmount = $t02647926705._2
570- let amBalanceNew = $t02647926705._3
571- let prBalanceNew = $t02647926705._4
572- let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, prDecimals), toX18(amBalanceNew, amDecimals))
552+ let outAmAmount = $t02618926415._1
553+ let outPrAmount = $t02618926415._2
554+ let amBalanceNew = $t02618926415._3
555+ let prBalanceNew = $t02618926415._4
556+ let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
573557 let priceNew = fromX18(priceNewX18, scale8)
574558 let commonState = if (isEval)
575559 then nil
576560 else [StringEntry(gau(toString(value(userAddress)), toBase58String(value(txId))), dataGetActionInfo(outAmAmount, outPrAmount, paymentAmount, priceNew, height, lastBlock.timestamp)), IntegerEntry(pl(), priceNew), IntegerEntry(ph(height, lastBlock.timestamp), priceNew)]
577- let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, prDecimals), toX18(amBalanceOld, amDecimals))
561+ let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
578562 let priceOld = fromX18(priceOldX18, scale8)
579563 let priceImpact = abs((((priceNew - priceOld) * scale8) / priceOld))
580564 $Tuple4(totalAmount, commonState, feeAmount, priceImpact)
721705
722706 @Callable(i)
723707 func putOneTkn (minOutAmount,autoStake) = {
724- let isPutDisabled = if (if (isGlobalShutdown())
708+ let isPoolOneTokenOperationsDisabled = {
709+ let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
710+ if ($isInstanceOf(@, "Boolean"))
711+ then @
712+ else throw(($getType(@) + " couldn't be cast to Boolean"))
713+ }
714+ let isPutDisabled = if (if (if (isGlobalShutdown())
725715 then true
726716 else (cfgPoolStatus == PoolPutDisabled))
727717 then true
728- else (cfgPoolStatus == PoolShutdown)
718+ else (cfgPoolStatus == PoolShutdown))
719+ then true
720+ else isPoolOneTokenOperationsDisabled
729721 let checks = [if (!(isPutDisabled))
730722 then true
731723 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
738730 let paymentAmountRaw = payment.amount
739731 let userAddress = i.caller
740732 let txId = i.transactionId
741- let $t03105731184 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
742- let emitAmountEstimated = $t03105731184._1
743- let commonState = $t03105731184._2
744- let feeAmount = $t03105731184._3
745- let bonus = $t03105731184._4
733+ let $t03099731124 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
734+ let emitAmountEstimated = $t03099731124._1
735+ let commonState = $t03099731124._2
736+ let feeAmount = $t03099731124._3
737+ let bonus = $t03099731124._4
746738 let emitAmount = if (if ((minOutAmount > 0))
747739 then (minOutAmount > emitAmountEstimated)
748740 else false)
773765
774766 @Callable(i)
775767 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
776- let $t03191332048 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
777- let emitAmountEstimated = $t03191332048._1
778- let commonState = $t03191332048._2
779- let feeAmount = $t03191332048._3
780- let bonus = $t03191332048._4
768+ let $t03185331988 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
769+ let emitAmountEstimated = $t03185331988._1
770+ let commonState = $t03185331988._2
771+ let feeAmount = $t03185331988._3
772+ let bonus = $t03185331988._4
781773 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
782774 }
783775
785777
786778 @Callable(i)
787779 func getOneTkn (outAssetIdStr,minOutAmount) = {
788- let isGetDisabled = if (isGlobalShutdown())
780+ let isPoolOneTokenOperationsDisabled = {
781+ let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
782+ if ($isInstanceOf(@, "Boolean"))
783+ then @
784+ else throw(($getType(@) + " couldn't be cast to Boolean"))
785+ }
786+ let isGetDisabled = if (if (isGlobalShutdown())
789787 then true
790- else (cfgPoolStatus == PoolShutdown)
788+ else (cfgPoolStatus == PoolShutdown))
789+ then true
790+ else isPoolOneTokenOperationsDisabled
791791 let checks = [if (!(isGetDisabled))
792792 then true
793793 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
801801 let paymentAmount = payment.amount
802802 let userAddress = i.caller
803803 let txId = i.transactionId
804- let $t03263632768 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
805- let amountEstimated = $t03263632768._1
806- let commonState = $t03263632768._2
807- let feeAmount = $t03263632768._3
808- let bonus = $t03263632768._4
804+ let $t03276032892 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
805+ let amountEstimated = $t03276032892._1
806+ let commonState = $t03276032892._2
807+ let feeAmount = $t03276032892._3
808+ let bonus = $t03276032892._4
809809 let amount = if (if ((minOutAmount > 0))
810810 then (minOutAmount > amountEstimated)
811811 else false)
829829
830830 @Callable(i)
831831 func getOneTknREADONLY (outAssetId,paymentAmount) = {
832- let $t03340333541 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
833- let amountEstimated = $t03340333541._1
834- let commonState = $t03340333541._2
835- let feeAmount = $t03340333541._3
836- let bonus = $t03340333541._4
832+ let $t03352733665 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
833+ let amountEstimated = $t03352733665._1
834+ let commonState = $t03352733665._2
835+ let feeAmount = $t03352733665._3
836+ let bonus = $t03352733665._4
837837 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
838838 }
839839
841841
842842 @Callable(i)
843843 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
844- let isGetDisabled = if (isGlobalShutdown())
844+ let isPoolOneTokenOperationsDisabled = {
845+ let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
846+ if ($isInstanceOf(@, "Boolean"))
847+ then @
848+ else throw(($getType(@) + " couldn't be cast to Boolean"))
849+ }
850+ let isGetDisabled = if (if (isGlobalShutdown())
845851 then true
846- else (cfgPoolStatus == PoolShutdown)
852+ else (cfgPoolStatus == PoolShutdown))
853+ then true
854+ else isPoolOneTokenOperationsDisabled
847855 let checks = [if (!(isGetDisabled))
848856 then true
849857 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
857865 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
858866 if ((unstakeInv == unstakeInv))
859867 then {
860- let $t03414934279 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
861- let amountEstimated = $t03414934279._1
862- let commonState = $t03414934279._2
863- let feeAmount = $t03414934279._3
864- let bonus = $t03414934279._4
868+ let $t03445734587 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
869+ let amountEstimated = $t03445734587._1
870+ let commonState = $t03445734587._2
871+ let feeAmount = $t03445734587._3
872+ let bonus = $t03445734587._4
865873 let amount = if (if ((minOutAmount > 0))
866874 then (minOutAmount > amountEstimated)
867875 else false)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let lPdecimals = 8
55
66 let scale8 = 100000000
77
88 let scale8BigInt = toBigInt(100000000)
99
1010 let scale18 = toBigInt(1000000000000000000)
1111
1212 let zeroBigInt = toBigInt(0)
1313
1414 let big0 = toBigInt(0)
1515
1616 let big1 = toBigInt(1)
1717
1818 let big2 = toBigInt(2)
1919
2020 let wavesString = "WAVES"
2121
2222 let SEP = "__"
2323
2424 let PoolActive = 1
2525
2626 let PoolPutDisabled = 2
2727
2828 let PoolMatcherDisabled = 3
2929
3030 let PoolShutdown = 4
3131
3232 let idxPoolAddress = 1
3333
3434 let idxPoolStatus = 2
3535
3636 let idxPoolLPAssetId = 3
3737
3838 let idxAmtAssetId = 4
3939
4040 let idxPriceAssetId = 5
4141
4242 let idxAmtAssetDcm = 6
4343
4444 let idxPriceAssetDcm = 7
4545
4646 let idxIAmtAssetId = 8
4747
4848 let idxIPriceAssetId = 9
4949
5050 let idxLPAssetDcm = 10
5151
5252 let idxPoolAmtAssetAmt = 1
5353
5454 let idxPoolPriceAssetAmt = 2
5555
5656 let idxPoolLPAssetAmt = 3
5757
5858 let idxFactoryStakingContract = 1
5959
6060 let idxFactorySlippageContract = 7
6161
6262 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
6363
6464
6565 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
6666
6767
6868 func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale)
6969
7070
7171 func abs (val) = if ((0 > val))
7272 then -(val)
7373 else val
7474
7575
7676 func absBigInt (val) = if ((zeroBigInt > val))
7777 then -(val)
7878 else val
7979
8080
8181 func fc () = "%s__factoryContract"
8282
8383
8484 func mpk () = "%s__managerPublicKey"
8585
8686
8787 func pmpk () = "%s__pendingManagerPublicKey"
8888
8989
9090 func pl () = "%s%s__price__last"
9191
9292
9393 func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP)
9494
9595
9696 func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId)
9797
9898
9999 func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId)
100100
101101
102102 func aa () = "%s__amountAsset"
103103
104104
105105 func pa () = "%s__priceAsset"
106106
107107
108108 let keyFee = "%s__fee"
109109
110110 let feeDefault = fraction(5, scale8, 10000)
111111
112112 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
113113
114114 func keyFactoryConfig () = "%s__factoryConfig"
115115
116116
117117 func keyMatcherPub () = "%s%s__matcher__publicKey"
118118
119119
120120 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
121121
122122
123123 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
124124
125125
126126 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
127127
128128
129129 func keyAllPoolsShutdown () = "%s__shutdown"
130130
131131
132132 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
133133
134134
135135 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
136136
137137
138138 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
139139
140140 func throwOrderError (orderValid,senderValid,matcherValid) = throw(((((("order validation failed: orderValid=" + toString(orderValid)) + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
141141
142142
143143 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
144144
145145
146146 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
147147
148148
149149 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
150150
151151
152152 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
153153
154154 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
155155
156156 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
157157
158158
159159 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
160160
161161
162162 func getPoolConfig () = {
163163 let amtAsset = getStringOrFail(this, aa())
164164 let priceAsset = getStringOrFail(this, pa())
165165 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
166166 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
167167 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
168168 }
169169
170170
171171 func parseAssetId (input) = if ((input == wavesString))
172172 then unit
173173 else fromBase58String(input)
174174
175175
176176 func assetIdToString (input) = if ((input == unit))
177177 then wavesString
178178 else toBase58String(value(input))
179179
180180
181181 func parsePoolConfig (poolConfig) = $Tuple7(addressFromStringValue(poolConfig[idxPoolAddress]), parseIntValue(poolConfig[idxPoolStatus]), fromBase58String(poolConfig[idxPoolLPAssetId]), parseAssetId(poolConfig[idxAmtAssetId]), parseAssetId(poolConfig[idxPriceAssetId]), parseIntValue(poolConfig[idxAmtAssetDcm]), parseIntValue(poolConfig[idxPriceAssetDcm]))
182182
183183
184184 let poolConfigParsed = parsePoolConfig(getPoolConfig())
185185
186186 let $t075437709 = poolConfigParsed
187187
188188 let cfgPoolAddress = $t075437709._1
189189
190190 let cfgPoolStatus = $t075437709._2
191191
192192 let cfgLpAssetId = $t075437709._3
193193
194194 let cfgAmountAssetId = $t075437709._4
195195
196196 let cfgPriceAssetId = $t075437709._5
197197
198198 let cfgAmountAssetDecimals = $t075437709._6
199199
200200 let cfgPriceAssetDecimals = $t075437709._7
201201
202202 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
203203
204204
205205 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
206206
207207 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
208208
209209 func dataPutActionInfo (inAmtAssetAmt,inPriceAssetAmt,outLpAmt,price,slippageTolerancePassedByUser,slippageToleranceReal,txHeight,txTimestamp,slipageAmtAssetAmt,slipagePriceAssetAmt) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(inAmtAssetAmt), toString(inPriceAssetAmt), toString(outLpAmt), toString(price), toString(slippageTolerancePassedByUser), toString(slippageToleranceReal), toString(txHeight), toString(txTimestamp), toString(slipageAmtAssetAmt), toString(slipagePriceAssetAmt)], SEP)
210210
211211
212212 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)
213213
214214
215215 func getAccBalance (assetId) = if ((assetId == "WAVES"))
216216 then wavesBalance(this).available
217217 else assetBalance(this, fromBase58String(assetId))
218218
219219
220220 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
221221
222222
223223 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
224224 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
225225 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
226226 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
227227 }
228228
229229
230230 func calcPrices (amAmt,prAmt,lpAmt) = {
231231 let cfg = getPoolConfig()
232232 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
233233 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
234234 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
235235 let amAmtX18 = toX18(amAmt, amtAssetDcm)
236236 let prAmtX18 = toX18(prAmt, priceAssetDcm)
237237 let lpAmtX18 = toX18(lpAmt, scale8)
238238 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
239239 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
240240 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
241241 }
242242
243243
244244 func calculatePrices (amAmt,prAmt,lpAmt) = {
245245 let prices = calcPrices(amAmt, prAmt, lpAmt)
246246 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
247247 }
248248
249249
250250 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
251251 let cfg = getPoolConfig()
252252 let lpAssetId = cfg[idxPoolLPAssetId]
253253 let amAssetId = cfg[idxAmtAssetId]
254254 let prAssetId = cfg[idxPriceAssetId]
255255 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
256256 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
257257 let poolStatus = cfg[idxPoolStatus]
258258 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
259259 if ((lpAssetId != pmtAssetId))
260260 then throw("Invalid asset passed.")
261261 else {
262262 let amBalance = getAccBalance(amAssetId)
263263 let amBalanceX18 = toX18(amBalance, amAssetDcm)
264264 let prBalance = getAccBalance(prAssetId)
265265 let prBalanceX18 = toX18(prBalance, prAssetDcm)
266266 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
267267 let curPrice = fromX18(curPriceX18, scale8)
268268 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
269269 let lpEmissionX18 = toX18(lpEmission, scale8)
270270 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
271271 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
272272 let outAmAmt = fromX18(outAmAmtX18, amAssetDcm)
273273 let outPrAmt = fromX18(outPrAmtX18, prAssetDcm)
274274 let state = if ((txId58 == ""))
275275 then nil
276276 else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
277277 then unit
278278 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
279279 then unit
280280 else fromBase58String(prAssetId)), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAmAmt, outPrAmt, pmtLpAmt, curPrice, height, lastBlock.timestamp)), IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice)]
281281 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
282282 }
283283 }
284284
285285
286286 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
287287 let cfg = getPoolConfig()
288288 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
289289 let amAssetIdStr = cfg[idxAmtAssetId]
290290 let prAssetIdStr = cfg[idxPriceAssetId]
291291 let iAmtAssetId = cfg[idxIAmtAssetId]
292292 let iPriceAssetId = cfg[idxIPriceAssetId]
293293 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
294294 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
295295 let poolStatus = cfg[idxPoolStatus]
296296 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
297297 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
298298 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
299299 if (if ((amAssetIdStr != inAmAssetIdStr))
300300 then true
301301 else (prAssetIdStr != inPrAssetIdStr))
302302 then throw("Invalid amt or price asset passed.")
303303 else {
304304 let amBalance = if (isEvaluate)
305305 then getAccBalance(amAssetIdStr)
306306 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
307307 let prBalance = if (isEvaluate)
308308 then getAccBalance(prAssetIdStr)
309309 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
310310 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
311311 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
312312 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
313313 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
314314 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
315315 let res = if ((lpEmission == 0))
316316 then {
317317 let curPriceX18 = zeroBigInt
318318 let slippageX18 = zeroBigInt
319319 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
320320 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
321321 }
322322 else {
323323 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
324324 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
325325 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
326326 if (if ((curPriceX18 != zeroBigInt))
327327 then (slippageX18 > slippageToleranceX18)
328328 else false)
329329 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
330330 else {
331331 let lpEmissionX18 = toX18(lpEmission, scale8)
332332 let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
333333 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
334334 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
335335 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
336336 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
337337 let expAmtAssetAmtX18 = expectedAmts._1
338338 let expPriceAssetAmtX18 = expectedAmts._2
339339 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18)
340340 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(expAmtAssetAmtX18, amtAssetDcm), fromX18(expPriceAssetAmtX18, priceAssetDcm), curPriceX18, slippageX18)
341341 }
342342 }
343343 let calcLpAmt = res._1
344344 let calcAmAssetPmt = res._2
345345 let calcPrAssetPmt = res._3
346346 let curPrice = fromX18(res._4, scale8)
347347 let slippageCalc = fromX18(res._5, scale8)
348348 if ((0 >= calcLpAmt))
349349 then throw("Invalid calculations. LP calculated is less than zero.")
350350 else {
351351 let emitLpAmt = if (!(emitLp))
352352 then 0
353353 else calcLpAmt
354354 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
355355 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
356356 let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId58), dataPutActionInfo(calcAmAssetPmt, calcPrAssetPmt, emitLpAmt, curPrice, slippageTolerance, slippageCalc, height, lastBlock.timestamp, amDiff, prDiff))]
357357 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
358358 }
359359 }
360360 }
361361
362362
363363 func validateMatcherOrderAllowed (order) = {
364364 let cfg = getPoolConfig()
365365 let amtAssetId = cfg[idxAmtAssetId]
366366 let priceAssetId = cfg[idxPriceAssetId]
367367 let poolStatus = parseIntValue(cfg[idxPoolStatus])
368368 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
369369 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
370370 let accAmtAssetBalance = getAccBalance(amtAssetId)
371371 let accPriceAssetBalance = getAccBalance(priceAssetId)
372372 let curPriceX18 = if ((order.orderType == Buy))
373373 then privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance + order.amount), accPriceAssetBalance)
374374 else privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance - order.amount), accPriceAssetBalance)
375375 let curPrice = fromX18(curPriceX18, scale8)
376376 if (if (if (isGlobalShutdown())
377377 then true
378378 else (poolStatus == PoolMatcherDisabled))
379379 then true
380380 else (poolStatus == PoolShutdown))
381381 then throw("Exchange operations disabled")
382382 else {
383383 let orderAmtAsset = order.assetPair.amountAsset
384384 let orderAmtAssetStr = if ((orderAmtAsset == unit))
385385 then "WAVES"
386386 else toBase58String(value(orderAmtAsset))
387387 let orderPriceAsset = order.assetPair.priceAsset
388388 let orderPriceAssetStr = if ((orderPriceAsset == unit))
389389 then "WAVES"
390390 else toBase58String(value(orderPriceAsset))
391391 if (if ((orderAmtAssetStr != amtAssetId))
392392 then true
393393 else (orderPriceAssetStr != priceAssetId))
394394 then throw("Wrong order assets.")
395395 else {
396396 let orderPrice = order.price
397397 let priceDcm = fraction(scale8, priceAssetDcm, amtAssetDcm)
398398 let castedOrderPrice = toScale(orderPrice, scale8, priceDcm)
399399 let isOrderPriceValid = if ((order.orderType == Buy))
400400 then (curPrice >= castedOrderPrice)
401401 else (castedOrderPrice >= curPrice)
402402 true
403403 }
404404 }
405405 }
406406
407407
408408 func commonGet (i) = if ((size(i.payments) != 1))
409409 then throw("exactly 1 payment is expected")
410410 else {
411411 let pmt = value(i.payments[0])
412412 let pmtAssetId = value(pmt.assetId)
413413 let pmtAmt = pmt.amount
414414 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
415415 let outAmAmt = res._1
416416 let outPrAmt = res._2
417417 let poolStatus = parseIntValue(res._9)
418418 let state = res._10
419419 if (if (isGlobalShutdown())
420420 then true
421421 else (poolStatus == PoolShutdown))
422422 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
423423 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
424424 }
425425
426426
427427 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
428428 then throw("exactly 2 payments are expected")
429429 else {
430430 let amAssetPmt = value(i.payments[0])
431431 let prAssetPmt = value(i.payments[1])
432432 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
433433 let poolStatus = parseIntValue(estPut._8)
434434 if (if (if (isGlobalShutdown())
435435 then true
436436 else (poolStatus == PoolPutDisabled))
437437 then true
438438 else (poolStatus == PoolShutdown))
439439 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
440440 else estPut
441441 }
442442
443443
444444 func emit (amount) = {
445445 let emitInv = invoke(factoryContract, "emit", [amount], nil)
446446 if ((emitInv == emitInv))
447447 then {
448448 let emitInvLegacy = match emitInv {
449449 case legacyFactoryContract: Address =>
450450 invoke(legacyFactoryContract, "emit", [amount], nil)
451451 case _ =>
452452 unit
453453 }
454454 if ((emitInvLegacy == emitInvLegacy))
455455 then amount
456456 else throw("Strict value is not equal to itself.")
457457 }
458458 else throw("Strict value is not equal to itself.")
459459 }
460460
461461
462462 func takeFee (amount) = {
463463 let feeAmount = fraction(amount, fee, scale8)
464464 $Tuple2((amount - feeAmount), feeAmount)
465465 }
466466
467467
468468 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
469469 let isEval = (txId == unit)
470- let $t02223222410 = parsePoolConfig(getPoolConfig())
471- let poolAddress = $t02223222410._1
472- let poolStatus = $t02223222410._2
473- let lpAssetId = $t02223222410._3
474- let amountAssetId = $t02223222410._4
475- let priceAssetId = $t02223222410._5
476- let amountAssetDecimals = $t02223222410._6
477- let priceAssetDecimals = $t02223222410._7
478- let amountBalanceRaw = getAccBalance(assetIdToString(amountAssetId))
479- let priceBalanceRaw = getAccBalance(assetIdToString(priceAssetId))
480- let paymentInAmountAsset = if ((paymentAssetId == amountAssetId))
470+ let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
471+ let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
472+ let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
481473 then true
482- else if ((paymentAssetId == priceAssetId))
474+ else if ((paymentAssetId == cfgPriceAssetId))
483475 then false
484476 else throwErr("invalid asset")
485- let $t02274023033 = if (isEval)
477+ let $t02257022863 = if (isEval)
486478 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
487479 else if (paymentInAmountAsset)
488480 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
489481 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
490- let amountBalanceOld = $t02274023033._1
491- let priceBalanceOld = $t02274023033._2
492- let $t02303723186 = if (paymentInAmountAsset)
482+ let amountBalanceOld = $t02257022863._1
483+ let priceBalanceOld = $t02257022863._2
484+ let $t02286723016 = if (paymentInAmountAsset)
493485 then $Tuple2(paymentAmountRaw, 0)
494486 else $Tuple2(0, paymentAmountRaw)
495- let amountAssetAmountRaw = $t02303723186._1
496- let priceAssetAmountRaw = $t02303723186._2
487+ let amountAssetAmountRaw = $t02286723016._1
488+ let priceAssetAmountRaw = $t02286723016._2
497489 let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
498490 let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
499- let $t02330823367 = takeFee(paymentAmountRaw)
500- let paymentAmount = $t02330823367._1
501- let feeAmount = $t02330823367._2
491+ let $t02313823197 = takeFee(paymentAmountRaw)
492+ let paymentAmount = $t02313823197._1
493+ let feeAmount = $t02313823197._2
502494 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
503495 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
504- let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, priceAssetDecimals), toX18(amountBalanceNew, amountAssetDecimals))
496+ let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
505497 let priceNew = fromX18(priceNewX18, scale8)
506498 let paymentBalance = if (paymentInAmountAsset)
507499 then amountBalanceOld
508500 else priceBalanceOld
509501 let paymentBalanceBigInt = toBigInt(paymentBalance)
510- let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(lpAssetId), (("asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity)
502+ let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
511503 let chechSupply = if ((supplyBigInt > big0))
512504 then true
513505 else throwErr("initial deposit requires all coins")
514506 if ((chechSupply == chechSupply))
515507 then {
516508 let depositBigInt = toBigInt(paymentAmount)
517509 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
518510 let commonState = if (isEval)
519511 then nil
520512 else [IntegerEntry(pl(), priceNew), IntegerEntry(ph(height, lastBlock.timestamp), priceNew), StringEntry(pau(toString(value(userAddress)), toBase58String(value(txId))), dataPutActionInfo(amountAssetAmountRaw, priceAssetAmountRaw, issueAmount, priceNew, 0, 0, height, lastBlock.timestamp, 0, 0))]
521- let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, priceAssetDecimals), toX18(amountBalanceOld, amountAssetDecimals))
513+ let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
522514 let priceOld = fromX18(priceOldX18, scale8)
523515 let priceImpact = abs((((priceNew - priceOld) * scale8) / priceOld))
524516 $Tuple4(issueAmount, commonState, feeAmount, priceImpact)
525517 }
526518 else throw("Strict value is not equal to itself.")
527519 }
528520
529521
530522 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
531523 let isEval = (txId == unit)
532- let $t02518925350 = parsePoolConfig(getPoolConfig())
533- let poolAddress = $t02518925350._1
534- let poolStatus = $t02518925350._2
535- let lpAssetId = $t02518925350._3
536- let amountAssetId = $t02518925350._4
537- let priceAssetId = $t02518925350._5
538- let amDecimals = $t02518925350._6
539- let prDecimals = $t02518925350._7
540- let checks = [if ((paymentAssetId == lpAssetId))
524+ let checks = [if ((paymentAssetId == cfgLpAssetId))
541525 then true
542526 else throwErr("invalid lp asset")]
543527 if ((checks == checks))
544528 then {
545- let outInAmountAsset = if ((outAssetId == amountAssetId))
529+ let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
546530 then true
547- else if ((outAssetId == priceAssetId))
531+ else if ((outAssetId == cfgPriceAssetId))
548532 then false
549533 else throwErr("invalid asset")
550534 let balanceBigInt = if (outInAmountAsset)
551- then toBigInt(getAccBalance(assetIdToString(amountAssetId)))
552- else toBigInt(getAccBalance(assetIdToString(priceAssetId)))
553- let amBalanceOld = getAccBalance(assetIdToString(amountAssetId))
554- let prBalanceOld = getAccBalance(assetIdToString(priceAssetId))
535+ then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
536+ else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
537+ let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
538+ let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
555539 let outBalance = if (outInAmountAsset)
556540 then amBalanceOld
557541 else prBalanceOld
558542 let outBalanceBigInt = toBigInt(outBalance)
559- let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(lpAssetId), (("asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity)
543+ let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
560544 let redeemedBigInt = toBigInt(paymentAmount)
561545 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
562- let $t02642526475 = takeFee(amountRaw)
563- let totalAmount = $t02642526475._1
564- let feeAmount = $t02642526475._2
565- let $t02647926705 = if (outInAmountAsset)
546+ let $t02613526185 = takeFee(amountRaw)
547+ let totalAmount = $t02613526185._1
548+ let feeAmount = $t02613526185._2
549+ let $t02618926415 = if (outInAmountAsset)
566550 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
567551 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
568- let outAmAmount = $t02647926705._1
569- let outPrAmount = $t02647926705._2
570- let amBalanceNew = $t02647926705._3
571- let prBalanceNew = $t02647926705._4
572- let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, prDecimals), toX18(amBalanceNew, amDecimals))
552+ let outAmAmount = $t02618926415._1
553+ let outPrAmount = $t02618926415._2
554+ let amBalanceNew = $t02618926415._3
555+ let prBalanceNew = $t02618926415._4
556+ let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
573557 let priceNew = fromX18(priceNewX18, scale8)
574558 let commonState = if (isEval)
575559 then nil
576560 else [StringEntry(gau(toString(value(userAddress)), toBase58String(value(txId))), dataGetActionInfo(outAmAmount, outPrAmount, paymentAmount, priceNew, height, lastBlock.timestamp)), IntegerEntry(pl(), priceNew), IntegerEntry(ph(height, lastBlock.timestamp), priceNew)]
577- let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, prDecimals), toX18(amBalanceOld, amDecimals))
561+ let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
578562 let priceOld = fromX18(priceOldX18, scale8)
579563 let priceImpact = abs((((priceNew - priceOld) * scale8) / priceOld))
580564 $Tuple4(totalAmount, commonState, feeAmount, priceImpact)
581565 }
582566 else throw("Strict value is not equal to itself.")
583567 }
584568
585569
586570 func managerPublicKeyOrUnit () = match getString(mpk()) {
587571 case s: String =>
588572 fromBase58String(s)
589573 case _: Unit =>
590574 unit
591575 case _ =>
592576 throw("Match error")
593577 }
594578
595579
596580 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
597581 case s: String =>
598582 fromBase58String(s)
599583 case _: Unit =>
600584 unit
601585 case _ =>
602586 throw("Match error")
603587 }
604588
605589
606590 func mustManager (i) = {
607591 let pd = throw("Permission denied")
608592 match managerPublicKeyOrUnit() {
609593 case pk: ByteVector =>
610594 if ((i.callerPublicKey == pk))
611595 then true
612596 else pd
613597 case _: Unit =>
614598 if ((i.caller == this))
615599 then true
616600 else pd
617601 case _ =>
618602 throw("Match error")
619603 }
620604 }
621605
622606
623607 @Callable(i)
624608 func setManager (pendingManagerPublicKey) = {
625609 let checkCaller = mustManager(i)
626610 if ((checkCaller == checkCaller))
627611 then {
628612 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
629613 if ((checkManagerPublicKey == checkManagerPublicKey))
630614 then [StringEntry(pmpk(), pendingManagerPublicKey)]
631615 else throw("Strict value is not equal to itself.")
632616 }
633617 else throw("Strict value is not equal to itself.")
634618 }
635619
636620
637621
638622 @Callable(i)
639623 func confirmManager () = {
640624 let pm = pendingManagerPublicKeyOrUnit()
641625 let hasPM = if (isDefined(pm))
642626 then true
643627 else throw("No pending manager")
644628 if ((hasPM == hasPM))
645629 then {
646630 let checkPM = if ((i.callerPublicKey == value(pm)))
647631 then true
648632 else throw("You are not pending manager")
649633 if ((checkPM == checkPM))
650634 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
651635 else throw("Strict value is not equal to itself.")
652636 }
653637 else throw("Strict value is not equal to itself.")
654638 }
655639
656640
657641
658642 @Callable(i)
659643 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
660644 then throw("Invalid slippageTolerance passed")
661645 else {
662646 let estPut = commonPut(i, slippageTolerance, true)
663647 let emitLpAmt = estPut._2
664648 let lpAssetId = estPut._7
665649 let state = estPut._9
666650 let amDiff = estPut._10
667651 let prDiff = estPut._11
668652 let amId = estPut._12
669653 let prId = estPut._13
670654 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
671655 if ((emitInv == emitInv))
672656 then {
673657 let emitInvLegacy = match emitInv {
674658 case legacyFactoryContract: Address =>
675659 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
676660 case _ =>
677661 unit
678662 }
679663 if ((emitInvLegacy == emitInvLegacy))
680664 then {
681665 let slippageAInv = if ((amDiff > 0))
682666 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
683667 else nil
684668 if ((slippageAInv == slippageAInv))
685669 then {
686670 let slippagePInv = if ((prDiff > 0))
687671 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
688672 else nil
689673 if ((slippagePInv == slippagePInv))
690674 then {
691675 let lpTransfer = if (shouldAutoStake)
692676 then {
693677 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
694678 if ((slpStakeInv == slpStakeInv))
695679 then nil
696680 else throw("Strict value is not equal to itself.")
697681 }
698682 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
699683 (state ++ lpTransfer)
700684 }
701685 else throw("Strict value is not equal to itself.")
702686 }
703687 else throw("Strict value is not equal to itself.")
704688 }
705689 else throw("Strict value is not equal to itself.")
706690 }
707691 else throw("Strict value is not equal to itself.")
708692 }
709693
710694
711695
712696 @Callable(i)
713697 func putForFree (maxSlippage) = if ((0 > maxSlippage))
714698 then throw("Invalid value passed")
715699 else {
716700 let estPut = commonPut(i, maxSlippage, false)
717701 estPut._9
718702 }
719703
720704
721705
722706 @Callable(i)
723707 func putOneTkn (minOutAmount,autoStake) = {
724- let isPutDisabled = if (if (isGlobalShutdown())
708+ let isPoolOneTokenOperationsDisabled = {
709+ let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
710+ if ($isInstanceOf(@, "Boolean"))
711+ then @
712+ else throw(($getType(@) + " couldn't be cast to Boolean"))
713+ }
714+ let isPutDisabled = if (if (if (isGlobalShutdown())
725715 then true
726716 else (cfgPoolStatus == PoolPutDisabled))
727717 then true
728- else (cfgPoolStatus == PoolShutdown)
718+ else (cfgPoolStatus == PoolShutdown))
719+ then true
720+ else isPoolOneTokenOperationsDisabled
729721 let checks = [if (!(isPutDisabled))
730722 then true
731723 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
732724 then true
733725 else throwErr("exactly 1 payment are expected")]
734726 if ((checks == checks))
735727 then {
736728 let payment = i.payments[0]
737729 let paymentAssetId = payment.assetId
738730 let paymentAmountRaw = payment.amount
739731 let userAddress = i.caller
740732 let txId = i.transactionId
741- let $t03105731184 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
742- let emitAmountEstimated = $t03105731184._1
743- let commonState = $t03105731184._2
744- let feeAmount = $t03105731184._3
745- let bonus = $t03105731184._4
733+ let $t03099731124 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
734+ let emitAmountEstimated = $t03099731124._1
735+ let commonState = $t03099731124._2
736+ let feeAmount = $t03099731124._3
737+ let bonus = $t03099731124._4
746738 let emitAmount = if (if ((minOutAmount > 0))
747739 then (minOutAmount > emitAmountEstimated)
748740 else false)
749741 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
750742 else emitAmountEstimated
751743 let emitInv = emit(emitAmount)
752744 if ((emitInv == emitInv))
753745 then {
754746 let lpTransfer = if (autoStake)
755747 then {
756748 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
757749 if ((stakeInv == stakeInv))
758750 then nil
759751 else throw("Strict value is not equal to itself.")
760752 }
761753 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
762754 let sendFee = if ((feeAmount > 0))
763755 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
764756 else nil
765757 $Tuple2(((commonState ++ lpTransfer) ++ sendFee), emitAmount)
766758 }
767759 else throw("Strict value is not equal to itself.")
768760 }
769761 else throw("Strict value is not equal to itself.")
770762 }
771763
772764
773765
774766 @Callable(i)
775767 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
776- let $t03191332048 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
777- let emitAmountEstimated = $t03191332048._1
778- let commonState = $t03191332048._2
779- let feeAmount = $t03191332048._3
780- let bonus = $t03191332048._4
768+ let $t03185331988 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
769+ let emitAmountEstimated = $t03185331988._1
770+ let commonState = $t03185331988._2
771+ let feeAmount = $t03185331988._3
772+ let bonus = $t03185331988._4
781773 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
782774 }
783775
784776
785777
786778 @Callable(i)
787779 func getOneTkn (outAssetIdStr,minOutAmount) = {
788- let isGetDisabled = if (isGlobalShutdown())
780+ let isPoolOneTokenOperationsDisabled = {
781+ let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
782+ if ($isInstanceOf(@, "Boolean"))
783+ then @
784+ else throw(($getType(@) + " couldn't be cast to Boolean"))
785+ }
786+ let isGetDisabled = if (if (isGlobalShutdown())
789787 then true
790- else (cfgPoolStatus == PoolShutdown)
788+ else (cfgPoolStatus == PoolShutdown))
789+ then true
790+ else isPoolOneTokenOperationsDisabled
791791 let checks = [if (!(isGetDisabled))
792792 then true
793793 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
794794 then true
795795 else throwErr("exactly 1 payment are expected")]
796796 if ((checks == checks))
797797 then {
798798 let outAssetId = parseAssetId(outAssetIdStr)
799799 let payment = i.payments[0]
800800 let paymentAssetId = payment.assetId
801801 let paymentAmount = payment.amount
802802 let userAddress = i.caller
803803 let txId = i.transactionId
804- let $t03263632768 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
805- let amountEstimated = $t03263632768._1
806- let commonState = $t03263632768._2
807- let feeAmount = $t03263632768._3
808- let bonus = $t03263632768._4
804+ let $t03276032892 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
805+ let amountEstimated = $t03276032892._1
806+ let commonState = $t03276032892._2
807+ let feeAmount = $t03276032892._3
808+ let bonus = $t03276032892._4
809809 let amount = if (if ((minOutAmount > 0))
810810 then (minOutAmount > amountEstimated)
811811 else false)
812812 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
813813 else amountEstimated
814814 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
815815 if ((burnInv == burnInv))
816816 then {
817817 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
818818 let sendFee = if ((feeAmount > 0))
819819 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
820820 else nil
821821 $Tuple2(((commonState ++ assetTransfer) ++ sendFee), amount)
822822 }
823823 else throw("Strict value is not equal to itself.")
824824 }
825825 else throw("Strict value is not equal to itself.")
826826 }
827827
828828
829829
830830 @Callable(i)
831831 func getOneTknREADONLY (outAssetId,paymentAmount) = {
832- let $t03340333541 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
833- let amountEstimated = $t03340333541._1
834- let commonState = $t03340333541._2
835- let feeAmount = $t03340333541._3
836- let bonus = $t03340333541._4
832+ let $t03352733665 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
833+ let amountEstimated = $t03352733665._1
834+ let commonState = $t03352733665._2
835+ let feeAmount = $t03352733665._3
836+ let bonus = $t03352733665._4
837837 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
838838 }
839839
840840
841841
842842 @Callable(i)
843843 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
844- let isGetDisabled = if (isGlobalShutdown())
844+ let isPoolOneTokenOperationsDisabled = {
845+ let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
846+ if ($isInstanceOf(@, "Boolean"))
847+ then @
848+ else throw(($getType(@) + " couldn't be cast to Boolean"))
849+ }
850+ let isGetDisabled = if (if (isGlobalShutdown())
845851 then true
846- else (cfgPoolStatus == PoolShutdown)
852+ else (cfgPoolStatus == PoolShutdown))
853+ then true
854+ else isPoolOneTokenOperationsDisabled
847855 let checks = [if (!(isGetDisabled))
848856 then true
849857 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
850858 then true
851859 else throwErr("no payments are expected")]
852860 if ((checks == checks))
853861 then {
854862 let outAssetId = parseAssetId(outAssetIdStr)
855863 let userAddress = i.caller
856864 let txId = i.transactionId
857865 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
858866 if ((unstakeInv == unstakeInv))
859867 then {
860- let $t03414934279 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
861- let amountEstimated = $t03414934279._1
862- let commonState = $t03414934279._2
863- let feeAmount = $t03414934279._3
864- let bonus = $t03414934279._4
868+ let $t03445734587 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
869+ let amountEstimated = $t03445734587._1
870+ let commonState = $t03445734587._2
871+ let feeAmount = $t03445734587._3
872+ let bonus = $t03445734587._4
865873 let amount = if (if ((minOutAmount > 0))
866874 then (minOutAmount > amountEstimated)
867875 else false)
868876 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
869877 else amountEstimated
870878 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
871879 if ((burnInv == burnInv))
872880 then {
873881 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
874882 let sendFee = if ((feeAmount > 0))
875883 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
876884 else nil
877885 $Tuple2(((commonState ++ assetTransfer) ++ sendFee), amount)
878886 }
879887 else throw("Strict value is not equal to itself.")
880888 }
881889 else throw("Strict value is not equal to itself.")
882890 }
883891 else throw("Strict value is not equal to itself.")
884892 }
885893
886894
887895
888896 @Callable(i)
889897 func get () = {
890898 let res = commonGet(i)
891899 let outAmtAmt = res._1
892900 let outPrAmt = res._2
893901 let pmtAmt = res._3
894902 let pmtAssetId = res._4
895903 let state = res._5
896904 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
897905 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
898906 then state
899907 else throw("Strict value is not equal to itself.")
900908 }
901909
902910
903911
904912 @Callable(i)
905913 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
906914 let res = commonGet(i)
907915 let outAmAmt = res._1
908916 let outPrAmt = res._2
909917 let pmtAmt = res._3
910918 let pmtAssetId = res._4
911919 let state = res._5
912920 if ((noLessThenAmtAsset > outAmAmt))
913921 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
914922 else if ((noLessThenPriceAsset > outPrAmt))
915923 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
916924 else {
917925 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
918926 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
919927 then state
920928 else throw("Strict value is not equal to itself.")
921929 }
922930 }
923931
924932
925933
926934 @Callable(i)
927935 func unstakeAndGet (amount) = {
928936 let checkPayments = if ((size(i.payments) != 0))
929937 then throw("No payments are expected")
930938 else true
931939 if ((checkPayments == checkPayments))
932940 then {
933941 let cfg = getPoolConfig()
934942 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
935943 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
936944 if ((unstakeInv == unstakeInv))
937945 then {
938946 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
939947 let poolStatus = parseIntValue(res._9)
940948 let state = res._10
941949 let checkPoolStatus = if (if (isGlobalShutdown())
942950 then true
943951 else (poolStatus == PoolShutdown))
944952 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
945953 else true
946954 if ((checkPoolStatus == checkPoolStatus))
947955 then {
948956 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
949957 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
950958 then state
951959 else throw("Strict value is not equal to itself.")
952960 }
953961 else throw("Strict value is not equal to itself.")
954962 }
955963 else throw("Strict value is not equal to itself.")
956964 }
957965 else throw("Strict value is not equal to itself.")
958966 }
959967
960968
961969
962970 @Callable(i)
963971 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
964972 then throw("permissions denied")
965973 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
966974
967975
968976
969977 @Callable(i)
970978 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
971979
972980
973981
974982 @Callable(i)
975983 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
976984
977985
978986
979987 @Callable(i)
980988 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
981989 let prices = calcPrices(amAmt, prAmt, lpAmt)
982990 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
983991 }
984992
985993
986994
987995 @Callable(i)
988996 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
989997
990998
991999
9921000 @Callable(i)
9931001 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
9941002
9951003
9961004
9971005 @Callable(i)
9981006 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
9991007
10001008
10011009
10021010 @Callable(i)
10031011 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
10041012
10051013
10061014
10071015 @Callable(i)
10081016 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
10091017 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
10101018 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
10111019 }
10121020
10131021
10141022
10151023 @Callable(i)
10161024 func statsREADONLY () = {
10171025 let cfg = getPoolConfig()
10181026 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
10191027 let amtAssetId = cfg[idxAmtAssetId]
10201028 let priceAssetId = cfg[idxPriceAssetId]
10211029 let iAmtAssetId = cfg[idxIAmtAssetId]
10221030 let iPriceAssetId = cfg[idxIPriceAssetId]
10231031 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
10241032 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
10251033 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
10261034 let accAmtAssetBalance = getAccBalance(amtAssetId)
10271035 let accPriceAssetBalance = getAccBalance(priceAssetId)
10281036 let pricesList = if ((poolLPBalance == 0))
10291037 then [zeroBigInt, zeroBigInt, zeroBigInt]
10301038 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
10311039 let curPrice = 0
10321040 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
10331041 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
10341042 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
10351043 $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(accAmtAssetBalance), toString(accPriceAssetBalance), toString(poolLPBalance), toString(curPrice), toString(lpAmtAssetShare), toString(lpPriceAssetShare), toString(poolWeight)], SEP))
10361044 }
10371045
10381046
10391047
10401048 @Callable(i)
10411049 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
10421050 let cfg = getPoolConfig()
10431051 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
10441052 let amAssetIdStr = cfg[idxAmtAssetId]
10451053 let amAssetId = fromBase58String(amAssetIdStr)
10461054 let prAssetIdStr = cfg[idxPriceAssetId]
10471055 let prAssetId = fromBase58String(prAssetIdStr)
10481056 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
10491057 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
10501058 let poolStatus = cfg[idxPoolStatus]
10511059 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
10521060 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
10531061 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
10541062 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
10551063 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
10561064 let curPriceX18 = if ((poolLPBalance == 0))
10571065 then zeroBigInt
10581066 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
10591067 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
10601068 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
10611069 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
10621070 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
10631071 let calcLpAmt = estPut._1
10641072 let curPriceCalc = estPut._3
10651073 let amBalance = estPut._4
10661074 let prBalance = estPut._5
10671075 let lpEmission = estPut._6
10681076 $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(calcLpAmt), toString(fromX18(curPriceX18, scale8)), toString(amBalance), toString(prBalance), toString(lpEmission), poolStatus, toString(inAmAssetAmt), toString(inPrAssetAmt)], SEP))
10691077 }
10701078
10711079
10721080
10731081 @Callable(i)
10741082 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
10751083 let cfg = getPoolConfig()
10761084 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
10771085 let amAssetIdStr = cfg[idxAmtAssetId]
10781086 let amAssetId = fromBase58String(amAssetIdStr)
10791087 let prAssetIdStr = cfg[idxPriceAssetId]
10801088 let prAssetId = fromBase58String(prAssetIdStr)
10811089 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
10821090 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
10831091 let poolStatus = cfg[idxPoolStatus]
10841092 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
10851093 let amBalanceRaw = getAccBalance(amAssetIdStr)
10861094 let prBalanceRaw = getAccBalance(prAssetIdStr)
10871095 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
10881096 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
10891097 let curPriceX18 = if ((poolLPBalance == 0))
10901098 then zeroBigInt
10911099 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
10921100 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
10931101 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
10941102 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
10951103 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
10961104 let calcLpAmt = estPut._1
10971105 let curPriceCalc = estPut._3
10981106 let amBalance = estPut._4
10991107 let prBalance = estPut._5
11001108 let lpEmission = estPut._6
11011109 $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(calcLpAmt), toString(fromX18(curPriceX18, scale8)), toString(amBalance), toString(prBalance), toString(lpEmission), poolStatus, toString(inAmAssetAmt), toString(inPrAssetAmt)], SEP))
11021110 }
11031111
11041112
11051113
11061114 @Callable(i)
11071115 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
11081116 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
11091117 let outAmAmt = res._1
11101118 let outPrAmt = res._2
11111119 let amBalance = res._5
11121120 let prBalance = res._6
11131121 let lpEmission = res._7
11141122 let curPrice = res._8
11151123 let poolStatus = parseIntValue(res._9)
11161124 $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(outAmAmt), toString(outPrAmt), toString(amBalance), toString(prBalance), toString(lpEmission), toString(curPrice), toString(poolStatus)], SEP))
11171125 }
11181126
11191127
11201128 @Verifier(tx)
11211129 func verify () = {
11221130 let targetPublicKey = match managerPublicKeyOrUnit() {
11231131 case pk: ByteVector =>
11241132 pk
11251133 case _: Unit =>
11261134 tx.senderPublicKey
11271135 case _ =>
11281136 throw("Match error")
11291137 }
11301138 match tx {
11311139 case order: Order =>
11321140 let matcherPub = getMatcherPubOrFail()
11331141 let orderValid = validateMatcherOrderAllowed(order)
11341142 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
11351143 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
11361144 if (if (if (orderValid)
11371145 then senderValid
11381146 else false)
11391147 then matcherValid
11401148 else false)
11411149 then true
11421150 else throwOrderError(orderValid, senderValid, matcherValid)
11431151 case s: SetScriptTransaction =>
11441152 let newHash = blake2b256(value(s.script))
11451153 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
11461154 let currentHash = scriptHash(this)
11471155 if (if ((allowedHash == newHash))
11481156 then (currentHash != newHash)
11491157 else false)
11501158 then true
11511159 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
11521160 case _ =>
11531161 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
11541162 }
11551163 }
11561164

github/deemru/w8io/169f3d6 
128.78 ms