tx · 4yZ8vM61Cj9nxSvyr4PU5QCjWMEYUJtdrJjTXhE7x8gQ

3MuibHtY4WMNqE2AgpPjm9fuDar6TUNCThP:  -0.04300000 Waves

2023.10.16 18:09 [2801333] smart account 3MuibHtY4WMNqE2AgpPjm9fuDar6TUNCThP > SELF 0.00000000 Waves

{ "type": 13, "id": "4yZ8vM61Cj9nxSvyr4PU5QCjWMEYUJtdrJjTXhE7x8gQ", "fee": 4300000, "feeAssetId": null, "timestamp": 1697468996998, "version": 2, "chainId": 84, "sender": "3MuibHtY4WMNqE2AgpPjm9fuDar6TUNCThP", "senderPublicKey": "5K6j2MTCQttt7Dt3hR4msP7sjtJ4LWVPHbUjbG485Lxw", "proofs": [ "C8F5SHDL5X4yQ8ptQ4UjX7kcb84Yi7wBmrsvarqwtenALSH7sKQ7Mx1CKT6W3v3GXG2ipLDvPjKKWCq4G4EaVEH" ], "script": "base64:BgLjOAgCEgASBQoDAQQBEgcKBQEEAQgBEgQKAgEEEgMKAQESBAoCAQQSBAoCCAESBAoCCAESBAoCCAESBQoDAQgBEgASBAoCAQESAwoBARIFCgMBAQESBAoCCAgSABIAEgMKAQgSBQoDAQEBEgQKAgEBEgQKAggBEgQKAggIEgsKCQgBAQIBAggEBBIGCgQICAEIEgASAwoBARIDCgEBEgQKAggBIgpsUGRlY2ltYWxzIgZzY2FsZTgiDHNjYWxlOEJpZ0ludCIHc2NhbGUxOCIKemVyb0JpZ0ludCIEYmlnMCIEYmlnMSIEYmlnMiILd2F2ZXNTdHJpbmciA1NFUCIKUG9vbEFjdGl2ZSIPUG9vbFB1dERpc2FibGVkIhNQb29sTWF0Y2hlckRpc2FibGVkIgxQb29sU2h1dGRvd24iDmlkeFBvb2xBZGRyZXNzIg1pZHhQb29sU3RhdHVzIhBpZHhQb29sTFBBc3NldElkIg1pZHhBbXRBc3NldElkIg9pZHhQcmljZUFzc2V0SWQiDmlkeEFtdEFzc2V0RGNtIhBpZHhQcmljZUFzc2V0RGNtIg5pZHhJQW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WN0b3IEAmd1BQJhUQUCZ3UDCQABAgUCYVECBFVuaXQIBQJpbQ9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgQCYVEFAmltAwkAAQIFAmFRAgVPcmRlcgQCZVMFAmFRBAJpcAkBAmJsAAQCaXEDCQECZU8ACQCUCgIGAgAJAQJlUgEFAmVTBAJhSwgFAmlxAl8xBAJhTAgFAmlxAl8yBAJhTQkA9AMDCAUCZVMJYm9keUJ5dGVzCQCRAwIIBQJlUwZwcm9vZnMAAAgFAmVTD3NlbmRlclB1YmxpY0tleQQCYU4JAPQDAwgFAmVTCWJvZHlCeXRlcwkAkQMCCAUCZVMGcHJvb2ZzAAEFAmlwAwMDBQJhSwUCYU0HBQJhTgcGCQECYUoEBQJhSwUCYUwFAmFNBQJhTgMJAAECBQJhUQIUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAmFWBQJhUQMJAPQDAwgFAmltCWJvZHlCeXRlcwkAkQMCCAUCaW0GcHJvb2ZzAAAFAmlvBgQCaXIJAPYDAQkBBXZhbHVlAQgFAmFWBnNjcmlwdAQCaXMJANsEAQkBBXZhbHVlAQkAnQgCBQJiZAkBAmFGAAQCaXQJAPEHAQUEdGhpcwMJAAACBQJpcwUCaXIJAQIhPQIFAml0BQJpcgcJAPQDAwgFAmltCWJvZHlCeXRlcwkAkQMCCAUCaW0GcHJvb2ZzAAAFAmlv1lDrtA==", "height": 2801333, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HqhxQMjBNzJHv7X2ZjbvwUTJFxdYLuK7TDuzRo3cMpCp Next: 3khDD6uHAnQs9Qb4Vs8ZUbmp5RDbakDr6JDQ7U6oQXWk Diff:
OldNewDifferences
228228 else throw(($getType(@) + " couldn't be cast to Int"))
229229 }
230230
231+func keyAddressWhitelisted (address) = makeString(["%s%s", "whitelisted", toString(address)], SEP)
232+
233+
234+func isAddressWhitelisted (address) = valueOrElse(getBoolean(factoryContract, keyAddressWhitelisted(address)), false)
235+
236+
231237 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
232238
233239
258264
259265 let poolConfigParsed = parsePoolConfig(getPoolConfig())
260266
261-let $t095299695 = poolConfigParsed
267+let $t097699935 = poolConfigParsed
262268
263-let cfgPoolAddress = $t095299695._1
269+let cfgPoolAddress = $t097699935._1
264270
265-let cfgPoolStatus = $t095299695._2
271+let cfgPoolStatus = $t097699935._2
266272
267-let cfgLpAssetId = $t095299695._3
273+let cfgLpAssetId = $t097699935._3
268274
269-let cfgAmountAssetId = $t095299695._4
275+let cfgAmountAssetId = $t097699935._4
270276
271-let cfgPriceAssetId = $t095299695._5
277+let cfgPriceAssetId = $t097699935._5
272278
273-let cfgAmountAssetDecimals = $t095299695._6
279+let cfgAmountAssetDecimals = $t097699935._6
274280
275-let cfgPriceAssetDecimals = $t095299695._7
281+let cfgPriceAssetDecimals = $t097699935._7
276282
277283 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
278284
421427
422428
423429 func rebalanceAsset (assetId) = {
424- let $t01593116067 = getLeaseProxyConfig(assetId)
425- let isLeasable = $t01593116067._1
426- let leasedRatio = $t01593116067._2
427- let minBalance = $t01593116067._3
428- let proxyAddress = $t01593116067._4
429- let proxyAssetId = $t01593116067._5
430- let proxyRateMul = $t01593116067._6
431- let stakingProfitAddress = $t01593116067._7
430+ let $t01617116307 = getLeaseProxyConfig(assetId)
431+ let isLeasable = $t01617116307._1
432+ let leasedRatio = $t01617116307._2
433+ let minBalance = $t01617116307._3
434+ let proxyAddress = $t01617116307._4
435+ let proxyAssetId = $t01617116307._5
436+ let proxyRateMul = $t01617116307._6
437+ let stakingProfitAddress = $t01617116307._7
432438 if (isLeasable)
433439 then rebalanceInternal(leasedRatio, assetId, proxyAssetId, minBalance, addressFromStringValue(proxyAddress), proxyRateMul, addressFromStringValue(stakingProfitAddress))
434440 else nil
436442
437443
438444 func withdrawAndRebalanceAsset (assetId,getAmount) = {
439- let $t01646616602 = getLeaseProxyConfig(assetId)
440- let isLeasable = $t01646616602._1
441- let leasedRatio = $t01646616602._2
442- let minBalance = $t01646616602._3
443- let proxyAddress = $t01646616602._4
444- let proxyAssetId = $t01646616602._5
445- let proxyRateMul = $t01646616602._6
446- let stakingProfitAddress = $t01646616602._7
445+ let $t01670616842 = getLeaseProxyConfig(assetId)
446+ let isLeasable = $t01670616842._1
447+ let leasedRatio = $t01670616842._2
448+ let minBalance = $t01670616842._3
449+ let proxyAddress = $t01670616842._4
450+ let proxyAssetId = $t01670616842._5
451+ let proxyRateMul = $t01670616842._6
452+ let stakingProfitAddress = $t01670616842._7
447453 if (isLeasable)
448454 then {
449455 let newTotalLeasableBalance = max([0, ((getAccBalance(assetId) - getAmount) - minBalance)])
656662 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
657663 let amountAssetAmount = order.amount
658664 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
659- let $t02899129203 = if ((order.orderType == Buy))
665+ let $t02923129443 = if ((order.orderType == Buy))
660666 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
661667 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
662- let amountAssetBalanceDelta = $t02899129203._1
663- let priceAssetBalanceDelta = $t02899129203._2
668+ let amountAssetBalanceDelta = $t02923129443._1
669+ let priceAssetBalanceDelta = $t02923129443._2
664670 if (if (if (isGlobalShutdown())
665671 then true
666672 else (cfgPoolStatus == PoolMatcherDisabled))
673679 then throw("Wrong order assets.")
674680 else {
675681 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
676- let $t02964329743 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
677- let unusedActions = $t02964329743._1
678- let kLpNew = $t02964329743._2
682+ let $t02988329983 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
683+ let unusedActions = $t02988329983._1
684+ let kLpNew = $t02988329983._2
679685 let isOrderValid = (kLpNew >= kLp)
680686 let info = makeString(["kLp=", toString(kLp), " kLpNew=", toString(kLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "")
681687 $Tuple2(isOrderValid, info)
692698 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
693699 let outAmAmt = res._1
694700 let outPrAmt = res._2
695- let poolStatus = parseIntValue(res._9)
696701 let state = res._10
697- if (if (isGlobalShutdown())
698- then true
699- else (poolStatus == PoolShutdown))
700- then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
702+ let isGetDisabled = if (!(isAddressWhitelisted(i.caller)))
703+ then if (isGlobalShutdown())
704+ then true
705+ else (cfgPoolStatus == PoolShutdown)
706+ else false
707+ if (isGetDisabled)
708+ then throw(("Get operation is blocked by admin. Status = " + toString(cfgPoolStatus)))
701709 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
702710 }
703711
708716 let amAssetPmt = value(i.payments[0])
709717 let prAssetPmt = value(i.payments[1])
710718 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
711- let poolStatus = parseIntValue(estPut._8)
712- if (if (if (isGlobalShutdown())
713- then true
714- else (poolStatus == PoolPutDisabled))
715- then true
716- else (poolStatus == PoolShutdown))
717- then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
719+ let isPutDisabled = if (!(isAddressWhitelisted(i.caller)))
720+ then if (if (isGlobalShutdown())
721+ then true
722+ else (cfgPoolStatus == PoolPutDisabled))
723+ then true
724+ else (cfgPoolStatus == PoolShutdown)
725+ else false
726+ if (isPutDisabled)
727+ then throw(("Put operation is blocked by admin. Status = " + toString(cfgPoolStatus)))
718728 else estPut
719729 }
720730
754764 else if ((paymentAssetId == cfgPriceAssetId))
755765 then false
756766 else throwErr("invalid asset")
757- let $t03285633149 = if (isEval)
767+ let $t03316933462 = if (isEval)
758768 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
759769 else if (paymentInAmountAsset)
760770 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
761771 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
762- let amountBalanceOld = $t03285633149._1
763- let priceBalanceOld = $t03285633149._2
764- let $t03315333302 = if (paymentInAmountAsset)
772+ let amountBalanceOld = $t03316933462._1
773+ let priceBalanceOld = $t03316933462._2
774+ let $t03346633615 = if (paymentInAmountAsset)
765775 then $Tuple2(paymentAmountRaw, 0)
766776 else $Tuple2(0, paymentAmountRaw)
767- let amountAssetAmountRaw = $t03315333302._1
768- let priceAssetAmountRaw = $t03315333302._2
777+ let amountAssetAmountRaw = $t03346633615._1
778+ let priceAssetAmountRaw = $t03346633615._2
769779 let amountAssetAmount = takeFee(amountAssetAmountRaw, inFee)._1
770780 let priceAssetAmount = takeFee(priceAssetAmountRaw, inFee)._1
771- let $t03343433498 = takeFee(paymentAmountRaw, inFee)
772- let paymentAmount = $t03343433498._1
773- let feeAmount = $t03343433498._2
781+ let $t03374733811 = takeFee(paymentAmountRaw, inFee)
782+ let paymentAmount = $t03374733811._1
783+ let feeAmount = $t03374733811._2
774784 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
775785 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
776786 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
793803 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
794804 let priceOld = fromX18(priceOldX18, scale8)
795805 let loss = {
796- let $t03517935346 = if (paymentInAmountAsset)
806+ let $t03549235659 = if (paymentInAmountAsset)
797807 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
798808 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
799- let amount = $t03517935346._1
800- let balance = $t03517935346._2
809+ let amount = $t03549235659._1
810+ let balance = $t03549235659._2
801811 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
802812 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
803813 }
837847 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
838848 let redeemedBigInt = toBigInt(paymentAmount)
839849 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
840- let $t03742437480 = takeFee(amountRaw, outFee)
841- let totalAmount = $t03742437480._1
842- let feeAmount = $t03742437480._2
843- let $t03748437710 = if (outInAmountAsset)
850+ let $t03773737793 = takeFee(amountRaw, outFee)
851+ let totalAmount = $t03773737793._1
852+ let feeAmount = $t03773737793._2
853+ let $t03779738023 = if (outInAmountAsset)
844854 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
845855 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
846- let outAmAmount = $t03748437710._1
847- let outPrAmount = $t03748437710._2
848- let amBalanceNew = $t03748437710._3
849- let prBalanceNew = $t03748437710._4
856+ let outAmAmount = $t03779738023._1
857+ let outPrAmount = $t03779738023._2
858+ let amBalanceNew = $t03779738023._3
859+ let prBalanceNew = $t03779738023._4
850860 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
851861 let priceNew = fromX18(priceNewX18, scale8)
852862 let commonState = if (isEval)
911921
912922 @Callable(i)
913923 func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = {
914- let $t03956839873 = if ((isReverse == false))
924+ let $t03988140186 = if ((isReverse == false))
915925 then {
916926 let assetOut = getStringOrFail(this, pa())
917927 let assetIn = getStringOrFail(this, aa())
922932 let assetIn = getStringOrFail(this, pa())
923933 $Tuple2(assetOut, assetIn)
924934 }
925- let assetOut = $t03956839873._1
926- let assetIn = $t03956839873._2
935+ let assetOut = $t03988140186._1
936+ let assetIn = $t03988140186._2
927937 let poolAssetInBalance = getAccBalance(assetIn)
928938 let poolAssetOutBalance = getAccBalance(assetOut)
929939 let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
953963 then @
954964 else throw(($getType(@) + " couldn't be cast to Boolean"))
955965 }
956- let isSwapDisabled = if (if (isGlobalShutdown())
957- then true
958- else (cfgPoolStatus == PoolShutdown))
959- then true
960- else isPoolSwapDisabled
966+ let isSwapDisabled = if (!(isAddressWhitelisted(i.caller)))
967+ then if (if (isGlobalShutdown())
968+ then true
969+ else (cfgPoolStatus == PoolShutdown))
970+ then true
971+ else isPoolSwapDisabled
972+ else false
961973 let checks = [if (if (!(isSwapDisabled))
962974 then true
963975 else isManager(i))
10651077 else throw("Strict value is not equal to itself.")
10661078 }
10671079 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
1068- let $t04500745469 = refreshKLpInternal(0, 0, 0)
1069- if (($t04500745469 == $t04500745469))
1080+ let $t04536245824 = refreshKLpInternal(0, 0, 0)
1081+ if (($t04536245824 == $t04536245824))
10701082 then {
1071- let updatedKLp = $t04500745469._2
1072- let refreshKLpActions = $t04500745469._1
1083+ let updatedKLp = $t04536245824._2
1084+ let refreshKLpActions = $t04536245824._1
10731085 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10741086 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10751087 then {
11061118 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
11071119 if ((currentKLp == currentKLp))
11081120 then {
1109- let $t04608146146 = refreshKLpInternal(0, 0, 0)
1110- let refreshKLpActions = $t04608146146._1
1111- let updatedKLp = $t04608146146._2
1121+ let $t04643646501 = refreshKLpInternal(0, 0, 0)
1122+ let refreshKLpActions = $t04643646501._1
1123+ let updatedKLp = $t04643646501._2
11121124 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11131125 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11141126 then (state ++ refreshKLpActions)
11271139 then @
11281140 else throw(($getType(@) + " couldn't be cast to Boolean"))
11291141 }
1130- let isPutDisabled = if (if (if (isGlobalShutdown())
1131- then true
1132- else (cfgPoolStatus == PoolPutDisabled))
1133- then true
1134- else (cfgPoolStatus == PoolShutdown))
1135- then true
1136- else isPoolOneTokenOperationsDisabled
1142+ let isPutDisabled = if (!(isAddressWhitelisted(i.caller)))
1143+ then if (if (if (isGlobalShutdown())
1144+ then true
1145+ else (cfgPoolStatus == PoolPutDisabled))
1146+ then true
1147+ else (cfgPoolStatus == PoolShutdown))
1148+ then true
1149+ else isPoolOneTokenOperationsDisabled
1150+ else false
11371151 let checks = [if (if (!(isPutDisabled))
11381152 then true
11391153 else isManager(i))
11551169 then {
11561170 let userAddress = i.caller
11571171 let txId = i.transactionId
1158- let $t04733447486 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1159- if (($t04733447486 == $t04733447486))
1172+ let $t04773047882 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1173+ if (($t04773047882 == $t04773047882))
11601174 then {
1161- let paymentInAmountAsset = $t04733447486._5
1162- let bonus = $t04733447486._4
1163- let feeAmount = $t04733447486._3
1164- let commonState = $t04733447486._2
1165- let emitAmountEstimated = $t04733447486._1
1175+ let paymentInAmountAsset = $t04773047882._5
1176+ let bonus = $t04773047882._4
1177+ let feeAmount = $t04773047882._3
1178+ let commonState = $t04773047882._2
1179+ let emitAmountEstimated = $t04773047882._1
11661180 let emitAmount = if (if ((minOutAmount > 0))
11671181 then (minOutAmount > emitAmountEstimated)
11681182 else false)
11821196 let sendFee = if ((feeAmount > 0))
11831197 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
11841198 else nil
1185- let $t04807248269 = if ((this == feeCollectorAddress))
1199+ let $t04846848665 = if ((this == feeCollectorAddress))
11861200 then $Tuple2(0, 0)
11871201 else if (paymentInAmountAsset)
11881202 then $Tuple2(-(feeAmount), 0)
11891203 else $Tuple2(0, -(feeAmount))
1190- let amountAssetBalanceDelta = $t04807248269._1
1191- let priceAssetBalanceDelta = $t04807248269._2
1192- let $t04827248380 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1193- let refreshKLpActions = $t04827248380._1
1194- let updatedKLp = $t04827248380._2
1204+ let amountAssetBalanceDelta = $t04846848665._1
1205+ let priceAssetBalanceDelta = $t04846848665._2
1206+ let $t04866848776 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1207+ let refreshKLpActions = $t04866848776._1
1208+ let updatedKLp = $t04866848776._2
11951209 let kLp = value(getString(keyKLp))
11961210 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11971211 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12161230
12171231 @Callable(i)
12181232 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
1219- let $t04873548892 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1220- let emitAmountEstimated = $t04873548892._1
1221- let commonState = $t04873548892._2
1222- let feeAmount = $t04873548892._3
1223- let bonus = $t04873548892._4
1224- let paymentInAmountAsset = $t04873548892._5
1233+ let $t04913149288 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1234+ let emitAmountEstimated = $t04913149288._1
1235+ let commonState = $t04913149288._2
1236+ let feeAmount = $t04913149288._3
1237+ let bonus = $t04913149288._4
1238+ let paymentInAmountAsset = $t04913149288._5
12251239 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
12261240 }
12271241
12351249 then @
12361250 else throw(($getType(@) + " couldn't be cast to Boolean"))
12371251 }
1238- let isGetDisabled = if (if (isGlobalShutdown())
1239- then true
1240- else (cfgPoolStatus == PoolShutdown))
1241- then true
1242- else isPoolOneTokenOperationsDisabled
1252+ let isGetDisabled = if (!(isAddressWhitelisted(i.caller)))
1253+ then if (if (isGlobalShutdown())
1254+ then true
1255+ else (cfgPoolStatus == PoolShutdown))
1256+ then true
1257+ else isPoolOneTokenOperationsDisabled
1258+ else false
12431259 let checks = [if (if (!(isGetDisabled))
12441260 then true
12451261 else isManager(i))
12581274 then {
12591275 let userAddress = i.caller
12601276 let txId = i.transactionId
1261- let $t04977749930 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1262- if (($t04977749930 == $t04977749930))
1277+ let $t05021050363 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1278+ if (($t05021050363 == $t05021050363))
12631279 then {
1264- let outInAmountAsset = $t04977749930._5
1265- let bonus = $t04977749930._4
1266- let feeAmount = $t04977749930._3
1267- let commonState = $t04977749930._2
1268- let amountEstimated = $t04977749930._1
1280+ let outInAmountAsset = $t05021050363._5
1281+ let bonus = $t05021050363._4
1282+ let feeAmount = $t05021050363._3
1283+ let commonState = $t05021050363._2
1284+ let amountEstimated = $t05021050363._1
12691285 let amount = if (if ((minOutAmount > 0))
12701286 then (minOutAmount > amountEstimated)
12711287 else false)
12791295 let sendFee = if ((feeAmount > 0))
12801296 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
12811297 else nil
1282- let $t05059450841 = {
1298+ let $t05102751274 = {
12831299 let feeAmountForCalc = if ((this == feeCollectorAddress))
12841300 then 0
12851301 else feeAmount
12871303 then $Tuple2(-((amount + feeAmountForCalc)), 0)
12881304 else $Tuple2(0, -((amount + feeAmountForCalc)))
12891305 }
1290- let amountAssetBalanceDelta = $t05059450841._1
1291- let priceAssetBalanceDelta = $t05059450841._2
1292- let $t05084450952 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1293- let refreshKLpActions = $t05084450952._1
1294- let updatedKLp = $t05084450952._2
1306+ let amountAssetBalanceDelta = $t05102751274._1
1307+ let priceAssetBalanceDelta = $t05102751274._2
1308+ let $t05127751385 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1309+ let refreshKLpActions = $t05127751385._1
1310+ let updatedKLp = $t05127751385._2
12951311 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12961312 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12971313 then $Tuple2(((((commonState ++ withdrawState) ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
13101326
13111327 @Callable(i)
13121328 func getOneTknREADONLY (outAssetId,paymentAmount) = {
1313- let $t05123051386 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1314- let amountEstimated = $t05123051386._1
1315- let commonState = $t05123051386._2
1316- let feeAmount = $t05123051386._3
1317- let bonus = $t05123051386._4
1318- let outInAmountAsset = $t05123051386._5
1329+ let $t05166351819 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1330+ let amountEstimated = $t05166351819._1
1331+ let commonState = $t05166351819._2
1332+ let feeAmount = $t05166351819._3
1333+ let bonus = $t05166351819._4
1334+ let outInAmountAsset = $t05166351819._5
13191335 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
13201336 }
13211337
13291345 then @
13301346 else throw(($getType(@) + " couldn't be cast to Boolean"))
13311347 }
1332- let isGetDisabled = if (if (isGlobalShutdown())
1333- then true
1334- else (cfgPoolStatus == PoolShutdown))
1335- then true
1336- else isPoolOneTokenOperationsDisabled
1348+ let isGetDisabled = if (!(isAddressWhitelisted(i.caller)))
1349+ then if (if (isGlobalShutdown())
1350+ then true
1351+ else (cfgPoolStatus == PoolShutdown))
1352+ then true
1353+ else isPoolOneTokenOperationsDisabled
1354+ else false
13371355 let checks = [if (if (!(isGetDisabled))
13381356 then true
13391357 else isManager(i))
13521370 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
13531371 if ((unstakeInv == unstakeInv))
13541372 then {
1355- let $t05229152442 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1356- if (($t05229152442 == $t05229152442))
1373+ let $t05276152912 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1374+ if (($t05276152912 == $t05276152912))
13571375 then {
1358- let outInAmountAsset = $t05229152442._5
1359- let bonus = $t05229152442._4
1360- let feeAmount = $t05229152442._3
1361- let commonState = $t05229152442._2
1362- let amountEstimated = $t05229152442._1
1376+ let outInAmountAsset = $t05276152912._5
1377+ let bonus = $t05276152912._4
1378+ let feeAmount = $t05276152912._3
1379+ let commonState = $t05276152912._2
1380+ let amountEstimated = $t05276152912._1
13631381 let amount = if (if ((minOutAmount > 0))
13641382 then (minOutAmount > amountEstimated)
13651383 else false)
13731391 let sendFee = if ((feeAmount > 0))
13741392 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
13751393 else nil
1376- let $t05310153348 = {
1394+ let $t05357153818 = {
13771395 let feeAmountForCalc = if ((this == feeCollectorAddress))
13781396 then 0
13791397 else feeAmount
13811399 then $Tuple2(-((amount + feeAmountForCalc)), 0)
13821400 else $Tuple2(0, -((amount + feeAmountForCalc)))
13831401 }
1384- let amountAssetBalanceDelta = $t05310153348._1
1385- let priceAssetBalanceDelta = $t05310153348._2
1386- let $t05335153459 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1387- let refreshKLpActions = $t05335153459._1
1388- let updatedKLp = $t05335153459._2
1402+ let amountAssetBalanceDelta = $t05357153818._1
1403+ let priceAssetBalanceDelta = $t05357153818._2
1404+ let $t05382153929 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1405+ let refreshKLpActions = $t05382153929._1
1406+ let updatedKLp = $t05382153929._2
13891407 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
13901408 if ((isUpdatedKLpValid == isUpdatedKLpValid))
13911409 then $Tuple2(((((commonState ++ withdrawState) ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
14191437 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14201438 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14211439 then {
1422- let $t05455454635 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1423- let refreshKLpActions = $t05455454635._1
1424- let updatedKLp = $t05455454635._2
1440+ let $t05502455105 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1441+ let refreshKLpActions = $t05502455105._1
1442+ let updatedKLp = $t05502455105._2
14251443 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14261444 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14271445 then ((withdrawState ++ state) ++ refreshKLpActions)
14541472 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14551473 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14561474 then {
1457- let $t05573055811 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1458- let refreshKLpActions = $t05573055811._1
1459- let updatedKLp = $t05573055811._2
1475+ let $t05620056281 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1476+ let refreshKLpActions = $t05620056281._1
1477+ let updatedKLp = $t05620056281._2
14601478 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14611479 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14621480 then ((withdrawState ++ state) ++ refreshKLpActions)
14911509 let poolStatus = parseIntValue(res._9)
14921510 let state = res._10
14931511 let withdrawState = withdrawAndRebalanceAll(outAmAmt, outPrAmt)
1494- let checkPoolStatus = if (if (isGlobalShutdown())
1495- then true
1496- else (poolStatus == PoolShutdown))
1512+ let isGetDisabled = if (!(isAddressWhitelisted(i.caller)))
1513+ then if (isGlobalShutdown())
1514+ then true
1515+ else (cfgPoolStatus == PoolShutdown)
1516+ else false
1517+ let checkPoolStatus = if (isGetDisabled)
14971518 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
14981519 else true
14991520 if ((checkPoolStatus == checkPoolStatus))
15011522 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
15021523 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15031524 then {
1504- let $t05708357164 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1505- let refreshKLpActions = $t05708357164._1
1506- let updatedKLp = $t05708357164._2
1525+ let $t05762957710 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1526+ let refreshKLpActions = $t05762957710._1
1527+ let updatedKLp = $t05762957710._2
15071528 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15081529 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15091530 then ((withdrawState ++ state) ++ refreshKLpActions)
15241545
15251546 @Callable(i)
15261547 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
1527- let isGetDisabled = if (isGlobalShutdown())
1528- then true
1529- else (cfgPoolStatus == PoolShutdown)
1548+ let isGetDisabled = if (!(isAddressWhitelisted(i.caller)))
1549+ then if (isGlobalShutdown())
1550+ then true
1551+ else (cfgPoolStatus == PoolShutdown)
1552+ else false
15301553 let checks = [if (!(isGetDisabled))
15311554 then true
15321555 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
15551578 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
15561579 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15571580 then {
1558- let $t05860558686 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1559- let refreshKLpActions = $t05860558686._1
1560- let updatedKLp = $t05860558686._2
1581+ let $t05918859269 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1582+ let refreshKLpActions = $t05918859269._1
1583+ let updatedKLp = $t05918859269._2
15611584 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15621585 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15631586 then ((withdrawState ++ state) ++ refreshKLpActions)
15921615 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
15931616 then {
15941617 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1595- let $t05989059954 = refreshKLpInternal(0, 0, 0)
1596- let kLpUpdateActions = $t05989059954._1
1597- let updatedKLp = $t05989059954._2
1618+ let $t06047360537 = refreshKLpInternal(0, 0, 0)
1619+ let kLpUpdateActions = $t06047360537._1
1620+ let updatedKLp = $t06047360537._2
15981621 let actions = if ((kLp != updatedKLp))
15991622 then kLpUpdateActions
16001623 else throwErr("nothing to refresh")
17691792 match tx {
17701793 case order: Order =>
17711794 let matcherPub = getMatcherPubOrFail()
1772- let $t06861668733 = if (skipOrderValidation())
1795+ let $t06919969316 = if (skipOrderValidation())
17731796 then $Tuple2(true, "")
17741797 else validateMatcherOrderAllowed(order)
1775- let orderValid = $t06861668733._1
1776- let orderValidInfo = $t06861668733._2
1798+ let orderValid = $t06919969316._1
1799+ let orderValidInfo = $t06919969316._2
17771800 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
17781801 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
17791802 if (if (if (orderValid)
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 toX18BigInt (origVal,origScaleMult) = fraction(origVal, scale18, origScaleMult)
6666
6767
6868 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
6969
7070
7171 func fromX18Round (val,resultScaleMult,round) = toInt(fraction(val, toBigInt(resultScaleMult), scale18, round))
7272
7373
7474 func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale)
7575
7676
7777 func abs (val) = if ((0 > val))
7878 then -(val)
7979 else val
8080
8181
8282 func absBigInt (val) = if ((zeroBigInt > val))
8383 then -(val)
8484 else val
8585
8686
8787 func swapContract () = "%s__swapContract"
8888
8989
9090 func fc () = "%s__factoryContract"
9191
9292
9393 func keyManagerPublicKey () = "%s__managerPublicKey"
9494
9595
9696 func keyManagerVaultAddress () = "%s__managerVaultAddress"
9797
9898
9999 func pl () = "%s%s__price__last"
100100
101101
102102 func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP)
103103
104104
105105 func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId)
106106
107107
108108 func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId)
109109
110110
111111 func aa () = "%s__amountAsset"
112112
113113
114114 func pa () = "%s__priceAsset"
115115
116116
117117 let keyFee = "%s__fee"
118118
119119 let feeDefault = fraction(10, scale8, 10000)
120120
121121 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
122122
123123 let keyKLp = makeString(["%s", "kLp"], SEP)
124124
125125 let keyKLpRefreshedHeight = makeString(["%s", "kLpRefreshedHeight"], SEP)
126126
127127 let keyKLpRefreshDelay = makeString(["%s", "refreshKLpDelay"], SEP)
128128
129129 let kLpRefreshDelayDefault = 30
130130
131131 let kLpRefreshDelay = valueOrElse(getInteger(this, keyKLpRefreshDelay), kLpRefreshDelayDefault)
132132
133133 func keyAdditionalBalance (assetId) = makeString(["%s%s", "stakedBalance", assetId], SEP)
134134
135135
136136 func keyStakingAssetBalance (assetId) = makeString(["%s%s", "shareAssetBalance", assetId], SEP)
137137
138138
139139 func getAdditionalBalanceOrZero (assetId) = valueOrElse(getInteger(this, keyAdditionalBalance(assetId)), 0)
140140
141141
142142 func getStakingAssetBalanceOrZero (assetId) = valueOrElse(getInteger(this, keyStakingAssetBalance(assetId)), 0)
143143
144144
145145 func keyFactoryConfig () = "%s__factoryConfig"
146146
147147
148148 func keyMatcherPub () = "%s%s__matcher__publicKey"
149149
150150
151151 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
152152
153153
154154 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
155155
156156
157157 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
158158
159159
160160 func keyAllPoolsShutdown () = "%s__shutdown"
161161
162162
163163 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
164164
165165
166166 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
167167
168168
169169 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
170170
171171 func keySkipOrderValidation (poolAddress) = ("%s%s__skipOrderValidation__" + poolAddress)
172172
173173
174174 func throwOrderError (orderValid,orderValidInfo,senderValid,matcherValid) = throw((((((((("order validation failed: orderValid=" + toString(orderValid)) + " (") + orderValidInfo) + ")") + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
175175
176176
177177 func addressFromStringOrThis (addressString) = match addressFromString(addressString) {
178178 case a: Address =>
179179 a
180180 case _ =>
181181 this
182182 }
183183
184184
185185 func getManagerVaultAddressOrThis () = {
186186 let factoryAddress = match getString(fc()) {
187187 case fca: String =>
188188 addressFromStringOrThis(fca)
189189 case _ =>
190190 this
191191 }
192192 match getString(factoryAddress, keyManagerVaultAddress()) {
193193 case s: String =>
194194 addressFromStringOrThis(s)
195195 case _ =>
196196 this
197197 }
198198 }
199199
200200
201201 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
202202
203203
204204 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
205205
206206
207207 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
208208
209209
210210 func fmtErr (msg) = makeString(["lp.ride:", msg], " ")
211211
212212
213213 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
214214
215215 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
216216
217217 let inFee = {
218218 let @ = invoke(factoryContract, "getInFeeREADONLY", [toString(this)], nil)
219219 if ($isInstanceOf(@, "Int"))
220220 then @
221221 else throw(($getType(@) + " couldn't be cast to Int"))
222222 }
223223
224224 let outFee = {
225225 let @ = invoke(factoryContract, "getOutFeeREADONLY", [toString(this)], nil)
226226 if ($isInstanceOf(@, "Int"))
227227 then @
228228 else throw(($getType(@) + " couldn't be cast to Int"))
229229 }
230230
231+func keyAddressWhitelisted (address) = makeString(["%s%s", "whitelisted", toString(address)], SEP)
232+
233+
234+func isAddressWhitelisted (address) = valueOrElse(getBoolean(factoryContract, keyAddressWhitelisted(address)), false)
235+
236+
231237 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
232238
233239
234240 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
235241
236242
237243 func getPoolConfig () = {
238244 let amtAsset = getStringOrFail(this, aa())
239245 let priceAsset = getStringOrFail(this, pa())
240246 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
241247 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
242248 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
243249 }
244250
245251
246252 func parseAssetId (input) = if ((input == wavesString))
247253 then unit
248254 else fromBase58String(input)
249255
250256
251257 func assetIdToString (input) = if ((input == unit))
252258 then wavesString
253259 else toBase58String(value(input))
254260
255261
256262 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]))
257263
258264
259265 let poolConfigParsed = parsePoolConfig(getPoolConfig())
260266
261-let $t095299695 = poolConfigParsed
267+let $t097699935 = poolConfigParsed
262268
263-let cfgPoolAddress = $t095299695._1
269+let cfgPoolAddress = $t097699935._1
264270
265-let cfgPoolStatus = $t095299695._2
271+let cfgPoolStatus = $t097699935._2
266272
267-let cfgLpAssetId = $t095299695._3
273+let cfgLpAssetId = $t097699935._3
268274
269-let cfgAmountAssetId = $t095299695._4
275+let cfgAmountAssetId = $t097699935._4
270276
271-let cfgPriceAssetId = $t095299695._5
277+let cfgPriceAssetId = $t097699935._5
272278
273-let cfgAmountAssetDecimals = $t095299695._6
279+let cfgAmountAssetDecimals = $t097699935._6
274280
275-let cfgPriceAssetDecimals = $t095299695._7
281+let cfgPriceAssetDecimals = $t097699935._7
276282
277283 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
278284
279285
280286 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
281287
282288 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
283289
284290 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)
285291
286292
287293 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)
288294
289295
290296 func getAccBalance (assetId) = {
291297 let balanceOnPool = if ((assetId == "WAVES"))
292298 then wavesBalance(this).available
293299 else assetBalance(this, fromBase58String(assetId))
294300 let totalBalance = ((balanceOnPool + getAdditionalBalanceOrZero(assetId)) - getStakingAssetBalanceOrZero(assetId))
295301 max([0, totalBalance])
296302 }
297303
298304
299305 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
300306
301307
302308 func calcPriceBigIntRound (prAmtX18,amAmtX18,round) = fraction(prAmtX18, scale18, amAmtX18, round)
303309
304310
305311 func getRate (proxy) = {
306312 let inv = invoke(proxy, "getRate", nil, nil)
307313 if ((inv == inv))
308314 then match inv {
309315 case r: Int =>
310316 r
311317 case _ =>
312318 throwErr("proxy.getRate() unexpected value")
313319 }
314320 else throw("Strict value is not equal to itself.")
315321 }
316322
317323
318324 func deposit (assetId,amount,stakingAssetId,proxy) = {
319325 let currentAdditionalBalance = getAdditionalBalanceOrZero(assetId)
320326 if ((currentAdditionalBalance == currentAdditionalBalance))
321327 then {
322328 let currentStakingAssetBalance = getStakingAssetBalanceOrZero(stakingAssetId)
323329 if ((currentStakingAssetBalance == currentStakingAssetBalance))
324330 then {
325331 let asset = parseAssetId(assetId)
326332 if ((amount > 0))
327333 then {
328334 let depositInvoke = invoke(proxy, "deposit", nil, [AttachedPayment(asset, amount)])
329335 if ((depositInvoke == depositInvoke))
330336 then match depositInvoke {
331337 case receivedStakingAsset: Int =>
332338 let newAdditionalBalance = (currentAdditionalBalance + amount)
333339 let newStakingAssetBalance = (currentStakingAssetBalance + receivedStakingAsset)
334340 [IntegerEntry(keyAdditionalBalance(assetId), newAdditionalBalance), IntegerEntry(keyStakingAssetBalance(stakingAssetId), newStakingAssetBalance)]
335341 case _ =>
336342 nil
337343 }
338344 else throw("Strict value is not equal to itself.")
339345 }
340346 else nil
341347 }
342348 else throw("Strict value is not equal to itself.")
343349 }
344350 else throw("Strict value is not equal to itself.")
345351 }
346352
347353
348354 func withdraw (assetId,amount,stakingAssetId,proxy,proxyRateMul,profitAddress) = {
349355 let currentAdditionalBalance = getAdditionalBalanceOrZero(assetId)
350356 if ((currentAdditionalBalance == currentAdditionalBalance))
351357 then {
352358 let currentStakingAssetBalance = getStakingAssetBalanceOrZero(stakingAssetId)
353359 if ((currentStakingAssetBalance == currentStakingAssetBalance))
354360 then {
355361 let currentProxyRate = getRate(proxy)
356362 if ((currentProxyRate == currentProxyRate))
357363 then {
358364 let oldRate = fraction(proxyRateMul, currentAdditionalBalance, currentStakingAssetBalance)
359365 let stakingAsset = parseAssetId(stakingAssetId)
360366 let oldSendStakingAmount = fraction(proxyRateMul, amount, oldRate)
361367 let sendStakingAssetAmount = fraction(proxyRateMul, amount, currentProxyRate)
362368 let profitAmount = max([0, (oldSendStakingAmount - sendStakingAssetAmount)])
363369 if ((sendStakingAssetAmount > 0))
364370 then {
365371 let withdrawInvoke = invoke(proxy, "withdraw", nil, [AttachedPayment(stakingAsset, sendStakingAssetAmount)])
366372 if ((withdrawInvoke == withdrawInvoke))
367373 then match withdrawInvoke {
368374 case receivedAssets: Int =>
369375 let newAdditionalBalance = (currentAdditionalBalance - receivedAssets)
370376 let newStakingAssetBalance = ((currentStakingAssetBalance - sendStakingAssetAmount) - profitAmount)
371377 [IntegerEntry(keyAdditionalBalance(assetId), newAdditionalBalance), IntegerEntry(keyStakingAssetBalance(stakingAssetId), newStakingAssetBalance), ScriptTransfer(profitAddress, profitAmount, parseAssetId(stakingAssetId))]
372378 case _ =>
373379 nil
374380 }
375381 else throw("Strict value is not equal to itself.")
376382 }
377383 else nil
378384 }
379385 else throw("Strict value is not equal to itself.")
380386 }
381387 else throw("Strict value is not equal to itself.")
382388 }
383389 else throw("Strict value is not equal to itself.")
384390 }
385391
386392
387393 func getLeaseProxyConfig (assetId) = match invoke(factoryContract, "getPoolLeaseConfigREADONLY", [toString(this), assetId], nil) {
388394 case a: (Boolean, Int, Int, String, String, Int, String) =>
389395 a
390396 case _ =>
391397 throwErr((("[" + assetId) + "] getLeaseProxyConfig() error"))
392398 }
393399
394400
395401 func rebalanceInternal (targetRatio,assetId,stakingAssetId,minBalance,proxy,proxyRateMul,profitAddress) = {
396402 let currentAdditionalBalance = getAdditionalBalanceOrZero(assetId)
397403 if ((currentAdditionalBalance == currentAdditionalBalance))
398404 then {
399405 let currentStakingAssetBalance = getStakingAssetBalanceOrZero(stakingAssetId)
400406 if ((currentStakingAssetBalance == currentStakingAssetBalance))
401407 then {
402408 let leasableTotalBalance = max([0, (getAccBalance(assetId) - minBalance)])
403409 let targetAdditionalBalance = fraction(targetRatio, leasableTotalBalance, 100)
404410 let diff = (currentAdditionalBalance - targetAdditionalBalance)
405411 if ((diff == 0))
406412 then nil
407413 else if ((0 > diff))
408414 then {
409415 let sendAssetAmount = -(diff)
410416 deposit(assetId, sendAssetAmount, stakingAssetId, proxy)
411417 }
412418 else {
413419 let getAssetAmount = diff
414420 withdraw(assetId, getAssetAmount, stakingAssetId, proxy, proxyRateMul, profitAddress)
415421 }
416422 }
417423 else throw("Strict value is not equal to itself.")
418424 }
419425 else throw("Strict value is not equal to itself.")
420426 }
421427
422428
423429 func rebalanceAsset (assetId) = {
424- let $t01593116067 = getLeaseProxyConfig(assetId)
425- let isLeasable = $t01593116067._1
426- let leasedRatio = $t01593116067._2
427- let minBalance = $t01593116067._3
428- let proxyAddress = $t01593116067._4
429- let proxyAssetId = $t01593116067._5
430- let proxyRateMul = $t01593116067._6
431- let stakingProfitAddress = $t01593116067._7
430+ let $t01617116307 = getLeaseProxyConfig(assetId)
431+ let isLeasable = $t01617116307._1
432+ let leasedRatio = $t01617116307._2
433+ let minBalance = $t01617116307._3
434+ let proxyAddress = $t01617116307._4
435+ let proxyAssetId = $t01617116307._5
436+ let proxyRateMul = $t01617116307._6
437+ let stakingProfitAddress = $t01617116307._7
432438 if (isLeasable)
433439 then rebalanceInternal(leasedRatio, assetId, proxyAssetId, minBalance, addressFromStringValue(proxyAddress), proxyRateMul, addressFromStringValue(stakingProfitAddress))
434440 else nil
435441 }
436442
437443
438444 func withdrawAndRebalanceAsset (assetId,getAmount) = {
439- let $t01646616602 = getLeaseProxyConfig(assetId)
440- let isLeasable = $t01646616602._1
441- let leasedRatio = $t01646616602._2
442- let minBalance = $t01646616602._3
443- let proxyAddress = $t01646616602._4
444- let proxyAssetId = $t01646616602._5
445- let proxyRateMul = $t01646616602._6
446- let stakingProfitAddress = $t01646616602._7
445+ let $t01670616842 = getLeaseProxyConfig(assetId)
446+ let isLeasable = $t01670616842._1
447+ let leasedRatio = $t01670616842._2
448+ let minBalance = $t01670616842._3
449+ let proxyAddress = $t01670616842._4
450+ let proxyAssetId = $t01670616842._5
451+ let proxyRateMul = $t01670616842._6
452+ let stakingProfitAddress = $t01670616842._7
447453 if (isLeasable)
448454 then {
449455 let newTotalLeasableBalance = max([0, ((getAccBalance(assetId) - getAmount) - minBalance)])
450456 if ((newTotalLeasableBalance == newTotalLeasableBalance))
451457 then {
452458 let newAdditionalBalance = fraction(leasedRatio, newTotalLeasableBalance, 100)
453459 if ((newAdditionalBalance == newAdditionalBalance))
454460 then {
455461 let withdrawAmount = (getAdditionalBalanceOrZero(assetId) - newAdditionalBalance)
456462 if ((withdrawAmount == withdrawAmount))
457463 then if ((0 > withdrawAmount))
458464 then deposit(assetId, -(withdrawAmount), proxyAssetId, addressFromStringValue(proxyAddress))
459465 else withdraw(assetId, withdrawAmount, proxyAssetId, addressFromStringValue(proxyAddress), proxyRateMul, addressFromStringValue(stakingProfitAddress))
460466 else throw("Strict value is not equal to itself.")
461467 }
462468 else throw("Strict value is not equal to itself.")
463469 }
464470 else throw("Strict value is not equal to itself.")
465471 }
466472 else nil
467473 }
468474
469475
470476 func withdrawAndRebalanceAll (amountAssetOutAmount,priceAssetOutAmount) = {
471477 let AmAmtWithdrawState = withdrawAndRebalanceAsset(getStringOrFail(this, aa()), amountAssetOutAmount)
472478 let PrAmtWithdrawState = withdrawAndRebalanceAsset(getStringOrFail(this, pa()), priceAssetOutAmount)
473479 (AmAmtWithdrawState ++ PrAmtWithdrawState)
474480 }
475481
476482
477483 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
478484 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
479485 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
480486 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
481487 }
482488
483489
484490 func calcPrices (amAmt,prAmt,lpAmt) = {
485491 let cfg = getPoolConfig()
486492 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
487493 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
488494 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
489495 let amAmtX18 = toX18(amAmt, amtAssetDcm)
490496 let prAmtX18 = toX18(prAmt, priceAssetDcm)
491497 let lpAmtX18 = toX18(lpAmt, scale8)
492498 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
493499 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
494500 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
495501 }
496502
497503
498504 func calculatePrices (amAmt,prAmt,lpAmt) = {
499505 let prices = calcPrices(amAmt, prAmt, lpAmt)
500506 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
501507 }
502508
503509
504510 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
505511 let cfg = getPoolConfig()
506512 let lpAssetId = cfg[idxPoolLPAssetId]
507513 let amAssetId = cfg[idxAmtAssetId]
508514 let prAssetId = cfg[idxPriceAssetId]
509515 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
510516 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
511517 let poolStatus = cfg[idxPoolStatus]
512518 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
513519 if ((lpAssetId != pmtAssetId))
514520 then throw("Invalid asset passed.")
515521 else {
516522 let amBalance = getAccBalance(amAssetId)
517523 let amBalanceX18 = toX18(amBalance, amAssetDcm)
518524 let prBalance = getAccBalance(prAssetId)
519525 let prBalanceX18 = toX18(prBalance, prAssetDcm)
520526 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
521527 let curPrice = fromX18(curPriceX18, scale8)
522528 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
523529 let lpEmissionX18 = toX18(lpEmission, scale8)
524530 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
525531 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
526532 let outAmAmt = fromX18Round(outAmAmtX18, amAssetDcm, FLOOR)
527533 let outPrAmt = fromX18Round(outPrAmtX18, prAssetDcm, FLOOR)
528534 let state = if ((txId58 == ""))
529535 then nil
530536 else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
531537 then unit
532538 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
533539 then unit
534540 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)]
535541 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
536542 }
537543 }
538544
539545
540546 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
541547 let cfg = getPoolConfig()
542548 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
543549 let amAssetIdStr = cfg[idxAmtAssetId]
544550 let prAssetIdStr = cfg[idxPriceAssetId]
545551 let iAmtAssetId = cfg[idxIAmtAssetId]
546552 let iPriceAssetId = cfg[idxIPriceAssetId]
547553 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
548554 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
549555 let poolStatus = cfg[idxPoolStatus]
550556 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
551557 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
552558 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
553559 if (if ((amAssetIdStr != inAmAssetIdStr))
554560 then true
555561 else (prAssetIdStr != inPrAssetIdStr))
556562 then throw("Invalid amt or price asset passed.")
557563 else {
558564 let amBalance = if (isEvaluate)
559565 then getAccBalance(amAssetIdStr)
560566 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
561567 let prBalance = if (isEvaluate)
562568 then getAccBalance(prAssetIdStr)
563569 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
564570 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
565571 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
566572 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
567573 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
568574 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
569575 let res = if ((lpEmission == 0))
570576 then {
571577 let curPriceX18 = zeroBigInt
572578 let slippageX18 = zeroBigInt
573579 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
574580 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
575581 }
576582 else {
577583 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
578584 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
579585 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
580586 if (if ((curPriceX18 != zeroBigInt))
581587 then (slippageX18 > slippageToleranceX18)
582588 else false)
583589 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
584590 else {
585591 let lpEmissionX18 = toX18(lpEmission, scale8)
586592 let prViaAmX18 = fraction(inAmAssetAmtX18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING)
587593 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, FLOOR), CEILING)
588594 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
589595 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
590596 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
591597 let expAmtAssetAmtX18 = expectedAmts._1
592598 let expPriceAssetAmtX18 = expectedAmts._2
593599 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18, FLOOR)
594600 $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtAssetDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceAssetDcm, CEILING), curPriceX18, slippageX18)
595601 }
596602 }
597603 let calcLpAmt = res._1
598604 let calcAmAssetPmt = res._2
599605 let calcPrAssetPmt = res._3
600606 let curPrice = fromX18(res._4, scale8)
601607 let slippageCalc = fromX18(res._5, scale8)
602608 if ((0 >= calcLpAmt))
603609 then throw("Invalid calculations. LP calculated is less than zero.")
604610 else {
605611 let emitLpAmt = if (!(emitLp))
606612 then 0
607613 else calcLpAmt
608614 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
609615 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
610616 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))]
611617 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
612618 }
613619 }
614620 }
615621
616622
617623 func calcKLp (amountBalance,priceBalance,lpEmission) = {
618624 let amountBalanceX18 = toX18BigInt(amountBalance, toBigInt(cfgAmountAssetDecimals))
619625 let priceBalanceX18 = toX18BigInt(priceBalance, toBigInt(cfgPriceAssetDecimals))
620626 let updatedKLp = fraction(pow((amountBalanceX18 * priceBalanceX18), 0, toBigInt(5), 1, 18, DOWN), big1, lpEmission)
621627 if ((lpEmission == big0))
622628 then big0
623629 else updatedKLp
624630 }
625631
626632
627633 func calcCurrentKLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
628634 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
629635 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
630636 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
631637 let currentKLp = calcKLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
632638 currentKLp
633639 }
634640
635641
636642 func refreshKLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
637643 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
638644 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
639645 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
640646 let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
641647 let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
642648 $Tuple2(actions, updatedKLp)
643649 }
644650
645651
646652 func skipOrderValidation () = valueOrElse(getBoolean(factoryContract, keySkipOrderValidation(toString(this))), false)
647653
648654
649655 func validateUpdatedKLp (oldKLp,updatedKLp) = if ((updatedKLp >= oldKLp))
650656 then true
651657 else throwErr(makeString(["updated KLp lower than current KLp", toString(oldKLp), toString(updatedKLp)], " "))
652658
653659
654660 func validateMatcherOrderAllowed (order) = {
655661 let amountAssetBalance = getAccBalance(assetIdToString(cfgAmountAssetId))
656662 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
657663 let amountAssetAmount = order.amount
658664 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
659- let $t02899129203 = if ((order.orderType == Buy))
665+ let $t02923129443 = if ((order.orderType == Buy))
660666 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
661667 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
662- let amountAssetBalanceDelta = $t02899129203._1
663- let priceAssetBalanceDelta = $t02899129203._2
668+ let amountAssetBalanceDelta = $t02923129443._1
669+ let priceAssetBalanceDelta = $t02923129443._2
664670 if (if (if (isGlobalShutdown())
665671 then true
666672 else (cfgPoolStatus == PoolMatcherDisabled))
667673 then true
668674 else (cfgPoolStatus == PoolShutdown))
669675 then throw("Exchange operations disabled")
670676 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
671677 then true
672678 else (order.assetPair.priceAsset != cfgPriceAssetId))
673679 then throw("Wrong order assets.")
674680 else {
675681 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
676- let $t02964329743 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
677- let unusedActions = $t02964329743._1
678- let kLpNew = $t02964329743._2
682+ let $t02988329983 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
683+ let unusedActions = $t02988329983._1
684+ let kLpNew = $t02988329983._2
679685 let isOrderValid = (kLpNew >= kLp)
680686 let info = makeString(["kLp=", toString(kLp), " kLpNew=", toString(kLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "")
681687 $Tuple2(isOrderValid, info)
682688 }
683689 }
684690
685691
686692 func commonGet (i) = if ((size(i.payments) != 1))
687693 then throw("exactly 1 payment is expected")
688694 else {
689695 let pmt = value(i.payments[0])
690696 let pmtAssetId = value(pmt.assetId)
691697 let pmtAmt = pmt.amount
692698 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
693699 let outAmAmt = res._1
694700 let outPrAmt = res._2
695- let poolStatus = parseIntValue(res._9)
696701 let state = res._10
697- if (if (isGlobalShutdown())
698- then true
699- else (poolStatus == PoolShutdown))
700- then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
702+ let isGetDisabled = if (!(isAddressWhitelisted(i.caller)))
703+ then if (isGlobalShutdown())
704+ then true
705+ else (cfgPoolStatus == PoolShutdown)
706+ else false
707+ if (isGetDisabled)
708+ then throw(("Get operation is blocked by admin. Status = " + toString(cfgPoolStatus)))
701709 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
702710 }
703711
704712
705713 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
706714 then throw("exactly 2 payments are expected")
707715 else {
708716 let amAssetPmt = value(i.payments[0])
709717 let prAssetPmt = value(i.payments[1])
710718 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
711- let poolStatus = parseIntValue(estPut._8)
712- if (if (if (isGlobalShutdown())
713- then true
714- else (poolStatus == PoolPutDisabled))
715- then true
716- else (poolStatus == PoolShutdown))
717- then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
719+ let isPutDisabled = if (!(isAddressWhitelisted(i.caller)))
720+ then if (if (isGlobalShutdown())
721+ then true
722+ else (cfgPoolStatus == PoolPutDisabled))
723+ then true
724+ else (cfgPoolStatus == PoolShutdown)
725+ else false
726+ if (isPutDisabled)
727+ then throw(("Put operation is blocked by admin. Status = " + toString(cfgPoolStatus)))
718728 else estPut
719729 }
720730
721731
722732 func emit (amount) = {
723733 let emitInv = invoke(factoryContract, "emit", [amount], nil)
724734 if ((emitInv == emitInv))
725735 then {
726736 let emitInvLegacy = match emitInv {
727737 case legacyFactoryContract: Address =>
728738 invoke(legacyFactoryContract, "emit", [amount], nil)
729739 case _ =>
730740 unit
731741 }
732742 if ((emitInvLegacy == emitInvLegacy))
733743 then amount
734744 else throw("Strict value is not equal to itself.")
735745 }
736746 else throw("Strict value is not equal to itself.")
737747 }
738748
739749
740750 func takeFee (amount,fee) = {
741751 let feeAmount = if ((fee == 0))
742752 then 0
743753 else fraction(amount, fee, scale8)
744754 $Tuple2((amount - feeAmount), feeAmount)
745755 }
746756
747757
748758 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
749759 let isEval = (txId == unit)
750760 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
751761 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
752762 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
753763 then true
754764 else if ((paymentAssetId == cfgPriceAssetId))
755765 then false
756766 else throwErr("invalid asset")
757- let $t03285633149 = if (isEval)
767+ let $t03316933462 = if (isEval)
758768 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
759769 else if (paymentInAmountAsset)
760770 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
761771 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
762- let amountBalanceOld = $t03285633149._1
763- let priceBalanceOld = $t03285633149._2
764- let $t03315333302 = if (paymentInAmountAsset)
772+ let amountBalanceOld = $t03316933462._1
773+ let priceBalanceOld = $t03316933462._2
774+ let $t03346633615 = if (paymentInAmountAsset)
765775 then $Tuple2(paymentAmountRaw, 0)
766776 else $Tuple2(0, paymentAmountRaw)
767- let amountAssetAmountRaw = $t03315333302._1
768- let priceAssetAmountRaw = $t03315333302._2
777+ let amountAssetAmountRaw = $t03346633615._1
778+ let priceAssetAmountRaw = $t03346633615._2
769779 let amountAssetAmount = takeFee(amountAssetAmountRaw, inFee)._1
770780 let priceAssetAmount = takeFee(priceAssetAmountRaw, inFee)._1
771- let $t03343433498 = takeFee(paymentAmountRaw, inFee)
772- let paymentAmount = $t03343433498._1
773- let feeAmount = $t03343433498._2
781+ let $t03374733811 = takeFee(paymentAmountRaw, inFee)
782+ let paymentAmount = $t03374733811._1
783+ let feeAmount = $t03374733811._2
774784 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
775785 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
776786 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
777787 let priceNew = fromX18(priceNewX18, scale8)
778788 let paymentBalance = if (paymentInAmountAsset)
779789 then amountBalanceOld
780790 else priceBalanceOld
781791 let paymentBalanceBigInt = toBigInt(paymentBalance)
782792 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
783793 let chechSupply = if ((supplyBigInt > big0))
784794 then true
785795 else throwErr("initial deposit requires all coins")
786796 if ((chechSupply == chechSupply))
787797 then {
788798 let depositBigInt = toBigInt(paymentAmount)
789799 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
790800 let commonState = if (isEval)
791801 then nil
792802 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))]
793803 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
794804 let priceOld = fromX18(priceOldX18, scale8)
795805 let loss = {
796- let $t03517935346 = if (paymentInAmountAsset)
806+ let $t03549235659 = if (paymentInAmountAsset)
797807 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
798808 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
799- let amount = $t03517935346._1
800- let balance = $t03517935346._2
809+ let amount = $t03549235659._1
810+ let balance = $t03549235659._2
801811 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
802812 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
803813 }
804814 $Tuple5(issueAmount, commonState, feeAmount, loss, paymentInAmountAsset)
805815 }
806816 else throw("Strict value is not equal to itself.")
807817 }
808818
809819
810820 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
811821 let isEval = (txId == unit)
812822 let cfg = getPoolConfig()
813823 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
814824 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
815825 let checks = [if ((paymentAssetId == cfgLpAssetId))
816826 then true
817827 else throwErr("invalid lp asset")]
818828 if ((checks == checks))
819829 then {
820830 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
821831 then true
822832 else if ((outAssetId == cfgPriceAssetId))
823833 then false
824834 else throwErr("invalid asset")
825835 let balanceBigInt = if (outInAmountAsset)
826836 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
827837 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
828838 let outInAmountAssetDecimals = if (outInAmountAsset)
829839 then amtAssetDcm
830840 else priceAssetDcm
831841 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
832842 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
833843 let outBalance = if (outInAmountAsset)
834844 then amBalanceOld
835845 else prBalanceOld
836846 let outBalanceBigInt = toBigInt(outBalance)
837847 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
838848 let redeemedBigInt = toBigInt(paymentAmount)
839849 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
840- let $t03742437480 = takeFee(amountRaw, outFee)
841- let totalAmount = $t03742437480._1
842- let feeAmount = $t03742437480._2
843- let $t03748437710 = if (outInAmountAsset)
850+ let $t03773737793 = takeFee(amountRaw, outFee)
851+ let totalAmount = $t03773737793._1
852+ let feeAmount = $t03773737793._2
853+ let $t03779738023 = if (outInAmountAsset)
844854 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
845855 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
846- let outAmAmount = $t03748437710._1
847- let outPrAmount = $t03748437710._2
848- let amBalanceNew = $t03748437710._3
849- let prBalanceNew = $t03748437710._4
856+ let outAmAmount = $t03779738023._1
857+ let outPrAmount = $t03779738023._2
858+ let amBalanceNew = $t03779738023._3
859+ let prBalanceNew = $t03779738023._4
850860 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
851861 let priceNew = fromX18(priceNewX18, scale8)
852862 let commonState = if (isEval)
853863 then nil
854864 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)]
855865 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
856866 let priceOld = fromX18(priceOldX18, scale8)
857867 let loss = {
858868 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
859869 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
860870 }
861871 $Tuple5(totalAmount, commonState, feeAmount, loss, outInAmountAsset)
862872 }
863873 else throw("Strict value is not equal to itself.")
864874 }
865875
866876
867877 func managerPublicKeyOrUnit () = {
868878 let managerVaultAddress = getManagerVaultAddressOrThis()
869879 match getString(managerVaultAddress, keyManagerPublicKey()) {
870880 case s: String =>
871881 fromBase58String(s)
872882 case _: Unit =>
873883 unit
874884 case _ =>
875885 throw("Match error")
876886 }
877887 }
878888
879889
880890 func isManager (i) = match managerPublicKeyOrUnit() {
881891 case pk: ByteVector =>
882892 (i.callerPublicKey == pk)
883893 case _: Unit =>
884894 (i.caller == this)
885895 case _ =>
886896 throw("Match error")
887897 }
888898
889899
890900 func mustManager (i) = {
891901 let pd = throw("Permission denied")
892902 match managerPublicKeyOrUnit() {
893903 case pk: ByteVector =>
894904 if ((i.callerPublicKey == pk))
895905 then true
896906 else pd
897907 case _: Unit =>
898908 if ((i.caller == this))
899909 then true
900910 else pd
901911 case _ =>
902912 throw("Match error")
903913 }
904914 }
905915
906916
907917 @Callable(i)
908918 func rebalance () = (rebalanceAsset(getStringOrFail(this, aa())) ++ rebalanceAsset(getStringOrFail(this, pa())))
909919
910920
911921
912922 @Callable(i)
913923 func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = {
914- let $t03956839873 = if ((isReverse == false))
924+ let $t03988140186 = if ((isReverse == false))
915925 then {
916926 let assetOut = getStringOrFail(this, pa())
917927 let assetIn = getStringOrFail(this, aa())
918928 $Tuple2(assetOut, assetIn)
919929 }
920930 else {
921931 let assetOut = getStringOrFail(this, aa())
922932 let assetIn = getStringOrFail(this, pa())
923933 $Tuple2(assetOut, assetIn)
924934 }
925- let assetOut = $t03956839873._1
926- let assetIn = $t03956839873._2
935+ let assetOut = $t03988140186._1
936+ let assetIn = $t03988140186._2
927937 let poolAssetInBalance = getAccBalance(assetIn)
928938 let poolAssetOutBalance = getAccBalance(assetOut)
929939 let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
930940 let oldK = (toBigInt(poolAssetInBalance) * toBigInt(poolAssetOutBalance))
931941 let newK = (((toBigInt(getAccBalance(assetIn)) + toBigInt(cleanAmountIn)) + toBigInt(feePoolAmount)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
932942 let checkK = if ((newK >= oldK))
933943 then true
934944 else throw("new K is fewer error")
935945 if ((checkK == checkK))
936946 then $Tuple2(nil, amountOut)
937947 else throw("Strict value is not equal to itself.")
938948 }
939949
940950
941951
942952 @Callable(i)
943953 func calculateAmountOutForSwapAndSendTokens (cleanAmountIn,isReverse,amountOutMin,addressTo,feePoolAmount) = {
944954 let swapContact = {
945955 let @ = invoke(factoryContract, "getSwapContractREADONLY", nil, nil)
946956 if ($isInstanceOf(@, "String"))
947957 then @
948958 else throw(($getType(@) + " couldn't be cast to String"))
949959 }
950960 let isPoolSwapDisabled = {
951961 let @ = invoke(factoryContract, "isPoolSwapDisabledREADONLY", [toString(this)], nil)
952962 if ($isInstanceOf(@, "Boolean"))
953963 then @
954964 else throw(($getType(@) + " couldn't be cast to Boolean"))
955965 }
956- let isSwapDisabled = if (if (isGlobalShutdown())
957- then true
958- else (cfgPoolStatus == PoolShutdown))
959- then true
960- else isPoolSwapDisabled
966+ let isSwapDisabled = if (!(isAddressWhitelisted(i.caller)))
967+ then if (if (isGlobalShutdown())
968+ then true
969+ else (cfgPoolStatus == PoolShutdown))
970+ then true
971+ else isPoolSwapDisabled
972+ else false
961973 let checks = [if (if (!(isSwapDisabled))
962974 then true
963975 else isManager(i))
964976 then true
965977 else throwErr("swap operation is blocked by admin"), if ((value(i.payments[0]).amount >= cleanAmountIn))
966978 then true
967979 else throwErr("Wrong amount"), if ((i.caller == addressFromStringValue(swapContact)))
968980 then true
969981 else throwErr("Permission denied")]
970982 if ((checks == checks))
971983 then {
972984 let pmt = value(i.payments[0])
973985 let assetIn = assetIdToString(pmt.assetId)
974986 let assetOut = if ((isReverse == false))
975987 then getStringOrFail(this, pa())
976988 else getStringOrFail(this, aa())
977989 let poolAssetInBalance = ((getAccBalance(assetIn) - value(i.payments[0]).amount) - feePoolAmount)
978990 let poolAssetOutBalance = getAccBalance(assetOut)
979991 let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
980992 let oldK = (toBigInt(poolAssetInBalance) * toBigInt(poolAssetOutBalance))
981993 let newK = ((toBigInt(getAccBalance(assetIn)) + toBigInt(feePoolAmount)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
982994 let checkK = if ((newK >= oldK))
983995 then true
984996 else throw("new K is fewer error")
985997 if ((checkK == checkK))
986998 then {
987999 let checkMin = if ((amountOut >= amountOutMin))
9881000 then true
9891001 else throw("Exchange result is fewer coins than expected")
9901002 if ((checkMin == checkMin))
9911003 then {
9921004 let amountAssetBalanceDelta = if (isReverse)
9931005 then -(amountOut)
9941006 else feePoolAmount
9951007 let priceAssetBalanceDelta = if (isReverse)
9961008 then feePoolAmount
9971009 else -(amountOut)
9981010 let refreshKLpActions = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)._1
9991011 if ((refreshKLpActions == refreshKLpActions))
10001012 then {
10011013 let rebalanceState = rebalanceAsset(assetIn)
10021014 if ((rebalanceState == rebalanceState))
10031015 then {
10041016 let withdrawState = withdrawAndRebalanceAsset(assetOut, amountOut)
10051017 if ((withdrawState == withdrawState))
10061018 then $Tuple2(((withdrawState ++ rebalanceState) ++ [ScriptTransfer(addressFromStringValue(addressTo), amountOut, parseAssetId(assetOut))]), amountOut)
10071019 else throw("Strict value is not equal to itself.")
10081020 }
10091021 else throw("Strict value is not equal to itself.")
10101022 }
10111023 else throw("Strict value is not equal to itself.")
10121024 }
10131025 else throw("Strict value is not equal to itself.")
10141026 }
10151027 else throw("Strict value is not equal to itself.")
10161028 }
10171029 else throw("Strict value is not equal to itself.")
10181030 }
10191031
10201032
10211033
10221034 @Callable(i)
10231035 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
10241036 then throw("Invalid slippageTolerance passed")
10251037 else {
10261038 let estPut = commonPut(i, slippageTolerance, true)
10271039 let emitLpAmt = estPut._2
10281040 let lpAssetId = estPut._7
10291041 let state = estPut._9
10301042 let amDiff = estPut._10
10311043 let prDiff = estPut._11
10321044 let amId = estPut._12
10331045 let prId = estPut._13
10341046 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
10351047 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
10361048 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
10371049 if ((currentKLp == currentKLp))
10381050 then {
10391051 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
10401052 if ((emitInv == emitInv))
10411053 then {
10421054 let emitInvLegacy = match emitInv {
10431055 case legacyFactoryContract: Address =>
10441056 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
10451057 case _ =>
10461058 unit
10471059 }
10481060 if ((emitInvLegacy == emitInvLegacy))
10491061 then {
10501062 let slippageAInv = if ((amDiff > 0))
10511063 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
10521064 else nil
10531065 if ((slippageAInv == slippageAInv))
10541066 then {
10551067 let slippagePInv = if ((prDiff > 0))
10561068 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
10571069 else nil
10581070 if ((slippagePInv == slippagePInv))
10591071 then {
10601072 let lpTransfer = if (shouldAutoStake)
10611073 then {
10621074 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
10631075 if ((slpStakeInv == slpStakeInv))
10641076 then nil
10651077 else throw("Strict value is not equal to itself.")
10661078 }
10671079 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
1068- let $t04500745469 = refreshKLpInternal(0, 0, 0)
1069- if (($t04500745469 == $t04500745469))
1080+ let $t04536245824 = refreshKLpInternal(0, 0, 0)
1081+ if (($t04536245824 == $t04536245824))
10701082 then {
1071- let updatedKLp = $t04500745469._2
1072- let refreshKLpActions = $t04500745469._1
1083+ let updatedKLp = $t04536245824._2
1084+ let refreshKLpActions = $t04536245824._1
10731085 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10741086 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10751087 then {
10761088 let reb = invoke(this, "rebalance", nil, nil)
10771089 if ((reb == reb))
10781090 then ((state ++ lpTransfer) ++ refreshKLpActions)
10791091 else throw("Strict value is not equal to itself.")
10801092 }
10811093 else throw("Strict value is not equal to itself.")
10821094 }
10831095 else throw("Strict value is not equal to itself.")
10841096 }
10851097 else throw("Strict value is not equal to itself.")
10861098 }
10871099 else throw("Strict value is not equal to itself.")
10881100 }
10891101 else throw("Strict value is not equal to itself.")
10901102 }
10911103 else throw("Strict value is not equal to itself.")
10921104 }
10931105 else throw("Strict value is not equal to itself.")
10941106 }
10951107
10961108
10971109
10981110 @Callable(i)
10991111 func putForFree (maxSlippage) = if ((0 > maxSlippage))
11001112 then throw("Invalid value passed")
11011113 else {
11021114 let estPut = commonPut(i, maxSlippage, false)
11031115 let state = estPut._9
11041116 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
11051117 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
11061118 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
11071119 if ((currentKLp == currentKLp))
11081120 then {
1109- let $t04608146146 = refreshKLpInternal(0, 0, 0)
1110- let refreshKLpActions = $t04608146146._1
1111- let updatedKLp = $t04608146146._2
1121+ let $t04643646501 = refreshKLpInternal(0, 0, 0)
1122+ let refreshKLpActions = $t04643646501._1
1123+ let updatedKLp = $t04643646501._2
11121124 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11131125 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11141126 then (state ++ refreshKLpActions)
11151127 else throw("Strict value is not equal to itself.")
11161128 }
11171129 else throw("Strict value is not equal to itself.")
11181130 }
11191131
11201132
11211133
11221134 @Callable(i)
11231135 func putOneTkn (minOutAmount,autoStake) = {
11241136 let isPoolOneTokenOperationsDisabled = {
11251137 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
11261138 if ($isInstanceOf(@, "Boolean"))
11271139 then @
11281140 else throw(($getType(@) + " couldn't be cast to Boolean"))
11291141 }
1130- let isPutDisabled = if (if (if (isGlobalShutdown())
1131- then true
1132- else (cfgPoolStatus == PoolPutDisabled))
1133- then true
1134- else (cfgPoolStatus == PoolShutdown))
1135- then true
1136- else isPoolOneTokenOperationsDisabled
1142+ let isPutDisabled = if (!(isAddressWhitelisted(i.caller)))
1143+ then if (if (if (isGlobalShutdown())
1144+ then true
1145+ else (cfgPoolStatus == PoolPutDisabled))
1146+ then true
1147+ else (cfgPoolStatus == PoolShutdown))
1148+ then true
1149+ else isPoolOneTokenOperationsDisabled
1150+ else false
11371151 let checks = [if (if (!(isPutDisabled))
11381152 then true
11391153 else isManager(i))
11401154 then true
11411155 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
11421156 then true
11431157 else throwErr("exactly 1 payment are expected")]
11441158 if ((checks == checks))
11451159 then {
11461160 let payment = i.payments[0]
11471161 let paymentAssetId = payment.assetId
11481162 let paymentAmountRaw = payment.amount
11491163 let currentKLp = if ((paymentAssetId == cfgAmountAssetId))
11501164 then calcCurrentKLp(toBigInt(paymentAmountRaw), toBigInt(0), toBigInt(0))
11511165 else if ((paymentAssetId == cfgPriceAssetId))
11521166 then calcCurrentKLp(toBigInt(0), toBigInt(paymentAmountRaw), toBigInt(0))
11531167 else throwErr("payment asset is not supported")
11541168 if ((currentKLp == currentKLp))
11551169 then {
11561170 let userAddress = i.caller
11571171 let txId = i.transactionId
1158- let $t04733447486 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1159- if (($t04733447486 == $t04733447486))
1172+ let $t04773047882 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1173+ if (($t04773047882 == $t04773047882))
11601174 then {
1161- let paymentInAmountAsset = $t04733447486._5
1162- let bonus = $t04733447486._4
1163- let feeAmount = $t04733447486._3
1164- let commonState = $t04733447486._2
1165- let emitAmountEstimated = $t04733447486._1
1175+ let paymentInAmountAsset = $t04773047882._5
1176+ let bonus = $t04773047882._4
1177+ let feeAmount = $t04773047882._3
1178+ let commonState = $t04773047882._2
1179+ let emitAmountEstimated = $t04773047882._1
11661180 let emitAmount = if (if ((minOutAmount > 0))
11671181 then (minOutAmount > emitAmountEstimated)
11681182 else false)
11691183 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
11701184 else emitAmountEstimated
11711185 let emitInv = emit(emitAmount)
11721186 if ((emitInv == emitInv))
11731187 then {
11741188 let lpTransfer = if (autoStake)
11751189 then {
11761190 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
11771191 if ((stakeInv == stakeInv))
11781192 then nil
11791193 else throw("Strict value is not equal to itself.")
11801194 }
11811195 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
11821196 let sendFee = if ((feeAmount > 0))
11831197 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
11841198 else nil
1185- let $t04807248269 = if ((this == feeCollectorAddress))
1199+ let $t04846848665 = if ((this == feeCollectorAddress))
11861200 then $Tuple2(0, 0)
11871201 else if (paymentInAmountAsset)
11881202 then $Tuple2(-(feeAmount), 0)
11891203 else $Tuple2(0, -(feeAmount))
1190- let amountAssetBalanceDelta = $t04807248269._1
1191- let priceAssetBalanceDelta = $t04807248269._2
1192- let $t04827248380 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1193- let refreshKLpActions = $t04827248380._1
1194- let updatedKLp = $t04827248380._2
1204+ let amountAssetBalanceDelta = $t04846848665._1
1205+ let priceAssetBalanceDelta = $t04846848665._2
1206+ let $t04866848776 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1207+ let refreshKLpActions = $t04866848776._1
1208+ let updatedKLp = $t04866848776._2
11951209 let kLp = value(getString(keyKLp))
11961210 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11971211 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11981212 then {
11991213 let reb = invoke(this, "rebalance", nil, nil)
12001214 if ((reb == reb))
12011215 then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
12021216 else throw("Strict value is not equal to itself.")
12031217 }
12041218 else throw("Strict value is not equal to itself.")
12051219 }
12061220 else throw("Strict value is not equal to itself.")
12071221 }
12081222 else throw("Strict value is not equal to itself.")
12091223 }
12101224 else throw("Strict value is not equal to itself.")
12111225 }
12121226 else throw("Strict value is not equal to itself.")
12131227 }
12141228
12151229
12161230
12171231 @Callable(i)
12181232 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
1219- let $t04873548892 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1220- let emitAmountEstimated = $t04873548892._1
1221- let commonState = $t04873548892._2
1222- let feeAmount = $t04873548892._3
1223- let bonus = $t04873548892._4
1224- let paymentInAmountAsset = $t04873548892._5
1233+ let $t04913149288 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1234+ let emitAmountEstimated = $t04913149288._1
1235+ let commonState = $t04913149288._2
1236+ let feeAmount = $t04913149288._3
1237+ let bonus = $t04913149288._4
1238+ let paymentInAmountAsset = $t04913149288._5
12251239 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
12261240 }
12271241
12281242
12291243
12301244 @Callable(i)
12311245 func getOneTkn (outAssetIdStr,minOutAmount) = {
12321246 let isPoolOneTokenOperationsDisabled = {
12331247 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
12341248 if ($isInstanceOf(@, "Boolean"))
12351249 then @
12361250 else throw(($getType(@) + " couldn't be cast to Boolean"))
12371251 }
1238- let isGetDisabled = if (if (isGlobalShutdown())
1239- then true
1240- else (cfgPoolStatus == PoolShutdown))
1241- then true
1242- else isPoolOneTokenOperationsDisabled
1252+ let isGetDisabled = if (!(isAddressWhitelisted(i.caller)))
1253+ then if (if (isGlobalShutdown())
1254+ then true
1255+ else (cfgPoolStatus == PoolShutdown))
1256+ then true
1257+ else isPoolOneTokenOperationsDisabled
1258+ else false
12431259 let checks = [if (if (!(isGetDisabled))
12441260 then true
12451261 else isManager(i))
12461262 then true
12471263 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
12481264 then true
12491265 else throwErr("exactly 1 payment are expected")]
12501266 if ((checks == checks))
12511267 then {
12521268 let outAssetId = parseAssetId(outAssetIdStr)
12531269 let payment = i.payments[0]
12541270 let paymentAssetId = payment.assetId
12551271 let paymentAmount = payment.amount
12561272 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
12571273 if ((currentKLp == currentKLp))
12581274 then {
12591275 let userAddress = i.caller
12601276 let txId = i.transactionId
1261- let $t04977749930 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1262- if (($t04977749930 == $t04977749930))
1277+ let $t05021050363 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1278+ if (($t05021050363 == $t05021050363))
12631279 then {
1264- let outInAmountAsset = $t04977749930._5
1265- let bonus = $t04977749930._4
1266- let feeAmount = $t04977749930._3
1267- let commonState = $t04977749930._2
1268- let amountEstimated = $t04977749930._1
1280+ let outInAmountAsset = $t05021050363._5
1281+ let bonus = $t05021050363._4
1282+ let feeAmount = $t05021050363._3
1283+ let commonState = $t05021050363._2
1284+ let amountEstimated = $t05021050363._1
12691285 let amount = if (if ((minOutAmount > 0))
12701286 then (minOutAmount > amountEstimated)
12711287 else false)
12721288 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
12731289 else amountEstimated
12741290 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
12751291 if ((burnInv == burnInv))
12761292 then {
12771293 let withdrawState = withdrawAndRebalanceAsset(outAssetIdStr, (amount + max([0, feeAmount])))
12781294 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
12791295 let sendFee = if ((feeAmount > 0))
12801296 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
12811297 else nil
1282- let $t05059450841 = {
1298+ let $t05102751274 = {
12831299 let feeAmountForCalc = if ((this == feeCollectorAddress))
12841300 then 0
12851301 else feeAmount
12861302 if (outInAmountAsset)
12871303 then $Tuple2(-((amount + feeAmountForCalc)), 0)
12881304 else $Tuple2(0, -((amount + feeAmountForCalc)))
12891305 }
1290- let amountAssetBalanceDelta = $t05059450841._1
1291- let priceAssetBalanceDelta = $t05059450841._2
1292- let $t05084450952 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1293- let refreshKLpActions = $t05084450952._1
1294- let updatedKLp = $t05084450952._2
1306+ let amountAssetBalanceDelta = $t05102751274._1
1307+ let priceAssetBalanceDelta = $t05102751274._2
1308+ let $t05127751385 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1309+ let refreshKLpActions = $t05127751385._1
1310+ let updatedKLp = $t05127751385._2
12951311 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12961312 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12971313 then $Tuple2(((((commonState ++ withdrawState) ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
12981314 else throw("Strict value is not equal to itself.")
12991315 }
13001316 else throw("Strict value is not equal to itself.")
13011317 }
13021318 else throw("Strict value is not equal to itself.")
13031319 }
13041320 else throw("Strict value is not equal to itself.")
13051321 }
13061322 else throw("Strict value is not equal to itself.")
13071323 }
13081324
13091325
13101326
13111327 @Callable(i)
13121328 func getOneTknREADONLY (outAssetId,paymentAmount) = {
1313- let $t05123051386 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1314- let amountEstimated = $t05123051386._1
1315- let commonState = $t05123051386._2
1316- let feeAmount = $t05123051386._3
1317- let bonus = $t05123051386._4
1318- let outInAmountAsset = $t05123051386._5
1329+ let $t05166351819 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1330+ let amountEstimated = $t05166351819._1
1331+ let commonState = $t05166351819._2
1332+ let feeAmount = $t05166351819._3
1333+ let bonus = $t05166351819._4
1334+ let outInAmountAsset = $t05166351819._5
13191335 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
13201336 }
13211337
13221338
13231339
13241340 @Callable(i)
13251341 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
13261342 let isPoolOneTokenOperationsDisabled = {
13271343 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
13281344 if ($isInstanceOf(@, "Boolean"))
13291345 then @
13301346 else throw(($getType(@) + " couldn't be cast to Boolean"))
13311347 }
1332- let isGetDisabled = if (if (isGlobalShutdown())
1333- then true
1334- else (cfgPoolStatus == PoolShutdown))
1335- then true
1336- else isPoolOneTokenOperationsDisabled
1348+ let isGetDisabled = if (!(isAddressWhitelisted(i.caller)))
1349+ then if (if (isGlobalShutdown())
1350+ then true
1351+ else (cfgPoolStatus == PoolShutdown))
1352+ then true
1353+ else isPoolOneTokenOperationsDisabled
1354+ else false
13371355 let checks = [if (if (!(isGetDisabled))
13381356 then true
13391357 else isManager(i))
13401358 then true
13411359 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
13421360 then true
13431361 else throwErr("no payments are expected")]
13441362 if ((checks == checks))
13451363 then {
13461364 let outAssetId = parseAssetId(outAssetIdStr)
13471365 let userAddress = i.caller
13481366 let txId = i.transactionId
13491367 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
13501368 if ((currentKLp == currentKLp))
13511369 then {
13521370 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
13531371 if ((unstakeInv == unstakeInv))
13541372 then {
1355- let $t05229152442 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1356- if (($t05229152442 == $t05229152442))
1373+ let $t05276152912 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1374+ if (($t05276152912 == $t05276152912))
13571375 then {
1358- let outInAmountAsset = $t05229152442._5
1359- let bonus = $t05229152442._4
1360- let feeAmount = $t05229152442._3
1361- let commonState = $t05229152442._2
1362- let amountEstimated = $t05229152442._1
1376+ let outInAmountAsset = $t05276152912._5
1377+ let bonus = $t05276152912._4
1378+ let feeAmount = $t05276152912._3
1379+ let commonState = $t05276152912._2
1380+ let amountEstimated = $t05276152912._1
13631381 let amount = if (if ((minOutAmount > 0))
13641382 then (minOutAmount > amountEstimated)
13651383 else false)
13661384 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
13671385 else amountEstimated
13681386 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
13691387 if ((burnInv == burnInv))
13701388 then {
13711389 let withdrawState = withdrawAndRebalanceAsset(outAssetIdStr, (amount + max([0, feeAmount])))
13721390 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
13731391 let sendFee = if ((feeAmount > 0))
13741392 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
13751393 else nil
1376- let $t05310153348 = {
1394+ let $t05357153818 = {
13771395 let feeAmountForCalc = if ((this == feeCollectorAddress))
13781396 then 0
13791397 else feeAmount
13801398 if (outInAmountAsset)
13811399 then $Tuple2(-((amount + feeAmountForCalc)), 0)
13821400 else $Tuple2(0, -((amount + feeAmountForCalc)))
13831401 }
1384- let amountAssetBalanceDelta = $t05310153348._1
1385- let priceAssetBalanceDelta = $t05310153348._2
1386- let $t05335153459 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1387- let refreshKLpActions = $t05335153459._1
1388- let updatedKLp = $t05335153459._2
1402+ let amountAssetBalanceDelta = $t05357153818._1
1403+ let priceAssetBalanceDelta = $t05357153818._2
1404+ let $t05382153929 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1405+ let refreshKLpActions = $t05382153929._1
1406+ let updatedKLp = $t05382153929._2
13891407 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
13901408 if ((isUpdatedKLpValid == isUpdatedKLpValid))
13911409 then $Tuple2(((((commonState ++ withdrawState) ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
13921410 else throw("Strict value is not equal to itself.")
13931411 }
13941412 else throw("Strict value is not equal to itself.")
13951413 }
13961414 else throw("Strict value is not equal to itself.")
13971415 }
13981416 else throw("Strict value is not equal to itself.")
13991417 }
14001418 else throw("Strict value is not equal to itself.")
14011419 }
14021420 else throw("Strict value is not equal to itself.")
14031421 }
14041422
14051423
14061424
14071425 @Callable(i)
14081426 func get () = {
14091427 let res = commonGet(i)
14101428 let outAmAmt = res._1
14111429 let outPrAmt = res._2
14121430 let pmtAmt = res._3
14131431 let pmtAssetId = res._4
14141432 let state = res._5
14151433 let withdrawState = withdrawAndRebalanceAll(outAmAmt, outPrAmt)
14161434 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
14171435 if ((currentKLp == currentKLp))
14181436 then {
14191437 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14201438 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14211439 then {
1422- let $t05455454635 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1423- let refreshKLpActions = $t05455454635._1
1424- let updatedKLp = $t05455454635._2
1440+ let $t05502455105 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1441+ let refreshKLpActions = $t05502455105._1
1442+ let updatedKLp = $t05502455105._2
14251443 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14261444 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14271445 then ((withdrawState ++ state) ++ refreshKLpActions)
14281446 else throw("Strict value is not equal to itself.")
14291447 }
14301448 else throw("Strict value is not equal to itself.")
14311449 }
14321450 else throw("Strict value is not equal to itself.")
14331451 }
14341452
14351453
14361454
14371455 @Callable(i)
14381456 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
14391457 let res = commonGet(i)
14401458 let outAmAmt = res._1
14411459 let outPrAmt = res._2
14421460 let pmtAmt = res._3
14431461 let pmtAssetId = res._4
14441462 let state = res._5
14451463 if ((noLessThenAmtAsset > outAmAmt))
14461464 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
14471465 else if ((noLessThenPriceAsset > outPrAmt))
14481466 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
14491467 else {
14501468 let withdrawState = withdrawAndRebalanceAll(outAmAmt, outPrAmt)
14511469 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
14521470 if ((currentKLp == currentKLp))
14531471 then {
14541472 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14551473 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14561474 then {
1457- let $t05573055811 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1458- let refreshKLpActions = $t05573055811._1
1459- let updatedKLp = $t05573055811._2
1475+ let $t05620056281 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1476+ let refreshKLpActions = $t05620056281._1
1477+ let updatedKLp = $t05620056281._2
14601478 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14611479 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14621480 then ((withdrawState ++ state) ++ refreshKLpActions)
14631481 else throw("Strict value is not equal to itself.")
14641482 }
14651483 else throw("Strict value is not equal to itself.")
14661484 }
14671485 else throw("Strict value is not equal to itself.")
14681486 }
14691487 }
14701488
14711489
14721490
14731491 @Callable(i)
14741492 func unstakeAndGet (amount) = {
14751493 let checkPayments = if ((size(i.payments) != 0))
14761494 then throw("No payments are expected")
14771495 else true
14781496 if ((checkPayments == checkPayments))
14791497 then {
14801498 let cfg = getPoolConfig()
14811499 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
14821500 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
14831501 if ((currentKLp == currentKLp))
14841502 then {
14851503 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
14861504 if ((unstakeInv == unstakeInv))
14871505 then {
14881506 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
14891507 let outAmAmt = res._1
14901508 let outPrAmt = res._2
14911509 let poolStatus = parseIntValue(res._9)
14921510 let state = res._10
14931511 let withdrawState = withdrawAndRebalanceAll(outAmAmt, outPrAmt)
1494- let checkPoolStatus = if (if (isGlobalShutdown())
1495- then true
1496- else (poolStatus == PoolShutdown))
1512+ let isGetDisabled = if (!(isAddressWhitelisted(i.caller)))
1513+ then if (isGlobalShutdown())
1514+ then true
1515+ else (cfgPoolStatus == PoolShutdown)
1516+ else false
1517+ let checkPoolStatus = if (isGetDisabled)
14971518 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
14981519 else true
14991520 if ((checkPoolStatus == checkPoolStatus))
15001521 then {
15011522 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
15021523 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15031524 then {
1504- let $t05708357164 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1505- let refreshKLpActions = $t05708357164._1
1506- let updatedKLp = $t05708357164._2
1525+ let $t05762957710 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1526+ let refreshKLpActions = $t05762957710._1
1527+ let updatedKLp = $t05762957710._2
15071528 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15081529 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15091530 then ((withdrawState ++ state) ++ refreshKLpActions)
15101531 else throw("Strict value is not equal to itself.")
15111532 }
15121533 else throw("Strict value is not equal to itself.")
15131534 }
15141535 else throw("Strict value is not equal to itself.")
15151536 }
15161537 else throw("Strict value is not equal to itself.")
15171538 }
15181539 else throw("Strict value is not equal to itself.")
15191540 }
15201541 else throw("Strict value is not equal to itself.")
15211542 }
15221543
15231544
15241545
15251546 @Callable(i)
15261547 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
1527- let isGetDisabled = if (isGlobalShutdown())
1528- then true
1529- else (cfgPoolStatus == PoolShutdown)
1548+ let isGetDisabled = if (!(isAddressWhitelisted(i.caller)))
1549+ then if (isGlobalShutdown())
1550+ then true
1551+ else (cfgPoolStatus == PoolShutdown)
1552+ else false
15301553 let checks = [if (!(isGetDisabled))
15311554 then true
15321555 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
15331556 then true
15341557 else throw("no payments are expected")]
15351558 if ((checks == checks))
15361559 then {
15371560 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
15381561 if ((currentKLp == currentKLp))
15391562 then {
15401563 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
15411564 if ((unstakeInv == unstakeInv))
15421565 then {
15431566 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
15441567 let outAmAmt = res._1
15451568 let outPrAmt = res._2
15461569 let state = res._10
15471570 let withdrawState = withdrawAndRebalanceAll(outAmAmt, outPrAmt)
15481571 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
15491572 then true
15501573 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
15511574 then true
15521575 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
15531576 if ((checkAmounts == checkAmounts))
15541577 then {
15551578 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
15561579 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15571580 then {
1558- let $t05860558686 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1559- let refreshKLpActions = $t05860558686._1
1560- let updatedKLp = $t05860558686._2
1581+ let $t05918859269 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1582+ let refreshKLpActions = $t05918859269._1
1583+ let updatedKLp = $t05918859269._2
15611584 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15621585 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15631586 then ((withdrawState ++ state) ++ refreshKLpActions)
15641587 else throw("Strict value is not equal to itself.")
15651588 }
15661589 else throw("Strict value is not equal to itself.")
15671590 }
15681591 else throw("Strict value is not equal to itself.")
15691592 }
15701593 else throw("Strict value is not equal to itself.")
15711594 }
15721595 else throw("Strict value is not equal to itself.")
15731596 }
15741597 else throw("Strict value is not equal to itself.")
15751598 }
15761599
15771600
15781601
15791602 @Callable(i)
15801603 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
15811604 then throw("permissions denied")
15821605 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
15831606
15841607
15851608
15861609 @Callable(i)
15871610 func refreshKLp () = {
15881611 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0)
15891612 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay))
15901613 then unit
15911614 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
15921615 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
15931616 then {
15941617 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1595- let $t05989059954 = refreshKLpInternal(0, 0, 0)
1596- let kLpUpdateActions = $t05989059954._1
1597- let updatedKLp = $t05989059954._2
1618+ let $t06047360537 = refreshKLpInternal(0, 0, 0)
1619+ let kLpUpdateActions = $t06047360537._1
1620+ let updatedKLp = $t06047360537._2
15981621 let actions = if ((kLp != updatedKLp))
15991622 then kLpUpdateActions
16001623 else throwErr("nothing to refresh")
16011624 $Tuple2(actions, toString(updatedKLp))
16021625 }
16031626 else throw("Strict value is not equal to itself.")
16041627 }
16051628
16061629
16071630
16081631 @Callable(i)
16091632 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
16101633
16111634
16121635
16131636 @Callable(i)
16141637 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
16151638
16161639
16171640
16181641 @Callable(i)
16191642 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
16201643 let prices = calcPrices(amAmt, prAmt, lpAmt)
16211644 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
16221645 }
16231646
16241647
16251648
16261649 @Callable(i)
16271650 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
16281651
16291652
16301653
16311654 @Callable(i)
16321655 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
16331656
16341657
16351658
16361659 @Callable(i)
16371660 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
16381661
16391662
16401663
16411664 @Callable(i)
16421665 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
16431666
16441667
16451668
16461669 @Callable(i)
16471670 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
16481671 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
16491672 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
16501673 }
16511674
16521675
16531676
16541677 @Callable(i)
16551678 func statsREADONLY () = {
16561679 let cfg = getPoolConfig()
16571680 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
16581681 let amtAssetId = cfg[idxAmtAssetId]
16591682 let priceAssetId = cfg[idxPriceAssetId]
16601683 let iAmtAssetId = cfg[idxIAmtAssetId]
16611684 let iPriceAssetId = cfg[idxIPriceAssetId]
16621685 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
16631686 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
16641687 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
16651688 let accAmtAssetBalance = getAccBalance(amtAssetId)
16661689 let accPriceAssetBalance = getAccBalance(priceAssetId)
16671690 let pricesList = if ((poolLPBalance == 0))
16681691 then [zeroBigInt, zeroBigInt, zeroBigInt]
16691692 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
16701693 let curPrice = 0
16711694 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
16721695 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
16731696 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
16741697 $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))
16751698 }
16761699
16771700
16781701
16791702 @Callable(i)
16801703 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
16811704 let cfg = getPoolConfig()
16821705 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
16831706 let amAssetIdStr = cfg[idxAmtAssetId]
16841707 let amAssetId = fromBase58String(amAssetIdStr)
16851708 let prAssetIdStr = cfg[idxPriceAssetId]
16861709 let prAssetId = fromBase58String(prAssetIdStr)
16871710 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
16881711 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
16891712 let poolStatus = cfg[idxPoolStatus]
16901713 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
16911714 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
16921715 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
16931716 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
16941717 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
16951718 let curPriceX18 = if ((poolLPBalance == 0))
16961719 then zeroBigInt
16971720 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
16981721 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
16991722 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
17001723 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
17011724 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
17021725 let calcLpAmt = estPut._1
17031726 let curPriceCalc = estPut._3
17041727 let amBalance = estPut._4
17051728 let prBalance = estPut._5
17061729 let lpEmission = estPut._6
17071730 $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))
17081731 }
17091732
17101733
17111734
17121735 @Callable(i)
17131736 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
17141737 let cfg = getPoolConfig()
17151738 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
17161739 let amAssetIdStr = cfg[idxAmtAssetId]
17171740 let amAssetId = fromBase58String(amAssetIdStr)
17181741 let prAssetIdStr = cfg[idxPriceAssetId]
17191742 let prAssetId = fromBase58String(prAssetIdStr)
17201743 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
17211744 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
17221745 let poolStatus = cfg[idxPoolStatus]
17231746 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
17241747 let amBalanceRaw = getAccBalance(amAssetIdStr)
17251748 let prBalanceRaw = getAccBalance(prAssetIdStr)
17261749 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
17271750 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
17281751 let curPriceX18 = if ((poolLPBalance == 0))
17291752 then zeroBigInt
17301753 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
17311754 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
17321755 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
17331756 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
17341757 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
17351758 let calcLpAmt = estPut._1
17361759 let curPriceCalc = estPut._3
17371760 let amBalance = estPut._4
17381761 let prBalance = estPut._5
17391762 let lpEmission = estPut._6
17401763 $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))
17411764 }
17421765
17431766
17441767
17451768 @Callable(i)
17461769 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
17471770 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
17481771 let outAmAmt = res._1
17491772 let outPrAmt = res._2
17501773 let amBalance = res._5
17511774 let prBalance = res._6
17521775 let lpEmission = res._7
17531776 let curPrice = res._8
17541777 let poolStatus = parseIntValue(res._9)
17551778 $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))
17561779 }
17571780
17581781
17591782 @Verifier(tx)
17601783 func verify () = {
17611784 let targetPublicKey = match managerPublicKeyOrUnit() {
17621785 case pk: ByteVector =>
17631786 pk
17641787 case _: Unit =>
17651788 tx.senderPublicKey
17661789 case _ =>
17671790 throw("Match error")
17681791 }
17691792 match tx {
17701793 case order: Order =>
17711794 let matcherPub = getMatcherPubOrFail()
1772- let $t06861668733 = if (skipOrderValidation())
1795+ let $t06919969316 = if (skipOrderValidation())
17731796 then $Tuple2(true, "")
17741797 else validateMatcherOrderAllowed(order)
1775- let orderValid = $t06861668733._1
1776- let orderValidInfo = $t06861668733._2
1798+ let orderValid = $t06919969316._1
1799+ let orderValidInfo = $t06919969316._2
17771800 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
17781801 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
17791802 if (if (if (orderValid)
17801803 then senderValid
17811804 else false)
17821805 then matcherValid
17831806 else false)
17841807 then true
17851808 else throwOrderError(orderValid, orderValidInfo, senderValid, matcherValid)
17861809 case s: SetScriptTransaction =>
17871810 if (sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey))
17881811 then true
17891812 else {
17901813 let newHash = blake2b256(value(s.script))
17911814 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
17921815 let currentHash = scriptHash(this)
17931816 if ((allowedHash == newHash))
17941817 then (currentHash != newHash)
17951818 else false
17961819 }
17971820 case _ =>
17981821 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
17991822 }
18001823 }
18011824

github/deemru/w8io/026f985 
1173.42 ms