tx · 5vXnkvMaWPXDQB5t78hMUEzhCRRWhbLJ8S9jBu1wz7or

3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA:  -0.03500000 Waves

2022.12.06 18:23 [2348662] smart account 3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA > SELF 0.00000000 Waves

{ "type": 13, "id": "5vXnkvMaWPXDQB5t78hMUEzhCRRWhbLJ8S9jBu1wz7or", "fee": 3500000, "feeAssetId": null, "timestamp": 1670340150298, "version": 1, "sender": "3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA", "senderPublicKey": "35yd3qw1gxKDxKwGAykHN9fANbXNWwseaUwbWDj24o3x", "proofs": [ "2zgmvwBHudXQ95webdLP8z6vm6Xp1F6pHeSwKy6HV2JR84panVLfFgriKfW3yQNYn641Dzg6gtuFeBVhCe8s7i1H" ], "script": "base64:BgKAKAgCEgMKAQgSAwoBCBIAEgQKAgEEEgQKAgEEEgMKAQESABIECgIIARIAEgQKAggBEgQKAggBEgQKAgEBEgMKAQESBQoDAQEBEgUKAwEIARIECgIBCBIECgIBCBIECgIICBIECgIICBIECgIIARIAEgMKAQgSBQoDAQEBEgQKAggBEgQKAgEBEgQKAggIEgsKCQgBAQIBAggEBBIGCgQICAEIEgAiBnNjYWxlOCIMc2NhbGU4QmlnSW50IgdzY2FsZTE4Igp6ZXJvQmlnSW50IgRiaWcwIgRiaWcxIgRiaWcyIgRiaWczIgRiaWc0IgpzbGlwcGFnZTREIgt3YXZlc1N0cmluZyIFQW11bHQiBURjb252IgNTRVAiBUVNUFRZIgpQb29sQWN0aXZlIgpQb29sUHV0RGlzIg5Qb29sTWF0Y2hlckRpcyIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyIJaWR4UG9vbFN0IglpZHhMUEFzSWQiCWlkeEFtQXNJZCIJaWR4UHJBc0lkIgtpZHhBbXRBc0RjbSINaWR4UHJpY2VBc0RjbSILaWR4SUFtdEFzSWQiDWlkeElQcmljZUFzSWQ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m9yBAJhRQUCaEYDCQABAgUCYUUCBU9yZGVyBAJlUQUCYUUEAmhJCQECYVEABAJoSgkBAmVQAQUCZVEEAmhLCQD0AwMIBQJlUQlib2R5Qnl0ZXMJAJEDAggFAmVRBnByb29mcwAACAUCZVEPc2VuZGVyUHVibGljS2V5BAJoTAkA9AMDCAUCZVEJYm9keUJ5dGVzCQCRAwIIBQJlUQZwcm9vZnMAAQUCaEkDAwMFAmhKBQJoSwcFAmhMBwYJAQJhegMFAmhKBQJoSwUCaEwDCQABAgUCYUUCFFNldFNjcmlwdFRyYW5zYWN0aW9uBAJkSQUCYUUEAmhNCQD2AwEJAQV2YWx1ZQEIBQJkSQZzY3JpcHQEAmhOCQDbBAEJAQV2YWx1ZQEJAJ0IAgUCYU4JAQJheAAEAmhPCQDxBwEFBHRoaXMDAwkAAAIFAmhOBQJoTQkBAiE9AgUCaE8FAmhNBwYJAPQDAwgFAmhGCWJvZHlCeXRlcwkAkQMCCAUCaEYGcHJvb2ZzAAAFAmhICQD0AwMIBQJoRglib2R5Qnl0ZXMJAJEDAggFAmhGBnByb29mcwAABQJoSITxBVM=", "chainId": 84, "height": 2348662, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2yG191nzau8mvTTHSDuFboSpdgtNfDY2dpu8ixeLLDKV Next: EzS7Gd5zDGLvuEqV96wsswnJYo5yy7vZeVtGu9ErT1ax Diff:
OldNewDifferences
599599 let $t02348523585 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
600600 let unusedActions = $t02348523585._1
601601 let dLpNew = $t02348523585._2
602- let isOrderValid = (dLpNew > dLp)
602+ let isOrderValid = (dLpNew >= dLp)
603603 isOrderValid
604604 }
605605 }
652652 then {
653653 let amBalance = getAccBalance(amId)
654654 let prBalance = getAccBalance(prId)
655- let $t02590126363 = if ((txId == ""))
655+ let $t02590226364 = if ((txId == ""))
656656 then $Tuple2(amBalance, prBalance)
657657 else if ((pmtAssetId == amId))
658658 then if ((pmtAmtRaw > amBalance))
663663 then throw("invalid payment amount")
664664 else $Tuple2(amBalance, (prBalance - pmtAmtRaw))
665665 else throw("wrong pmtAssetId")
666- let amBalanceOld = $t02590126363._1
667- let prBalanceOld = $t02590126363._2
668- let $t02636926545 = if ((pmtAssetId == amId))
666+ let amBalanceOld = $t02590226364._1
667+ let prBalanceOld = $t02590226364._2
668+ let $t02637026546 = if ((pmtAssetId == amId))
669669 then $Tuple2(pmtAmtRaw, 0)
670670 else if ((pmtAssetId == prId))
671671 then $Tuple2(0, pmtAmtRaw)
672672 else throw("invalid payment")
673- let amAmountRaw = $t02636926545._1
674- let prAmountRaw = $t02636926545._2
675- let $t02654926788 = if (withTakeFee)
673+ let amAmountRaw = $t02637026546._1
674+ let prAmountRaw = $t02637026546._2
675+ let $t02655026789 = if (withTakeFee)
676676 then $Tuple3(takeFee(amAmountRaw)._1, takeFee(prAmountRaw)._1, takeFee(pmtAmtRaw)._2)
677677 else $Tuple3(amAmountRaw, prAmountRaw, 0)
678- let amAmount = $t02654926788._1
679- let prAmount = $t02654926788._2
680- let feeAmount = $t02654926788._3
678+ let amAmount = $t02655026789._1
679+ let prAmount = $t02655026789._2
680+ let feeAmount = $t02655026789._3
681681 let amBalanceNew = (amBalanceOld + amAmount)
682682 let prBalanceNew = (prBalanceOld + prAmount)
683683 let D0 = getD([toBigInt(amBalanceOld), toBigInt(prBalanceOld)])
724724 else {
725725 let amBalance = getAccBalance(amId)
726726 let prBalance = getAccBalance(prId)
727- let $t02887228983 = {
727+ let $t02887328984 = {
728728 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil)
729729 if ($isInstanceOf(@, "(Int, Int)"))
730730 then @
731731 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
732732 }
733- if (($t02887228983 == $t02887228983))
733+ if (($t02887328984 == $t02887328984))
734734 then {
735- let feeAmount = $t02887228983._2
736- let totalGet = $t02887228983._1
735+ let feeAmount = $t02887328984._2
736+ let totalGet = $t02887328984._1
737737 let totalAmount = if (if ((minOutAmount > 0))
738738 then (minOutAmount > totalGet)
739739 else false)
740740 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
741741 else totalGet
742- let $t02917329480 = if ((outAssetId == amId))
742+ let $t02917429481 = if ((outAssetId == amId))
743743 then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance)
744744 else if ((outAssetId == prId))
745745 then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount))
746746 else throw("invalid out asset id")
747- let outAm = $t02917329480._1
748- let outPr = $t02917329480._2
749- let amBalanceNew = $t02917329480._3
750- let prBalanceNew = $t02917329480._4
747+ let outAm = $t02917429481._1
748+ let outPr = $t02917429481._2
749+ let amBalanceNew = $t02917429481._3
750+ let prBalanceNew = $t02917429481._4
751751 let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals))
752752 let curPr = f1(curPrX18, scale8)
753753 let outAssetIdOrWaves = if ((outAssetId == "WAVES"))
762762 let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
763763 if ((burn == burn))
764764 then {
765- let $t03026530615 = {
765+ let $t03026630616 = {
766766 let feeAmountForCalc = if ((this == feeCollectorAddress))
767767 then 0
768768 else feeAmount
773773 then $Tuple2(-((totalGet + feeAmountForCalc)), 0)
774774 else $Tuple2(0, -((totalGet + feeAmountForCalc)))
775775 }
776- let amountAssetBalanceDelta = $t03026530615._1
777- let priceAssetBalanceDelta = $t03026530615._2
778- let $t03061830726 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
779- let refreshDLpActions = $t03061830726._1
780- let updatedDLp = $t03061830726._2
776+ let amountAssetBalanceDelta = $t03026630616._1
777+ let priceAssetBalanceDelta = $t03026630616._2
778+ let $t03061930727 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
779+ let refreshDLpActions = $t03061930727._1
780+ let updatedDLp = $t03061930727._2
781781 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
782782 if ((isUpdatedDLpValid == isUpdatedDLpValid))
783783 then $Tuple2((state ++ refreshDLpActions), totalAmount)
935935 else throw("Strict value is not equal to itself.")
936936 }
937937 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
938- let $t03458234647 = refreshDLpInternal(0, 0, 0)
939- let refreshDLpActions = $t03458234647._1
940- let updatedDLp = $t03458234647._2
938+ let $t03458334648 = refreshDLpInternal(0, 0, 0)
939+ let refreshDLpActions = $t03458334648._1
940+ let updatedDLp = $t03458334648._2
941941 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
942942 if ((isUpdatedDLpValid == isUpdatedDLpValid))
943943 then ((state ++ lpTrnsfr) ++ refreshDLpActions)
993993 let pmt = value(i.payments[0])
994994 let pmtAssetId = toBase58String(value(pmt.assetId))
995995 let pmtAmt = pmt.amount
996- let $t03578435942 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
997- if (($t03578435942 == $t03578435942))
996+ let $t03578535943 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
997+ if (($t03578535943 == $t03578535943))
998998 then {
999- let feeAmount = $t03578435942._3
1000- let state = $t03578435942._2
1001- let estimLP = $t03578435942._1
999+ let feeAmount = $t03578535943._3
1000+ let state = $t03578535943._2
1001+ let estimLP = $t03578535943._1
10021002 let emitLpAmt = if (if ((minOutAmount > 0))
10031003 then (minOutAmount > estimLP)
10041004 else false)
10261026 let sendFeeToMatcher = if ((feeAmount > 0))
10271027 then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))]
10281028 else nil
1029- let $t03675737106 = if ((this == feeCollectorAddress))
1029+ let $t03675837107 = if ((this == feeCollectorAddress))
10301030 then $Tuple2(0, 0)
10311031 else {
10321032 let paymentInAmountAsset = if ((pmt.assetId == cfgAmountAssetId))
10361036 then $Tuple2(-(feeAmount), 0)
10371037 else $Tuple2(0, -(feeAmount))
10381038 }
1039- let amountAssetBalanceDelta = $t03675737106._1
1040- let priceAssetBalanceDelta = $t03675737106._2
1041- let $t03710937217 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1042- let refreshDLpActions = $t03710937217._1
1043- let updatedDLp = $t03710937217._2
1039+ let amountAssetBalanceDelta = $t03675837107._1
1040+ let priceAssetBalanceDelta = $t03675837107._2
1041+ let $t03711037218 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1042+ let refreshDLpActions = $t03711037218._1
1043+ let updatedDLp = $t03711037218._2
10441044 $Tuple2((((state ++ lpTrnsfr) ++ sendFeeToMatcher) ++ refreshDLpActions), emitLpAmt)
10451045 }
10461046 else throw("Strict value is not equal to itself.")
10671067 let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0))
10681068 if ((currentDLp == currentDLp))
10691069 then {
1070- let $t03817638241 = refreshDLpInternal(0, 0, 0)
1071- let refreshDLpActions = $t03817638241._1
1072- let updatedDLp = $t03817638241._2
1070+ let $t03817738242 = refreshDLpInternal(0, 0, 0)
1071+ let refreshDLpActions = $t03817738242._1
1072+ let updatedDLp = $t03817738242._2
10731073 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
10741074 if ((isUpdatedDLpValid == isUpdatedDLpValid))
10751075 then (state ++ refreshDLpActions)
10921092 if ((b == b))
10931093 then {
10941094 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(pmtAmt))
1095- let $t03903039112 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1096- let refreshDLpActions = $t03903039112._1
1097- let updatedDLp = $t03903039112._2
1095+ let $t03903139113 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1096+ let refreshDLpActions = $t03903139113._1
1097+ let updatedDLp = $t03903139113._2
10981098 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
10991099 if ((isUpdatedDLpValid == isUpdatedDLpValid))
11001100 then (state ++ refreshDLpActions)
11271127 else throwErr("exactly 1 payment are expected")]
11281128 if ((checks == checks))
11291129 then {
1130- let $t03973039885 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1131- let state = $t03973039885._1
1132- let totalAmount = $t03973039885._2
1130+ let $t03973139886 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1131+ let state = $t03973139886._1
1132+ let totalAmount = $t03973139886._2
11331133 $Tuple2(state, totalAmount)
11341134 }
11351135 else throw("Strict value is not equal to itself.")
11461146 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
11471147 then {
11481148 let dLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyDLp), "0")), fmtErr("invalid dLp"))
1149- let $t04040940473 = refreshDLpInternal(0, 0, 0)
1150- let dLpUpdateActions = $t04040940473._1
1151- let updatedDLp = $t04040940473._2
1149+ let $t04041040474 = refreshDLpInternal(0, 0, 0)
1150+ let dLpUpdateActions = $t04041040474._1
1151+ let updatedDLp = $t04041040474._2
11521152 let actions = if ((dLp != updatedDLp))
11531153 then dLpUpdateActions
11541154 else throwErr("nothing to refresh")
11771177 let newY = getYD(xp, index, D1)
11781178 let dy = (xp[index] - newY)
11791179 let totalGetRaw = max([0, toInt((dy - big1))])
1180- let $t04137341422 = takeFee(totalGetRaw)
1181- let totalGet = $t04137341422._1
1182- let feeAmount = $t04137341422._2
1180+ let $t04137441423 = takeFee(totalGetRaw)
1181+ let totalGet = $t04137441423._1
1182+ let feeAmount = $t04137441423._2
11831183 $Tuple2(nil, $Tuple2(totalGet, feeAmount))
11841184 }
11851185
11931193 let lpId = poolConfig[idxLPAsId]
11941194 let amBalance = getAccBalance(amId)
11951195 let prBalance = getAccBalance(prId)
1196- let $t04176741882 = {
1196+ let $t04176841883 = {
11971197 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil)
11981198 if ($isInstanceOf(@, "(Int, Int)"))
11991199 then @
12001200 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
12011201 }
1202- let totalGet = $t04176741882._1
1203- let feeAmount = $t04176741882._2
1202+ let totalGet = $t04176841883._1
1203+ let feeAmount = $t04176841883._2
12041204 let r = ego("", lpId, lpAssetAmount, this)
12051205 let outAmAmt = r._1
12061206 let outPrAmt = r._2
12321232 let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
12331233 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
12341234 then {
1235- let $t04305043131 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1236- let refreshDLpActions = $t04305043131._1
1237- let updatedDLp = $t04305043131._2
1235+ let $t04305143132 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1236+ let refreshDLpActions = $t04305143132._1
1237+ let updatedDLp = $t04305143132._2
12381238 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
12391239 if ((isUpdatedDLpValid == isUpdatedDLpValid))
12401240 then (state ++ refreshDLpActions)
12761276 let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
12771277 if ((burnA == burnA))
12781278 then {
1279- let $t04419444275 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1280- let refreshDLpActions = $t04419444275._1
1281- let updatedDLp = $t04419444275._2
1279+ let $t04419544276 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1280+ let refreshDLpActions = $t04419544276._1
1281+ let updatedDLp = $t04419544276._2
12821282 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
12831283 if ((isUpdatedDLpValid == isUpdatedDLpValid))
12841284 then (state ++ refreshDLpActions)
13251325 let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
13261326 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
13271327 then {
1328- let $t04552345604 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1329- let refreshDLpActions = $t04552345604._1
1330- let updatedDLp = $t04552345604._2
1328+ let $t04552445605 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1329+ let refreshDLpActions = $t04552445605._1
1330+ let updatedDLp = $t04552445605._2
13311331 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
13321332 if ((isUpdatedDLpValid == isUpdatedDLpValid))
13331333 then (state ++ refreshDLpActions)
13731373 let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), unstakeAmount], nil)
13741374 if ((unstakeInv == unstakeInv))
13751375 then {
1376- let $t04653846726 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1377- let state = $t04653846726._1
1378- let totalAmount = $t04653846726._2
1376+ let $t04653946727 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1377+ let state = $t04653946727._1
1378+ let totalAmount = $t04653946727._2
13791379 $Tuple2(state, totalAmount)
13801380 }
13811381 else throw("Strict value is not equal to itself.")
13911391 let amId = poolConfig[idxAmAsId]
13921392 let prId = poolConfig[idxPrAsId]
13931393 let lpId = poolConfig[idxLPAsId]
1394- let $t04698547088 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1395- let lpAmount = $t04698547088._1
1396- let state = $t04698547088._2
1397- let feeAmount = $t04698547088._3
1398- let bonus = $t04698547088._4
1394+ let $t04698647089 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1395+ let lpAmount = $t04698647089._1
1396+ let state = $t04698647089._2
1397+ let feeAmount = $t04698647089._3
1398+ let bonus = $t04698647089._4
13991399 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
14001400 }
14011401
14071407 let amId = poolConfig[idxAmAsId]
14081408 let prId = poolConfig[idxPrAsId]
14091409 let lpId = poolConfig[idxLPAsId]
1410- let $t04736747471 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1411- let lpAmount = $t04736747471._1
1412- let state = $t04736747471._2
1413- let feeAmount = $t04736747471._3
1414- let bonus = $t04736747471._4
1410+ let $t04736847472 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1411+ let lpAmount = $t04736847472._1
1412+ let state = $t04736847472._2
1413+ let feeAmount = $t04736847472._3
1414+ let bonus = $t04736847472._4
14151415 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
14161416 }
14171417
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let scale8 = 100000000
55
66 let scale8BigInt = toBigInt(100000000)
77
88 let scale18 = toBigInt(1000000000000000000)
99
1010 let zeroBigInt = toBigInt(0)
1111
1212 let big0 = toBigInt(0)
1313
1414 let big1 = toBigInt(1)
1515
1616 let big2 = toBigInt(2)
1717
1818 let big3 = toBigInt(3)
1919
2020 let big4 = toBigInt(4)
2121
2222 let slippage4D = toBigInt((scale8 - ((scale8 * 1) / scale8)))
2323
2424 let wavesString = "WAVES"
2525
2626 let Amult = "100"
2727
2828 let Dconv = "1"
2929
3030 let SEP = "__"
3131
3232 let EMPTY = ""
3333
3434 let PoolActive = 1
3535
3636 let PoolPutDis = 2
3737
3838 let PoolMatcherDis = 3
3939
4040 let PoolShutdown = 4
4141
4242 let idxPoolAddress = 1
4343
4444 let idxPoolSt = 2
4545
4646 let idxLPAsId = 3
4747
4848 let idxAmAsId = 4
4949
5050 let idxPrAsId = 5
5151
5252 let idxAmtAsDcm = 6
5353
5454 let idxPriceAsDcm = 7
5555
5656 let idxIAmtAsId = 8
5757
5858 let idxIPriceAsId = 9
5959
6060 let idxFactStakCntr = 1
6161
6262 let idxFactoryRestCntr = 6
6363
6464 let idxFactSlippCntr = 7
6565
6666 let idxFactGwxRewCntr = 10
6767
6868 let feeDefault = fraction(10, scale8, 10000)
6969
7070 func t1 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
7171
7272
7373 func f1 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
7474
7575
7676 func ts (amt,resScale,curScale) = fraction(amt, resScale, curScale)
7777
7878
7979 func abs (val) = if ((zeroBigInt > val))
8080 then -(val)
8181 else val
8282
8383
8484 func absBigInt (val) = if ((zeroBigInt > val))
8585 then -(val)
8686 else val
8787
8888
8989 func fc () = "%s__factoryContract"
9090
9191
9292 func mpk () = "%s__managerPublicKey"
9393
9494
9595 func pmpk () = "%s__pendingManagerPublicKey"
9696
9797
9898 func pl () = "%s%s__price__last"
9999
100100
101101 func ph (h,t) = makeString(["%s%s%d%d__price__history", toString(h), toString(t)], SEP)
102102
103103
104104 func pau (ua,txId) = ((("%s%s%s__P__" + ua) + "__") + txId)
105105
106106
107107 func gau (ua,txId) = ((("%s%s%s__G__" + ua) + "__") + txId)
108108
109109
110110 func aa () = "%s__amountAsset"
111111
112112
113113 func pa () = "%s__priceAsset"
114114
115115
116116 func amp () = "%s__amp"
117117
118118
119119 func ada () = "%s__addonAddr"
120120
121121
122122 let keyFee = "%s__fee"
123123
124124 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
125125
126126 let keyDLp = makeString(["%s", "dLp"], SEP)
127127
128128 let keyDLpRefreshedHeight = makeString(["%s", "dLpRefreshedHeight"], SEP)
129129
130130 let keyDLpRefreshDelay = makeString(["%s", "refreshDLpDelay"], SEP)
131131
132132 let dLpRefreshDelayDefault = 30
133133
134134 let dLpRefreshDelay = valueOrElse(getInteger(this, keyDLpRefreshDelay), dLpRefreshDelayDefault)
135135
136136 func fcfg () = "%s__factoryConfig"
137137
138138
139139 func mtpk () = "%s%s__matcher__publicKey"
140140
141141
142142 func pc (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config")
143143
144144
145145 func mba (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr)
146146
147147
148148 func aps () = "%s__shutdown"
149149
150150
151151 func keyAllowedLpStableScriptHash () = "%s__allowedLpStableScriptHash"
152152
153153
154154 func keyFeeCollectorAddress () = "%s__feeCollectorAddress"
155155
156156
157157 func toe (orV,sendrV,matchV) = throw(((((("Failed: ordValid=" + toString(orV)) + " sndrValid=") + toString(sendrV)) + " mtchrValid=") + toString(matchV)))
158158
159159
160160 func str (val) = match val {
161161 case valStr: String =>
162162 valStr
163163 case _ =>
164164 throw("fail cast to String")
165165 }
166166
167167
168168 func strf (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
169169
170170
171171 func intf (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
172172
173173
174174 func throwErr (msg) = throw(makeString(["lp_stable.ride:", msg], " "))
175175
176176
177177 func fmtErr (msg) = makeString(["lp_stable.ride:", msg], " ")
178178
179179
180180 let fca = addressFromStringValue(strf(this, fc()))
181181
182182 let A = strf(this, amp())
183183
184184 func igs () = valueOrElse(getBoolean(fca, aps()), false)
185185
186186
187187 func mp () = fromBase58String(strf(fca, mtpk()))
188188
189189
190190 let feeCollectorAddress = addressFromStringValue(strf(fca, keyFeeCollectorAddress()))
191191
192192 func gpc () = {
193193 let amtAs = strf(this, aa())
194194 let priceAs = strf(this, pa())
195195 let iPriceAs = intf(fca, mba(priceAs))
196196 let iAmtAs = intf(fca, mba(amtAs))
197197 split(strf(fca, pc(toString(iAmtAs), toString(iPriceAs))), SEP)
198198 }
199199
200200
201201 func parseAssetId (input) = if ((input == wavesString))
202202 then unit
203203 else fromBase58String(input)
204204
205205
206206 func assetIdToString (input) = if ((input == unit))
207207 then wavesString
208208 else toBase58String(value(input))
209209
210210
211211 func parsePoolConfig (poolConfig) = $Tuple7(addressFromStringValue(poolConfig[idxPoolAddress]), parseIntValue(poolConfig[idxPoolSt]), fromBase58String(poolConfig[idxLPAsId]), parseAssetId(poolConfig[idxAmAsId]), parseAssetId(poolConfig[idxPrAsId]), parseIntValue(poolConfig[idxAmtAsDcm]), parseIntValue(poolConfig[idxPriceAsDcm]))
212212
213213
214214 let poolConfigParsed = parsePoolConfig(gpc())
215215
216216 let $t072567442 = poolConfigParsed
217217
218218 let cfgPoolAddress = $t072567442._1
219219
220220 let cfgPoolStatus = $t072567442._2
221221
222222 let cfgLpAssetId = $t072567442._3
223223
224224 let cfgAmountAssetId = $t072567442._4
225225
226226 let cfgPriceAssetId = $t072567442._5
227227
228228 let cfgAmountAssetDecimals = $t072567442._6
229229
230230 let cfgPriceAssetDecimals = $t072567442._7
231231
232232 func gfc () = split(strf(fca, fcfg()), SEP)
233233
234234
235235 let factoryConfig = gfc()
236236
237237 let stakingContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactStakCntr]), "Invalid staking contract address")
238238
239239 let slipageContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactSlippCntr]), "Invalid slipage contract address")
240240
241241 let gwxContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactGwxRewCntr]), "Invalid gwx contract address")
242242
243243 let restContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactoryRestCntr]), "Invalid gwx contract address")
244244
245245 func dataPutActionInfo (inAmtAssetAmt,inPriceAssetAmt,outLpAmt,price,slipByUser,slippageReal,txHeight,txTimestamp,slipageAmAmt,slipagePrAmt) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(inAmtAssetAmt), toString(inPriceAssetAmt), toString(outLpAmt), toString(price), toString(slipByUser), toString(slippageReal), toString(txHeight), toString(txTimestamp), toString(slipageAmAmt), toString(slipagePrAmt)], SEP)
246246
247247
248248 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)
249249
250250
251251 func getAccBalance (assetId) = if ((assetId == "WAVES"))
252252 then wavesBalance(this).available
253253 else assetBalance(this, fromBase58String(assetId))
254254
255255
256256 func cpbi (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
257257
258258
259259 func vad (A1,A2,slippage) = {
260260 let diff = fraction((A1 - A2), scale8BigInt, A2)
261261 let pass = ((slippage - abs(diff)) > zeroBigInt)
262262 if (!(pass))
263263 then throw(("Big slpg: " + toString(diff)))
264264 else $Tuple2(pass, min([A1, A2]))
265265 }
266266
267267
268268 func vd (D1,D0,slpg) = {
269269 let diff = fraction(D0, scale8BigInt, D1)
270270 let fail = (slpg > diff)
271271 if (if (fail)
272272 then true
273273 else (D0 > D1))
274274 then throw(((((((toString(D0) + " ") + toString(D1)) + " ") + toString(diff)) + " ") + toString(slpg)))
275275 else fail
276276 }
277277
278278
279279 func pcp (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
280280 let amtAsAmtX18 = t1(amAmt, amAssetDcm)
281281 let prAsAmtX18 = t1(prAmt, prAssetDcm)
282282 cpbi(prAsAmtX18, amtAsAmtX18)
283283 }
284284
285285
286286 func calcPrices (amAmt,prAmt,lpAmt) = {
287287 let cfg = gpc()
288288 let amtAsDcm = parseIntValue(cfg[idxAmtAsDcm])
289289 let prAsDcm = parseIntValue(cfg[idxPriceAsDcm])
290290 let priceX18 = pcp(amtAsDcm, prAsDcm, amAmt, prAmt)
291291 let amAmtX18 = t1(amAmt, amtAsDcm)
292292 let prAmtX18 = t1(prAmt, prAsDcm)
293293 let lpAmtX18 = t1(lpAmt, scale8)
294294 let lpPrInAmAsX18 = cpbi(amAmtX18, lpAmtX18)
295295 let lpPrInPrAsX18 = cpbi(prAmtX18, lpAmtX18)
296296 [priceX18, lpPrInAmAsX18, lpPrInPrAsX18]
297297 }
298298
299299
300300 func calculatePrices (amAmt,prAmt,lpAmt) = {
301301 let p = calcPrices(amAmt, prAmt, lpAmt)
302302 [f1(p[0], scale8), f1(p[1], scale8), f1(p[2], scale8)]
303303 }
304304
305305
306306 func takeFee (amount) = {
307307 let feeAmount = fraction(amount, fee, scale8)
308308 $Tuple2((amount - feeAmount), feeAmount)
309309 }
310310
311311
312312 func ego (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
313313 let cfg = gpc()
314314 let lpId = cfg[idxLPAsId]
315315 let amId = cfg[idxAmAsId]
316316 let prId = cfg[idxPrAsId]
317317 let amDcm = parseIntValue(cfg[idxAmtAsDcm])
318318 let prDcm = parseIntValue(cfg[idxPriceAsDcm])
319319 let sts = cfg[idxPoolSt]
320320 let lpEmiss = valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "Wrong LP id").quantity
321321 if ((lpId != pmtAssetId))
322322 then throw("Wrong pmt asset")
323323 else {
324324 let amBalance = getAccBalance(amId)
325325 let amBalanceX18 = t1(amBalance, amDcm)
326326 let prBalance = getAccBalance(prId)
327327 let prBalanceX18 = t1(prBalance, prDcm)
328328 let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
329329 let curPrice = f1(curPriceX18, scale8)
330330 let pmtLpAmtX18 = t1(pmtLpAmt, scale8)
331331 let lpEmissX18 = t1(lpEmiss, scale8)
332332 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissX18)
333333 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissX18)
334334 let outAmAmt = f1(outAmAmtX18, amDcm)
335335 let outPrAmt = f1(outPrAmtX18, prDcm)
336336 let state = if ((txId58 == ""))
337337 then nil
338338 else [ScriptTransfer(userAddress, outAmAmt, if ((amId == "WAVES"))
339339 then unit
340340 else fromBase58String(amId)), ScriptTransfer(userAddress, outPrAmt, if ((prId == "WAVES"))
341341 then unit
342342 else fromBase58String(prId)), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAmAmt, outPrAmt, pmtLpAmt, curPrice, height, lastBlock.timestamp)), IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice)]
343343 $Tuple10(outAmAmt, outPrAmt, amId, prId, amBalance, prBalance, lpEmiss, curPriceX18, sts, state)
344344 }
345345 }
346346
347347
348348 func epo (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEval,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = {
349349 let cfg = gpc()
350350 let lpId = fromBase58String(cfg[idxLPAsId])
351351 let amIdStr = cfg[idxAmAsId]
352352 let prIdStr = cfg[idxPrAsId]
353353 let inAmIdStr = cfg[idxIAmtAsId]
354354 let inPrIdStr = cfg[idxIPriceAsId]
355355 let amtDcm = parseIntValue(cfg[idxAmtAsDcm])
356356 let priceDcm = parseIntValue(cfg[idxPriceAsDcm])
357357 let sts = cfg[idxPoolSt]
358358 let lpEm = valueOrErrorMessage(assetInfo(lpId), "Wr lp as").quantity
359359 let amBalance = if (isEval)
360360 then getAccBalance(amIdStr)
361361 else if (if (isOneAsset)
362362 then (pmtId == amIdStr)
363363 else false)
364364 then (getAccBalance(amIdStr) - pmtAmt)
365365 else if (isOneAsset)
366366 then getAccBalance(amIdStr)
367367 else (getAccBalance(amIdStr) - inAmAmt)
368368 let prBalance = if (isEval)
369369 then getAccBalance(prIdStr)
370370 else if (if (isOneAsset)
371371 then (pmtId == prIdStr)
372372 else false)
373373 then (getAccBalance(prIdStr) - pmtAmt)
374374 else if (isOneAsset)
375375 then getAccBalance(prIdStr)
376376 else (getAccBalance(prIdStr) - inPrAmt)
377377 let inAmAssetAmtX18 = t1(inAmAmt, amtDcm)
378378 let inPrAssetAmtX18 = t1(inPrAmt, priceDcm)
379379 let userPriceX18 = cpbi(inPrAssetAmtX18, inAmAssetAmtX18)
380380 let amBalanceX18 = t1(amBalance, amtDcm)
381381 let prBalanceX18 = t1(prBalance, priceDcm)
382382 let r = if ((lpEm == 0))
383383 then {
384384 let curPriceX18 = zeroBigInt
385385 let slippageX18 = zeroBigInt
386386 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
387387 $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
388388 }
389389 else {
390390 let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
391391 let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18)
392392 let slippageX18 = t1(slippage, scale8)
393393 if (if (if (validateSlippage)
394394 then (curPriceX18 != zeroBigInt)
395395 else false)
396396 then (slippageRealX18 > slippageX18)
397397 else false)
398398 then throw(((("Price slippage " + toString(slippageRealX18)) + " > ") + toString(slippageX18)))
399399 else {
400400 let lpEmissionX18 = t1(lpEm, scale8)
401401 let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
402402 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
403403 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
404404 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
405405 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
406406 let expAmtAssetAmtX18 = expectedAmts._1
407407 let expPriceAssetAmtX18 = expectedAmts._2
408408 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18)
409409 $Tuple5(f1(lpAmtX18, scale8), f1(expAmtAssetAmtX18, amtDcm), f1(expPriceAssetAmtX18, priceDcm), curPriceX18, slippageX18)
410410 }
411411 }
412412 let calcLpAmt = r._1
413413 let calcAmAssetPmt = r._2
414414 let calcPrAssetPmt = r._3
415415 let curPrice = f1(r._4, scale8)
416416 let slippageCalc = f1(r._5, scale8)
417417 if ((0 >= calcLpAmt))
418418 then throw("LP <= 0")
419419 else {
420420 let emitLpAmt = if (!(emitLp))
421421 then 0
422422 else calcLpAmt
423423 let amDiff = (inAmAmt - calcAmAssetPmt)
424424 let prDiff = (inPrAmt - calcPrAssetPmt)
425425 let $t01787318218 = if (if (isOneAsset)
426426 then (pmtId == amIdStr)
427427 else false)
428428 then $Tuple2(pmtAmt, 0)
429429 else if (if (isOneAsset)
430430 then (pmtId == prIdStr)
431431 else false)
432432 then $Tuple2(0, pmtAmt)
433433 else $Tuple2(calcAmAssetPmt, calcPrAssetPmt)
434434 let writeAmAmt = $t01787318218._1
435435 let writePrAmt = $t01787318218._2
436436 let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId58), dataPutActionInfo(writeAmAmt, writePrAmt, emitLpAmt, curPrice, slippage, slippageCalc, height, lastBlock.timestamp, amDiff, prDiff))]
437437 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId)
438438 }
439439 }
440440
441441
442442 func getD (xp) = {
443443 let xp0 = xp[0]
444444 let xp1 = xp[1]
445445 let s = (xp0 + xp1)
446446 if ((s == big0))
447447 then big0
448448 else {
449449 let a = parseIntValue(A)
450450 let ann = (a * 2)
451451 let p = fraction(xp0, xp1, big1)
452452 let xp0_xp1_n_n = fraction(p, big4, big1)
453453 let ann_s = fraction(toBigInt(ann), s, big1)
454454 let ann_1 = toBigInt((ann - 1))
455455 func calcDNext (d) = {
456456 let dd = fraction(d, d, big1)
457457 let ddd = fraction(dd, d, big1)
458458 let dp = fraction(ddd, big1, xp0_xp1_n_n)
459459 fraction((ann_s + fraction(dp, big2, big1)), d, (fraction(ann_1, d, big1) + fraction(big3, dp, big1)))
460460 }
461461
462462 func calc (acc,i) = if (acc._2)
463463 then acc
464464 else {
465465 let d = acc._1
466466 let dNext = calcDNext(d)
467467 let dDiffRaw = toInt((dNext - value(d)))
468468 let dDiff = if ((0 > dDiffRaw))
469469 then -(dDiffRaw)
470470 else dDiffRaw
471471 if ((1 >= dDiff))
472472 then $Tuple2(dNext, true)
473473 else $Tuple2(dNext, false)
474474 }
475475
476476 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
477477 let $t02012920177 = {
478478 let $l = arr
479479 let $s = size($l)
480480 let $acc0 = $Tuple2(s, false)
481481 func $f0_1 ($a,$i) = if (($i >= $s))
482482 then $a
483483 else calc($a, $l[$i])
484484
485485 func $f0_2 ($a,$i) = if (($i >= $s))
486486 then $a
487487 else throw("List size exceeds 15")
488488
489489 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15)
490490 }
491491 let d = $t02012920177._1
492492 let found = $t02012920177._2
493493 if (found)
494494 then d
495495 else throw(("D calculation error, D = " + toString(d)))
496496 }
497497 }
498498
499499
500500 func getYD (xp,i,D) = {
501501 let n = big2
502502 let x = xp[if ((i == 0))
503503 then 1
504504 else 0]
505505 let aPrecision = parseBigIntValue(Amult)
506506 let a = (parseBigIntValue(A) * aPrecision)
507507 let s = x
508508 let ann = (a * n)
509509 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
510510 let b = ((s + ((D * aPrecision) / ann)) - D)
511511 func calc (acc,cur) = {
512512 let $t02066920689 = acc
513513 let y = $t02066920689._1
514514 let found = $t02066920689._2
515515 if ((found != unit))
516516 then acc
517517 else {
518518 let yNext = (((y * y) + c) / ((big2 * y) + b))
519519 let yDiff = absBigInt((yNext - value(y)))
520520 if ((big1 >= yDiff))
521521 then $Tuple2(yNext, cur)
522522 else $Tuple2(yNext, unit)
523523 }
524524 }
525525
526526 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
527527 let $t02099621043 = {
528528 let $l = arr
529529 let $s = size($l)
530530 let $acc0 = $Tuple2(D, unit)
531531 func $f0_1 ($a,$i) = if (($i >= $s))
532532 then $a
533533 else calc($a, $l[$i])
534534
535535 func $f0_2 ($a,$i) = if (($i >= $s))
536536 then $a
537537 else throw("List size exceeds 15")
538538
539539 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15)
540540 }
541541 let y = $t02099621043._1
542542 let found = $t02099621043._2
543543 if ((found != unit))
544544 then y
545545 else throw(("Y calculation error, Y = " + toString(y)))
546546 }
547547
548548
549549 func calcDLp (amountBalance,priceBalance,lpEmission) = {
550550 let updatedDLp = fraction(getD([amountBalance, priceBalance]), scale18, lpEmission)
551551 updatedDLp
552552 }
553553
554554
555555 func calcCurrentDLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
556556 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
557557 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
558558 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
559559 let currentDLp = calcDLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
560560 currentDLp
561561 }
562562
563563
564564 func refreshDLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
565565 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
566566 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
567567 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
568568 let updatedDLp = calcDLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
569569 let actions = [IntegerEntry(keyDLpRefreshedHeight, height), StringEntry(keyDLp, toString(updatedDLp))]
570570 $Tuple2(actions, updatedDLp)
571571 }
572572
573573
574574 func validateUpdatedDLp (oldDLp,updatedDLp) = if ((updatedDLp >= oldDLp))
575575 then true
576576 else throwErr("updated KLp lower than current KLp")
577577
578578
579579 func validateMatcherOrderAllowed (order) = {
580580 let amountAssetAmount = order.amount
581581 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
582582 let $t02294323155 = if ((order.orderType == Buy))
583583 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
584584 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
585585 let amountAssetBalanceDelta = $t02294323155._1
586586 let priceAssetBalanceDelta = $t02294323155._2
587587 if (if (if (igs())
588588 then true
589589 else (cfgPoolStatus == PoolMatcherDis))
590590 then true
591591 else (cfgPoolStatus == PoolShutdown))
592592 then throw("Admin blocked")
593593 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
594594 then true
595595 else (order.assetPair.priceAsset != cfgPriceAssetId))
596596 then throw("Wr assets")
597597 else {
598598 let dLp = parseBigIntValue(getStringValue(this, keyDLp))
599599 let $t02348523585 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
600600 let unusedActions = $t02348523585._1
601601 let dLpNew = $t02348523585._2
602- let isOrderValid = (dLpNew > dLp)
602+ let isOrderValid = (dLpNew >= dLp)
603603 isOrderValid
604604 }
605605 }
606606
607607
608608 func cg (i) = if ((size(i.payments) != 1))
609609 then throw("1 pmnt exp")
610610 else {
611611 let pmt = value(i.payments[0])
612612 let pmtAssetId = value(pmt.assetId)
613613 let pmtAmt = pmt.amount
614614 let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
615615 let outAmAmt = r._1
616616 let outPrAmt = r._2
617617 let sts = parseIntValue(r._9)
618618 let state = r._10
619619 if (if (igs())
620620 then true
621621 else (sts == PoolShutdown))
622622 then throw(("Admin blocked: " + toString(sts)))
623623 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
624624 }
625625
626626
627627 func cp (caller,txId,amAsPmt,prAsPmt,slippage,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = {
628628 let r = epo(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, (txId == ""), emitLp, isOneAsset, validateSlippage, pmtAmt, pmtId)
629629 let sts = parseIntValue(r._8)
630630 if (if (if (igs())
631631 then true
632632 else (sts == PoolPutDis))
633633 then true
634634 else (sts == PoolShutdown))
635635 then throw(("Blocked:" + toString(sts)))
636636 else r
637637 }
638638
639639
640640 func calcPutOneTkn (pmtAmtRaw,pmtAssetId,userAddress,txId,withTakeFee) = {
641641 let poolConfig = gpc()
642642 let amId = poolConfig[idxAmAsId]
643643 let prId = poolConfig[idxPrAsId]
644644 let lpId = poolConfig[idxLPAsId]
645645 let amtDcm = parseIntValue(poolConfig[idxAmtAsDcm])
646646 let priceDcm = parseIntValue(poolConfig[idxPriceAsDcm])
647647 let lpAssetEmission = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "invalid lp asset").quantity)
648648 let chechEmission = if ((lpAssetEmission > big0))
649649 then true
650650 else throw("initial deposit requires all coins")
651651 if ((chechEmission == chechEmission))
652652 then {
653653 let amBalance = getAccBalance(amId)
654654 let prBalance = getAccBalance(prId)
655- let $t02590126363 = if ((txId == ""))
655+ let $t02590226364 = if ((txId == ""))
656656 then $Tuple2(amBalance, prBalance)
657657 else if ((pmtAssetId == amId))
658658 then if ((pmtAmtRaw > amBalance))
659659 then throw("invalid payment amount")
660660 else $Tuple2((amBalance - pmtAmtRaw), prBalance)
661661 else if ((pmtAssetId == prId))
662662 then if ((pmtAmtRaw > prBalance))
663663 then throw("invalid payment amount")
664664 else $Tuple2(amBalance, (prBalance - pmtAmtRaw))
665665 else throw("wrong pmtAssetId")
666- let amBalanceOld = $t02590126363._1
667- let prBalanceOld = $t02590126363._2
668- let $t02636926545 = if ((pmtAssetId == amId))
666+ let amBalanceOld = $t02590226364._1
667+ let prBalanceOld = $t02590226364._2
668+ let $t02637026546 = if ((pmtAssetId == amId))
669669 then $Tuple2(pmtAmtRaw, 0)
670670 else if ((pmtAssetId == prId))
671671 then $Tuple2(0, pmtAmtRaw)
672672 else throw("invalid payment")
673- let amAmountRaw = $t02636926545._1
674- let prAmountRaw = $t02636926545._2
675- let $t02654926788 = if (withTakeFee)
673+ let amAmountRaw = $t02637026546._1
674+ let prAmountRaw = $t02637026546._2
675+ let $t02655026789 = if (withTakeFee)
676676 then $Tuple3(takeFee(amAmountRaw)._1, takeFee(prAmountRaw)._1, takeFee(pmtAmtRaw)._2)
677677 else $Tuple3(amAmountRaw, prAmountRaw, 0)
678- let amAmount = $t02654926788._1
679- let prAmount = $t02654926788._2
680- let feeAmount = $t02654926788._3
678+ let amAmount = $t02655026789._1
679+ let prAmount = $t02655026789._2
680+ let feeAmount = $t02655026789._3
681681 let amBalanceNew = (amBalanceOld + amAmount)
682682 let prBalanceNew = (prBalanceOld + prAmount)
683683 let D0 = getD([toBigInt(amBalanceOld), toBigInt(prBalanceOld)])
684684 let D1 = getD([toBigInt(amBalanceNew), toBigInt(prBalanceNew)])
685685 let checkD = if ((D1 > D0))
686686 then true
687687 else throw()
688688 if ((checkD == checkD))
689689 then {
690690 let lpAmount = fraction(lpAssetEmission, (D1 - D0), D0)
691691 let curPrice = f1(cpbi(t1(prBalanceNew, priceDcm), t1(amBalanceNew, amtDcm)), scale8)
692692 let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId), dataPutActionInfo(amAmountRaw, prAmountRaw, toInt(lpAmount), curPrice, 0, 0, height, lastBlock.timestamp, 0, 0))]
693693 let poolProportion = fraction(prBalanceOld, scale8, amBalanceOld)
694694 let amountAssetPart = fraction(pmtAmtRaw, scale8, (poolProportion + scale8))
695695 let priceAssetPart = (pmtAmtRaw - amountAssetPart)
696696 let lpAmtBoth = fraction(lpAssetEmission, toBigInt(priceAssetPart), toBigInt(prBalanceOld))
697697 let bonus = toInt(fraction((lpAmount - lpAmtBoth), scale8BigInt, lpAmtBoth))
698698 $Tuple4(toInt(lpAmount), commonState, feeAmount, bonus)
699699 }
700700 else throw("Strict value is not equal to itself.")
701701 }
702702 else throw("Strict value is not equal to itself.")
703703 }
704704
705705
706706 func getOneTknV2Internal (outAssetId,minOutAmount,payments,caller,originCaller,transactionId) = {
707707 let poolConfig = gpc()
708708 let lpId = poolConfig[idxLPAsId]
709709 let amId = poolConfig[idxAmAsId]
710710 let prId = poolConfig[idxPrAsId]
711711 let amDecimals = parseIntValue(poolConfig[idxAmtAsDcm])
712712 let prDecimals = parseIntValue(poolConfig[idxPriceAsDcm])
713713 let poolStatus = poolConfig[idxPoolSt]
714714 let userAddress = if ((caller == restContract))
715715 then originCaller
716716 else caller
717717 let pmt = value(payments[0])
718718 let pmtAssetId = value(pmt.assetId)
719719 let pmtAmt = pmt.amount
720720 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(pmtAmt))
721721 let txId58 = toBase58String(transactionId)
722722 if ((lpId != toBase58String(pmtAssetId)))
723723 then throw("Wrong LP")
724724 else {
725725 let amBalance = getAccBalance(amId)
726726 let prBalance = getAccBalance(prId)
727- let $t02887228983 = {
727+ let $t02887328984 = {
728728 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil)
729729 if ($isInstanceOf(@, "(Int, Int)"))
730730 then @
731731 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
732732 }
733- if (($t02887228983 == $t02887228983))
733+ if (($t02887328984 == $t02887328984))
734734 then {
735- let feeAmount = $t02887228983._2
736- let totalGet = $t02887228983._1
735+ let feeAmount = $t02887328984._2
736+ let totalGet = $t02887328984._1
737737 let totalAmount = if (if ((minOutAmount > 0))
738738 then (minOutAmount > totalGet)
739739 else false)
740740 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
741741 else totalGet
742- let $t02917329480 = if ((outAssetId == amId))
742+ let $t02917429481 = if ((outAssetId == amId))
743743 then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance)
744744 else if ((outAssetId == prId))
745745 then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount))
746746 else throw("invalid out asset id")
747- let outAm = $t02917329480._1
748- let outPr = $t02917329480._2
749- let amBalanceNew = $t02917329480._3
750- let prBalanceNew = $t02917329480._4
747+ let outAm = $t02917429481._1
748+ let outPr = $t02917429481._2
749+ let amBalanceNew = $t02917429481._3
750+ let prBalanceNew = $t02917429481._4
751751 let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals))
752752 let curPr = f1(curPrX18, scale8)
753753 let outAssetIdOrWaves = if ((outAssetId == "WAVES"))
754754 then unit
755755 else fromBase58String(outAssetId)
756756 let sendFeeToMatcher = if ((feeAmount > 0))
757757 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetIdOrWaves)]
758758 else nil
759759 let state = ([ScriptTransfer(userAddress, totalAmount, outAssetIdOrWaves), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAm, outPr, pmtAmt, curPr, height, lastBlock.timestamp)), IntegerEntry(pl(), curPr), IntegerEntry(ph(height, lastBlock.timestamp), curPr)] ++ sendFeeToMatcher)
760760 if ((state == state))
761761 then {
762762 let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
763763 if ((burn == burn))
764764 then {
765- let $t03026530615 = {
765+ let $t03026630616 = {
766766 let feeAmountForCalc = if ((this == feeCollectorAddress))
767767 then 0
768768 else feeAmount
769769 let outInAmountAsset = if ((parseAssetId(outAssetId) == cfgAmountAssetId))
770770 then true
771771 else false
772772 if (outInAmountAsset)
773773 then $Tuple2(-((totalGet + feeAmountForCalc)), 0)
774774 else $Tuple2(0, -((totalGet + feeAmountForCalc)))
775775 }
776- let amountAssetBalanceDelta = $t03026530615._1
777- let priceAssetBalanceDelta = $t03026530615._2
778- let $t03061830726 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
779- let refreshDLpActions = $t03061830726._1
780- let updatedDLp = $t03061830726._2
776+ let amountAssetBalanceDelta = $t03026630616._1
777+ let priceAssetBalanceDelta = $t03026630616._2
778+ let $t03061930727 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
779+ let refreshDLpActions = $t03061930727._1
780+ let updatedDLp = $t03061930727._2
781781 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
782782 if ((isUpdatedDLpValid == isUpdatedDLpValid))
783783 then $Tuple2((state ++ refreshDLpActions), totalAmount)
784784 else throw("Strict value is not equal to itself.")
785785 }
786786 else throw("Strict value is not equal to itself.")
787787 }
788788 else throw("Strict value is not equal to itself.")
789789 }
790790 else throw("Strict value is not equal to itself.")
791791 }
792792 }
793793
794794
795795 func m () = match getString(mpk()) {
796796 case s: String =>
797797 fromBase58String(s)
798798 case _: Unit =>
799799 unit
800800 case _ =>
801801 throw("Match error")
802802 }
803803
804804
805805 func pm () = match getString(pmpk()) {
806806 case s: String =>
807807 fromBase58String(s)
808808 case _: Unit =>
809809 unit
810810 case _ =>
811811 throw("Match error")
812812 }
813813
814814
815815 let pd = throw("Permission denied")
816816
817817 func isManager (i) = match m() {
818818 case pk: ByteVector =>
819819 (i.callerPublicKey == pk)
820820 case _: Unit =>
821821 (i.caller == this)
822822 case _ =>
823823 throw("Match error")
824824 }
825825
826826
827827 func mm (i) = match m() {
828828 case pk: ByteVector =>
829829 if ((i.callerPublicKey == pk))
830830 then true
831831 else pd
832832 case _: Unit =>
833833 if ((i.caller == this))
834834 then true
835835 else pd
836836 case _ =>
837837 throw("Match error")
838838 }
839839
840840
841841 @Callable(i)
842842 func constructor (fc) = {
843843 let c = mm(i)
844844 if ((c == c))
845845 then [StringEntry(fc(), fc)]
846846 else throw("Strict value is not equal to itself.")
847847 }
848848
849849
850850
851851 @Callable(i)
852852 func setManager (pendingManagerPublicKey) = {
853853 let c = mm(i)
854854 if ((c == c))
855855 then {
856856 let cm = fromBase58String(pendingManagerPublicKey)
857857 if ((cm == cm))
858858 then [StringEntry(pmpk(), pendingManagerPublicKey)]
859859 else throw("Strict value is not equal to itself.")
860860 }
861861 else throw("Strict value is not equal to itself.")
862862 }
863863
864864
865865
866866 @Callable(i)
867867 func confirmManager () = {
868868 let p = pm()
869869 let hpm = if (isDefined(p))
870870 then true
871871 else throw("No pending manager")
872872 if ((hpm == hpm))
873873 then {
874874 let cpm = if ((i.callerPublicKey == value(p)))
875875 then true
876876 else throw("You are not pending manager")
877877 if ((cpm == cpm))
878878 then [StringEntry(mpk(), toBase58String(value(p))), DeleteEntry(pmpk())]
879879 else throw("Strict value is not equal to itself.")
880880 }
881881 else throw("Strict value is not equal to itself.")
882882 }
883883
884884
885885
886886 @Callable(i)
887887 func put (slip,autoStake) = {
888888 let factCfg = gfc()
889889 let stakingCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactStakCntr]), "Wr st addr")
890890 let slipCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactSlippCntr]), "Wr sl addr")
891891 if ((0 > slip))
892892 then throw("Wrong slippage")
893893 else if ((size(i.payments) != 2))
894894 then throw("2 pmnts expd")
895895 else {
896896 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
897897 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
898898 let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0))
899899 if ((currentDLp == currentDLp))
900900 then {
901901 let e = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(value(i.payments[0]).assetId, value(i.payments[0]).amount), i.payments[1], slip, true, false, true, 0, "")
902902 let emitLpAmt = e._2
903903 let lpAssetId = e._7
904904 let state = e._9
905905 let amDiff = e._10
906906 let prDiff = e._11
907907 let amId = e._12
908908 let prId = e._13
909909 let r = invoke(fca, "emit", [emitLpAmt], nil)
910910 if ((r == r))
911911 then {
912912 let el = match r {
913913 case legacy: Address =>
914914 invoke(legacy, "emit", [emitLpAmt], nil)
915915 case _ =>
916916 unit
917917 }
918918 if ((el == el))
919919 then {
920920 let sa = if ((amDiff > 0))
921921 then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)])
922922 else nil
923923 if ((sa == sa))
924924 then {
925925 let sp = if ((prDiff > 0))
926926 then invoke(slipCntr, "put", nil, [AttachedPayment(prId, prDiff)])
927927 else nil
928928 if ((sp == sp))
929929 then {
930930 let lpTrnsfr = if (autoStake)
931931 then {
932932 let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
933933 if ((ss == ss))
934934 then nil
935935 else throw("Strict value is not equal to itself.")
936936 }
937937 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
938- let $t03458234647 = refreshDLpInternal(0, 0, 0)
939- let refreshDLpActions = $t03458234647._1
940- let updatedDLp = $t03458234647._2
938+ let $t03458334648 = refreshDLpInternal(0, 0, 0)
939+ let refreshDLpActions = $t03458334648._1
940+ let updatedDLp = $t03458334648._2
941941 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
942942 if ((isUpdatedDLpValid == isUpdatedDLpValid))
943943 then ((state ++ lpTrnsfr) ++ refreshDLpActions)
944944 else throw("Strict value is not equal to itself.")
945945 }
946946 else throw("Strict value is not equal to itself.")
947947 }
948948 else throw("Strict value is not equal to itself.")
949949 }
950950 else throw("Strict value is not equal to itself.")
951951 }
952952 else throw("Strict value is not equal to itself.")
953953 }
954954 else throw("Strict value is not equal to itself.")
955955 }
956956 }
957957
958958
959959
960960 @Callable(i)
961961 func putOneTknV2 (minOutAmount,autoStake) = {
962962 let isPoolOneTokenOperationsDisabled = {
963963 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
964964 if ($isInstanceOf(@, "Boolean"))
965965 then @
966966 else throw(($getType(@) + " couldn't be cast to Boolean"))
967967 }
968968 let isPutDisabled = if (if (if (igs())
969969 then true
970970 else (cfgPoolStatus == PoolPutDis))
971971 then true
972972 else (cfgPoolStatus == PoolShutdown))
973973 then true
974974 else isPoolOneTokenOperationsDisabled
975975 let checks = [if (if (!(isPutDisabled))
976976 then true
977977 else isManager(i))
978978 then true
979979 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
980980 then true
981981 else throwErr("exactly 1 payment are expected")]
982982 if ((checks == checks))
983983 then {
984984 let poolConfig = gpc()
985985 let amId = poolConfig[idxAmAsId]
986986 let prId = poolConfig[idxPrAsId]
987987 let lpId = fromBase58String(poolConfig[idxLPAsId])
988988 let amDecimals = parseIntValue(poolConfig[idxAmtAsDcm])
989989 let prDecimals = parseIntValue(poolConfig[idxPriceAsDcm])
990990 let userAddress = if ((i.caller == this))
991991 then i.originCaller
992992 else i.caller
993993 let pmt = value(i.payments[0])
994994 let pmtAssetId = toBase58String(value(pmt.assetId))
995995 let pmtAmt = pmt.amount
996- let $t03578435942 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
997- if (($t03578435942 == $t03578435942))
996+ let $t03578535943 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
997+ if (($t03578535943 == $t03578535943))
998998 then {
999- let feeAmount = $t03578435942._3
1000- let state = $t03578435942._2
1001- let estimLP = $t03578435942._1
999+ let feeAmount = $t03578535943._3
1000+ let state = $t03578535943._2
1001+ let estimLP = $t03578535943._1
10021002 let emitLpAmt = if (if ((minOutAmount > 0))
10031003 then (minOutAmount > estimLP)
10041004 else false)
10051005 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
10061006 else estimLP
10071007 let e = invoke(fca, "emit", [emitLpAmt], nil)
10081008 if ((e == e))
10091009 then {
10101010 let el = match e {
10111011 case legacy: Address =>
10121012 invoke(legacy, "emit", [emitLpAmt], nil)
10131013 case _ =>
10141014 unit
10151015 }
10161016 if ((el == el))
10171017 then {
10181018 let lpTrnsfr = if (autoStake)
10191019 then {
10201020 let ss = invoke(stakingContract, "stake", nil, [AttachedPayment(lpId, emitLpAmt)])
10211021 if ((ss == ss))
10221022 then nil
10231023 else throw("Strict value is not equal to itself.")
10241024 }
10251025 else [ScriptTransfer(i.caller, emitLpAmt, lpId)]
10261026 let sendFeeToMatcher = if ((feeAmount > 0))
10271027 then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))]
10281028 else nil
1029- let $t03675737106 = if ((this == feeCollectorAddress))
1029+ let $t03675837107 = if ((this == feeCollectorAddress))
10301030 then $Tuple2(0, 0)
10311031 else {
10321032 let paymentInAmountAsset = if ((pmt.assetId == cfgAmountAssetId))
10331033 then true
10341034 else false
10351035 if (paymentInAmountAsset)
10361036 then $Tuple2(-(feeAmount), 0)
10371037 else $Tuple2(0, -(feeAmount))
10381038 }
1039- let amountAssetBalanceDelta = $t03675737106._1
1040- let priceAssetBalanceDelta = $t03675737106._2
1041- let $t03710937217 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1042- let refreshDLpActions = $t03710937217._1
1043- let updatedDLp = $t03710937217._2
1039+ let amountAssetBalanceDelta = $t03675837107._1
1040+ let priceAssetBalanceDelta = $t03675837107._2
1041+ let $t03711037218 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1042+ let refreshDLpActions = $t03711037218._1
1043+ let updatedDLp = $t03711037218._2
10441044 $Tuple2((((state ++ lpTrnsfr) ++ sendFeeToMatcher) ++ refreshDLpActions), emitLpAmt)
10451045 }
10461046 else throw("Strict value is not equal to itself.")
10471047 }
10481048 else throw("Strict value is not equal to itself.")
10491049 }
10501050 else throw("Strict value is not equal to itself.")
10511051 }
10521052 else throw("Strict value is not equal to itself.")
10531053 }
10541054
10551055
10561056
10571057 @Callable(i)
10581058 func putForFree (maxSlpg) = if ((0 > maxSlpg))
10591059 then throw("Wrong slpg")
10601060 else if ((size(i.payments) != 2))
10611061 then throw("2 pmnts expd")
10621062 else {
10631063 let estPut = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(value(i.payments[0]).assetId, value(i.payments[0]).amount), i.payments[1], maxSlpg, false, false, true, 0, "")
10641064 let state = estPut._9
10651065 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
10661066 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
10671067 let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0))
10681068 if ((currentDLp == currentDLp))
10691069 then {
1070- let $t03817638241 = refreshDLpInternal(0, 0, 0)
1071- let refreshDLpActions = $t03817638241._1
1072- let updatedDLp = $t03817638241._2
1070+ let $t03817738242 = refreshDLpInternal(0, 0, 0)
1071+ let refreshDLpActions = $t03817738242._1
1072+ let updatedDLp = $t03817738242._2
10731073 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
10741074 if ((isUpdatedDLpValid == isUpdatedDLpValid))
10751075 then (state ++ refreshDLpActions)
10761076 else throw("Strict value is not equal to itself.")
10771077 }
10781078 else throw("Strict value is not equal to itself.")
10791079 }
10801080
10811081
10821082
10831083 @Callable(i)
10841084 func get () = {
10851085 let r = cg(i)
10861086 let outAmtAmt = r._1
10871087 let outPrAmt = r._2
10881088 let pmtAmt = r._3
10891089 let pmtAssetId = r._4
10901090 let state = r._5
10911091 let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10921092 if ((b == b))
10931093 then {
10941094 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(pmtAmt))
1095- let $t03903039112 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1096- let refreshDLpActions = $t03903039112._1
1097- let updatedDLp = $t03903039112._2
1095+ let $t03903139113 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1096+ let refreshDLpActions = $t03903139113._1
1097+ let updatedDLp = $t03903139113._2
10981098 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
10991099 if ((isUpdatedDLpValid == isUpdatedDLpValid))
11001100 then (state ++ refreshDLpActions)
11011101 else throw("Strict value is not equal to itself.")
11021102 }
11031103 else throw("Strict value is not equal to itself.")
11041104 }
11051105
11061106
11071107
11081108 @Callable(i)
11091109 func getOneTknV2 (outAssetId,minOutAmount) = {
11101110 let isPoolOneTokenOperationsDisabled = {
11111111 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
11121112 if ($isInstanceOf(@, "Boolean"))
11131113 then @
11141114 else throw(($getType(@) + " couldn't be cast to Boolean"))
11151115 }
11161116 let isGetDisabled = if (if (igs())
11171117 then true
11181118 else (cfgPoolStatus == PoolShutdown))
11191119 then true
11201120 else isPoolOneTokenOperationsDisabled
11211121 let checks = [if (if (!(isGetDisabled))
11221122 then true
11231123 else isManager(i))
11241124 then true
11251125 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
11261126 then true
11271127 else throwErr("exactly 1 payment are expected")]
11281128 if ((checks == checks))
11291129 then {
1130- let $t03973039885 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1131- let state = $t03973039885._1
1132- let totalAmount = $t03973039885._2
1130+ let $t03973139886 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1131+ let state = $t03973139886._1
1132+ let totalAmount = $t03973139886._2
11331133 $Tuple2(state, totalAmount)
11341134 }
11351135 else throw("Strict value is not equal to itself.")
11361136 }
11371137
11381138
11391139
11401140 @Callable(i)
11411141 func refreshDLp () = {
11421142 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyDLpRefreshedHeight), 0)
11431143 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= dLpRefreshDelay))
11441144 then unit
11451145 else throwErr(makeString([toString(dLpRefreshDelay), " blocks have not passed since the previous call"], ""))
11461146 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
11471147 then {
11481148 let dLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyDLp), "0")), fmtErr("invalid dLp"))
1149- let $t04040940473 = refreshDLpInternal(0, 0, 0)
1150- let dLpUpdateActions = $t04040940473._1
1151- let updatedDLp = $t04040940473._2
1149+ let $t04041040474 = refreshDLpInternal(0, 0, 0)
1150+ let dLpUpdateActions = $t04041040474._1
1151+ let updatedDLp = $t04041040474._2
11521152 let actions = if ((dLp != updatedDLp))
11531153 then dLpUpdateActions
11541154 else throwErr("nothing to refresh")
11551155 $Tuple2(actions, toString(updatedDLp))
11561156 }
11571157 else throw("Strict value is not equal to itself.")
11581158 }
11591159
11601160
11611161
11621162 @Callable(i)
11631163 func getOneTknV2READONLY (outAssetId,lpAssetAmount) = {
11641164 let poolConfig = gpc()
11651165 let amId = poolConfig[idxAmAsId]
11661166 let prId = poolConfig[idxPrAsId]
11671167 let lpId = poolConfig[idxLPAsId]
11681168 let xp = [toBigInt(getAccBalance(amId)), toBigInt(getAccBalance(prId))]
11691169 let lpEmission = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "invalid lp asset").quantity)
11701170 let D0 = getD(xp)
11711171 let D1 = (D0 - fraction(toBigInt(lpAssetAmount), D0, lpEmission))
11721172 let index = if ((outAssetId == amId))
11731173 then 0
11741174 else if ((outAssetId == prId))
11751175 then 1
11761176 else throw("invalid out asset id")
11771177 let newY = getYD(xp, index, D1)
11781178 let dy = (xp[index] - newY)
11791179 let totalGetRaw = max([0, toInt((dy - big1))])
1180- let $t04137341422 = takeFee(totalGetRaw)
1181- let totalGet = $t04137341422._1
1182- let feeAmount = $t04137341422._2
1180+ let $t04137441423 = takeFee(totalGetRaw)
1181+ let totalGet = $t04137441423._1
1182+ let feeAmount = $t04137441423._2
11831183 $Tuple2(nil, $Tuple2(totalGet, feeAmount))
11841184 }
11851185
11861186
11871187
11881188 @Callable(i)
11891189 func getOneTknV2WithBonusREADONLY (outAssetId,lpAssetAmount) = {
11901190 let poolConfig = gpc()
11911191 let amId = poolConfig[idxAmAsId]
11921192 let prId = poolConfig[idxPrAsId]
11931193 let lpId = poolConfig[idxLPAsId]
11941194 let amBalance = getAccBalance(amId)
11951195 let prBalance = getAccBalance(prId)
1196- let $t04176741882 = {
1196+ let $t04176841883 = {
11971197 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil)
11981198 if ($isInstanceOf(@, "(Int, Int)"))
11991199 then @
12001200 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
12011201 }
1202- let totalGet = $t04176741882._1
1203- let feeAmount = $t04176741882._2
1202+ let totalGet = $t04176841883._1
1203+ let feeAmount = $t04176841883._2
12041204 let r = ego("", lpId, lpAssetAmount, this)
12051205 let outAmAmt = r._1
12061206 let outPrAmt = r._2
12071207 let sumOfGetAssets = (outAmAmt + outPrAmt)
12081208 let bonus = if ((sumOfGetAssets == 0))
12091209 then if ((totalGet == 0))
12101210 then 0
12111211 else throw("bonus calculation error")
12121212 else fraction((totalGet - sumOfGetAssets), scale8, sumOfGetAssets)
12131213 $Tuple2(nil, $Tuple3(totalGet, feeAmount, bonus))
12141214 }
12151215
12161216
12171217
12181218 @Callable(i)
12191219 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
12201220 let r = cg(i)
12211221 let outAmAmt = r._1
12221222 let outPrAmt = r._2
12231223 let pmtAmt = r._3
12241224 let pmtAssetId = r._4
12251225 let state = r._5
12261226 if ((noLessThenAmtAsset > outAmAmt))
12271227 then throw(((("Failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
12281228 else if ((noLessThenPriceAsset > outPrAmt))
12291229 then throw(((("Failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
12301230 else {
12311231 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(pmtAmt))
12321232 let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
12331233 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
12341234 then {
1235- let $t04305043131 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1236- let refreshDLpActions = $t04305043131._1
1237- let updatedDLp = $t04305043131._2
1235+ let $t04305143132 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1236+ let refreshDLpActions = $t04305143132._1
1237+ let updatedDLp = $t04305143132._2
12381238 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
12391239 if ((isUpdatedDLpValid == isUpdatedDLpValid))
12401240 then (state ++ refreshDLpActions)
12411241 else throw("Strict value is not equal to itself.")
12421242 }
12431243 else throw("Strict value is not equal to itself.")
12441244 }
12451245 }
12461246
12471247
12481248
12491249 @Callable(i)
12501250 func unstakeAndGet (amount) = {
12511251 let checkPayments = if ((size(i.payments) != 0))
12521252 then throw("No pmnts expd")
12531253 else true
12541254 if ((checkPayments == checkPayments))
12551255 then {
12561256 let cfg = gpc()
12571257 let factoryCfg = gfc()
12581258 let lpAssetId = fromBase58String(cfg[idxLPAsId])
12591259 let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr")
12601260 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0))
12611261 let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil)
12621262 if ((unstakeInv == unstakeInv))
12631263 then {
12641264 let r = ego(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
12651265 let outAmAmt = r._1
12661266 let outPrAmt = r._2
12671267 let sts = parseIntValue(r._9)
12681268 let state = r._10
12691269 let v = if (if (igs())
12701270 then true
12711271 else (sts == PoolShutdown))
12721272 then throw(("Blocked: " + toString(sts)))
12731273 else true
12741274 if ((v == v))
12751275 then {
12761276 let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
12771277 if ((burnA == burnA))
12781278 then {
1279- let $t04419444275 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1280- let refreshDLpActions = $t04419444275._1
1281- let updatedDLp = $t04419444275._2
1279+ let $t04419544276 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1280+ let refreshDLpActions = $t04419544276._1
1281+ let updatedDLp = $t04419544276._2
12821282 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
12831283 if ((isUpdatedDLpValid == isUpdatedDLpValid))
12841284 then (state ++ refreshDLpActions)
12851285 else throw("Strict value is not equal to itself.")
12861286 }
12871287 else throw("Strict value is not equal to itself.")
12881288 }
12891289 else throw("Strict value is not equal to itself.")
12901290 }
12911291 else throw("Strict value is not equal to itself.")
12921292 }
12931293 else throw("Strict value is not equal to itself.")
12941294 }
12951295
12961296
12971297
12981298 @Callable(i)
12991299 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
13001300 let isGetDisabled = if (igs())
13011301 then true
13021302 else (cfgPoolStatus == PoolShutdown)
13031303 let checks = [if (!(isGetDisabled))
13041304 then true
13051305 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
13061306 then true
13071307 else throw("no payments are expected")]
13081308 if ((checks == checks))
13091309 then {
13101310 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0))
13111311 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
13121312 if ((unstakeInv == unstakeInv))
13131313 then {
13141314 let res = ego(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
13151315 let outAmAmt = res._1
13161316 let outPrAmt = res._2
13171317 let state = res._10
13181318 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
13191319 then true
13201320 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
13211321 then true
13221322 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
13231323 if ((checkAmounts == checkAmounts))
13241324 then {
13251325 let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
13261326 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
13271327 then {
1328- let $t04552345604 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1329- let refreshDLpActions = $t04552345604._1
1330- let updatedDLp = $t04552345604._2
1328+ let $t04552445605 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1329+ let refreshDLpActions = $t04552445605._1
1330+ let updatedDLp = $t04552445605._2
13311331 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
13321332 if ((isUpdatedDLpValid == isUpdatedDLpValid))
13331333 then (state ++ refreshDLpActions)
13341334 else throw("Strict value is not equal to itself.")
13351335 }
13361336 else throw("Strict value is not equal to itself.")
13371337 }
13381338 else throw("Strict value is not equal to itself.")
13391339 }
13401340 else throw("Strict value is not equal to itself.")
13411341 }
13421342 else throw("Strict value is not equal to itself.")
13431343 }
13441344
13451345
13461346
13471347 @Callable(i)
13481348 func unstakeAndGetOneTknV2 (unstakeAmount,outAssetId,minOutAmount) = {
13491349 let isPoolOneTokenOperationsDisabled = {
13501350 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
13511351 if ($isInstanceOf(@, "Boolean"))
13521352 then @
13531353 else throw(($getType(@) + " couldn't be cast to Boolean"))
13541354 }
13551355 let isGetDisabled = if (if (igs())
13561356 then true
13571357 else (cfgPoolStatus == PoolShutdown))
13581358 then true
13591359 else isPoolOneTokenOperationsDisabled
13601360 let checks = [if (if (!(isGetDisabled))
13611361 then true
13621362 else isManager(i))
13631363 then true
13641364 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
13651365 then true
13661366 else throwErr("no payments are expected")]
13671367 if ((checks == checks))
13681368 then {
13691369 let cfg = gpc()
13701370 let factoryCfg = gfc()
13711371 let lpAssetId = fromBase58String(cfg[idxLPAsId])
13721372 let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr")
13731373 let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), unstakeAmount], nil)
13741374 if ((unstakeInv == unstakeInv))
13751375 then {
1376- let $t04653846726 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1377- let state = $t04653846726._1
1378- let totalAmount = $t04653846726._2
1376+ let $t04653946727 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1377+ let state = $t04653946727._1
1378+ let totalAmount = $t04653946727._2
13791379 $Tuple2(state, totalAmount)
13801380 }
13811381 else throw("Strict value is not equal to itself.")
13821382 }
13831383 else throw("Strict value is not equal to itself.")
13841384 }
13851385
13861386
13871387
13881388 @Callable(i)
13891389 func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = {
13901390 let poolConfig = gpc()
13911391 let amId = poolConfig[idxAmAsId]
13921392 let prId = poolConfig[idxPrAsId]
13931393 let lpId = poolConfig[idxLPAsId]
1394- let $t04698547088 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1395- let lpAmount = $t04698547088._1
1396- let state = $t04698547088._2
1397- let feeAmount = $t04698547088._3
1398- let bonus = $t04698547088._4
1394+ let $t04698647089 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1395+ let lpAmount = $t04698647089._1
1396+ let state = $t04698647089._2
1397+ let feeAmount = $t04698647089._3
1398+ let bonus = $t04698647089._4
13991399 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
14001400 }
14011401
14021402
14031403
14041404 @Callable(i)
14051405 func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = {
14061406 let poolConfig = gpc()
14071407 let amId = poolConfig[idxAmAsId]
14081408 let prId = poolConfig[idxPrAsId]
14091409 let lpId = poolConfig[idxLPAsId]
1410- let $t04736747471 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1411- let lpAmount = $t04736747471._1
1412- let state = $t04736747471._2
1413- let feeAmount = $t04736747471._3
1414- let bonus = $t04736747471._4
1410+ let $t04736847472 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1411+ let lpAmount = $t04736847472._1
1412+ let state = $t04736847472._2
1413+ let feeAmount = $t04736847472._3
1414+ let bonus = $t04736847472._4
14151415 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
14161416 }
14171417
14181418
14191419
14201420 @Callable(i)
14211421 func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString(fca)))
14221422 then throw("denied")
14231423 else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr)], "success")
14241424
14251425
14261426
14271427 @Callable(i)
14281428 func setS (k,v) = if ((toString(i.caller) != strf(this, ada())))
14291429 then pd
14301430 else [StringEntry(k, v)]
14311431
14321432
14331433
14341434 @Callable(i)
14351435 func setI (k,v) = if ((toString(i.caller) != strf(this, ada())))
14361436 then pd
14371437 else [IntegerEntry(k, v)]
14381438
14391439
14401440
14411441 @Callable(i)
14421442 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, gpc())
14431443
14441444
14451445
14461446 @Callable(i)
14471447 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
14481448
14491449
14501450
14511451 @Callable(i)
14521452 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
14531453 let pr = calcPrices(amAmt, prAmt, lpAmt)
14541454 $Tuple2(nil, [toString(pr[0]), toString(pr[1]), toString(pr[2])])
14551455 }
14561456
14571457
14581458
14591459 @Callable(i)
14601460 func fromX18WrapperREADONLY (val,resScaleMult) = $Tuple2(nil, f1(parseBigIntValue(val), resScaleMult))
14611461
14621462
14631463
14641464 @Callable(i)
14651465 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(t1(origVal, origScaleMult)))
14661466
14671467
14681468
14691469 @Callable(i)
14701470 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(cpbi(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
14711471
14721472
14731473
14741474 @Callable(i)
14751475 func estimatePutOperationWrapperREADONLY (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,usrAddr,isEval,emitLp) = $Tuple2(nil, epo(txId58, slippage, inAmAmt, inAmId, inPrAmt, inPrId, usrAddr, isEval, emitLp, true, false, 0, ""))
14761476
14771477
14781478
14791479 @Callable(i)
14801480 func estimateGetOperationWrapperREADONLY (txId58,pmtAsId,pmtLpAmt,usrAddr) = {
14811481 let r = ego(txId58, pmtAsId, pmtLpAmt, addressFromStringValue(usrAddr))
14821482 $Tuple2(nil, $Tuple10(r._1, r._2, r._3, r._4, r._5, r._6, r._7, toString(r._8), r._9, r._10))
14831483 }
14841484
14851485
14861486
14871487 @Callable(i)
14881488 func getFeeREADONLY () = $Tuple2(nil, fee)
14891489
14901490
14911491 @Verifier(tx)
14921492 func verify () = {
14931493 let targetPublicKey = match m() {
14941494 case pk: ByteVector =>
14951495 pk
14961496 case _: Unit =>
14971497 tx.senderPublicKey
14981498 case _ =>
14991499 throw("Match error")
15001500 }
15011501 match tx {
15021502 case order: Order =>
15031503 let matcherPub = mp()
15041504 let orderValid = validateMatcherOrderAllowed(order)
15051505 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
15061506 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
15071507 if (if (if (orderValid)
15081508 then senderValid
15091509 else false)
15101510 then matcherValid
15111511 else false)
15121512 then true
15131513 else toe(orderValid, senderValid, matcherValid)
15141514 case s: SetScriptTransaction =>
15151515 let newHash = blake2b256(value(s.script))
15161516 let allowedHash = fromBase64String(value(getString(fca, keyAllowedLpStableScriptHash())))
15171517 let currentHash = scriptHash(this)
15181518 if (if ((allowedHash == newHash))
15191519 then (currentHash != newHash)
15201520 else false)
15211521 then true
15221522 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
15231523 case _ =>
15241524 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
15251525 }
15261526 }
15271527

github/deemru/w8io/169f3d6 
179.90 ms