tx · 6QurXqd5XVSFEkCyqTirfP41DvRr1auRZTTBkEeuRSdu

3N8sfbgCJCsLbcWYRiVKm6ivccPLMsQmVDx:  -0.03300000 Waves

2022.11.30 09:52 [2339519] smart account 3N8sfbgCJCsLbcWYRiVKm6ivccPLMsQmVDx > SELF 0.00000000 Waves

{ "type": 13, "id": "6QurXqd5XVSFEkCyqTirfP41DvRr1auRZTTBkEeuRSdu", "fee": 3300000, "feeAssetId": null, "timestamp": 1669790942516, "version": 1, "sender": "3N8sfbgCJCsLbcWYRiVKm6ivccPLMsQmVDx", "senderPublicKey": "G4Ha5wvhDpHGy5koVJsmfWC2zwF89jXDUmWBb28mRyrr", "proofs": [ "5MvieEVVHAk8gBPouFvTBMqVCYnnNbX8mRaZ3vaATrudxTZTe1KE3fBxZp4Wc4DAmfGqdtz8QpxfwUNxKunMVA9y" ], "script": "base64:BgLYKwgCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFzc2V0SWQiEGlkeElQcmljZUFzc2V0SWQiDWlkeExQQ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JjZQkAzAgCCQCkAwEFAmNiCQDMCAIJAKYDAQUCY2gJAMwIAgkApAMBBQJjYQUDbmlsBQFqAQJncAECZ3EABAJncgQCZEUJAQJlRwADCQABAgUCZEUCCkJ5dGVWZWN0b3IEAmVLBQJkRQUCZUsDCQABAgUCZEUCBFVuaXQIBQJncA9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgQCZEUFAmdwAwkAAQIFAmRFAgVPcmRlcgQCZGoFAmRFBAJncwkBAmFNAAQCYXoJAQJkaQEFAmRqBAJhQQkA9AMDCAUCZGoJYm9keUJ5dGVzCQCRAwIIBQJkagZwcm9vZnMAAAgFAmRqD3NlbmRlclB1YmxpY0tleQQCYUIJAPQDAwgFAmRqCWJvZHlCeXRlcwkAkQMCCAUCZGoGcHJvb2ZzAAEFAmdzAwMDBQJhegUCYUEHBQJhQgcGCQECYXkDBQJhegUCYUEFAmFCAwkAAQIFAmRFAhRTZXRTY3JpcHRUcmFuc2FjdGlvbgQCZUgFAmRFBAJndAkA9gMBCQEFdmFsdWUBCAUCZUgGc2NyaXB0BAJndQkA2wQBCQEFdmFsdWUBCQCdCAIFAmFKCQECYXcABAJndgkA8QcBBQR0aGlzAwMJAAACBQJndQUCZ3QJAQIhPQIFAmd2BQJndAcGCQD0AwMIBQJncAlib2R5Qnl0ZXMJAJEDAggFAmdwBnByb29mcwAABQJncgkA9AMDCAUCZ3AJYm9keUJ5dGVzCQCRAwIIBQJncAZwcm9vZnMAAAUCZ3JXKual", "chainId": 84, "height": 2339519, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3jDPFs8KnzjDKqRzrKxazxtwnFvWiqwQeoUi5qpu7vgR Next: GHvGjidF2qZf9rW36J1u8Mx1JKwCFpq3E4t4SJq5ZuRP Diff:
OldNewDifferences
390390
391391
392392 func validateMatcherOrderAllowed (order) = {
393- let cfg = getPoolConfig()
394- let amtAssetId = cfg[idxAmtAssetId]
395- let priceAssetId = cfg[idxPriceAssetId]
396- let poolStatus = parseIntValue(cfg[idxPoolStatus])
397- let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
398- let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
399393 let amountAssetAmount = order.amount
400394 let priceAssetAmount = fraction(order.amount, order.price, scale8)
401- let $t01983820050 = if ((order.orderType == Buy))
395+ let $t01955919771 = if ((order.orderType == Buy))
402396 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
403397 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
404- let amountAssetBalanceDelta = $t01983820050._1
405- let priceAssetBalanceDelta = $t01983820050._2
398+ let amountAssetBalanceDelta = $t01955919771._1
399+ let priceAssetBalanceDelta = $t01955919771._2
406400 if (if (if (isGlobalShutdown())
407401 then true
408- else (poolStatus == PoolMatcherDisabled))
402+ else (cfgPoolStatus == PoolMatcherDisabled))
409403 then true
410- else (poolStatus == PoolShutdown))
404+ else (cfgPoolStatus == PoolShutdown))
411405 then throw("Exchange operations disabled")
412- else {
413- let orderAmtAssetStr = assetIdToString(value(order.assetPair.amountAsset))
414- let orderPriceAssetStr = assetIdToString(value(order.assetPair.priceAsset))
415- if (if ((orderAmtAssetStr != amtAssetId))
416- then true
417- else (orderPriceAssetStr != priceAssetId))
418- then throw("Wrong order assets.")
419- else {
420- let kLp = valueOrErrorMessage(parseBigInt(valueOrErrorMessage(getString(this, keyKLp), fmtErr("kLp is required"))), fmtErr("invalid kLp"))
421- let $t02064520745 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
422- let unusedActions = $t02064520745._1
423- let kLpNew = $t02064520745._2
424- let isOrderValid = (kLpNew > kLp)
425- isOrderValid
426- }
427- }
406+ else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
407+ then true
408+ else (order.assetPair.priceAsset != cfgPriceAssetId))
409+ then throw("Wrong order assets.")
410+ else {
411+ let kLp = valueOrErrorMessage(parseBigInt(valueOrErrorMessage(getString(this, keyKLp), fmtErr("kLp is required"))), fmtErr("invalid kLp"))
412+ let $t02024220342 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
413+ let unusedActions = $t02024220342._1
414+ let kLpNew = $t02024220342._2
415+ let isOrderValid = (kLpNew > kLp)
416+ isOrderValid
417+ }
428418 }
429419
430420
497487 else if ((paymentAssetId == cfgPriceAssetId))
498488 then false
499489 else throwErr("invalid asset")
500- let $t02342923722 = if (isEval)
490+ let $t02302623319 = if (isEval)
501491 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
502492 else if (paymentInAmountAsset)
503493 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
504494 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
505- let amountBalanceOld = $t02342923722._1
506- let priceBalanceOld = $t02342923722._2
507- let $t02372623875 = if (paymentInAmountAsset)
495+ let amountBalanceOld = $t02302623319._1
496+ let priceBalanceOld = $t02302623319._2
497+ let $t02332323472 = if (paymentInAmountAsset)
508498 then $Tuple2(paymentAmountRaw, 0)
509499 else $Tuple2(0, paymentAmountRaw)
510- let amountAssetAmountRaw = $t02372623875._1
511- let priceAssetAmountRaw = $t02372623875._2
500+ let amountAssetAmountRaw = $t02332323472._1
501+ let priceAssetAmountRaw = $t02332323472._2
512502 let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
513503 let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
514- let $t02399724056 = takeFee(paymentAmountRaw)
515- let paymentAmount = $t02399724056._1
516- let feeAmount = $t02399724056._2
504+ let $t02359423653 = takeFee(paymentAmountRaw)
505+ let paymentAmount = $t02359423653._1
506+ let feeAmount = $t02359423653._2
517507 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
518508 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
519509 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
536526 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
537527 let priceOld = fromX18(priceOldX18, scale8)
538528 let loss = {
539- let $t02553325700 = if (paymentInAmountAsset)
529+ let $t02513025297 = if (paymentInAmountAsset)
540530 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
541531 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
542- let amount = $t02553325700._1
543- let balance = $t02553325700._2
532+ let amount = $t02513025297._1
533+ let balance = $t02513025297._2
544534 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
545535 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
546536 }
574564 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
575565 let redeemedBigInt = toBigInt(paymentAmount)
576566 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
577- let $t02730227352 = takeFee(amountRaw)
578- let totalAmount = $t02730227352._1
579- let feeAmount = $t02730227352._2
580- let $t02735627582 = if (outInAmountAsset)
567+ let $t02689926949 = takeFee(amountRaw)
568+ let totalAmount = $t02689926949._1
569+ let feeAmount = $t02689926949._2
570+ let $t02695327179 = if (outInAmountAsset)
581571 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
582572 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
583- let outAmAmount = $t02735627582._1
584- let outPrAmount = $t02735627582._2
585- let amBalanceNew = $t02735627582._3
586- let prBalanceNew = $t02735627582._4
573+ let outAmAmount = $t02695327179._1
574+ let outPrAmount = $t02695327179._2
575+ let amBalanceNew = $t02695327179._3
576+ let prBalanceNew = $t02695327179._4
587577 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
588578 let priceNew = fromX18(priceNewX18, scale8)
589579 let commonState = if (isEval)
724714 else throw("Strict value is not equal to itself.")
725715 }
726716 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
727- let $t03153331598 = refreshKLpInternal(0, 0, 0)
728- let refreshKLpActions = $t03153331598._1
729- let updatedKLp = $t03153331598._2
717+ let $t03113031195 = refreshKLpInternal(0, 0, 0)
718+ let refreshKLpActions = $t03113031195._1
719+ let updatedKLp = $t03113031195._2
730720 ((state ++ lpTransfer) ++ refreshKLpActions)
731721 }
732722 else throw("Strict value is not equal to itself.")
746736 else {
747737 let estPut = commonPut(i, maxSlippage, false)
748738 let state = estPut._9
749- let $t03188431949 = refreshKLpInternal(0, 0, 0)
750- let refreshKLpActions = $t03188431949._1
751- let updatedKLp = $t03188431949._2
739+ let $t03148131546 = refreshKLpInternal(0, 0, 0)
740+ let refreshKLpActions = $t03148131546._1
741+ let updatedKLp = $t03148131546._2
752742 (state ++ refreshKLpActions)
753743 }
754744
783773 let paymentAmountRaw = payment.amount
784774 let userAddress = i.caller
785775 let txId = i.transactionId
786- let $t03272532877 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
787- if (($t03272532877 == $t03272532877))
776+ let $t03232232474 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
777+ if (($t03232232474 == $t03232232474))
788778 then {
789- let paymentInAmountAsset = $t03272532877._5
790- let bonus = $t03272532877._4
791- let feeAmount = $t03272532877._3
792- let commonState = $t03272532877._2
793- let emitAmountEstimated = $t03272532877._1
779+ let paymentInAmountAsset = $t03232232474._5
780+ let bonus = $t03232232474._4
781+ let feeAmount = $t03232232474._3
782+ let commonState = $t03232232474._2
783+ let emitAmountEstimated = $t03232232474._1
794784 let emitAmount = if (if ((minOutAmount > 0))
795785 then (minOutAmount > emitAmountEstimated)
796786 else false)
810800 let sendFee = if ((feeAmount > 0))
811801 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
812802 else nil
813- let $t03346333660 = if ((this == feeCollectorAddress))
803+ let $t03306033257 = if ((this == feeCollectorAddress))
814804 then $Tuple2(0, 0)
815805 else if (paymentInAmountAsset)
816806 then $Tuple2(-(feeAmount), 0)
817807 else $Tuple2(0, -(feeAmount))
818- let amountAssetBalanceDelta = $t03346333660._1
819- let priceAssetBalanceDelta = $t03346333660._2
820- let $t03366333771 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
821- let refreshKLpActions = $t03366333771._1
822- let updatedKLp = $t03366333771._2
808+ let amountAssetBalanceDelta = $t03306033257._1
809+ let priceAssetBalanceDelta = $t03306033257._2
810+ let $t03326033368 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
811+ let refreshKLpActions = $t03326033368._1
812+ let updatedKLp = $t03326033368._2
823813 $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
824814 }
825815 else throw("Strict value is not equal to itself.")
833823
834824 @Callable(i)
835825 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
836- let $t03396434121 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
837- let emitAmountEstimated = $t03396434121._1
838- let commonState = $t03396434121._2
839- let feeAmount = $t03396434121._3
840- let bonus = $t03396434121._4
841- let paymentInAmountAsset = $t03396434121._5
826+ let $t03356133718 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
827+ let emitAmountEstimated = $t03356133718._1
828+ let commonState = $t03356133718._2
829+ let feeAmount = $t03356133718._3
830+ let bonus = $t03356133718._4
831+ let paymentInAmountAsset = $t03356133718._5
842832 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
843833 }
844834
872862 let paymentAmount = payment.amount
873863 let userAddress = i.caller
874864 let txId = i.transactionId
875- let $t03492635079 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
876- if (($t03492635079 == $t03492635079))
865+ let $t03452334676 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
866+ if (($t03452334676 == $t03452334676))
877867 then {
878- let outInAmountAsset = $t03492635079._5
879- let bonus = $t03492635079._4
880- let feeAmount = $t03492635079._3
881- let commonState = $t03492635079._2
882- let amountEstimated = $t03492635079._1
868+ let outInAmountAsset = $t03452334676._5
869+ let bonus = $t03452334676._4
870+ let feeAmount = $t03452334676._3
871+ let commonState = $t03452334676._2
872+ let amountEstimated = $t03452334676._1
883873 let amount = if (if ((minOutAmount > 0))
884874 then (minOutAmount > amountEstimated)
885875 else false)
892882 let sendFee = if ((feeAmount > 0))
893883 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
894884 else nil
895- let $t03557935826 = {
885+ let $t03517635423 = {
896886 let feeAmountForCalc = if ((this == feeCollectorAddress))
897887 then 0
898888 else feeAmount
900890 then $Tuple2(-((amount + feeAmountForCalc)), 0)
901891 else $Tuple2(0, -((amount + feeAmountForCalc)))
902892 }
903- let amountAssetBalanceDelta = $t03557935826._1
904- let priceAssetBalanceDelta = $t03557935826._2
905- let $t03582935937 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
906- let refreshKLpActions = $t03582935937._1
907- let updatedKLp = $t03582935937._2
893+ let amountAssetBalanceDelta = $t03517635423._1
894+ let priceAssetBalanceDelta = $t03517635423._2
895+ let $t03542635534 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
896+ let refreshKLpActions = $t03542635534._1
897+ let updatedKLp = $t03542635534._2
908898 $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
909899 }
910900 else throw("Strict value is not equal to itself.")
918908
919909 @Callable(i)
920910 func getOneTknREADONLY (outAssetId,paymentAmount) = {
921- let $t03612136277 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
922- let amountEstimated = $t03612136277._1
923- let commonState = $t03612136277._2
924- let feeAmount = $t03612136277._3
925- let bonus = $t03612136277._4
926- let outInAmountAsset = $t03612136277._5
911+ let $t03571835874 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
912+ let amountEstimated = $t03571835874._1
913+ let commonState = $t03571835874._2
914+ let feeAmount = $t03571835874._3
915+ let bonus = $t03571835874._4
916+ let outInAmountAsset = $t03571835874._5
927917 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
928918 }
929919
957947 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
958948 if ((unstakeInv == unstakeInv))
959949 then {
960- let $t03710237253 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
961- if (($t03710237253 == $t03710237253))
950+ let $t03669936850 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
951+ if (($t03669936850 == $t03669936850))
962952 then {
963- let outInAmountAsset = $t03710237253._5
964- let bonus = $t03710237253._4
965- let feeAmount = $t03710237253._3
966- let commonState = $t03710237253._2
967- let amountEstimated = $t03710237253._1
953+ let outInAmountAsset = $t03669936850._5
954+ let bonus = $t03669936850._4
955+ let feeAmount = $t03669936850._3
956+ let commonState = $t03669936850._2
957+ let amountEstimated = $t03669936850._1
968958 let amount = if (if ((minOutAmount > 0))
969959 then (minOutAmount > amountEstimated)
970960 else false)
977967 let sendFee = if ((feeAmount > 0))
978968 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
979969 else nil
980- let $t03774837995 = {
970+ let $t03734537592 = {
981971 let feeAmountForCalc = if ((this == feeCollectorAddress))
982972 then 0
983973 else feeAmount
985975 then $Tuple2(-((amount + feeAmountForCalc)), 0)
986976 else $Tuple2(0, -((amount + feeAmountForCalc)))
987977 }
988- let amountAssetBalanceDelta = $t03774837995._1
989- let priceAssetBalanceDelta = $t03774837995._2
990- let $t03799838106 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
991- let refreshKLpActions = $t03799838106._1
992- let updatedKLp = $t03799838106._2
978+ let amountAssetBalanceDelta = $t03734537592._1
979+ let priceAssetBalanceDelta = $t03734537592._2
980+ let $t03759537703 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
981+ let refreshKLpActions = $t03759537703._1
982+ let updatedKLp = $t03759537703._2
993983 $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
994984 }
995985 else throw("Strict value is not equal to itself.")
10141004 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10151005 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10161006 then {
1017- let $t03889838980 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1018- let refreshKLpActions = $t03889838980._1
1019- let updatedKLp = $t03889838980._2
1007+ let $t03849538577 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1008+ let refreshKLpActions = $t03849538577._1
1009+ let updatedKLp = $t03849538577._2
10201010 (state ++ refreshKLpActions)
10211011 }
10221012 else throw("Strict value is not equal to itself.")
10401030 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10411031 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10421032 then {
1043- let $t03977639857 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1044- let refreshKLpActions = $t03977639857._1
1045- let updatedKLp = $t03977639857._2
1033+ let $t03937339454 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1034+ let refreshKLpActions = $t03937339454._1
1035+ let updatedKLp = $t03937339454._2
10461036 (state ++ refreshKLpActions)
10471037 }
10481038 else throw("Strict value is not equal to itself.")
10781068 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
10791069 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10801070 then {
1081- let $t04083040911 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1082- let refreshKLpActions = $t04083040911._1
1083- let updatedKLp = $t04083040911._2
1071+ let $t04042740508 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1072+ let refreshKLpActions = $t04042740508._1
1073+ let updatedKLp = $t04042740508._2
10841074 (state ++ refreshKLpActions)
10851075 }
10861076 else throw("Strict value is not equal to itself.")
11231113 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
11241114 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11251115 then {
1126- let $t04205142132 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1127- let refreshKLpActions = $t04205142132._1
1128- let updatedKLp = $t04205142132._2
1116+ let $t04164841729 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1117+ let refreshKLpActions = $t04164841729._1
1118+ let updatedKLp = $t04164841729._2
11291119 (state ++ refreshKLpActions)
11301120 }
11311121 else throw("Strict value is not equal to itself.")
11541144 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
11551145 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
11561146 then {
1157- let $t04312043175 = refreshKLpInternal(0, 0, 0)
1158- let actions = $t04312043175._1
1159- let updatedKLp = $t04312043175._2
1147+ let $t04271742772 = refreshKLpInternal(0, 0, 0)
1148+ let actions = $t04271742772._1
1149+ let updatedKLp = $t04271742772._2
11601150 $Tuple2(actions, toString(updatedKLp))
11611151 }
11621152 else throw("Strict value is not equal to itself.")
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(10, scale8, 10000)
111111
112112 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
113113
114114 let keyKLp = makeString(["%s", "kLp"], SEP)
115115
116116 let keyKLpRefreshedHeight = makeString(["%s", "kLpRefreshedHeight"], SEP)
117117
118118 let keyKLpRefreshDelay = makeString(["%s", "refreshKLpDelay"], SEP)
119119
120120 let kLpRefreshDelayDefault = 30
121121
122122 let kLpRefreshDelay = valueOrElse(getInteger(this, keyKLpRefreshDelay), kLpRefreshDelayDefault)
123123
124124 func keyFactoryConfig () = "%s__factoryConfig"
125125
126126
127127 func keyMatcherPub () = "%s%s__matcher__publicKey"
128128
129129
130130 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
131131
132132
133133 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
134134
135135
136136 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
137137
138138
139139 func keyAllPoolsShutdown () = "%s__shutdown"
140140
141141
142142 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
143143
144144
145145 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
146146
147147
148148 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
149149
150150 func throwOrderError (orderValid,senderValid,matcherValid) = throw(((((("order validation failed: orderValid=" + toString(orderValid)) + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
151151
152152
153153 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
154154
155155
156156 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
157157
158158
159159 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
160160
161161
162162 func fmtErr (msg) = makeString(["lp.ride:", msg], " ")
163163
164164
165165 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
166166
167167 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
168168
169169 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
170170
171171
172172 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
173173
174174
175175 func getPoolConfig () = {
176176 let amtAsset = getStringOrFail(this, aa())
177177 let priceAsset = getStringOrFail(this, pa())
178178 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
179179 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
180180 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
181181 }
182182
183183
184184 func parseAssetId (input) = if ((input == wavesString))
185185 then unit
186186 else fromBase58String(input)
187187
188188
189189 func assetIdToString (input) = if ((input == unit))
190190 then wavesString
191191 else toBase58String(value(input))
192192
193193
194194 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]))
195195
196196
197197 let poolConfigParsed = parsePoolConfig(getPoolConfig())
198198
199199 let $t079158081 = poolConfigParsed
200200
201201 let cfgPoolAddress = $t079158081._1
202202
203203 let cfgPoolStatus = $t079158081._2
204204
205205 let cfgLpAssetId = $t079158081._3
206206
207207 let cfgAmountAssetId = $t079158081._4
208208
209209 let cfgPriceAssetId = $t079158081._5
210210
211211 let cfgAmountAssetDecimals = $t079158081._6
212212
213213 let cfgPriceAssetDecimals = $t079158081._7
214214
215215 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
216216
217217
218218 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
219219
220220 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
221221
222222 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)
223223
224224
225225 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)
226226
227227
228228 func getAccBalance (assetId) = if ((assetId == "WAVES"))
229229 then wavesBalance(this).available
230230 else assetBalance(this, fromBase58String(assetId))
231231
232232
233233 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
234234
235235
236236 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
237237 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
238238 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
239239 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
240240 }
241241
242242
243243 func calcPrices (amAmt,prAmt,lpAmt) = {
244244 let cfg = getPoolConfig()
245245 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
246246 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
247247 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
248248 let amAmtX18 = toX18(amAmt, amtAssetDcm)
249249 let prAmtX18 = toX18(prAmt, priceAssetDcm)
250250 let lpAmtX18 = toX18(lpAmt, scale8)
251251 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
252252 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
253253 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
254254 }
255255
256256
257257 func calculatePrices (amAmt,prAmt,lpAmt) = {
258258 let prices = calcPrices(amAmt, prAmt, lpAmt)
259259 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
260260 }
261261
262262
263263 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
264264 let cfg = getPoolConfig()
265265 let lpAssetId = cfg[idxPoolLPAssetId]
266266 let amAssetId = cfg[idxAmtAssetId]
267267 let prAssetId = cfg[idxPriceAssetId]
268268 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
269269 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
270270 let poolStatus = cfg[idxPoolStatus]
271271 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
272272 if ((lpAssetId != pmtAssetId))
273273 then throw("Invalid asset passed.")
274274 else {
275275 let amBalance = getAccBalance(amAssetId)
276276 let amBalanceX18 = toX18(amBalance, amAssetDcm)
277277 let prBalance = getAccBalance(prAssetId)
278278 let prBalanceX18 = toX18(prBalance, prAssetDcm)
279279 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
280280 let curPrice = fromX18(curPriceX18, scale8)
281281 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
282282 let lpEmissionX18 = toX18(lpEmission, scale8)
283283 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
284284 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
285285 let outAmAmt = fromX18(outAmAmtX18, amAssetDcm)
286286 let outPrAmt = fromX18(outPrAmtX18, prAssetDcm)
287287 let state = if ((txId58 == ""))
288288 then nil
289289 else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
290290 then unit
291291 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
292292 then unit
293293 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)]
294294 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
295295 }
296296 }
297297
298298
299299 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
300300 let cfg = getPoolConfig()
301301 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
302302 let amAssetIdStr = cfg[idxAmtAssetId]
303303 let prAssetIdStr = cfg[idxPriceAssetId]
304304 let iAmtAssetId = cfg[idxIAmtAssetId]
305305 let iPriceAssetId = cfg[idxIPriceAssetId]
306306 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
307307 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
308308 let poolStatus = cfg[idxPoolStatus]
309309 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
310310 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
311311 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
312312 if (if ((amAssetIdStr != inAmAssetIdStr))
313313 then true
314314 else (prAssetIdStr != inPrAssetIdStr))
315315 then throw("Invalid amt or price asset passed.")
316316 else {
317317 let amBalance = if (isEvaluate)
318318 then getAccBalance(amAssetIdStr)
319319 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
320320 let prBalance = if (isEvaluate)
321321 then getAccBalance(prAssetIdStr)
322322 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
323323 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
324324 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
325325 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
326326 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
327327 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
328328 let res = if ((lpEmission == 0))
329329 then {
330330 let curPriceX18 = zeroBigInt
331331 let slippageX18 = zeroBigInt
332332 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
333333 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
334334 }
335335 else {
336336 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
337337 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
338338 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
339339 if (if ((curPriceX18 != zeroBigInt))
340340 then (slippageX18 > slippageToleranceX18)
341341 else false)
342342 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
343343 else {
344344 let lpEmissionX18 = toX18(lpEmission, scale8)
345345 let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
346346 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
347347 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
348348 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
349349 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
350350 let expAmtAssetAmtX18 = expectedAmts._1
351351 let expPriceAssetAmtX18 = expectedAmts._2
352352 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18)
353353 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(expAmtAssetAmtX18, amtAssetDcm), fromX18(expPriceAssetAmtX18, priceAssetDcm), curPriceX18, slippageX18)
354354 }
355355 }
356356 let calcLpAmt = res._1
357357 let calcAmAssetPmt = res._2
358358 let calcPrAssetPmt = res._3
359359 let curPrice = fromX18(res._4, scale8)
360360 let slippageCalc = fromX18(res._5, scale8)
361361 if ((0 >= calcLpAmt))
362362 then throw("Invalid calculations. LP calculated is less than zero.")
363363 else {
364364 let emitLpAmt = if (!(emitLp))
365365 then 0
366366 else calcLpAmt
367367 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
368368 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
369369 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))]
370370 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
371371 }
372372 }
373373 }
374374
375375
376376 func calcKLp (amountBalance,priceBalance,lpEmission) = {
377377 let updatedKLp = fraction(pow((amountBalance * priceBalance), 0, toBigInt(5), 1, 0, DOWN), scale18, lpEmission)
378378 updatedKLp
379379 }
380380
381381
382382 func refreshKLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
383383 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
384384 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
385385 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
386386 let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
387387 let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
388388 $Tuple2(actions, updatedKLp)
389389 }
390390
391391
392392 func validateMatcherOrderAllowed (order) = {
393- let cfg = getPoolConfig()
394- let amtAssetId = cfg[idxAmtAssetId]
395- let priceAssetId = cfg[idxPriceAssetId]
396- let poolStatus = parseIntValue(cfg[idxPoolStatus])
397- let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
398- let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
399393 let amountAssetAmount = order.amount
400394 let priceAssetAmount = fraction(order.amount, order.price, scale8)
401- let $t01983820050 = if ((order.orderType == Buy))
395+ let $t01955919771 = if ((order.orderType == Buy))
402396 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
403397 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
404- let amountAssetBalanceDelta = $t01983820050._1
405- let priceAssetBalanceDelta = $t01983820050._2
398+ let amountAssetBalanceDelta = $t01955919771._1
399+ let priceAssetBalanceDelta = $t01955919771._2
406400 if (if (if (isGlobalShutdown())
407401 then true
408- else (poolStatus == PoolMatcherDisabled))
402+ else (cfgPoolStatus == PoolMatcherDisabled))
409403 then true
410- else (poolStatus == PoolShutdown))
404+ else (cfgPoolStatus == PoolShutdown))
411405 then throw("Exchange operations disabled")
412- else {
413- let orderAmtAssetStr = assetIdToString(value(order.assetPair.amountAsset))
414- let orderPriceAssetStr = assetIdToString(value(order.assetPair.priceAsset))
415- if (if ((orderAmtAssetStr != amtAssetId))
416- then true
417- else (orderPriceAssetStr != priceAssetId))
418- then throw("Wrong order assets.")
419- else {
420- let kLp = valueOrErrorMessage(parseBigInt(valueOrErrorMessage(getString(this, keyKLp), fmtErr("kLp is required"))), fmtErr("invalid kLp"))
421- let $t02064520745 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
422- let unusedActions = $t02064520745._1
423- let kLpNew = $t02064520745._2
424- let isOrderValid = (kLpNew > kLp)
425- isOrderValid
426- }
427- }
406+ else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
407+ then true
408+ else (order.assetPair.priceAsset != cfgPriceAssetId))
409+ then throw("Wrong order assets.")
410+ else {
411+ let kLp = valueOrErrorMessage(parseBigInt(valueOrErrorMessage(getString(this, keyKLp), fmtErr("kLp is required"))), fmtErr("invalid kLp"))
412+ let $t02024220342 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
413+ let unusedActions = $t02024220342._1
414+ let kLpNew = $t02024220342._2
415+ let isOrderValid = (kLpNew > kLp)
416+ isOrderValid
417+ }
428418 }
429419
430420
431421 func commonGet (i) = if ((size(i.payments) != 1))
432422 then throw("exactly 1 payment is expected")
433423 else {
434424 let pmt = value(i.payments[0])
435425 let pmtAssetId = value(pmt.assetId)
436426 let pmtAmt = pmt.amount
437427 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
438428 let outAmAmt = res._1
439429 let outPrAmt = res._2
440430 let poolStatus = parseIntValue(res._9)
441431 let state = res._10
442432 if (if (isGlobalShutdown())
443433 then true
444434 else (poolStatus == PoolShutdown))
445435 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
446436 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
447437 }
448438
449439
450440 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
451441 then throw("exactly 2 payments are expected")
452442 else {
453443 let amAssetPmt = value(i.payments[0])
454444 let prAssetPmt = value(i.payments[1])
455445 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
456446 let poolStatus = parseIntValue(estPut._8)
457447 if (if (if (isGlobalShutdown())
458448 then true
459449 else (poolStatus == PoolPutDisabled))
460450 then true
461451 else (poolStatus == PoolShutdown))
462452 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
463453 else estPut
464454 }
465455
466456
467457 func emit (amount) = {
468458 let emitInv = invoke(factoryContract, "emit", [amount], nil)
469459 if ((emitInv == emitInv))
470460 then {
471461 let emitInvLegacy = match emitInv {
472462 case legacyFactoryContract: Address =>
473463 invoke(legacyFactoryContract, "emit", [amount], nil)
474464 case _ =>
475465 unit
476466 }
477467 if ((emitInvLegacy == emitInvLegacy))
478468 then amount
479469 else throw("Strict value is not equal to itself.")
480470 }
481471 else throw("Strict value is not equal to itself.")
482472 }
483473
484474
485475 func takeFee (amount) = {
486476 let feeAmount = fraction(amount, fee, scale8)
487477 $Tuple2((amount - feeAmount), feeAmount)
488478 }
489479
490480
491481 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
492482 let isEval = (txId == unit)
493483 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
494484 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
495485 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
496486 then true
497487 else if ((paymentAssetId == cfgPriceAssetId))
498488 then false
499489 else throwErr("invalid asset")
500- let $t02342923722 = if (isEval)
490+ let $t02302623319 = if (isEval)
501491 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
502492 else if (paymentInAmountAsset)
503493 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
504494 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
505- let amountBalanceOld = $t02342923722._1
506- let priceBalanceOld = $t02342923722._2
507- let $t02372623875 = if (paymentInAmountAsset)
495+ let amountBalanceOld = $t02302623319._1
496+ let priceBalanceOld = $t02302623319._2
497+ let $t02332323472 = if (paymentInAmountAsset)
508498 then $Tuple2(paymentAmountRaw, 0)
509499 else $Tuple2(0, paymentAmountRaw)
510- let amountAssetAmountRaw = $t02372623875._1
511- let priceAssetAmountRaw = $t02372623875._2
500+ let amountAssetAmountRaw = $t02332323472._1
501+ let priceAssetAmountRaw = $t02332323472._2
512502 let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
513503 let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
514- let $t02399724056 = takeFee(paymentAmountRaw)
515- let paymentAmount = $t02399724056._1
516- let feeAmount = $t02399724056._2
504+ let $t02359423653 = takeFee(paymentAmountRaw)
505+ let paymentAmount = $t02359423653._1
506+ let feeAmount = $t02359423653._2
517507 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
518508 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
519509 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
520510 let priceNew = fromX18(priceNewX18, scale8)
521511 let paymentBalance = if (paymentInAmountAsset)
522512 then amountBalanceOld
523513 else priceBalanceOld
524514 let paymentBalanceBigInt = toBigInt(paymentBalance)
525515 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
526516 let chechSupply = if ((supplyBigInt > big0))
527517 then true
528518 else throwErr("initial deposit requires all coins")
529519 if ((chechSupply == chechSupply))
530520 then {
531521 let depositBigInt = toBigInt(paymentAmount)
532522 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
533523 let commonState = if (isEval)
534524 then nil
535525 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))]
536526 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
537527 let priceOld = fromX18(priceOldX18, scale8)
538528 let loss = {
539- let $t02553325700 = if (paymentInAmountAsset)
529+ let $t02513025297 = if (paymentInAmountAsset)
540530 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
541531 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
542- let amount = $t02553325700._1
543- let balance = $t02553325700._2
532+ let amount = $t02513025297._1
533+ let balance = $t02513025297._2
544534 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
545535 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
546536 }
547537 $Tuple5(issueAmount, commonState, feeAmount, loss, paymentInAmountAsset)
548538 }
549539 else throw("Strict value is not equal to itself.")
550540 }
551541
552542
553543 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
554544 let isEval = (txId == unit)
555545 let checks = [if ((paymentAssetId == cfgLpAssetId))
556546 then true
557547 else throwErr("invalid lp asset")]
558548 if ((checks == checks))
559549 then {
560550 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
561551 then true
562552 else if ((outAssetId == cfgPriceAssetId))
563553 then false
564554 else throwErr("invalid asset")
565555 let balanceBigInt = if (outInAmountAsset)
566556 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
567557 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
568558 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
569559 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
570560 let outBalance = if (outInAmountAsset)
571561 then amBalanceOld
572562 else prBalanceOld
573563 let outBalanceBigInt = toBigInt(outBalance)
574564 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
575565 let redeemedBigInt = toBigInt(paymentAmount)
576566 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
577- let $t02730227352 = takeFee(amountRaw)
578- let totalAmount = $t02730227352._1
579- let feeAmount = $t02730227352._2
580- let $t02735627582 = if (outInAmountAsset)
567+ let $t02689926949 = takeFee(amountRaw)
568+ let totalAmount = $t02689926949._1
569+ let feeAmount = $t02689926949._2
570+ let $t02695327179 = if (outInAmountAsset)
581571 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
582572 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
583- let outAmAmount = $t02735627582._1
584- let outPrAmount = $t02735627582._2
585- let amBalanceNew = $t02735627582._3
586- let prBalanceNew = $t02735627582._4
573+ let outAmAmount = $t02695327179._1
574+ let outPrAmount = $t02695327179._2
575+ let amBalanceNew = $t02695327179._3
576+ let prBalanceNew = $t02695327179._4
587577 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
588578 let priceNew = fromX18(priceNewX18, scale8)
589579 let commonState = if (isEval)
590580 then nil
591581 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)]
592582 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
593583 let priceOld = fromX18(priceOldX18, scale8)
594584 let loss = {
595585 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
596586 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
597587 }
598588 $Tuple5(totalAmount, commonState, feeAmount, loss, outInAmountAsset)
599589 }
600590 else throw("Strict value is not equal to itself.")
601591 }
602592
603593
604594 func managerPublicKeyOrUnit () = match getString(mpk()) {
605595 case s: String =>
606596 fromBase58String(s)
607597 case _: Unit =>
608598 unit
609599 case _ =>
610600 throw("Match error")
611601 }
612602
613603
614604 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
615605 case s: String =>
616606 fromBase58String(s)
617607 case _: Unit =>
618608 unit
619609 case _ =>
620610 throw("Match error")
621611 }
622612
623613
624614 func isManager (i) = match managerPublicKeyOrUnit() {
625615 case pk: ByteVector =>
626616 (i.callerPublicKey == pk)
627617 case _: Unit =>
628618 (i.caller == this)
629619 case _ =>
630620 throw("Match error")
631621 }
632622
633623
634624 func mustManager (i) = {
635625 let pd = throw("Permission denied")
636626 match managerPublicKeyOrUnit() {
637627 case pk: ByteVector =>
638628 if ((i.callerPublicKey == pk))
639629 then true
640630 else pd
641631 case _: Unit =>
642632 if ((i.caller == this))
643633 then true
644634 else pd
645635 case _ =>
646636 throw("Match error")
647637 }
648638 }
649639
650640
651641 @Callable(i)
652642 func setManager (pendingManagerPublicKey) = {
653643 let checkCaller = mustManager(i)
654644 if ((checkCaller == checkCaller))
655645 then {
656646 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
657647 if ((checkManagerPublicKey == checkManagerPublicKey))
658648 then [StringEntry(pmpk(), pendingManagerPublicKey)]
659649 else throw("Strict value is not equal to itself.")
660650 }
661651 else throw("Strict value is not equal to itself.")
662652 }
663653
664654
665655
666656 @Callable(i)
667657 func confirmManager () = {
668658 let pm = pendingManagerPublicKeyOrUnit()
669659 let hasPM = if (isDefined(pm))
670660 then true
671661 else throw("No pending manager")
672662 if ((hasPM == hasPM))
673663 then {
674664 let checkPM = if ((i.callerPublicKey == value(pm)))
675665 then true
676666 else throw("You are not pending manager")
677667 if ((checkPM == checkPM))
678668 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
679669 else throw("Strict value is not equal to itself.")
680670 }
681671 else throw("Strict value is not equal to itself.")
682672 }
683673
684674
685675
686676 @Callable(i)
687677 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
688678 then throw("Invalid slippageTolerance passed")
689679 else {
690680 let estPut = commonPut(i, slippageTolerance, true)
691681 let emitLpAmt = estPut._2
692682 let lpAssetId = estPut._7
693683 let state = estPut._9
694684 let amDiff = estPut._10
695685 let prDiff = estPut._11
696686 let amId = estPut._12
697687 let prId = estPut._13
698688 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
699689 if ((emitInv == emitInv))
700690 then {
701691 let emitInvLegacy = match emitInv {
702692 case legacyFactoryContract: Address =>
703693 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
704694 case _ =>
705695 unit
706696 }
707697 if ((emitInvLegacy == emitInvLegacy))
708698 then {
709699 let slippageAInv = if ((amDiff > 0))
710700 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
711701 else nil
712702 if ((slippageAInv == slippageAInv))
713703 then {
714704 let slippagePInv = if ((prDiff > 0))
715705 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
716706 else nil
717707 if ((slippagePInv == slippagePInv))
718708 then {
719709 let lpTransfer = if (shouldAutoStake)
720710 then {
721711 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
722712 if ((slpStakeInv == slpStakeInv))
723713 then nil
724714 else throw("Strict value is not equal to itself.")
725715 }
726716 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
727- let $t03153331598 = refreshKLpInternal(0, 0, 0)
728- let refreshKLpActions = $t03153331598._1
729- let updatedKLp = $t03153331598._2
717+ let $t03113031195 = refreshKLpInternal(0, 0, 0)
718+ let refreshKLpActions = $t03113031195._1
719+ let updatedKLp = $t03113031195._2
730720 ((state ++ lpTransfer) ++ refreshKLpActions)
731721 }
732722 else throw("Strict value is not equal to itself.")
733723 }
734724 else throw("Strict value is not equal to itself.")
735725 }
736726 else throw("Strict value is not equal to itself.")
737727 }
738728 else throw("Strict value is not equal to itself.")
739729 }
740730
741731
742732
743733 @Callable(i)
744734 func putForFree (maxSlippage) = if ((0 > maxSlippage))
745735 then throw("Invalid value passed")
746736 else {
747737 let estPut = commonPut(i, maxSlippage, false)
748738 let state = estPut._9
749- let $t03188431949 = refreshKLpInternal(0, 0, 0)
750- let refreshKLpActions = $t03188431949._1
751- let updatedKLp = $t03188431949._2
739+ let $t03148131546 = refreshKLpInternal(0, 0, 0)
740+ let refreshKLpActions = $t03148131546._1
741+ let updatedKLp = $t03148131546._2
752742 (state ++ refreshKLpActions)
753743 }
754744
755745
756746
757747 @Callable(i)
758748 func putOneTkn (minOutAmount,autoStake) = {
759749 let isPoolOneTokenOperationsDisabled = {
760750 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
761751 if ($isInstanceOf(@, "Boolean"))
762752 then @
763753 else throw(($getType(@) + " couldn't be cast to Boolean"))
764754 }
765755 let isPutDisabled = if (if (if (isGlobalShutdown())
766756 then true
767757 else (cfgPoolStatus == PoolPutDisabled))
768758 then true
769759 else (cfgPoolStatus == PoolShutdown))
770760 then true
771761 else isPoolOneTokenOperationsDisabled
772762 let checks = [if (if (!(isPutDisabled))
773763 then true
774764 else isManager(i))
775765 then true
776766 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
777767 then true
778768 else throwErr("exactly 1 payment are expected")]
779769 if ((checks == checks))
780770 then {
781771 let payment = i.payments[0]
782772 let paymentAssetId = payment.assetId
783773 let paymentAmountRaw = payment.amount
784774 let userAddress = i.caller
785775 let txId = i.transactionId
786- let $t03272532877 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
787- if (($t03272532877 == $t03272532877))
776+ let $t03232232474 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
777+ if (($t03232232474 == $t03232232474))
788778 then {
789- let paymentInAmountAsset = $t03272532877._5
790- let bonus = $t03272532877._4
791- let feeAmount = $t03272532877._3
792- let commonState = $t03272532877._2
793- let emitAmountEstimated = $t03272532877._1
779+ let paymentInAmountAsset = $t03232232474._5
780+ let bonus = $t03232232474._4
781+ let feeAmount = $t03232232474._3
782+ let commonState = $t03232232474._2
783+ let emitAmountEstimated = $t03232232474._1
794784 let emitAmount = if (if ((minOutAmount > 0))
795785 then (minOutAmount > emitAmountEstimated)
796786 else false)
797787 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
798788 else emitAmountEstimated
799789 let emitInv = emit(emitAmount)
800790 if ((emitInv == emitInv))
801791 then {
802792 let lpTransfer = if (autoStake)
803793 then {
804794 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
805795 if ((stakeInv == stakeInv))
806796 then nil
807797 else throw("Strict value is not equal to itself.")
808798 }
809799 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
810800 let sendFee = if ((feeAmount > 0))
811801 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
812802 else nil
813- let $t03346333660 = if ((this == feeCollectorAddress))
803+ let $t03306033257 = if ((this == feeCollectorAddress))
814804 then $Tuple2(0, 0)
815805 else if (paymentInAmountAsset)
816806 then $Tuple2(-(feeAmount), 0)
817807 else $Tuple2(0, -(feeAmount))
818- let amountAssetBalanceDelta = $t03346333660._1
819- let priceAssetBalanceDelta = $t03346333660._2
820- let $t03366333771 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
821- let refreshKLpActions = $t03366333771._1
822- let updatedKLp = $t03366333771._2
808+ let amountAssetBalanceDelta = $t03306033257._1
809+ let priceAssetBalanceDelta = $t03306033257._2
810+ let $t03326033368 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
811+ let refreshKLpActions = $t03326033368._1
812+ let updatedKLp = $t03326033368._2
823813 $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
824814 }
825815 else throw("Strict value is not equal to itself.")
826816 }
827817 else throw("Strict value is not equal to itself.")
828818 }
829819 else throw("Strict value is not equal to itself.")
830820 }
831821
832822
833823
834824 @Callable(i)
835825 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
836- let $t03396434121 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
837- let emitAmountEstimated = $t03396434121._1
838- let commonState = $t03396434121._2
839- let feeAmount = $t03396434121._3
840- let bonus = $t03396434121._4
841- let paymentInAmountAsset = $t03396434121._5
826+ let $t03356133718 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
827+ let emitAmountEstimated = $t03356133718._1
828+ let commonState = $t03356133718._2
829+ let feeAmount = $t03356133718._3
830+ let bonus = $t03356133718._4
831+ let paymentInAmountAsset = $t03356133718._5
842832 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
843833 }
844834
845835
846836
847837 @Callable(i)
848838 func getOneTkn (outAssetIdStr,minOutAmount) = {
849839 let isPoolOneTokenOperationsDisabled = {
850840 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
851841 if ($isInstanceOf(@, "Boolean"))
852842 then @
853843 else throw(($getType(@) + " couldn't be cast to Boolean"))
854844 }
855845 let isGetDisabled = if (if (isGlobalShutdown())
856846 then true
857847 else (cfgPoolStatus == PoolShutdown))
858848 then true
859849 else isPoolOneTokenOperationsDisabled
860850 let checks = [if (if (!(isGetDisabled))
861851 then true
862852 else isManager(i))
863853 then true
864854 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
865855 then true
866856 else throwErr("exactly 1 payment are expected")]
867857 if ((checks == checks))
868858 then {
869859 let outAssetId = parseAssetId(outAssetIdStr)
870860 let payment = i.payments[0]
871861 let paymentAssetId = payment.assetId
872862 let paymentAmount = payment.amount
873863 let userAddress = i.caller
874864 let txId = i.transactionId
875- let $t03492635079 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
876- if (($t03492635079 == $t03492635079))
865+ let $t03452334676 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
866+ if (($t03452334676 == $t03452334676))
877867 then {
878- let outInAmountAsset = $t03492635079._5
879- let bonus = $t03492635079._4
880- let feeAmount = $t03492635079._3
881- let commonState = $t03492635079._2
882- let amountEstimated = $t03492635079._1
868+ let outInAmountAsset = $t03452334676._5
869+ let bonus = $t03452334676._4
870+ let feeAmount = $t03452334676._3
871+ let commonState = $t03452334676._2
872+ let amountEstimated = $t03452334676._1
883873 let amount = if (if ((minOutAmount > 0))
884874 then (minOutAmount > amountEstimated)
885875 else false)
886876 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
887877 else amountEstimated
888878 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
889879 if ((burnInv == burnInv))
890880 then {
891881 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
892882 let sendFee = if ((feeAmount > 0))
893883 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
894884 else nil
895- let $t03557935826 = {
885+ let $t03517635423 = {
896886 let feeAmountForCalc = if ((this == feeCollectorAddress))
897887 then 0
898888 else feeAmount
899889 if (outInAmountAsset)
900890 then $Tuple2(-((amount + feeAmountForCalc)), 0)
901891 else $Tuple2(0, -((amount + feeAmountForCalc)))
902892 }
903- let amountAssetBalanceDelta = $t03557935826._1
904- let priceAssetBalanceDelta = $t03557935826._2
905- let $t03582935937 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
906- let refreshKLpActions = $t03582935937._1
907- let updatedKLp = $t03582935937._2
893+ let amountAssetBalanceDelta = $t03517635423._1
894+ let priceAssetBalanceDelta = $t03517635423._2
895+ let $t03542635534 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
896+ let refreshKLpActions = $t03542635534._1
897+ let updatedKLp = $t03542635534._2
908898 $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
909899 }
910900 else throw("Strict value is not equal to itself.")
911901 }
912902 else throw("Strict value is not equal to itself.")
913903 }
914904 else throw("Strict value is not equal to itself.")
915905 }
916906
917907
918908
919909 @Callable(i)
920910 func getOneTknREADONLY (outAssetId,paymentAmount) = {
921- let $t03612136277 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
922- let amountEstimated = $t03612136277._1
923- let commonState = $t03612136277._2
924- let feeAmount = $t03612136277._3
925- let bonus = $t03612136277._4
926- let outInAmountAsset = $t03612136277._5
911+ let $t03571835874 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
912+ let amountEstimated = $t03571835874._1
913+ let commonState = $t03571835874._2
914+ let feeAmount = $t03571835874._3
915+ let bonus = $t03571835874._4
916+ let outInAmountAsset = $t03571835874._5
927917 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
928918 }
929919
930920
931921
932922 @Callable(i)
933923 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
934924 let isPoolOneTokenOperationsDisabled = {
935925 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
936926 if ($isInstanceOf(@, "Boolean"))
937927 then @
938928 else throw(($getType(@) + " couldn't be cast to Boolean"))
939929 }
940930 let isGetDisabled = if (if (isGlobalShutdown())
941931 then true
942932 else (cfgPoolStatus == PoolShutdown))
943933 then true
944934 else isPoolOneTokenOperationsDisabled
945935 let checks = [if (if (!(isGetDisabled))
946936 then true
947937 else isManager(i))
948938 then true
949939 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
950940 then true
951941 else throwErr("no payments are expected")]
952942 if ((checks == checks))
953943 then {
954944 let outAssetId = parseAssetId(outAssetIdStr)
955945 let userAddress = i.caller
956946 let txId = i.transactionId
957947 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
958948 if ((unstakeInv == unstakeInv))
959949 then {
960- let $t03710237253 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
961- if (($t03710237253 == $t03710237253))
950+ let $t03669936850 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
951+ if (($t03669936850 == $t03669936850))
962952 then {
963- let outInAmountAsset = $t03710237253._5
964- let bonus = $t03710237253._4
965- let feeAmount = $t03710237253._3
966- let commonState = $t03710237253._2
967- let amountEstimated = $t03710237253._1
953+ let outInAmountAsset = $t03669936850._5
954+ let bonus = $t03669936850._4
955+ let feeAmount = $t03669936850._3
956+ let commonState = $t03669936850._2
957+ let amountEstimated = $t03669936850._1
968958 let amount = if (if ((minOutAmount > 0))
969959 then (minOutAmount > amountEstimated)
970960 else false)
971961 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
972962 else amountEstimated
973963 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
974964 if ((burnInv == burnInv))
975965 then {
976966 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
977967 let sendFee = if ((feeAmount > 0))
978968 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
979969 else nil
980- let $t03774837995 = {
970+ let $t03734537592 = {
981971 let feeAmountForCalc = if ((this == feeCollectorAddress))
982972 then 0
983973 else feeAmount
984974 if (outInAmountAsset)
985975 then $Tuple2(-((amount + feeAmountForCalc)), 0)
986976 else $Tuple2(0, -((amount + feeAmountForCalc)))
987977 }
988- let amountAssetBalanceDelta = $t03774837995._1
989- let priceAssetBalanceDelta = $t03774837995._2
990- let $t03799838106 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
991- let refreshKLpActions = $t03799838106._1
992- let updatedKLp = $t03799838106._2
978+ let amountAssetBalanceDelta = $t03734537592._1
979+ let priceAssetBalanceDelta = $t03734537592._2
980+ let $t03759537703 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
981+ let refreshKLpActions = $t03759537703._1
982+ let updatedKLp = $t03759537703._2
993983 $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
994984 }
995985 else throw("Strict value is not equal to itself.")
996986 }
997987 else throw("Strict value is not equal to itself.")
998988 }
999989 else throw("Strict value is not equal to itself.")
1000990 }
1001991 else throw("Strict value is not equal to itself.")
1002992 }
1003993
1004994
1005995
1006996 @Callable(i)
1007997 func get () = {
1008998 let res = commonGet(i)
1009999 let outAmtAmt = res._1
10101000 let outPrAmt = res._2
10111001 let pmtAmt = res._3
10121002 let pmtAssetId = res._4
10131003 let state = res._5
10141004 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10151005 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10161006 then {
1017- let $t03889838980 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1018- let refreshKLpActions = $t03889838980._1
1019- let updatedKLp = $t03889838980._2
1007+ let $t03849538577 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1008+ let refreshKLpActions = $t03849538577._1
1009+ let updatedKLp = $t03849538577._2
10201010 (state ++ refreshKLpActions)
10211011 }
10221012 else throw("Strict value is not equal to itself.")
10231013 }
10241014
10251015
10261016
10271017 @Callable(i)
10281018 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
10291019 let res = commonGet(i)
10301020 let outAmAmt = res._1
10311021 let outPrAmt = res._2
10321022 let pmtAmt = res._3
10331023 let pmtAssetId = res._4
10341024 let state = res._5
10351025 if ((noLessThenAmtAsset > outAmAmt))
10361026 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
10371027 else if ((noLessThenPriceAsset > outPrAmt))
10381028 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
10391029 else {
10401030 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10411031 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10421032 then {
1043- let $t03977639857 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1044- let refreshKLpActions = $t03977639857._1
1045- let updatedKLp = $t03977639857._2
1033+ let $t03937339454 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1034+ let refreshKLpActions = $t03937339454._1
1035+ let updatedKLp = $t03937339454._2
10461036 (state ++ refreshKLpActions)
10471037 }
10481038 else throw("Strict value is not equal to itself.")
10491039 }
10501040 }
10511041
10521042
10531043
10541044 @Callable(i)
10551045 func unstakeAndGet (amount) = {
10561046 let checkPayments = if ((size(i.payments) != 0))
10571047 then throw("No payments are expected")
10581048 else true
10591049 if ((checkPayments == checkPayments))
10601050 then {
10611051 let cfg = getPoolConfig()
10621052 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
10631053 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
10641054 if ((unstakeInv == unstakeInv))
10651055 then {
10661056 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
10671057 let outAmAmt = res._1
10681058 let outPrAmt = res._2
10691059 let poolStatus = parseIntValue(res._9)
10701060 let state = res._10
10711061 let checkPoolStatus = if (if (isGlobalShutdown())
10721062 then true
10731063 else (poolStatus == PoolShutdown))
10741064 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
10751065 else true
10761066 if ((checkPoolStatus == checkPoolStatus))
10771067 then {
10781068 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
10791069 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10801070 then {
1081- let $t04083040911 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1082- let refreshKLpActions = $t04083040911._1
1083- let updatedKLp = $t04083040911._2
1071+ let $t04042740508 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1072+ let refreshKLpActions = $t04042740508._1
1073+ let updatedKLp = $t04042740508._2
10841074 (state ++ refreshKLpActions)
10851075 }
10861076 else throw("Strict value is not equal to itself.")
10871077 }
10881078 else throw("Strict value is not equal to itself.")
10891079 }
10901080 else throw("Strict value is not equal to itself.")
10911081 }
10921082 else throw("Strict value is not equal to itself.")
10931083 }
10941084
10951085
10961086
10971087 @Callable(i)
10981088 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
10991089 let isGetDisabled = if (isGlobalShutdown())
11001090 then true
11011091 else (cfgPoolStatus == PoolShutdown)
11021092 let checks = [if (!(isGetDisabled))
11031093 then true
11041094 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
11051095 then true
11061096 else throw("no payments are expected")]
11071097 if ((checks == checks))
11081098 then {
11091099 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
11101100 if ((unstakeInv == unstakeInv))
11111101 then {
11121102 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
11131103 let outAmAmt = res._1
11141104 let outPrAmt = res._2
11151105 let state = res._10
11161106 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
11171107 then true
11181108 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
11191109 then true
11201110 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
11211111 if ((checkAmounts == checkAmounts))
11221112 then {
11231113 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
11241114 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11251115 then {
1126- let $t04205142132 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1127- let refreshKLpActions = $t04205142132._1
1128- let updatedKLp = $t04205142132._2
1116+ let $t04164841729 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1117+ let refreshKLpActions = $t04164841729._1
1118+ let updatedKLp = $t04164841729._2
11291119 (state ++ refreshKLpActions)
11301120 }
11311121 else throw("Strict value is not equal to itself.")
11321122 }
11331123 else throw("Strict value is not equal to itself.")
11341124 }
11351125 else throw("Strict value is not equal to itself.")
11361126 }
11371127 else throw("Strict value is not equal to itself.")
11381128 }
11391129
11401130
11411131
11421132 @Callable(i)
11431133 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
11441134 then throw("permissions denied")
11451135 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
11461136
11471137
11481138
11491139 @Callable(i)
11501140 func refreshKLp () = {
11511141 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0)
11521142 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay))
11531143 then unit
11541144 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
11551145 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
11561146 then {
1157- let $t04312043175 = refreshKLpInternal(0, 0, 0)
1158- let actions = $t04312043175._1
1159- let updatedKLp = $t04312043175._2
1147+ let $t04271742772 = refreshKLpInternal(0, 0, 0)
1148+ let actions = $t04271742772._1
1149+ let updatedKLp = $t04271742772._2
11601150 $Tuple2(actions, toString(updatedKLp))
11611151 }
11621152 else throw("Strict value is not equal to itself.")
11631153 }
11641154
11651155
11661156
11671157 @Callable(i)
11681158 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
11691159
11701160
11711161
11721162 @Callable(i)
11731163 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
11741164
11751165
11761166
11771167 @Callable(i)
11781168 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
11791169 let prices = calcPrices(amAmt, prAmt, lpAmt)
11801170 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
11811171 }
11821172
11831173
11841174
11851175 @Callable(i)
11861176 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
11871177
11881178
11891179
11901180 @Callable(i)
11911181 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
11921182
11931183
11941184
11951185 @Callable(i)
11961186 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
11971187
11981188
11991189
12001190 @Callable(i)
12011191 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
12021192
12031193
12041194
12051195 @Callable(i)
12061196 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
12071197 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
12081198 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
12091199 }
12101200
12111201
12121202
12131203 @Callable(i)
12141204 func statsREADONLY () = {
12151205 let cfg = getPoolConfig()
12161206 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
12171207 let amtAssetId = cfg[idxAmtAssetId]
12181208 let priceAssetId = cfg[idxPriceAssetId]
12191209 let iAmtAssetId = cfg[idxIAmtAssetId]
12201210 let iPriceAssetId = cfg[idxIPriceAssetId]
12211211 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
12221212 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
12231213 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
12241214 let accAmtAssetBalance = getAccBalance(amtAssetId)
12251215 let accPriceAssetBalance = getAccBalance(priceAssetId)
12261216 let pricesList = if ((poolLPBalance == 0))
12271217 then [zeroBigInt, zeroBigInt, zeroBigInt]
12281218 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
12291219 let curPrice = 0
12301220 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
12311221 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
12321222 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
12331223 $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))
12341224 }
12351225
12361226
12371227
12381228 @Callable(i)
12391229 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
12401230 let cfg = getPoolConfig()
12411231 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
12421232 let amAssetIdStr = cfg[idxAmtAssetId]
12431233 let amAssetId = fromBase58String(amAssetIdStr)
12441234 let prAssetIdStr = cfg[idxPriceAssetId]
12451235 let prAssetId = fromBase58String(prAssetIdStr)
12461236 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
12471237 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
12481238 let poolStatus = cfg[idxPoolStatus]
12491239 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
12501240 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
12511241 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
12521242 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
12531243 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
12541244 let curPriceX18 = if ((poolLPBalance == 0))
12551245 then zeroBigInt
12561246 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
12571247 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
12581248 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
12591249 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
12601250 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
12611251 let calcLpAmt = estPut._1
12621252 let curPriceCalc = estPut._3
12631253 let amBalance = estPut._4
12641254 let prBalance = estPut._5
12651255 let lpEmission = estPut._6
12661256 $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))
12671257 }
12681258
12691259
12701260
12711261 @Callable(i)
12721262 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
12731263 let cfg = getPoolConfig()
12741264 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
12751265 let amAssetIdStr = cfg[idxAmtAssetId]
12761266 let amAssetId = fromBase58String(amAssetIdStr)
12771267 let prAssetIdStr = cfg[idxPriceAssetId]
12781268 let prAssetId = fromBase58String(prAssetIdStr)
12791269 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
12801270 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
12811271 let poolStatus = cfg[idxPoolStatus]
12821272 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
12831273 let amBalanceRaw = getAccBalance(amAssetIdStr)
12841274 let prBalanceRaw = getAccBalance(prAssetIdStr)
12851275 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
12861276 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
12871277 let curPriceX18 = if ((poolLPBalance == 0))
12881278 then zeroBigInt
12891279 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
12901280 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
12911281 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
12921282 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
12931283 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
12941284 let calcLpAmt = estPut._1
12951285 let curPriceCalc = estPut._3
12961286 let amBalance = estPut._4
12971287 let prBalance = estPut._5
12981288 let lpEmission = estPut._6
12991289 $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))
13001290 }
13011291
13021292
13031293
13041294 @Callable(i)
13051295 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
13061296 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
13071297 let outAmAmt = res._1
13081298 let outPrAmt = res._2
13091299 let amBalance = res._5
13101300 let prBalance = res._6
13111301 let lpEmission = res._7
13121302 let curPrice = res._8
13131303 let poolStatus = parseIntValue(res._9)
13141304 $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))
13151305 }
13161306
13171307
13181308 @Verifier(tx)
13191309 func verify () = {
13201310 let targetPublicKey = match managerPublicKeyOrUnit() {
13211311 case pk: ByteVector =>
13221312 pk
13231313 case _: Unit =>
13241314 tx.senderPublicKey
13251315 case _ =>
13261316 throw("Match error")
13271317 }
13281318 match tx {
13291319 case order: Order =>
13301320 let matcherPub = getMatcherPubOrFail()
13311321 let orderValid = validateMatcherOrderAllowed(order)
13321322 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
13331323 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
13341324 if (if (if (orderValid)
13351325 then senderValid
13361326 else false)
13371327 then matcherValid
13381328 else false)
13391329 then true
13401330 else throwOrderError(orderValid, senderValid, matcherValid)
13411331 case s: SetScriptTransaction =>
13421332 let newHash = blake2b256(value(s.script))
13431333 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
13441334 let currentHash = scriptHash(this)
13451335 if (if ((allowedHash == newHash))
13461336 then (currentHash != newHash)
13471337 else false)
13481338 then true
13491339 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
13501340 case _ =>
13511341 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
13521342 }
13531343 }
13541344

github/deemru/w8io/169f3d6 
186.23 ms