tx · HrUNq8fAZmz84rG89pdDkgQ1Q7ng9kB4imWr4FPrDzNR

3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT:  -0.04200000 Waves

2023.10.16 18:12 [2801335] smart account 3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT > SELF 0.00000000 Waves

{ "type": 13, "id": "HrUNq8fAZmz84rG89pdDkgQ1Q7ng9kB4imWr4FPrDzNR", "fee": 4200000, "feeAssetId": null, "timestamp": 1697469104964, "version": 2, "chainId": 84, "sender": "3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT", "senderPublicKey": "D1BL65meykxFZTCuq7jq9HSGLLnWvQamQPUNrguW5w39", "proofs": [ "HuwMroEMJ7XijGCtVbjoNggB422bdBRCck8zEkMew2VnPgDxiVPWgTQgCAeVqaBDoR3UKYet12214yjSZWr6qSg" ], "script": "base64:BgLnLQgCEgUKAwEEARIHCgUBBAEIARIDCgEIEgQKAgEEEgQKAgEEEgMKAQESABIECgIIARIAEgQKAggBEgQKAggBEgQKAgEBEgMKAQESBQoDAQEBEgUKAwEIARIECgIBCBIECgIBCBIECgIICBIAEgMKAQgSBQoDAQEBEgQKAggBEgQKAgEBEgQKAggIEgsKCQgBAQIBAggEBBIGCgQICAEIEgAiBnNjYWxlOCIMc2NhbGU4QmlnSW50IgdzY2FsZTE4Igp6ZXJvQmlnSW50IgRiaWcwIgRiaWcxIgRiaWcyIgRiaWczIgRiaWc0IgpzbGlwcGFnZTREIgt3YXZlc1N0cmluZyIKYW1wSW5pdGlhbCIFQW11bHQiBURjb252IgNTRVAiBUVNUFRZIgpQb29sQWN0aXZlIgpQb29sUHV0RGlzIg5Qb29sTWF0Y2hlckRpcyIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyIJaWR4UG9vbFN0IglpZHhMUEFzSWQiCWlkeEFtQXNJZCIJaWR4UHJBc0lkIgtpZHhBbXRBc0RjbSINaWR4UHJpY2VBc0RjbSILaWR4SUFtdEFzSWQiDWlkeElQ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AmFRAgpCeXRlVmVjdG9yBAJnQQUCYVEFAmdBAwkAAQIFAmFRAgRVbml0CAUCaUEPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IEAmFRBQJpQQMJAAECBQJhUQIFT3JkZXIEAmZqBQJhUQQCaUQJAQJibAAEAmlFAwkBAmdIAAkAlAoCBgIACQECZmkBBQJmagQCYUsIBQJpRQJfMQQCYUwIBQJpRQJfMgQCYU0JAPQDAwgFAmZqCWJvZHlCeXRlcwkAkQMCCAUCZmoGcHJvb2ZzAAAIBQJmag9zZW5kZXJQdWJsaWNLZXkEAmFOCQD0AwMIBQJmaglib2R5Qnl0ZXMJAJEDAggFAmZqBnByb29mcwABBQJpRAMDAwUCYUsFAmFNBwUCYU4HBgkBAmFKBAUCYUsFAmFMBQJhTQUCYU4DCQABAgUCYVECFFNldFNjcmlwdFRyYW5zYWN0aW9uBAJhVgUCYVEDCQD0AwMIBQJpQQlib2R5Qnl0ZXMJAJEDAggFAmlBBnByb29mcwAABQJpQwYEAmlGCQD2AwEJAQV2YWx1ZQEIBQJhVgZzY3JpcHQEAmlHCQDbBAEJAQV2YWx1ZQEJAJ0IAgUCYVUJAQJhRgAEAmlICQDxBwEFBHRoaXMDCQAAAgUCaUcFAmlGCQECIT0CBQJpSAUCaUYHCQD0AwMIBQJpQQlib2R5Qnl0ZXMJAJEDAggFAmlBBnByb29mcwAABQJpQ1Wa7u0=", "height": 2801335, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: JFbdagHpBNy3qRjSWLENLoGQgGKW4W16TfJTNB2LHPQ Next: JE4VCLxAAGMMytb8XvE6qdxJqUwyExphP8WupXH7WsLD Diff:
OldNewDifferences
229229 else throw(($getType(@) + " couldn't be cast to Int"))
230230 }
231231
232+func keyAddressWhitelisted (address) = makeString(["%s%s", "whitelisted", toString(address)], SEP)
233+
234+
235+func isAddressWhitelisted (address) = valueOrElse(getBoolean(fca, keyAddressWhitelisted(address)), false)
236+
237+
232238 let A = strf(this, amp())
233239
234240 func igs () = valueOrElse(getBoolean(fca, aps()), false)
263269
264270 let poolConfigParsed = parsePoolConfig(gpc())
265271
266-let $t086088794 = poolConfigParsed
272+let $t088369022 = poolConfigParsed
267273
268-let cfgPoolAddress = $t086088794._1
274+let cfgPoolAddress = $t088369022._1
269275
270-let cfgPoolStatus = $t086088794._2
276+let cfgPoolStatus = $t088369022._2
271277
272-let cfgLpAssetId = $t086088794._3
278+let cfgLpAssetId = $t088369022._3
273279
274-let cfgAmountAssetId = $t086088794._4
280+let cfgAmountAssetId = $t088369022._4
275281
276-let cfgPriceAssetId = $t086088794._5
282+let cfgPriceAssetId = $t088369022._5
277283
278-let cfgAmountAssetDecimals = $t086088794._6
284+let cfgAmountAssetDecimals = $t088369022._6
279285
280-let cfgPriceAssetDecimals = $t086088794._7
286+let cfgPriceAssetDecimals = $t088369022._7
281287
282288 func gfc () = split(strf(fca, fcfg()), SEP)
283289
398404 }
399405
400406 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
401- let $t01329913347 = {
407+ let $t01352713575 = {
402408 let $l = arr
403409 let $s = size($l)
404410 let $acc0 = $Tuple2(s, false)
412418
413419 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17)
414420 }
415- let d = $t01329913347._1
416- let found = $t01329913347._2
421+ let d = $t01352713575._1
422+ let found = $t01352713575._2
417423 if (found)
418424 then d
419425 else throw(("D calculation error, D = " + toString(d)))
464470 let priceDcm = cfgPriceAssetDecimals
465471 let sts = toString(cfgPoolStatus)
466472 let lpEm = valueOrErrorMessage(assetInfo(lpId), "Wr lp as").quantity
467- let amBalance = if (isEval)
468- then getAccBalance(amIdStr)
469- else if (if (isOneAsset)
470- then (pmtId == amIdStr)
471- else false)
472- then (getAccBalance(amIdStr) - pmtAmt)
473- else if (isOneAsset)
473+ let checkAssets = [if (if ((inAmId == parseAssetId(amIdStr)))
474+ then (inPrId == parseAssetId(prIdStr))
475+ else false)
476+ then true
477+ else throwErr("Invalid amt or price asset passed.")]
478+ if ((checkAssets == checkAssets))
479+ then {
480+ let amBalance = if (isEval)
474481 then getAccBalance(amIdStr)
475- else (getAccBalance(amIdStr) - inAmAmt)
476- let prBalance = if (isEval)
477- then getAccBalance(prIdStr)
478- else if (if (isOneAsset)
479- then (pmtId == prIdStr)
480- else false)
481- then (getAccBalance(prIdStr) - pmtAmt)
482- else if (isOneAsset)
482+ else if (if (isOneAsset)
483+ then (pmtId == amIdStr)
484+ else false)
485+ then (getAccBalance(amIdStr) - pmtAmt)
486+ else if (isOneAsset)
487+ then getAccBalance(amIdStr)
488+ else (getAccBalance(amIdStr) - inAmAmt)
489+ let prBalance = if (isEval)
483490 then getAccBalance(prIdStr)
484- else (getAccBalance(prIdStr) - inPrAmt)
485- let inAmAssetAmtX18 = t1(inAmAmt, amtDcm)
486- let inPrAssetAmtX18 = t1(inPrAmt, priceDcm)
487- let userPriceX18 = cpbi(inPrAssetAmtX18, inAmAssetAmtX18)
488- let amBalanceX18 = t1(amBalance, amtDcm)
489- let prBalanceX18 = t1(prBalance, priceDcm)
490- let D0 = getD([amBalanceX18, prBalanceX18])
491- let r = if ((lpEm == 0))
492- then {
493- let D1 = getD([(amBalanceX18 + inAmAssetAmtX18), (prBalanceX18 + inPrAssetAmtX18)])
494- let checkD = if ((D1 > D0))
495- then true
496- else throw("D1 should be greater than D0")
497- if ((checkD == checkD))
491+ else if (if (isOneAsset)
492+ then (pmtId == prIdStr)
493+ else false)
494+ then (getAccBalance(prIdStr) - pmtAmt)
495+ else if (isOneAsset)
496+ then getAccBalance(prIdStr)
497+ else (getAccBalance(prIdStr) - inPrAmt)
498+ let inAmAssetAmtX18 = t1(inAmAmt, amtDcm)
499+ let inPrAssetAmtX18 = t1(inPrAmt, priceDcm)
500+ let userPriceX18 = cpbi(inPrAssetAmtX18, inAmAssetAmtX18)
501+ let amBalanceX18 = t1(amBalance, amtDcm)
502+ let prBalanceX18 = t1(prBalance, priceDcm)
503+ let D0 = getD([amBalanceX18, prBalanceX18])
504+ let r = if ((lpEm == 0))
498505 then {
499- let curPriceX18 = zeroBigInt
500- let slippageX18 = zeroBigInt
501- let lpAmtX18 = D1
502- $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
503- }
504- else throw("Strict value is not equal to itself.")
505- }
506- else {
507- let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
508- let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18)
509- let slippageX18 = t1(slippage, scale8)
510- if (if (if (validateSlippage)
511- then (curPriceX18 != zeroBigInt)
512- else false)
513- then (slippageRealX18 > slippageX18)
514- else false)
515- then throw(((("Price slippage " + toString(slippageRealX18)) + " > ") + toString(slippageX18)))
516- else {
517- let lpEmissionX18 = t1(lpEm, scale8)
518- let prViaAmX18 = fraction(inAmAssetAmtX18, cpbir(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING)
519- let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, cpbir(prBalanceX18, amBalanceX18, FLOOR), CEILING)
520- let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
521- then $Tuple2(amViaPrX18, inPrAssetAmtX18)
522- else $Tuple2(inAmAssetAmtX18, prViaAmX18)
523- let expAmtAssetAmtX18 = expectedAmts._1
524- let expPriceAssetAmtX18 = expectedAmts._2
525- let D1 = getD([(amBalanceX18 + expAmtAssetAmtX18), (prBalanceX18 + expPriceAssetAmtX18)])
506+ let D1 = getD([(amBalanceX18 + inAmAssetAmtX18), (prBalanceX18 + inPrAssetAmtX18)])
526507 let checkD = if ((D1 > D0))
527508 then true
528509 else throw("D1 should be greater than D0")
529510 if ((checkD == checkD))
530511 then {
531- let lpAmtX18 = fraction(lpEmissionX18, (D1 - D0), D0)
532- $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceDcm, CEILING), curPriceX18, slippageX18)
512+ let curPriceX18 = zeroBigInt
513+ let slippageX18 = zeroBigInt
514+ let lpAmtX18 = D1
515+ $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
533516 }
534517 else throw("Strict value is not equal to itself.")
535518 }
519+ else {
520+ let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
521+ let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18)
522+ let slippageX18 = t1(slippage, scale8)
523+ if (if (if (validateSlippage)
524+ then (curPriceX18 != zeroBigInt)
525+ else false)
526+ then (slippageRealX18 > slippageX18)
527+ else false)
528+ then throw(((("Price slippage " + toString(slippageRealX18)) + " > ") + toString(slippageX18)))
529+ else {
530+ let lpEmissionX18 = t1(lpEm, scale8)
531+ let prViaAmX18 = fraction(inAmAssetAmtX18, cpbir(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING)
532+ let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, cpbir(prBalanceX18, amBalanceX18, FLOOR), CEILING)
533+ let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
534+ then $Tuple2(amViaPrX18, inPrAssetAmtX18)
535+ else $Tuple2(inAmAssetAmtX18, prViaAmX18)
536+ let expAmtAssetAmtX18 = expectedAmts._1
537+ let expPriceAssetAmtX18 = expectedAmts._2
538+ let D1 = getD([(amBalanceX18 + expAmtAssetAmtX18), (prBalanceX18 + expPriceAssetAmtX18)])
539+ let checkD = if ((D1 > D0))
540+ then true
541+ else throw("D1 should be greater than D0")
542+ if ((checkD == checkD))
543+ then {
544+ let lpAmtX18 = fraction(lpEmissionX18, (D1 - D0), D0)
545+ $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceDcm, CEILING), curPriceX18, slippageX18)
546+ }
547+ else throw("Strict value is not equal to itself.")
548+ }
549+ }
550+ let calcLpAmt = r._1
551+ let calcAmAssetPmt = r._2
552+ let calcPrAssetPmt = r._3
553+ let curPrice = f1(r._4, scale8)
554+ let slippageCalc = f1(r._5, scale8)
555+ if ((0 >= calcLpAmt))
556+ then throw("LP <= 0")
557+ else {
558+ let emitLpAmt = if (!(emitLp))
559+ then 0
560+ else calcLpAmt
561+ let amDiff = (inAmAmt - calcAmAssetPmt)
562+ let prDiff = (inPrAmt - calcPrAssetPmt)
563+ let $t02149821843 = if (if (isOneAsset)
564+ then (pmtId == amIdStr)
565+ else false)
566+ then $Tuple2(pmtAmt, 0)
567+ else if (if (isOneAsset)
568+ then (pmtId == prIdStr)
569+ else false)
570+ then $Tuple2(0, pmtAmt)
571+ else $Tuple2(calcAmAssetPmt, calcPrAssetPmt)
572+ let writeAmAmt = $t02149821843._1
573+ let writePrAmt = $t02149821843._2
574+ let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId58), dataPutActionInfo(writeAmAmt, writePrAmt, emitLpAmt, curPrice, slippage, slippageCalc, height, lastBlock.timestamp, amDiff, prDiff))]
575+ $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId)
576+ }
536577 }
537- let calcLpAmt = r._1
538- let calcAmAssetPmt = r._2
539- let calcPrAssetPmt = r._3
540- let curPrice = f1(r._4, scale8)
541- let slippageCalc = f1(r._5, scale8)
542- if ((0 >= calcLpAmt))
543- then throw("LP <= 0")
544- else {
545- let emitLpAmt = if (!(emitLp))
546- then 0
547- else calcLpAmt
548- let amDiff = (inAmAmt - calcAmAssetPmt)
549- let prDiff = (inPrAmt - calcPrAssetPmt)
550- let $t02110921454 = if (if (isOneAsset)
551- then (pmtId == amIdStr)
552- else false)
553- then $Tuple2(pmtAmt, 0)
554- else if (if (isOneAsset)
555- then (pmtId == prIdStr)
556- else false)
557- then $Tuple2(0, pmtAmt)
558- else $Tuple2(calcAmAssetPmt, calcPrAssetPmt)
559- let writeAmAmt = $t02110921454._1
560- let writePrAmt = $t02110921454._2
561- let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId58), dataPutActionInfo(writeAmAmt, writePrAmt, emitLpAmt, curPrice, slippage, slippageCalc, height, lastBlock.timestamp, amDiff, prDiff))]
562- $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId)
563- }
578+ else throw("Strict value is not equal to itself.")
564579 }
565580
566581
576591 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
577592 let b = ((s + ((D * aPrecision) / ann)) - D)
578593 func calc (acc,cur) = {
579- let $t02264922669 = acc
580- let y = $t02264922669._1
581- let found = $t02264922669._2
594+ let $t02303823058 = acc
595+ let y = $t02303823058._1
596+ let found = $t02303823058._2
582597 if ((found != unit))
583598 then acc
584599 else {
591606 }
592607
593608 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
594- let $t02297623023 = {
609+ let $t02336523412 = {
595610 let $l = arr
596611 let $s = size($l)
597612 let $acc0 = $Tuple2(D, unit)
605620
606621 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15)
607622 }
608- let y = $t02297623023._1
609- let found = $t02297623023._2
623+ let y = $t02336523412._1
624+ let found = $t02336523412._2
610625 if ((found != unit))
611626 then y
612627 else throw(("Y calculation error, Y = " + toString(y)))
650665 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
651666 let amountAssetAmount = order.amount
652667 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
653- let $t02522125433 = if ((order.orderType == Buy))
668+ let $t02561025822 = if ((order.orderType == Buy))
654669 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
655670 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
656- let amountAssetBalanceDelta = $t02522125433._1
657- let priceAssetBalanceDelta = $t02522125433._2
671+ let amountAssetBalanceDelta = $t02561025822._1
672+ let priceAssetBalanceDelta = $t02561025822._2
658673 if (if (if (igs())
659674 then true
660675 else (cfgPoolStatus == PoolMatcherDis))
667682 then throw("Wr assets")
668683 else {
669684 let dLp = parseBigIntValue(valueOrElse(getString(this, keyDLp), "0"))
670- let $t02577525875 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
671- let unusedActions = $t02577525875._1
672- let dLpNew = $t02577525875._2
685+ let $t02616426264 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
686+ let unusedActions = $t02616426264._1
687+ let dLpNew = $t02616426264._2
673688 let isOrderValid = (dLpNew >= dLp)
674689 let info = makeString(["dLp=", toString(dLp), " dLpNew=", toString(dLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "")
675690 $Tuple2(isOrderValid, info)
688703 let outPrAmt = r._2
689704 let sts = parseIntValue(r._9)
690705 let state = r._10
691- if (if (igs())
692- then true
693- else (sts == PoolShutdown))
706+ let isGetDisabled = if (!(isAddressWhitelisted(i.caller)))
707+ then if (igs())
708+ then true
709+ else (cfgPoolStatus == PoolShutdown)
710+ else false
711+ if (isGetDisabled)
694712 then throw(("Admin blocked: " + toString(sts)))
695713 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
696714 }
699717 func cp (caller,txId,amAsPmt,prAsPmt,slippage,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = {
700718 let r = epo(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, (txId == ""), emitLp, isOneAsset, validateSlippage, pmtAmt, pmtId)
701719 let sts = parseIntValue(r._8)
702- if (if (if (igs())
703- then true
704- else (sts == PoolPutDis))
705- then true
706- else (sts == PoolShutdown))
720+ let isPutDisabled = if (!(isAddressWhitelisted(addressFromStringValue(caller))))
721+ then if (if (igs())
722+ then true
723+ else (cfgPoolStatus == PoolShutdown))
724+ then true
725+ else (cfgPoolStatus == PoolPutDis)
726+ else false
727+ if (isPutDisabled)
707728 then throw(("Blocked:" + toString(sts)))
708729 else r
709730 }
723744 then {
724745 let amBalance = getAccBalance(amId)
725746 let prBalance = getAccBalance(prId)
726- let $t02853128993 = if ((txId == ""))
747+ let $t02912329585 = if ((txId == ""))
727748 then $Tuple2(amBalance, prBalance)
728749 else if ((pmtAssetId == amId))
729750 then if ((pmtAmtRaw > amBalance))
734755 then throw("invalid payment amount")
735756 else $Tuple2(amBalance, (prBalance - pmtAmtRaw))
736757 else throw("wrong pmtAssetId")
737- let amBalanceOld = $t02853128993._1
738- let prBalanceOld = $t02853128993._2
739- let $t02899929175 = if ((pmtAssetId == amId))
758+ let amBalanceOld = $t02912329585._1
759+ let prBalanceOld = $t02912329585._2
760+ let $t02959129767 = if ((pmtAssetId == amId))
740761 then $Tuple2(pmtAmtRaw, 0)
741762 else if ((pmtAssetId == prId))
742763 then $Tuple2(0, pmtAmtRaw)
743764 else throw("invalid payment")
744- let amAmountRaw = $t02899929175._1
745- let prAmountRaw = $t02899929175._2
746- let $t02917929433 = if (withTakeFee)
765+ let amAmountRaw = $t02959129767._1
766+ let prAmountRaw = $t02959129767._2
767+ let $t02977130025 = if (withTakeFee)
747768 then $Tuple3(takeFee(amAmountRaw, inFee)._1, takeFee(prAmountRaw, inFee)._1, takeFee(pmtAmtRaw, inFee)._2)
748769 else $Tuple3(amAmountRaw, prAmountRaw, 0)
749- let amAmount = $t02917929433._1
750- let prAmount = $t02917929433._2
751- let feeAmount = $t02917929433._3
770+ let amAmount = $t02977130025._1
771+ let prAmount = $t02977130025._2
772+ let feeAmount = $t02977130025._3
752773 let amBalanceNew = (amBalanceOld + amAmount)
753774 let prBalanceNew = (prBalanceOld + prAmount)
754775 let D0 = getD([t1(amBalanceOld, cfgAmountAssetDecimals), t1(prBalanceOld, cfgPriceAssetDecimals)])
796817 else {
797818 let amBalance = getAccBalance(amId)
798819 let prBalance = getAccBalance(prId)
799- let $t03154531656 = {
820+ let $t03213732248 = {
800821 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil)
801822 if ($isInstanceOf(@, "(Int, Int)"))
802823 then @
803824 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
804825 }
805- if (($t03154531656 == $t03154531656))
826+ if (($t03213732248 == $t03213732248))
806827 then {
807- let feeAmount = $t03154531656._2
808- let totalGet = $t03154531656._1
828+ let feeAmount = $t03213732248._2
829+ let totalGet = $t03213732248._1
809830 let totalAmount = if (if ((minOutAmount > 0))
810831 then (minOutAmount > totalGet)
811832 else false)
812833 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
813834 else totalGet
814- let $t03184632153 = if ((outAssetId == amId))
835+ let $t03243832745 = if ((outAssetId == amId))
815836 then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance)
816837 else if ((outAssetId == prId))
817838 then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount))
818839 else throw("invalid out asset id")
819- let outAm = $t03184632153._1
820- let outPr = $t03184632153._2
821- let amBalanceNew = $t03184632153._3
822- let prBalanceNew = $t03184632153._4
840+ let outAm = $t03243832745._1
841+ let outPr = $t03243832745._2
842+ let amBalanceNew = $t03243832745._3
843+ let prBalanceNew = $t03243832745._4
823844 let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals))
824845 let curPr = f1(curPrX18, scale8)
825846 let outAssetIdOrWaves = if ((outAssetId == "WAVES"))
834855 let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
835856 if ((burn == burn))
836857 then {
837- let $t03293833288 = {
858+ let $t03353033880 = {
838859 let feeAmountForCalc = if ((this == feeCollectorAddress))
839860 then 0
840861 else feeAmount
845866 then $Tuple2(-((totalGet + feeAmountForCalc)), 0)
846867 else $Tuple2(0, -((totalGet + feeAmountForCalc)))
847868 }
848- let amountAssetBalanceDelta = $t03293833288._1
849- let priceAssetBalanceDelta = $t03293833288._2
850- let $t03329133399 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
851- let refreshDLpActions = $t03329133399._1
852- let updatedDLp = $t03329133399._2
869+ let amountAssetBalanceDelta = $t03353033880._1
870+ let priceAssetBalanceDelta = $t03353033880._2
871+ let $t03388333991 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
872+ let refreshDLpActions = $t03388333991._1
873+ let updatedDLp = $t03388333991._2
853874 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
854875 if ((isUpdatedDLpValid == isUpdatedDLpValid))
855876 then $Tuple2((state ++ refreshDLpActions), totalAmount)
921942 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
922943 let b = ((s + ((D * aPrecision) / ann)) - D)
923944 func calc (acc,cur) = {
924- let $t03488634906 = acc
925- let y = $t03488634906._1
926- let found = $t03488634906._2
945+ let $t03547835498 = acc
946+ let y = $t03547835498._1
947+ let found = $t03547835498._2
927948 if ((found != unit))
928949 then acc
929950 else {
936957 }
937958
938959 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
939- let $t03523735284 = {
960+ let $t03582935876 = {
940961 let $l = arr
941962 let $s = size($l)
942963 let $acc0 = $Tuple2(D, unit)
950971
951972 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15)
952973 }
953- let y = $t03523735284._1
954- let found = $t03523735284._2
974+ let y = $t03582935876._1
975+ let found = $t03582935876._2
955976 if ((found != unit))
956977 then y
957978 else throw(("Y calculation error, Y = " + toString(y)))
963984
964985 @Callable(i)
965986 func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = {
966- let $t03563636060 = if ((isReverse == false))
987+ let $t03622836652 = if ((isReverse == false))
967988 then {
968989 let assetOut = strf(this, pa())
969990 let poolAmountInBalance = (toBigInt(getAccBalance(strf(this, aa()))) + toBigInt(cleanAmountIn))
974995 let poolAmountInBalance = (toBigInt(getAccBalance(strf(this, pa()))) + toBigInt(cleanAmountIn))
975996 $Tuple2(assetOut, poolAmountInBalance)
976997 }
977- let assetOut = $t03563636060._1
978- let poolAmountInBalance = $t03563636060._2
998+ let assetOut = $t03622836652._1
999+ let poolAmountInBalance = $t03622836652._2
9791000 let poolConfig = gpc()
9801001 let amId = poolConfig[idxAmAsId]
9811002 let prId = poolConfig[idxPrAsId]
10121033 then @
10131034 else throw(($getType(@) + " couldn't be cast to Boolean"))
10141035 }
1015- let isSwapDisabled = if (if (igs())
1016- then true
1017- else (cfgPoolStatus == PoolShutdown))
1018- then true
1019- else isPoolSwapDisabled
1036+ let isSwapDisabled = if (!(isAddressWhitelisted(i.caller)))
1037+ then if (if (igs())
1038+ then true
1039+ else (cfgPoolStatus == PoolShutdown))
1040+ then true
1041+ else isPoolSwapDisabled
1042+ else false
10201043 let checks = [if (if (!(isSwapDisabled))
10211044 then true
10221045 else isManager(i))
10301053 then {
10311054 let pmt = value(i.payments[0])
10321055 let assetIn = assetIdToString(pmt.assetId)
1033- let $t03779538189 = if ((isReverse == false))
1056+ let $t03842438818 = if ((isReverse == false))
10341057 then {
10351058 let assetOut = strf(this, pa())
10361059 let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
10411064 let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
10421065 $Tuple2(assetOut, poolAmountInBalance)
10431066 }
1044- let assetOut = $t03779538189._1
1045- let poolAmountInBalance = $t03779538189._2
1067+ let assetOut = $t03842438818._1
1068+ let poolAmountInBalance = $t03842438818._2
10461069 let poolConfig = gpc()
10471070 let amId = poolConfig[idxAmAsId]
10481071 let prId = poolConfig[idxPrAsId]
11581181 else throw("Strict value is not equal to itself.")
11591182 }
11601183 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
1161- let $t04264442786 = refreshDLpInternal(0, 0, 0)
1162- let refreshDLpActions = $t04264442786._1
1163- let updatedDLp = $t04264442786._2
1184+ let $t04327343415 = refreshDLpInternal(0, 0, 0)
1185+ let refreshDLpActions = $t04327343415._1
1186+ let updatedDLp = $t04327343415._2
11641187 let check = if ((updatedDLp >= currentDLp))
11651188 then true
11661189 else throwErr(makeString(["updated DLp lower than current DLp", toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentDLp), toString(updatedDLp), toString(amDiff), toString(prDiff)], " "))
12011224 then @
12021225 else throw(($getType(@) + " couldn't be cast to Boolean"))
12031226 }
1204- let isPutDisabled = if (if (if (igs())
1205- then true
1206- else (cfgPoolStatus == PoolPutDis))
1207- then true
1208- else (cfgPoolStatus == PoolShutdown))
1209- then true
1210- else isPoolOneTokenOperationsDisabled
1227+ let isPutDisabled = if (!(isAddressWhitelisted(i.caller)))
1228+ then if (if (if (igs())
1229+ then true
1230+ else (cfgPoolStatus == PoolPutDis))
1231+ then true
1232+ else (cfgPoolStatus == PoolShutdown))
1233+ then true
1234+ else isPoolOneTokenOperationsDisabled
1235+ else false
12111236 let checks = [if (if (!(isPutDisabled))
12121237 then true
12131238 else isManager(i))
12331258 else calcCurrentDLp(toBigInt(0), toBigInt(pmtAmt), toBigInt(0))
12341259 if ((currentDLp == currentDLp))
12351260 then {
1236- let $t04442744585 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1237- if (($t04442744585 == $t04442744585))
1261+ let $t04509345251 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1262+ if (($t04509345251 == $t04509345251))
12381263 then {
1239- let feeAmount = $t04442744585._3
1240- let state = $t04442744585._2
1241- let estimLP = $t04442744585._1
1264+ let feeAmount = $t04509345251._3
1265+ let state = $t04509345251._2
1266+ let estimLP = $t04509345251._1
12421267 let emitLpAmt = if (if ((minOutAmount > 0))
12431268 then (minOutAmount > estimLP)
12441269 else false)
12661291 let sendFeeToMatcher = if ((feeAmount > 0))
12671292 then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))]
12681293 else nil
1269- let $t04547045819 = if ((this == feeCollectorAddress))
1294+ let $t04613646485 = if ((this == feeCollectorAddress))
12701295 then $Tuple2(0, 0)
12711296 else {
12721297 let paymentInAmountAsset = if ((pmt.assetId == cfgAmountAssetId))
12761301 then $Tuple2(-(feeAmount), 0)
12771302 else $Tuple2(0, -(feeAmount))
12781303 }
1279- let amountAssetBalanceDelta = $t04547045819._1
1280- let priceAssetBalanceDelta = $t04547045819._2
1281- let $t04582245930 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1282- let refreshDLpActions = $t04582245930._1
1283- let updatedDLp = $t04582245930._2
1304+ let amountAssetBalanceDelta = $t04613646485._1
1305+ let priceAssetBalanceDelta = $t04613646485._2
1306+ let $t04648846596 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1307+ let refreshDLpActions = $t04648846596._1
1308+ let updatedDLp = $t04648846596._2
12841309 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
12851310 if ((isUpdatedDLpValid == isUpdatedDLpValid))
12861311 then $Tuple2((((state ++ lpTrnsfr) ++ sendFeeToMatcher) ++ refreshDLpActions), emitLpAmt)
13121337 let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0))
13131338 if ((currentDLp == currentDLp))
13141339 then {
1315- let $t04696047025 = refreshDLpInternal(0, 0, 0)
1316- let refreshDLpActions = $t04696047025._1
1317- let updatedDLp = $t04696047025._2
1340+ let $t04762647691 = refreshDLpInternal(0, 0, 0)
1341+ let refreshDLpActions = $t04762647691._1
1342+ let updatedDLp = $t04762647691._2
13181343 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
13191344 if ((isUpdatedDLpValid == isUpdatedDLpValid))
13201345 then (state ++ refreshDLpActions)
13391364 let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
13401365 if ((b == b))
13411366 then {
1342- let $t04819848280 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1343- let refreshDLpActions = $t04819848280._1
1344- let updatedDLp = $t04819848280._2
1367+ let $t04886448946 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1368+ let refreshDLpActions = $t04886448946._1
1369+ let updatedDLp = $t04886448946._2
13451370 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
13461371 if ((isUpdatedDLpValid == isUpdatedDLpValid))
13471372 then (state ++ refreshDLpActions)
13621387 then @
13631388 else throw(($getType(@) + " couldn't be cast to Boolean"))
13641389 }
1365- let isGetDisabled = if (if (igs())
1366- then true
1367- else (cfgPoolStatus == PoolShutdown))
1368- then true
1369- else isPoolOneTokenOperationsDisabled
1390+ let isGetDisabled = if (!(isAddressWhitelisted(i.caller)))
1391+ then if (if (igs())
1392+ then true
1393+ else (cfgPoolStatus == PoolShutdown))
1394+ then true
1395+ else isPoolOneTokenOperationsDisabled
1396+ else false
13701397 let checks = [if (if (!(isGetDisabled))
13711398 then true
13721399 else isManager(i))
13761403 else throwErr("exactly 1 payment are expected")]
13771404 if ((checks == checks))
13781405 then {
1379- let $t04889849053 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1380- let state = $t04889849053._1
1381- let totalAmount = $t04889849053._2
1406+ let $t04960149756 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1407+ let state = $t04960149756._1
1408+ let totalAmount = $t04960149756._2
13821409 $Tuple2(state, totalAmount)
13831410 }
13841411 else throw("Strict value is not equal to itself.")
13951422 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
13961423 then {
13971424 let dLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyDLp), "0")), fmtErr("invalid dLp"))
1398- let $t04957749641 = refreshDLpInternal(0, 0, 0)
1399- let dLpUpdateActions = $t04957749641._1
1400- let updatedDLp = $t04957749641._2
1425+ let $t05028050344 = refreshDLpInternal(0, 0, 0)
1426+ let dLpUpdateActions = $t05028050344._1
1427+ let updatedDLp = $t05028050344._2
14011428 let actions = if ((dLp != updatedDLp))
14021429 then dLpUpdateActions
14031430 else throwErr("nothing to refresh")
14251452 let newY = getYD(xp, index, D1)
14261453 let dy = (xp[index] - newY)
14271454 let totalGetRaw = max([0, toInt((dy - big1))])
1428- let $t05065150706 = takeFee(totalGetRaw, outFee)
1429- let totalGet = $t05065150706._1
1430- let feeAmount = $t05065150706._2
1455+ let $t05135451409 = takeFee(totalGetRaw, outFee)
1456+ let totalGet = $t05135451409._1
1457+ let feeAmount = $t05135451409._2
14311458 $Tuple2(nil, $Tuple2(totalGet, feeAmount))
14321459 }
14331460
14401467 let lpId = toBase58String(value(cfgLpAssetId))
14411468 let amBalance = getAccBalance(amId)
14421469 let prBalance = getAccBalance(prId)
1443- let $t05108151196 = {
1470+ let $t05178451899 = {
14441471 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil)
14451472 if ($isInstanceOf(@, "(Int, Int)"))
14461473 then @
14471474 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
14481475 }
1449- let totalGet = $t05108151196._1
1450- let feeAmount = $t05108151196._2
1476+ let totalGet = $t05178451899._1
1477+ let feeAmount = $t05178451899._2
14511478 let r = ego("", lpId, lpAssetAmount, this)
14521479 let outAmAmt = r._1
14531480 let outPrAmt = r._2
14811508 let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14821509 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14831510 then {
1484- let $t05236252443 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1485- let refreshDLpActions = $t05236252443._1
1486- let updatedDLp = $t05236252443._2
1511+ let $t05306553146 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1512+ let refreshDLpActions = $t05306553146._1
1513+ let updatedDLp = $t05306553146._2
14871514 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
14881515 if ((isUpdatedDLpValid == isUpdatedDLpValid))
14891516 then (state ++ refreshDLpActions)
15181545 let outPrAmt = r._2
15191546 let sts = parseIntValue(r._9)
15201547 let state = r._10
1521- let v = if (if (igs())
1522- then true
1523- else (sts == PoolShutdown))
1548+ let isGetDisabled = if (!(isAddressWhitelisted(i.caller)))
1549+ then if (igs())
1550+ then true
1551+ else (cfgPoolStatus == PoolShutdown)
1552+ else false
1553+ let v = if (isGetDisabled)
15241554 then throw(("Blocked: " + toString(sts)))
15251555 else true
15261556 if ((v == v))
15281558 let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
15291559 if ((burnA == burnA))
15301560 then {
1531- let $t05347053551 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1532- let refreshDLpActions = $t05347053551._1
1533- let updatedDLp = $t05347053551._2
1561+ let $t05425654337 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1562+ let refreshDLpActions = $t05425654337._1
1563+ let updatedDLp = $t05425654337._2
15341564 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
15351565 if ((isUpdatedDLpValid == isUpdatedDLpValid))
15361566 then (state ++ refreshDLpActions)
15511581
15521582 @Callable(i)
15531583 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
1554- let isGetDisabled = if (igs())
1555- then true
1556- else (cfgPoolStatus == PoolShutdown)
1584+ let isGetDisabled = if (!(isAddressWhitelisted(i.caller)))
1585+ then if (igs())
1586+ then true
1587+ else (cfgPoolStatus == PoolShutdown)
1588+ else false
15571589 let checks = [if (!(isGetDisabled))
15581590 then true
15591591 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
15811613 let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
15821614 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15831615 then {
1584- let $t05480254883 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1585- let refreshDLpActions = $t05480254883._1
1586- let updatedDLp = $t05480254883._2
1616+ let $t05562555706 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1617+ let refreshDLpActions = $t05562555706._1
1618+ let updatedDLp = $t05562555706._2
15871619 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
15881620 if ((isUpdatedDLpValid == isUpdatedDLpValid))
15891621 then (state ++ refreshDLpActions)
16101642 then @
16111643 else throw(($getType(@) + " couldn't be cast to Boolean"))
16121644 }
1613- let isGetDisabled = if (if (igs())
1614- then true
1615- else (cfgPoolStatus == PoolShutdown))
1616- then true
1617- else isPoolOneTokenOperationsDisabled
1645+ let isGetDisabled = if (!(isAddressWhitelisted(i.caller)))
1646+ then if (if (igs())
1647+ then true
1648+ else (cfgPoolStatus == PoolShutdown))
1649+ then true
1650+ else isPoolOneTokenOperationsDisabled
1651+ else false
16181652 let checks = [if (if (!(isGetDisabled))
16191653 then true
16201654 else isManager(i))
16321666 let unstakeInv = invoke(staking, "unstakeINTERNAL", [lpAssetId, unstakeAmount, userAddress.bytes, lpAssetRecipientAddress.bytes], nil)
16331667 if ((unstakeInv == unstakeInv))
16341668 then {
1635- let $t05590556093 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1636- let state = $t05590556093._1
1637- let totalAmount = $t05590556093._2
1669+ let $t05676556953 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1670+ let state = $t05676556953._1
1671+ let totalAmount = $t05676556953._2
16381672 $Tuple2(state, totalAmount)
16391673 }
16401674 else throw("Strict value is not equal to itself.")
16461680
16471681 @Callable(i)
16481682 func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = {
1649- let $t05622156324 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1650- let lpAmount = $t05622156324._1
1651- let state = $t05622156324._2
1652- let feeAmount = $t05622156324._3
1653- let bonus = $t05622156324._4
1683+ let $t05708157184 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1684+ let lpAmount = $t05708157184._1
1685+ let state = $t05708157184._2
1686+ let feeAmount = $t05708157184._3
1687+ let bonus = $t05708157184._4
16541688 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
16551689 }
16561690
16581692
16591693 @Callable(i)
16601694 func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = {
1661- let $t05647256576 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1662- let lpAmount = $t05647256576._1
1663- let state = $t05647256576._2
1664- let feeAmount = $t05647256576._3
1665- let bonus = $t05647256576._4
1695+ let $t05733257436 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1696+ let lpAmount = $t05733257436._1
1697+ let state = $t05733257436._2
1698+ let feeAmount = $t05733257436._3
1699+ let bonus = $t05733257436._4
16661700 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
16671701 }
16681702
17241758 @Callable(i)
17251759 func changeAmp () = {
17261760 let cfg = invoke(fca, "getChangeAmpConfigREADONLY", [toString(this)], nil)
1727- let $t05905659255 = match cfg {
1761+ let $t05991660115 = match cfg {
17281762 case list: List[Any] =>
17291763 $Tuple3({
17301764 let @ = list[0]
17451779 case _ =>
17461780 throwErr("invalid entry type")
17471781 }
1748- let delay = $t05905659255._1
1749- let delta = $t05905659255._2
1750- let target = $t05905659255._3
1782+ let delay = $t05991660115._1
1783+ let delta = $t05991660115._2
1784+ let target = $t05991660115._3
17511785 let curAmp = parseIntValue(getStringValue(amp()))
17521786 let newAmpRaw = (curAmp + delta)
17531787 let newAmp = if ((0 > delta))
17831817 match tx {
17841818 case order: Order =>
17851819 let matcherPub = mp()
1786- let $t06018860305 = if (skipOrderValidation())
1820+ let $t06104861165 = if (skipOrderValidation())
17871821 then $Tuple2(true, "")
17881822 else validateMatcherOrderAllowed(order)
1789- let orderValid = $t06018860305._1
1790- let orderValidInfo = $t06018860305._2
1823+ let orderValid = $t06104861165._1
1824+ let orderValidInfo = $t06104861165._2
17911825 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
17921826 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
17931827 if (if (if (orderValid)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let scale8 = 100000000
55
66 let scale8BigInt = toBigInt(100000000)
77
88 let scale18 = toBigInt(1000000000000000000)
99
1010 let zeroBigInt = toBigInt(0)
1111
1212 let big0 = toBigInt(0)
1313
1414 let big1 = toBigInt(1)
1515
1616 let big2 = toBigInt(2)
1717
1818 let big3 = toBigInt(3)
1919
2020 let big4 = toBigInt(4)
2121
2222 let slippage4D = toBigInt((scale8 - ((scale8 * 1) / scale8)))
2323
2424 let wavesString = "WAVES"
2525
2626 let ampInitial = 50
2727
2828 let Amult = "100"
2929
3030 let Dconv = "1"
3131
3232 let SEP = "__"
3333
3434 let EMPTY = ""
3535
3636 let PoolActive = 1
3737
3838 let PoolPutDis = 2
3939
4040 let PoolMatcherDis = 3
4141
4242 let PoolShutdown = 4
4343
4444 let idxPoolAddress = 1
4545
4646 let idxPoolSt = 2
4747
4848 let idxLPAsId = 3
4949
5050 let idxAmAsId = 4
5151
5252 let idxPrAsId = 5
5353
5454 let idxAmtAsDcm = 6
5555
5656 let idxPriceAsDcm = 7
5757
5858 let idxIAmtAsId = 8
5959
6060 let idxIPriceAsId = 9
6161
6262 let idxFactStakCntr = 1
6363
6464 let idxFactoryRestCntr = 6
6565
6666 let idxFactSlippCntr = 7
6767
6868 let idxFactGwxRewCntr = 10
6969
7070 let feeDefault = fraction(10, scale8, 10000)
7171
7272 func t1 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
7373
7474
7575 func t1BigInt (origVal,origScaleMult) = fraction(origVal, scale18, origScaleMult)
7676
7777
7878 func f1 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
7979
8080
8181 func fromX18Round (val,resultScaleMult,round) = toInt(fraction(val, toBigInt(resultScaleMult), scale18, round))
8282
8383
8484 func t2 (origVal,origScaleMult) = fraction(origVal, scale18, toBigInt(origScaleMult))
8585
8686
8787 func f2 (val,resultScaleMult) = fraction(val, toBigInt(resultScaleMult), scale18)
8888
8989
9090 func ts (amt,resScale,curScale) = fraction(amt, resScale, curScale)
9191
9292
9393 func abs (val) = if ((zeroBigInt > val))
9494 then -(val)
9595 else val
9696
9797
9898 func absBigInt (val) = if ((zeroBigInt > val))
9999 then -(val)
100100 else val
101101
102102
103103 func fc () = "%s__factoryContract"
104104
105105
106106 func keyManagerPublicKey () = "%s__managerPublicKey"
107107
108108
109109 func keyManagerVaultAddress () = "%s__managerVaultAddress"
110110
111111
112112 func pl () = "%s%s__price__last"
113113
114114
115115 func ph (h,t) = makeString(["%s%s%d%d__price__history", toString(h), toString(t)], SEP)
116116
117117
118118 func pau (ua,txId) = ((("%s%s%s__P__" + ua) + "__") + txId)
119119
120120
121121 func gau (ua,txId) = ((("%s%s%s__G__" + ua) + "__") + txId)
122122
123123
124124 func aa () = "%s__amountAsset"
125125
126126
127127 func pa () = "%s__priceAsset"
128128
129129
130130 func amp () = "%s__amp"
131131
132132
133133 func keyAmpHistory (heightBlocks) = ("%s%d__amp__" + toString(heightBlocks))
134134
135135
136136 func keyChangeAmpLastCall () = "%s__changeAmpLastCall"
137137
138138
139139 let keyFee = "%s__fee"
140140
141141 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
142142
143143 let keyDLp = makeString(["%s", "dLp"], SEP)
144144
145145 let keyDLpRefreshedHeight = makeString(["%s", "dLpRefreshedHeight"], SEP)
146146
147147 let keyDLpRefreshDelay = makeString(["%s", "refreshDLpDelay"], SEP)
148148
149149 let dLpRefreshDelayDefault = 30
150150
151151 let dLpRefreshDelay = valueOrElse(getInteger(this, keyDLpRefreshDelay), dLpRefreshDelayDefault)
152152
153153 func fcfg () = "%s__factoryConfig"
154154
155155
156156 func mtpk () = "%s%s__matcher__publicKey"
157157
158158
159159 func pc (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config")
160160
161161
162162 func mba (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr)
163163
164164
165165 func aps () = "%s__shutdown"
166166
167167
168168 func keyAllowedLpStableScriptHash () = "%s__allowedLpStableScriptHash"
169169
170170
171171 func keyFeeCollectorAddress () = "%s__feeCollectorAddress"
172172
173173
174174 func keySkipOrderValidation (poolAddress) = ("%s%s__skipOrderValidation__" + poolAddress)
175175
176176
177177 func throwOrderError (orderValid,orderValidInfo,senderValid,matcherValid) = throw((((((((("order validation failed: orderValid=" + toString(orderValid)) + " (") + orderValidInfo) + ")") + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
178178
179179
180180 func addressFromStringOrThis (addressString) = match addressFromString(addressString) {
181181 case a: Address =>
182182 a
183183 case _ =>
184184 this
185185 }
186186
187187
188188 func getManagerVaultAddressOrThis () = {
189189 let factoryAddress = match getString(fc()) {
190190 case fca: String =>
191191 addressFromStringOrThis(fca)
192192 case _ =>
193193 this
194194 }
195195 match getString(factoryAddress, keyManagerVaultAddress()) {
196196 case s: String =>
197197 addressFromStringOrThis(s)
198198 case _ =>
199199 this
200200 }
201201 }
202202
203203
204204 func strf (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
205205
206206
207207 func intf (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
208208
209209
210210 func throwErr (msg) = throw(makeString(["lp_stable.ride:", msg], " "))
211211
212212
213213 func fmtErr (msg) = makeString(["lp_stable.ride:", msg], " ")
214214
215215
216216 let fca = addressFromStringValue(strf(this, fc()))
217217
218218 let inFee = {
219219 let @ = invoke(fca, "getInFeeREADONLY", [toString(this)], nil)
220220 if ($isInstanceOf(@, "Int"))
221221 then @
222222 else throw(($getType(@) + " couldn't be cast to Int"))
223223 }
224224
225225 let outFee = {
226226 let @ = invoke(fca, "getOutFeeREADONLY", [toString(this)], nil)
227227 if ($isInstanceOf(@, "Int"))
228228 then @
229229 else throw(($getType(@) + " couldn't be cast to Int"))
230230 }
231231
232+func keyAddressWhitelisted (address) = makeString(["%s%s", "whitelisted", toString(address)], SEP)
233+
234+
235+func isAddressWhitelisted (address) = valueOrElse(getBoolean(fca, keyAddressWhitelisted(address)), false)
236+
237+
232238 let A = strf(this, amp())
233239
234240 func igs () = valueOrElse(getBoolean(fca, aps()), false)
235241
236242
237243 func mp () = fromBase58String(strf(fca, mtpk()))
238244
239245
240246 let feeCollectorAddress = addressFromStringValue(strf(fca, keyFeeCollectorAddress()))
241247
242248 func gpc () = {
243249 let amtAs = strf(this, aa())
244250 let priceAs = strf(this, pa())
245251 let iPriceAs = intf(fca, mba(priceAs))
246252 let iAmtAs = intf(fca, mba(amtAs))
247253 split(strf(fca, pc(toString(iAmtAs), toString(iPriceAs))), SEP)
248254 }
249255
250256
251257 func parseAssetId (input) = if ((input == wavesString))
252258 then unit
253259 else fromBase58String(input)
254260
255261
256262 func assetIdToString (input) = if ((input == unit))
257263 then wavesString
258264 else toBase58String(value(input))
259265
260266
261267 func parsePoolConfig (poolConfig) = $Tuple7(addressFromStringValue(poolConfig[idxPoolAddress]), parseIntValue(poolConfig[idxPoolSt]), fromBase58String(poolConfig[idxLPAsId]), parseAssetId(poolConfig[idxAmAsId]), parseAssetId(poolConfig[idxPrAsId]), parseIntValue(poolConfig[idxAmtAsDcm]), parseIntValue(poolConfig[idxPriceAsDcm]))
262268
263269
264270 let poolConfigParsed = parsePoolConfig(gpc())
265271
266-let $t086088794 = poolConfigParsed
272+let $t088369022 = poolConfigParsed
267273
268-let cfgPoolAddress = $t086088794._1
274+let cfgPoolAddress = $t088369022._1
269275
270-let cfgPoolStatus = $t086088794._2
276+let cfgPoolStatus = $t088369022._2
271277
272-let cfgLpAssetId = $t086088794._3
278+let cfgLpAssetId = $t088369022._3
273279
274-let cfgAmountAssetId = $t086088794._4
280+let cfgAmountAssetId = $t088369022._4
275281
276-let cfgPriceAssetId = $t086088794._5
282+let cfgPriceAssetId = $t088369022._5
277283
278-let cfgAmountAssetDecimals = $t086088794._6
284+let cfgAmountAssetDecimals = $t088369022._6
279285
280-let cfgPriceAssetDecimals = $t086088794._7
286+let cfgPriceAssetDecimals = $t088369022._7
281287
282288 func gfc () = split(strf(fca, fcfg()), SEP)
283289
284290
285291 let factoryConfig = gfc()
286292
287293 let stakingContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactStakCntr]), "Invalid staking contract address")
288294
289295 let slipageContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactSlippCntr]), "Invalid slipage contract address")
290296
291297 let gwxContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactGwxRewCntr]), "Invalid gwx contract address")
292298
293299 let restContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactoryRestCntr]), "Invalid gwx contract address")
294300
295301 func dataPutActionInfo (inAmtAssetAmt,inPriceAssetAmt,outLpAmt,price,slipByUser,slippageReal,txHeight,txTimestamp,slipageAmAmt,slipagePrAmt) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(inAmtAssetAmt), toString(inPriceAssetAmt), toString(outLpAmt), toString(price), toString(slipByUser), toString(slippageReal), toString(txHeight), toString(txTimestamp), toString(slipageAmAmt), toString(slipagePrAmt)], SEP)
296302
297303
298304 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)
299305
300306
301307 func getAccBalance (assetId) = if ((assetId == "WAVES"))
302308 then wavesBalance(this).available
303309 else assetBalance(this, fromBase58String(assetId))
304310
305311
306312 func cpbi (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
307313
308314
309315 func cpbir (prAmtX18,amAmtX18,round) = fraction(prAmtX18, scale18, amAmtX18, round)
310316
311317
312318 func vad (A1,A2,slippage) = {
313319 let diff = fraction((A1 - A2), scale8BigInt, A2)
314320 let pass = ((slippage - abs(diff)) > zeroBigInt)
315321 if (!(pass))
316322 then throw(("Big slpg: " + toString(diff)))
317323 else $Tuple2(pass, min([A1, A2]))
318324 }
319325
320326
321327 func vd (D1,D0,slpg) = {
322328 let diff = fraction(D0, scale8BigInt, D1)
323329 let fail = (slpg > diff)
324330 if (if (fail)
325331 then true
326332 else (D0 > D1))
327333 then throw(((((((toString(D0) + " ") + toString(D1)) + " ") + toString(diff)) + " ") + toString(slpg)))
328334 else fail
329335 }
330336
331337
332338 func pcp (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
333339 let amtAsAmtX18 = t1(amAmt, amAssetDcm)
334340 let prAsAmtX18 = t1(prAmt, prAssetDcm)
335341 cpbi(prAsAmtX18, amtAsAmtX18)
336342 }
337343
338344
339345 func calcPrices (amAmt,prAmt,lpAmt) = {
340346 let amtAsDcm = cfgAmountAssetDecimals
341347 let prAsDcm = cfgPriceAssetDecimals
342348 let priceX18 = pcp(amtAsDcm, prAsDcm, amAmt, prAmt)
343349 let amAmtX18 = t1(amAmt, amtAsDcm)
344350 let prAmtX18 = t1(prAmt, prAsDcm)
345351 let lpAmtX18 = t1(lpAmt, scale8)
346352 let lpPrInAmAsX18 = cpbi(amAmtX18, lpAmtX18)
347353 let lpPrInPrAsX18 = cpbi(prAmtX18, lpAmtX18)
348354 [priceX18, lpPrInAmAsX18, lpPrInPrAsX18]
349355 }
350356
351357
352358 func calculatePrices (amAmt,prAmt,lpAmt) = {
353359 let p = calcPrices(amAmt, prAmt, lpAmt)
354360 [f1(p[0], scale8), f1(p[1], scale8), f1(p[2], scale8)]
355361 }
356362
357363
358364 func takeFee (amount,fee) = {
359365 let feeAmount = if ((fee == 0))
360366 then 0
361367 else fraction(amount, fee, scale8)
362368 $Tuple2((amount - feeAmount), feeAmount)
363369 }
364370
365371
366372 func getD (xp) = {
367373 let xp0 = xp[0]
368374 let xp1 = xp[1]
369375 let s = (xp0 + xp1)
370376 if ((s == big0))
371377 then big0
372378 else {
373379 let a = parseIntValue(A)
374380 let ann = (a * 2)
375381 let p = fraction(xp0, xp1, big1)
376382 let xp0_xp1_n_n = fraction(p, big4, big1)
377383 let ann_s = fraction(toBigInt(ann), s, big1)
378384 let ann_1 = toBigInt((ann - 1))
379385 func calcDNext (d) = {
380386 let dd = fraction(d, d, big1)
381387 let ddd = fraction(dd, d, big1)
382388 let dp = fraction(ddd, big1, xp0_xp1_n_n)
383389 fraction((ann_s + fraction(dp, big2, big1)), d, (fraction(ann_1, d, big1) + fraction(big3, dp, big1)))
384390 }
385391
386392 func calc (acc,i) = if (acc._2)
387393 then acc
388394 else {
389395 let d = acc._1
390396 let dNext = calcDNext(d)
391397 let dDiffRaw = (dNext - value(d))
392398 let dDiff = if ((big0 > dDiffRaw))
393399 then -(dDiffRaw)
394400 else dDiffRaw
395401 if ((big1 >= dDiff))
396402 then $Tuple2(dNext, true)
397403 else $Tuple2(dNext, false)
398404 }
399405
400406 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
401- let $t01329913347 = {
407+ let $t01352713575 = {
402408 let $l = arr
403409 let $s = size($l)
404410 let $acc0 = $Tuple2(s, false)
405411 func $f0_1 ($a,$i) = if (($i >= $s))
406412 then $a
407413 else calc($a, $l[$i])
408414
409415 func $f0_2 ($a,$i) = if (($i >= $s))
410416 then $a
411417 else throw("List size exceeds 17")
412418
413419 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17)
414420 }
415- let d = $t01329913347._1
416- let found = $t01329913347._2
421+ let d = $t01352713575._1
422+ let found = $t01352713575._2
417423 if (found)
418424 then d
419425 else throw(("D calculation error, D = " + toString(d)))
420426 }
421427 }
422428
423429
424430 func ego (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
425431 let lpId = cfgLpAssetId
426432 let amId = toBase58String(value(cfgAmountAssetId))
427433 let prId = toBase58String(value(cfgPriceAssetId))
428434 let amDcm = cfgAmountAssetDecimals
429435 let prDcm = cfgPriceAssetDecimals
430436 let sts = toString(cfgPoolStatus)
431437 let lpEmiss = valueOrErrorMessage(assetInfo(lpId), "Wrong LP id").quantity
432438 if ((toBase58String(lpId) != pmtAssetId))
433439 then throw("Wrong pmt asset")
434440 else {
435441 let amBalance = getAccBalance(amId)
436442 let amBalanceX18 = t1(amBalance, amDcm)
437443 let prBalance = getAccBalance(prId)
438444 let prBalanceX18 = t1(prBalance, prDcm)
439445 let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
440446 let curPrice = f1(curPriceX18, scale8)
441447 let pmtLpAmtX18 = t1(pmtLpAmt, scale8)
442448 let lpEmissX18 = t1(lpEmiss, scale8)
443449 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissX18)
444450 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissX18)
445451 let outAmAmt = fromX18Round(outAmAmtX18, amDcm, FLOOR)
446452 let outPrAmt = fromX18Round(outPrAmtX18, prDcm, FLOOR)
447453 let state = if ((txId58 == ""))
448454 then nil
449455 else [ScriptTransfer(userAddress, outAmAmt, if ((amId == "WAVES"))
450456 then unit
451457 else fromBase58String(amId)), ScriptTransfer(userAddress, outPrAmt, if ((prId == "WAVES"))
452458 then unit
453459 else fromBase58String(prId)), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAmAmt, outPrAmt, pmtLpAmt, curPrice, height, lastBlock.timestamp)), IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice)]
454460 $Tuple10(outAmAmt, outPrAmt, amId, prId, amBalance, prBalance, lpEmiss, curPriceX18, sts, state)
455461 }
456462 }
457463
458464
459465 func epo (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEval,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = {
460466 let lpId = cfgLpAssetId
461467 let amIdStr = toBase58String(value(cfgAmountAssetId))
462468 let prIdStr = toBase58String(value(cfgPriceAssetId))
463469 let amtDcm = cfgAmountAssetDecimals
464470 let priceDcm = cfgPriceAssetDecimals
465471 let sts = toString(cfgPoolStatus)
466472 let lpEm = valueOrErrorMessage(assetInfo(lpId), "Wr lp as").quantity
467- let amBalance = if (isEval)
468- then getAccBalance(amIdStr)
469- else if (if (isOneAsset)
470- then (pmtId == amIdStr)
471- else false)
472- then (getAccBalance(amIdStr) - pmtAmt)
473- else if (isOneAsset)
473+ let checkAssets = [if (if ((inAmId == parseAssetId(amIdStr)))
474+ then (inPrId == parseAssetId(prIdStr))
475+ else false)
476+ then true
477+ else throwErr("Invalid amt or price asset passed.")]
478+ if ((checkAssets == checkAssets))
479+ then {
480+ let amBalance = if (isEval)
474481 then getAccBalance(amIdStr)
475- else (getAccBalance(amIdStr) - inAmAmt)
476- let prBalance = if (isEval)
477- then getAccBalance(prIdStr)
478- else if (if (isOneAsset)
479- then (pmtId == prIdStr)
480- else false)
481- then (getAccBalance(prIdStr) - pmtAmt)
482- else if (isOneAsset)
482+ else if (if (isOneAsset)
483+ then (pmtId == amIdStr)
484+ else false)
485+ then (getAccBalance(amIdStr) - pmtAmt)
486+ else if (isOneAsset)
487+ then getAccBalance(amIdStr)
488+ else (getAccBalance(amIdStr) - inAmAmt)
489+ let prBalance = if (isEval)
483490 then getAccBalance(prIdStr)
484- else (getAccBalance(prIdStr) - inPrAmt)
485- let inAmAssetAmtX18 = t1(inAmAmt, amtDcm)
486- let inPrAssetAmtX18 = t1(inPrAmt, priceDcm)
487- let userPriceX18 = cpbi(inPrAssetAmtX18, inAmAssetAmtX18)
488- let amBalanceX18 = t1(amBalance, amtDcm)
489- let prBalanceX18 = t1(prBalance, priceDcm)
490- let D0 = getD([amBalanceX18, prBalanceX18])
491- let r = if ((lpEm == 0))
492- then {
493- let D1 = getD([(amBalanceX18 + inAmAssetAmtX18), (prBalanceX18 + inPrAssetAmtX18)])
494- let checkD = if ((D1 > D0))
495- then true
496- else throw("D1 should be greater than D0")
497- if ((checkD == checkD))
491+ else if (if (isOneAsset)
492+ then (pmtId == prIdStr)
493+ else false)
494+ then (getAccBalance(prIdStr) - pmtAmt)
495+ else if (isOneAsset)
496+ then getAccBalance(prIdStr)
497+ else (getAccBalance(prIdStr) - inPrAmt)
498+ let inAmAssetAmtX18 = t1(inAmAmt, amtDcm)
499+ let inPrAssetAmtX18 = t1(inPrAmt, priceDcm)
500+ let userPriceX18 = cpbi(inPrAssetAmtX18, inAmAssetAmtX18)
501+ let amBalanceX18 = t1(amBalance, amtDcm)
502+ let prBalanceX18 = t1(prBalance, priceDcm)
503+ let D0 = getD([amBalanceX18, prBalanceX18])
504+ let r = if ((lpEm == 0))
498505 then {
499- let curPriceX18 = zeroBigInt
500- let slippageX18 = zeroBigInt
501- let lpAmtX18 = D1
502- $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
503- }
504- else throw("Strict value is not equal to itself.")
505- }
506- else {
507- let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
508- let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18)
509- let slippageX18 = t1(slippage, scale8)
510- if (if (if (validateSlippage)
511- then (curPriceX18 != zeroBigInt)
512- else false)
513- then (slippageRealX18 > slippageX18)
514- else false)
515- then throw(((("Price slippage " + toString(slippageRealX18)) + " > ") + toString(slippageX18)))
516- else {
517- let lpEmissionX18 = t1(lpEm, scale8)
518- let prViaAmX18 = fraction(inAmAssetAmtX18, cpbir(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING)
519- let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, cpbir(prBalanceX18, amBalanceX18, FLOOR), CEILING)
520- let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
521- then $Tuple2(amViaPrX18, inPrAssetAmtX18)
522- else $Tuple2(inAmAssetAmtX18, prViaAmX18)
523- let expAmtAssetAmtX18 = expectedAmts._1
524- let expPriceAssetAmtX18 = expectedAmts._2
525- let D1 = getD([(amBalanceX18 + expAmtAssetAmtX18), (prBalanceX18 + expPriceAssetAmtX18)])
506+ let D1 = getD([(amBalanceX18 + inAmAssetAmtX18), (prBalanceX18 + inPrAssetAmtX18)])
526507 let checkD = if ((D1 > D0))
527508 then true
528509 else throw("D1 should be greater than D0")
529510 if ((checkD == checkD))
530511 then {
531- let lpAmtX18 = fraction(lpEmissionX18, (D1 - D0), D0)
532- $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceDcm, CEILING), curPriceX18, slippageX18)
512+ let curPriceX18 = zeroBigInt
513+ let slippageX18 = zeroBigInt
514+ let lpAmtX18 = D1
515+ $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
533516 }
534517 else throw("Strict value is not equal to itself.")
535518 }
519+ else {
520+ let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
521+ let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18)
522+ let slippageX18 = t1(slippage, scale8)
523+ if (if (if (validateSlippage)
524+ then (curPriceX18 != zeroBigInt)
525+ else false)
526+ then (slippageRealX18 > slippageX18)
527+ else false)
528+ then throw(((("Price slippage " + toString(slippageRealX18)) + " > ") + toString(slippageX18)))
529+ else {
530+ let lpEmissionX18 = t1(lpEm, scale8)
531+ let prViaAmX18 = fraction(inAmAssetAmtX18, cpbir(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING)
532+ let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, cpbir(prBalanceX18, amBalanceX18, FLOOR), CEILING)
533+ let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
534+ then $Tuple2(amViaPrX18, inPrAssetAmtX18)
535+ else $Tuple2(inAmAssetAmtX18, prViaAmX18)
536+ let expAmtAssetAmtX18 = expectedAmts._1
537+ let expPriceAssetAmtX18 = expectedAmts._2
538+ let D1 = getD([(amBalanceX18 + expAmtAssetAmtX18), (prBalanceX18 + expPriceAssetAmtX18)])
539+ let checkD = if ((D1 > D0))
540+ then true
541+ else throw("D1 should be greater than D0")
542+ if ((checkD == checkD))
543+ then {
544+ let lpAmtX18 = fraction(lpEmissionX18, (D1 - D0), D0)
545+ $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceDcm, CEILING), curPriceX18, slippageX18)
546+ }
547+ else throw("Strict value is not equal to itself.")
548+ }
549+ }
550+ let calcLpAmt = r._1
551+ let calcAmAssetPmt = r._2
552+ let calcPrAssetPmt = r._3
553+ let curPrice = f1(r._4, scale8)
554+ let slippageCalc = f1(r._5, scale8)
555+ if ((0 >= calcLpAmt))
556+ then throw("LP <= 0")
557+ else {
558+ let emitLpAmt = if (!(emitLp))
559+ then 0
560+ else calcLpAmt
561+ let amDiff = (inAmAmt - calcAmAssetPmt)
562+ let prDiff = (inPrAmt - calcPrAssetPmt)
563+ let $t02149821843 = if (if (isOneAsset)
564+ then (pmtId == amIdStr)
565+ else false)
566+ then $Tuple2(pmtAmt, 0)
567+ else if (if (isOneAsset)
568+ then (pmtId == prIdStr)
569+ else false)
570+ then $Tuple2(0, pmtAmt)
571+ else $Tuple2(calcAmAssetPmt, calcPrAssetPmt)
572+ let writeAmAmt = $t02149821843._1
573+ let writePrAmt = $t02149821843._2
574+ let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId58), dataPutActionInfo(writeAmAmt, writePrAmt, emitLpAmt, curPrice, slippage, slippageCalc, height, lastBlock.timestamp, amDiff, prDiff))]
575+ $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId)
576+ }
536577 }
537- let calcLpAmt = r._1
538- let calcAmAssetPmt = r._2
539- let calcPrAssetPmt = r._3
540- let curPrice = f1(r._4, scale8)
541- let slippageCalc = f1(r._5, scale8)
542- if ((0 >= calcLpAmt))
543- then throw("LP <= 0")
544- else {
545- let emitLpAmt = if (!(emitLp))
546- then 0
547- else calcLpAmt
548- let amDiff = (inAmAmt - calcAmAssetPmt)
549- let prDiff = (inPrAmt - calcPrAssetPmt)
550- let $t02110921454 = if (if (isOneAsset)
551- then (pmtId == amIdStr)
552- else false)
553- then $Tuple2(pmtAmt, 0)
554- else if (if (isOneAsset)
555- then (pmtId == prIdStr)
556- else false)
557- then $Tuple2(0, pmtAmt)
558- else $Tuple2(calcAmAssetPmt, calcPrAssetPmt)
559- let writeAmAmt = $t02110921454._1
560- let writePrAmt = $t02110921454._2
561- let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId58), dataPutActionInfo(writeAmAmt, writePrAmt, emitLpAmt, curPrice, slippage, slippageCalc, height, lastBlock.timestamp, amDiff, prDiff))]
562- $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId)
563- }
578+ else throw("Strict value is not equal to itself.")
564579 }
565580
566581
567582 func getYD (xp,i,D) = {
568583 let n = big2
569584 let x = xp[if ((i == 0))
570585 then 1
571586 else 0]
572587 let aPrecision = parseBigIntValue(Amult)
573588 let a = (parseBigIntValue(A) * aPrecision)
574589 let s = x
575590 let ann = (a * n)
576591 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
577592 let b = ((s + ((D * aPrecision) / ann)) - D)
578593 func calc (acc,cur) = {
579- let $t02264922669 = acc
580- let y = $t02264922669._1
581- let found = $t02264922669._2
594+ let $t02303823058 = acc
595+ let y = $t02303823058._1
596+ let found = $t02303823058._2
582597 if ((found != unit))
583598 then acc
584599 else {
585600 let yNext = (((y * y) + c) / ((big2 * y) + b))
586601 let yDiff = absBigInt((yNext - value(y)))
587602 if ((big1 >= yDiff))
588603 then $Tuple2(yNext, cur)
589604 else $Tuple2(yNext, unit)
590605 }
591606 }
592607
593608 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
594- let $t02297623023 = {
609+ let $t02336523412 = {
595610 let $l = arr
596611 let $s = size($l)
597612 let $acc0 = $Tuple2(D, unit)
598613 func $f0_1 ($a,$i) = if (($i >= $s))
599614 then $a
600615 else calc($a, $l[$i])
601616
602617 func $f0_2 ($a,$i) = if (($i >= $s))
603618 then $a
604619 else throw("List size exceeds 15")
605620
606621 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15)
607622 }
608- let y = $t02297623023._1
609- let found = $t02297623023._2
623+ let y = $t02336523412._1
624+ let found = $t02336523412._2
610625 if ((found != unit))
611626 then y
612627 else throw(("Y calculation error, Y = " + toString(y)))
613628 }
614629
615630
616631 func calcDLp (amountBalance,priceBalance,lpEmission) = {
617632 let updatedDLp = fraction(getD([t1BigInt(amountBalance, toBigInt(cfgAmountAssetDecimals)), t1BigInt(priceBalance, toBigInt(cfgPriceAssetDecimals))]), scale18, lpEmission)
618633 if ((lpEmission == big0))
619634 then big0
620635 else updatedDLp
621636 }
622637
623638
624639 func calcCurrentDLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
625640 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
626641 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
627642 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
628643 let currentDLp = calcDLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
629644 currentDLp
630645 }
631646
632647
633648 func refreshDLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
634649 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
635650 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
636651 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
637652 let updatedDLp = calcDLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
638653 let actions = [IntegerEntry(keyDLpRefreshedHeight, height), StringEntry(keyDLp, toString(updatedDLp))]
639654 $Tuple2(actions, updatedDLp)
640655 }
641656
642657
643658 func validateUpdatedDLp (oldDLp,updatedDLp) = if ((updatedDLp >= oldDLp))
644659 then true
645660 else throwErr("updated DLp lower than current DLp")
646661
647662
648663 func validateMatcherOrderAllowed (order) = {
649664 let amountAssetBalance = getAccBalance(assetIdToString(cfgAmountAssetId))
650665 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
651666 let amountAssetAmount = order.amount
652667 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
653- let $t02522125433 = if ((order.orderType == Buy))
668+ let $t02561025822 = if ((order.orderType == Buy))
654669 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
655670 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
656- let amountAssetBalanceDelta = $t02522125433._1
657- let priceAssetBalanceDelta = $t02522125433._2
671+ let amountAssetBalanceDelta = $t02561025822._1
672+ let priceAssetBalanceDelta = $t02561025822._2
658673 if (if (if (igs())
659674 then true
660675 else (cfgPoolStatus == PoolMatcherDis))
661676 then true
662677 else (cfgPoolStatus == PoolShutdown))
663678 then throw("Admin blocked")
664679 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
665680 then true
666681 else (order.assetPair.priceAsset != cfgPriceAssetId))
667682 then throw("Wr assets")
668683 else {
669684 let dLp = parseBigIntValue(valueOrElse(getString(this, keyDLp), "0"))
670- let $t02577525875 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
671- let unusedActions = $t02577525875._1
672- let dLpNew = $t02577525875._2
685+ let $t02616426264 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
686+ let unusedActions = $t02616426264._1
687+ let dLpNew = $t02616426264._2
673688 let isOrderValid = (dLpNew >= dLp)
674689 let info = makeString(["dLp=", toString(dLp), " dLpNew=", toString(dLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "")
675690 $Tuple2(isOrderValid, info)
676691 }
677692 }
678693
679694
680695 func cg (i) = if ((size(i.payments) != 1))
681696 then throw("1 pmnt exp")
682697 else {
683698 let pmt = value(i.payments[0])
684699 let pmtAssetId = value(pmt.assetId)
685700 let pmtAmt = pmt.amount
686701 let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
687702 let outAmAmt = r._1
688703 let outPrAmt = r._2
689704 let sts = parseIntValue(r._9)
690705 let state = r._10
691- if (if (igs())
692- then true
693- else (sts == PoolShutdown))
706+ let isGetDisabled = if (!(isAddressWhitelisted(i.caller)))
707+ then if (igs())
708+ then true
709+ else (cfgPoolStatus == PoolShutdown)
710+ else false
711+ if (isGetDisabled)
694712 then throw(("Admin blocked: " + toString(sts)))
695713 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
696714 }
697715
698716
699717 func cp (caller,txId,amAsPmt,prAsPmt,slippage,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = {
700718 let r = epo(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, (txId == ""), emitLp, isOneAsset, validateSlippage, pmtAmt, pmtId)
701719 let sts = parseIntValue(r._8)
702- if (if (if (igs())
703- then true
704- else (sts == PoolPutDis))
705- then true
706- else (sts == PoolShutdown))
720+ let isPutDisabled = if (!(isAddressWhitelisted(addressFromStringValue(caller))))
721+ then if (if (igs())
722+ then true
723+ else (cfgPoolStatus == PoolShutdown))
724+ then true
725+ else (cfgPoolStatus == PoolPutDis)
726+ else false
727+ if (isPutDisabled)
707728 then throw(("Blocked:" + toString(sts)))
708729 else r
709730 }
710731
711732
712733 func calcPutOneTkn (pmtAmtRaw,pmtAssetId,userAddress,txId,withTakeFee) = {
713734 let amId = toBase58String(value(cfgAmountAssetId))
714735 let prId = toBase58String(value(cfgPriceAssetId))
715736 let lpId = cfgLpAssetId
716737 let amtDcm = cfgAmountAssetDecimals
717738 let priceDcm = cfgPriceAssetDecimals
718739 let lpAssetEmission = toBigInt(valueOrErrorMessage(assetInfo(lpId), "invalid lp asset").quantity)
719740 let chechEmission = if ((lpAssetEmission > big0))
720741 then true
721742 else throw("initial deposit requires all coins")
722743 if ((chechEmission == chechEmission))
723744 then {
724745 let amBalance = getAccBalance(amId)
725746 let prBalance = getAccBalance(prId)
726- let $t02853128993 = if ((txId == ""))
747+ let $t02912329585 = if ((txId == ""))
727748 then $Tuple2(amBalance, prBalance)
728749 else if ((pmtAssetId == amId))
729750 then if ((pmtAmtRaw > amBalance))
730751 then throw("invalid payment amount")
731752 else $Tuple2((amBalance - pmtAmtRaw), prBalance)
732753 else if ((pmtAssetId == prId))
733754 then if ((pmtAmtRaw > prBalance))
734755 then throw("invalid payment amount")
735756 else $Tuple2(amBalance, (prBalance - pmtAmtRaw))
736757 else throw("wrong pmtAssetId")
737- let amBalanceOld = $t02853128993._1
738- let prBalanceOld = $t02853128993._2
739- let $t02899929175 = if ((pmtAssetId == amId))
758+ let amBalanceOld = $t02912329585._1
759+ let prBalanceOld = $t02912329585._2
760+ let $t02959129767 = if ((pmtAssetId == amId))
740761 then $Tuple2(pmtAmtRaw, 0)
741762 else if ((pmtAssetId == prId))
742763 then $Tuple2(0, pmtAmtRaw)
743764 else throw("invalid payment")
744- let amAmountRaw = $t02899929175._1
745- let prAmountRaw = $t02899929175._2
746- let $t02917929433 = if (withTakeFee)
765+ let amAmountRaw = $t02959129767._1
766+ let prAmountRaw = $t02959129767._2
767+ let $t02977130025 = if (withTakeFee)
747768 then $Tuple3(takeFee(amAmountRaw, inFee)._1, takeFee(prAmountRaw, inFee)._1, takeFee(pmtAmtRaw, inFee)._2)
748769 else $Tuple3(amAmountRaw, prAmountRaw, 0)
749- let amAmount = $t02917929433._1
750- let prAmount = $t02917929433._2
751- let feeAmount = $t02917929433._3
770+ let amAmount = $t02977130025._1
771+ let prAmount = $t02977130025._2
772+ let feeAmount = $t02977130025._3
752773 let amBalanceNew = (amBalanceOld + amAmount)
753774 let prBalanceNew = (prBalanceOld + prAmount)
754775 let D0 = getD([t1(amBalanceOld, cfgAmountAssetDecimals), t1(prBalanceOld, cfgPriceAssetDecimals)])
755776 let D1 = getD([t1(amBalanceNew, cfgAmountAssetDecimals), t1(prBalanceNew, cfgPriceAssetDecimals)])
756777 let checkD = if ((D1 > D0))
757778 then true
758779 else throw()
759780 if ((checkD == checkD))
760781 then {
761782 let lpAmount = fraction(lpAssetEmission, (D1 - D0), D0, FLOOR)
762783 let curPrice = f1(cpbi(t1(prBalanceNew, priceDcm), t1(amBalanceNew, amtDcm)), scale8)
763784 let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId), dataPutActionInfo(amAmountRaw, prAmountRaw, toInt(lpAmount), curPrice, 0, 0, height, lastBlock.timestamp, 0, 0))]
764785 let poolProportion = fraction(prBalanceOld, scale8, amBalanceOld)
765786 let amountAssetPart = fraction(pmtAmtRaw, scale8, (poolProportion + scale8))
766787 let priceAssetPart = (pmtAmtRaw - amountAssetPart)
767788 let lpAmtBoth = fraction(lpAssetEmission, toBigInt(priceAssetPart), toBigInt(prBalanceOld))
768789 let bonus = toInt(fraction((lpAmount - lpAmtBoth), scale8BigInt, lpAmtBoth))
769790 $Tuple4(toInt(lpAmount), commonState, feeAmount, bonus)
770791 }
771792 else throw("Strict value is not equal to itself.")
772793 }
773794 else throw("Strict value is not equal to itself.")
774795 }
775796
776797
777798 func getOneTknV2Internal (outAssetId,minOutAmount,payments,caller,originCaller,transactionId) = {
778799 let lpId = toBase58String(value(cfgLpAssetId))
779800 let amId = toBase58String(value(cfgAmountAssetId))
780801 let prId = toBase58String(value(cfgPriceAssetId))
781802 let amDecimals = cfgAmountAssetDecimals
782803 let prDecimals = cfgPriceAssetDecimals
783804 let poolStatus = cfgPoolStatus
784805 let userAddress = if ((caller == restContract))
785806 then originCaller
786807 else caller
787808 let pmt = value(payments[0])
788809 let pmtAssetId = value(pmt.assetId)
789810 let pmtAmt = pmt.amount
790811 let currentDLp = calcCurrentDLp(big0, big0, big0)
791812 if ((currentDLp == currentDLp))
792813 then {
793814 let txId58 = toBase58String(transactionId)
794815 if ((lpId != toBase58String(pmtAssetId)))
795816 then throw("Wrong LP")
796817 else {
797818 let amBalance = getAccBalance(amId)
798819 let prBalance = getAccBalance(prId)
799- let $t03154531656 = {
820+ let $t03213732248 = {
800821 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil)
801822 if ($isInstanceOf(@, "(Int, Int)"))
802823 then @
803824 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
804825 }
805- if (($t03154531656 == $t03154531656))
826+ if (($t03213732248 == $t03213732248))
806827 then {
807- let feeAmount = $t03154531656._2
808- let totalGet = $t03154531656._1
828+ let feeAmount = $t03213732248._2
829+ let totalGet = $t03213732248._1
809830 let totalAmount = if (if ((minOutAmount > 0))
810831 then (minOutAmount > totalGet)
811832 else false)
812833 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
813834 else totalGet
814- let $t03184632153 = if ((outAssetId == amId))
835+ let $t03243832745 = if ((outAssetId == amId))
815836 then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance)
816837 else if ((outAssetId == prId))
817838 then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount))
818839 else throw("invalid out asset id")
819- let outAm = $t03184632153._1
820- let outPr = $t03184632153._2
821- let amBalanceNew = $t03184632153._3
822- let prBalanceNew = $t03184632153._4
840+ let outAm = $t03243832745._1
841+ let outPr = $t03243832745._2
842+ let amBalanceNew = $t03243832745._3
843+ let prBalanceNew = $t03243832745._4
823844 let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals))
824845 let curPr = f1(curPrX18, scale8)
825846 let outAssetIdOrWaves = if ((outAssetId == "WAVES"))
826847 then unit
827848 else fromBase58String(outAssetId)
828849 let sendFeeToMatcher = if ((feeAmount > 0))
829850 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetIdOrWaves)]
830851 else nil
831852 let state = ([ScriptTransfer(userAddress, totalAmount, outAssetIdOrWaves), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAm, outPr, pmtAmt, curPr, height, lastBlock.timestamp)), IntegerEntry(pl(), curPr), IntegerEntry(ph(height, lastBlock.timestamp), curPr)] ++ sendFeeToMatcher)
832853 if ((state == state))
833854 then {
834855 let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
835856 if ((burn == burn))
836857 then {
837- let $t03293833288 = {
858+ let $t03353033880 = {
838859 let feeAmountForCalc = if ((this == feeCollectorAddress))
839860 then 0
840861 else feeAmount
841862 let outInAmountAsset = if ((parseAssetId(outAssetId) == cfgAmountAssetId))
842863 then true
843864 else false
844865 if (outInAmountAsset)
845866 then $Tuple2(-((totalGet + feeAmountForCalc)), 0)
846867 else $Tuple2(0, -((totalGet + feeAmountForCalc)))
847868 }
848- let amountAssetBalanceDelta = $t03293833288._1
849- let priceAssetBalanceDelta = $t03293833288._2
850- let $t03329133399 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
851- let refreshDLpActions = $t03329133399._1
852- let updatedDLp = $t03329133399._2
869+ let amountAssetBalanceDelta = $t03353033880._1
870+ let priceAssetBalanceDelta = $t03353033880._2
871+ let $t03388333991 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
872+ let refreshDLpActions = $t03388333991._1
873+ let updatedDLp = $t03388333991._2
853874 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
854875 if ((isUpdatedDLpValid == isUpdatedDLpValid))
855876 then $Tuple2((state ++ refreshDLpActions), totalAmount)
856877 else throw("Strict value is not equal to itself.")
857878 }
858879 else throw("Strict value is not equal to itself.")
859880 }
860881 else throw("Strict value is not equal to itself.")
861882 }
862883 else throw("Strict value is not equal to itself.")
863884 }
864885 }
865886 else throw("Strict value is not equal to itself.")
866887 }
867888
868889
869890 func managerPublicKeyOrUnit () = {
870891 let managerVaultAddress = getManagerVaultAddressOrThis()
871892 match getString(managerVaultAddress, keyManagerPublicKey()) {
872893 case s: String =>
873894 fromBase58String(s)
874895 case _: Unit =>
875896 unit
876897 case _ =>
877898 throw("Match error")
878899 }
879900 }
880901
881902
882903 let pd = throw("Permission denied")
883904
884905 func isManager (i) = match managerPublicKeyOrUnit() {
885906 case pk: ByteVector =>
886907 (i.callerPublicKey == pk)
887908 case _: Unit =>
888909 (i.caller == this)
889910 case _ =>
890911 throw("Match error")
891912 }
892913
893914
894915 func mustManager (i) = match managerPublicKeyOrUnit() {
895916 case pk: ByteVector =>
896917 if ((i.callerPublicKey == pk))
897918 then true
898919 else pd
899920 case _: Unit =>
900921 if ((i.caller == this))
901922 then true
902923 else pd
903924 case _ =>
904925 throw("Match error")
905926 }
906927
907928
908929 func getY (isReverse,D,poolAmountInBalance) = {
909930 let poolConfig = gpc()
910931 let amId = poolConfig[idxAmAsId]
911932 let prId = poolConfig[idxPrAsId]
912933 let n = big2
913934 let aPrecision = parseBigIntValue(Amult)
914935 let a = (parseBigIntValue(A) * aPrecision)
915936 let xp = if ((isReverse == false))
916937 then [(toBigInt(getAccBalance(amId)) + poolAmountInBalance), toBigInt(getAccBalance(prId))]
917938 else [(toBigInt(getAccBalance(prId)) + poolAmountInBalance), toBigInt(getAccBalance(amId))]
918939 let x = xp[0]
919940 let s = x
920941 let ann = (a * n)
921942 let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n))
922943 let b = ((s + ((D * aPrecision) / ann)) - D)
923944 func calc (acc,cur) = {
924- let $t03488634906 = acc
925- let y = $t03488634906._1
926- let found = $t03488634906._2
945+ let $t03547835498 = acc
946+ let y = $t03547835498._1
947+ let found = $t03547835498._2
927948 if ((found != unit))
928949 then acc
929950 else {
930951 let yNext = (((y * y) + c) / ((big2 * y) + b))
931952 let yDiff = absBigInt((yNext - value(y)))
932953 if ((big1 >= yDiff))
933954 then $Tuple2(yNext, cur)
934955 else $Tuple2(yNext, unit)
935956 }
936957 }
937958
938959 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
939- let $t03523735284 = {
960+ let $t03582935876 = {
940961 let $l = arr
941962 let $s = size($l)
942963 let $acc0 = $Tuple2(D, unit)
943964 func $f0_1 ($a,$i) = if (($i >= $s))
944965 then $a
945966 else calc($a, $l[$i])
946967
947968 func $f0_2 ($a,$i) = if (($i >= $s))
948969 then $a
949970 else throw("List size exceeds 15")
950971
951972 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15)
952973 }
953- let y = $t03523735284._1
954- let found = $t03523735284._2
974+ let y = $t03582935876._1
975+ let found = $t03582935876._2
955976 if ((found != unit))
956977 then y
957978 else throw(("Y calculation error, Y = " + toString(y)))
958979 }
959980
960981
961982 func skipOrderValidation () = valueOrElse(getBoolean(fca, keySkipOrderValidation(toString(this))), false)
962983
963984
964985 @Callable(i)
965986 func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = {
966- let $t03563636060 = if ((isReverse == false))
987+ let $t03622836652 = if ((isReverse == false))
967988 then {
968989 let assetOut = strf(this, pa())
969990 let poolAmountInBalance = (toBigInt(getAccBalance(strf(this, aa()))) + toBigInt(cleanAmountIn))
970991 $Tuple2(assetOut, poolAmountInBalance)
971992 }
972993 else {
973994 let assetOut = strf(this, aa())
974995 let poolAmountInBalance = (toBigInt(getAccBalance(strf(this, pa()))) + toBigInt(cleanAmountIn))
975996 $Tuple2(assetOut, poolAmountInBalance)
976997 }
977- let assetOut = $t03563636060._1
978- let poolAmountInBalance = $t03563636060._2
998+ let assetOut = $t03622836652._1
999+ let poolAmountInBalance = $t03622836652._2
9791000 let poolConfig = gpc()
9801001 let amId = poolConfig[idxAmAsId]
9811002 let prId = poolConfig[idxPrAsId]
9821003 let xp = [toBigInt(getAccBalance(amId)), toBigInt(getAccBalance(prId))]
9831004 let D = getD(xp)
9841005 let y = getY(isReverse, D, toBigInt(cleanAmountIn))
9851006 let dy = ((toBigInt(getAccBalance(assetOut)) - y) - toBigInt(1))
9861007 let totalGetRaw = max([0, toInt(dy)])
9871008 let newXp = if ((isReverse == false))
9881009 then [((toBigInt(getAccBalance(amId)) + toBigInt(cleanAmountIn)) + toBigInt(feePoolAmount)), (toBigInt(getAccBalance(prId)) - dy)]
9891010 else [(toBigInt(getAccBalance(amId)) - dy), ((toBigInt(getAccBalance(prId)) + toBigInt(cleanAmountIn)) + toBigInt(feePoolAmount))]
9901011 let newD = getD(newXp)
9911012 let checkD = if ((newD >= D))
9921013 then true
9931014 else throw(makeString(["new D is fewer error", toString(D), toString(newD)], "__"))
9941015 if ((checkD == checkD))
9951016 then $Tuple2(nil, totalGetRaw)
9961017 else throw("Strict value is not equal to itself.")
9971018 }
9981019
9991020
10001021
10011022 @Callable(i)
10021023 func calculateAmountOutForSwapAndSendTokens (cleanAmountIn,isReverse,amountOutMin,addressTo,feePoolAmount) = {
10031024 let swapContact = {
10041025 let @ = invoke(fca, "getSwapContractREADONLY", nil, nil)
10051026 if ($isInstanceOf(@, "String"))
10061027 then @
10071028 else throw(($getType(@) + " couldn't be cast to String"))
10081029 }
10091030 let isPoolSwapDisabled = {
10101031 let @ = invoke(fca, "isPoolSwapDisabledREADONLY", [toString(this)], nil)
10111032 if ($isInstanceOf(@, "Boolean"))
10121033 then @
10131034 else throw(($getType(@) + " couldn't be cast to Boolean"))
10141035 }
1015- let isSwapDisabled = if (if (igs())
1016- then true
1017- else (cfgPoolStatus == PoolShutdown))
1018- then true
1019- else isPoolSwapDisabled
1036+ let isSwapDisabled = if (!(isAddressWhitelisted(i.caller)))
1037+ then if (if (igs())
1038+ then true
1039+ else (cfgPoolStatus == PoolShutdown))
1040+ then true
1041+ else isPoolSwapDisabled
1042+ else false
10201043 let checks = [if (if (!(isSwapDisabled))
10211044 then true
10221045 else isManager(i))
10231046 then true
10241047 else throwErr("swap operation is blocked by admin"), if ((value(i.payments[0]).amount >= cleanAmountIn))
10251048 then true
10261049 else throwErr("Wrong amount"), if ((i.caller == addressFromStringValue(swapContact)))
10271050 then true
10281051 else throwErr("Permission denied")]
10291052 if ((checks == checks))
10301053 then {
10311054 let pmt = value(i.payments[0])
10321055 let assetIn = assetIdToString(pmt.assetId)
1033- let $t03779538189 = if ((isReverse == false))
1056+ let $t03842438818 = if ((isReverse == false))
10341057 then {
10351058 let assetOut = strf(this, pa())
10361059 let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
10371060 $Tuple2(assetOut, poolAmountInBalance)
10381061 }
10391062 else {
10401063 let assetOut = strf(this, aa())
10411064 let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
10421065 $Tuple2(assetOut, poolAmountInBalance)
10431066 }
1044- let assetOut = $t03779538189._1
1045- let poolAmountInBalance = $t03779538189._2
1067+ let assetOut = $t03842438818._1
1068+ let poolAmountInBalance = $t03842438818._2
10461069 let poolConfig = gpc()
10471070 let amId = poolConfig[idxAmAsId]
10481071 let prId = poolConfig[idxPrAsId]
10491072 let xp = if ((isReverse == false))
10501073 then [(toBigInt(getAccBalance(amId)) - toBigInt(value(i.payments[0]).amount)), toBigInt(getAccBalance(prId))]
10511074 else [toBigInt(getAccBalance(amId)), (toBigInt(getAccBalance(prId)) - toBigInt(value(i.payments[0]).amount))]
10521075 let D = getD(xp)
10531076 let y = getY(isReverse, D, toBigInt(0))
10541077 let dy = ((toBigInt(getAccBalance(assetOut)) - y) - toBigInt(1))
10551078 let totalGetRaw = max([0, toInt(dy)])
10561079 let checkMin = if ((totalGetRaw >= amountOutMin))
10571080 then true
10581081 else throw("Exchange result is fewer coins than expected")
10591082 if ((checkMin == checkMin))
10601083 then {
10611084 let newXp = if ((isReverse == false))
10621085 then [(toBigInt(getAccBalance(amId)) + toBigInt(feePoolAmount)), (toBigInt(getAccBalance(prId)) - dy)]
10631086 else [(toBigInt(getAccBalance(amId)) - dy), (toBigInt(getAccBalance(prId)) + toBigInt(feePoolAmount))]
10641087 let newD = getD(newXp)
10651088 let checkD = if ((newD >= D))
10661089 then true
10671090 else throw("new D is fewer error")
10681091 if ((checkD == checkD))
10691092 then {
10701093 let amountAssetBalanceDelta = if (isReverse)
10711094 then -(totalGetRaw)
10721095 else feePoolAmount
10731096 let priceAssetBalanceDelta = if (isReverse)
10741097 then feePoolAmount
10751098 else -(totalGetRaw)
10761099 let refreshDLpActions = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)._1
10771100 if ((refreshDLpActions == refreshDLpActions))
10781101 then $Tuple2([ScriptTransfer(addressFromStringValue(addressTo), totalGetRaw, parseAssetId(assetOut))], totalGetRaw)
10791102 else throw("Strict value is not equal to itself.")
10801103 }
10811104 else throw("Strict value is not equal to itself.")
10821105 }
10831106 else throw("Strict value is not equal to itself.")
10841107 }
10851108 else throw("Strict value is not equal to itself.")
10861109 }
10871110
10881111
10891112
10901113 @Callable(i)
10911114 func constructor (fc) = {
10921115 let c = mustManager(i)
10931116 if ((c == c))
10941117 then [StringEntry(fc(), fc)]
10951118 else throw("Strict value is not equal to itself.")
10961119 }
10971120
10981121
10991122
11001123 @Callable(i)
11011124 func put (slip,autoStake) = {
11021125 let factCfg = gfc()
11031126 let stakingCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactStakCntr]), "Wr st addr")
11041127 let slipCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactSlippCntr]), "Wr sl addr")
11051128 if ((0 > slip))
11061129 then throw("Wrong slippage")
11071130 else if ((size(i.payments) != 2))
11081131 then throw("2 pmnts expd")
11091132 else {
11101133 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
11111134 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
11121135 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amAssetPmt)
11131136 if ((amountAssetBalance == amountAssetBalance))
11141137 then {
11151138 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - prAssetPmt)
11161139 if ((priceAssetBalance == priceAssetBalance))
11171140 then {
11181141 let lpAssetEmission = toBigInt(value(assetInfo(cfgLpAssetId)).quantity)
11191142 if ((lpAssetEmission == lpAssetEmission))
11201143 then {
11211144 let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0))
11221145 if ((currentDLp == currentDLp))
11231146 then {
11241147 let e = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(value(i.payments[0]).assetId, value(i.payments[0]).amount), i.payments[1], slip, true, false, true, 0, "")
11251148 let emitLpAmt = e._2
11261149 let lpAssetId = e._7
11271150 let state = e._9
11281151 let amDiff = e._10
11291152 let prDiff = e._11
11301153 let amId = e._12
11311154 let prId = e._13
11321155 let r = invoke(fca, "emit", [emitLpAmt], nil)
11331156 if ((r == r))
11341157 then {
11351158 let el = match r {
11361159 case legacy: Address =>
11371160 invoke(legacy, "emit", [emitLpAmt], nil)
11381161 case _ =>
11391162 unit
11401163 }
11411164 if ((el == el))
11421165 then {
11431166 let sa = if ((amDiff > 0))
11441167 then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)])
11451168 else nil
11461169 if ((sa == sa))
11471170 then {
11481171 let sp = if ((prDiff > 0))
11491172 then invoke(slipCntr, "put", nil, [AttachedPayment(prId, prDiff)])
11501173 else nil
11511174 if ((sp == sp))
11521175 then {
11531176 let lpTrnsfr = if (autoStake)
11541177 then {
11551178 let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
11561179 if ((ss == ss))
11571180 then nil
11581181 else throw("Strict value is not equal to itself.")
11591182 }
11601183 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
1161- let $t04264442786 = refreshDLpInternal(0, 0, 0)
1162- let refreshDLpActions = $t04264442786._1
1163- let updatedDLp = $t04264442786._2
1184+ let $t04327343415 = refreshDLpInternal(0, 0, 0)
1185+ let refreshDLpActions = $t04327343415._1
1186+ let updatedDLp = $t04327343415._2
11641187 let check = if ((updatedDLp >= currentDLp))
11651188 then true
11661189 else throwErr(makeString(["updated DLp lower than current DLp", toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentDLp), toString(updatedDLp), toString(amDiff), toString(prDiff)], " "))
11671190 if ((check == check))
11681191 then {
11691192 let lpAssetEmissionAfter = value(assetInfo(cfgLpAssetId)).quantity
11701193 if ((lpAssetEmissionAfter == lpAssetEmissionAfter))
11711194 then ((state ++ lpTrnsfr) ++ refreshDLpActions)
11721195 else throw("Strict value is not equal to itself.")
11731196 }
11741197 else throw("Strict value is not equal to itself.")
11751198 }
11761199 else throw("Strict value is not equal to itself.")
11771200 }
11781201 else throw("Strict value is not equal to itself.")
11791202 }
11801203 else throw("Strict value is not equal to itself.")
11811204 }
11821205 else throw("Strict value is not equal to itself.")
11831206 }
11841207 else throw("Strict value is not equal to itself.")
11851208 }
11861209 else throw("Strict value is not equal to itself.")
11871210 }
11881211 else throw("Strict value is not equal to itself.")
11891212 }
11901213 else throw("Strict value is not equal to itself.")
11911214 }
11921215 }
11931216
11941217
11951218
11961219 @Callable(i)
11971220 func putOneTknV2 (minOutAmount,autoStake) = {
11981221 let isPoolOneTokenOperationsDisabled = {
11991222 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
12001223 if ($isInstanceOf(@, "Boolean"))
12011224 then @
12021225 else throw(($getType(@) + " couldn't be cast to Boolean"))
12031226 }
1204- let isPutDisabled = if (if (if (igs())
1205- then true
1206- else (cfgPoolStatus == PoolPutDis))
1207- then true
1208- else (cfgPoolStatus == PoolShutdown))
1209- then true
1210- else isPoolOneTokenOperationsDisabled
1227+ let isPutDisabled = if (!(isAddressWhitelisted(i.caller)))
1228+ then if (if (if (igs())
1229+ then true
1230+ else (cfgPoolStatus == PoolPutDis))
1231+ then true
1232+ else (cfgPoolStatus == PoolShutdown))
1233+ then true
1234+ else isPoolOneTokenOperationsDisabled
1235+ else false
12111236 let checks = [if (if (!(isPutDisabled))
12121237 then true
12131238 else isManager(i))
12141239 then true
12151240 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
12161241 then true
12171242 else throwErr("exactly 1 payment are expected")]
12181243 if ((checks == checks))
12191244 then {
12201245 let amId = toBase58String(value(cfgAmountAssetId))
12211246 let prId = toBase58String(value(cfgPriceAssetId))
12221247 let lpId = cfgLpAssetId
12231248 let amDecimals = cfgAmountAssetDecimals
12241249 let prDecimals = cfgPriceAssetDecimals
12251250 let userAddress = if ((i.caller == this))
12261251 then i.originCaller
12271252 else i.caller
12281253 let pmt = value(i.payments[0])
12291254 let pmtAssetId = toBase58String(value(pmt.assetId))
12301255 let pmtAmt = pmt.amount
12311256 let currentDLp = if ((pmt.assetId == cfgAmountAssetId))
12321257 then calcCurrentDLp(toBigInt(pmtAmt), toBigInt(0), toBigInt(0))
12331258 else calcCurrentDLp(toBigInt(0), toBigInt(pmtAmt), toBigInt(0))
12341259 if ((currentDLp == currentDLp))
12351260 then {
1236- let $t04442744585 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1237- if (($t04442744585 == $t04442744585))
1261+ let $t04509345251 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true)
1262+ if (($t04509345251 == $t04509345251))
12381263 then {
1239- let feeAmount = $t04442744585._3
1240- let state = $t04442744585._2
1241- let estimLP = $t04442744585._1
1264+ let feeAmount = $t04509345251._3
1265+ let state = $t04509345251._2
1266+ let estimLP = $t04509345251._1
12421267 let emitLpAmt = if (if ((minOutAmount > 0))
12431268 then (minOutAmount > estimLP)
12441269 else false)
12451270 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
12461271 else estimLP
12471272 let e = invoke(fca, "emit", [emitLpAmt], nil)
12481273 if ((e == e))
12491274 then {
12501275 let el = match e {
12511276 case legacy: Address =>
12521277 invoke(legacy, "emit", [emitLpAmt], nil)
12531278 case _ =>
12541279 unit
12551280 }
12561281 if ((el == el))
12571282 then {
12581283 let lpTrnsfr = if (autoStake)
12591284 then {
12601285 let ss = invoke(stakingContract, "stakeFor", [toString(i.caller)], [AttachedPayment(lpId, emitLpAmt)])
12611286 if ((ss == ss))
12621287 then nil
12631288 else throw("Strict value is not equal to itself.")
12641289 }
12651290 else [ScriptTransfer(i.caller, emitLpAmt, lpId)]
12661291 let sendFeeToMatcher = if ((feeAmount > 0))
12671292 then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))]
12681293 else nil
1269- let $t04547045819 = if ((this == feeCollectorAddress))
1294+ let $t04613646485 = if ((this == feeCollectorAddress))
12701295 then $Tuple2(0, 0)
12711296 else {
12721297 let paymentInAmountAsset = if ((pmt.assetId == cfgAmountAssetId))
12731298 then true
12741299 else false
12751300 if (paymentInAmountAsset)
12761301 then $Tuple2(-(feeAmount), 0)
12771302 else $Tuple2(0, -(feeAmount))
12781303 }
1279- let amountAssetBalanceDelta = $t04547045819._1
1280- let priceAssetBalanceDelta = $t04547045819._2
1281- let $t04582245930 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1282- let refreshDLpActions = $t04582245930._1
1283- let updatedDLp = $t04582245930._2
1304+ let amountAssetBalanceDelta = $t04613646485._1
1305+ let priceAssetBalanceDelta = $t04613646485._2
1306+ let $t04648846596 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1307+ let refreshDLpActions = $t04648846596._1
1308+ let updatedDLp = $t04648846596._2
12841309 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
12851310 if ((isUpdatedDLpValid == isUpdatedDLpValid))
12861311 then $Tuple2((((state ++ lpTrnsfr) ++ sendFeeToMatcher) ++ refreshDLpActions), emitLpAmt)
12871312 else throw("Strict value is not equal to itself.")
12881313 }
12891314 else throw("Strict value is not equal to itself.")
12901315 }
12911316 else throw("Strict value is not equal to itself.")
12921317 }
12931318 else throw("Strict value is not equal to itself.")
12941319 }
12951320 else throw("Strict value is not equal to itself.")
12961321 }
12971322 else throw("Strict value is not equal to itself.")
12981323 }
12991324
13001325
13011326
13021327 @Callable(i)
13031328 func putForFree (maxSlpg) = if ((0 > maxSlpg))
13041329 then throw("Wrong slpg")
13051330 else if ((size(i.payments) != 2))
13061331 then throw("2 pmnts expd")
13071332 else {
13081333 let estPut = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(value(i.payments[0]).assetId, value(i.payments[0]).amount), i.payments[1], maxSlpg, false, false, true, 0, "")
13091334 let state = estPut._9
13101335 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
13111336 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
13121337 let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0))
13131338 if ((currentDLp == currentDLp))
13141339 then {
1315- let $t04696047025 = refreshDLpInternal(0, 0, 0)
1316- let refreshDLpActions = $t04696047025._1
1317- let updatedDLp = $t04696047025._2
1340+ let $t04762647691 = refreshDLpInternal(0, 0, 0)
1341+ let refreshDLpActions = $t04762647691._1
1342+ let updatedDLp = $t04762647691._2
13181343 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
13191344 if ((isUpdatedDLpValid == isUpdatedDLpValid))
13201345 then (state ++ refreshDLpActions)
13211346 else throw("Strict value is not equal to itself.")
13221347 }
13231348 else throw("Strict value is not equal to itself.")
13241349 }
13251350
13261351
13271352
13281353 @Callable(i)
13291354 func get () = {
13301355 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0))
13311356 if ((currentDLp == currentDLp))
13321357 then {
13331358 let r = cg(i)
13341359 let outAmtAmt = r._1
13351360 let outPrAmt = r._2
13361361 let pmtAmt = r._3
13371362 let pmtAssetId = r._4
13381363 let state = r._5
13391364 let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
13401365 if ((b == b))
13411366 then {
1342- let $t04819848280 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1343- let refreshDLpActions = $t04819848280._1
1344- let updatedDLp = $t04819848280._2
1367+ let $t04886448946 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1368+ let refreshDLpActions = $t04886448946._1
1369+ let updatedDLp = $t04886448946._2
13451370 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
13461371 if ((isUpdatedDLpValid == isUpdatedDLpValid))
13471372 then (state ++ refreshDLpActions)
13481373 else throw("Strict value is not equal to itself.")
13491374 }
13501375 else throw("Strict value is not equal to itself.")
13511376 }
13521377 else throw("Strict value is not equal to itself.")
13531378 }
13541379
13551380
13561381
13571382 @Callable(i)
13581383 func getOneTknV2 (outAssetId,minOutAmount) = {
13591384 let isPoolOneTokenOperationsDisabled = {
13601385 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
13611386 if ($isInstanceOf(@, "Boolean"))
13621387 then @
13631388 else throw(($getType(@) + " couldn't be cast to Boolean"))
13641389 }
1365- let isGetDisabled = if (if (igs())
1366- then true
1367- else (cfgPoolStatus == PoolShutdown))
1368- then true
1369- else isPoolOneTokenOperationsDisabled
1390+ let isGetDisabled = if (!(isAddressWhitelisted(i.caller)))
1391+ then if (if (igs())
1392+ then true
1393+ else (cfgPoolStatus == PoolShutdown))
1394+ then true
1395+ else isPoolOneTokenOperationsDisabled
1396+ else false
13701397 let checks = [if (if (!(isGetDisabled))
13711398 then true
13721399 else isManager(i))
13731400 then true
13741401 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
13751402 then true
13761403 else throwErr("exactly 1 payment are expected")]
13771404 if ((checks == checks))
13781405 then {
1379- let $t04889849053 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1380- let state = $t04889849053._1
1381- let totalAmount = $t04889849053._2
1406+ let $t04960149756 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId)
1407+ let state = $t04960149756._1
1408+ let totalAmount = $t04960149756._2
13821409 $Tuple2(state, totalAmount)
13831410 }
13841411 else throw("Strict value is not equal to itself.")
13851412 }
13861413
13871414
13881415
13891416 @Callable(i)
13901417 func refreshDLp () = {
13911418 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyDLpRefreshedHeight), 0)
13921419 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= dLpRefreshDelay))
13931420 then unit
13941421 else throwErr(makeString([toString(dLpRefreshDelay), " blocks have not passed since the previous call"], ""))
13951422 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
13961423 then {
13971424 let dLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyDLp), "0")), fmtErr("invalid dLp"))
1398- let $t04957749641 = refreshDLpInternal(0, 0, 0)
1399- let dLpUpdateActions = $t04957749641._1
1400- let updatedDLp = $t04957749641._2
1425+ let $t05028050344 = refreshDLpInternal(0, 0, 0)
1426+ let dLpUpdateActions = $t05028050344._1
1427+ let updatedDLp = $t05028050344._2
14011428 let actions = if ((dLp != updatedDLp))
14021429 then dLpUpdateActions
14031430 else throwErr("nothing to refresh")
14041431 $Tuple2(actions, toString(updatedDLp))
14051432 }
14061433 else throw("Strict value is not equal to itself.")
14071434 }
14081435
14091436
14101437
14111438 @Callable(i)
14121439 func getOneTknV2READONLY (outAssetId,lpAssetAmount) = {
14131440 let amId = toBase58String(value(cfgAmountAssetId))
14141441 let prId = toBase58String(value(cfgPriceAssetId))
14151442 let lpId = toBase58String(value(cfgLpAssetId))
14161443 let xp = [toBigInt(getAccBalance(amId)), toBigInt(getAccBalance(prId))]
14171444 let lpEmission = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "invalid lp asset").quantity)
14181445 let D0 = getD(xp)
14191446 let D1 = (D0 - fraction(toBigInt(lpAssetAmount), D0, lpEmission))
14201447 let index = if ((outAssetId == amId))
14211448 then 0
14221449 else if ((outAssetId == prId))
14231450 then 1
14241451 else throw("invalid out asset id")
14251452 let newY = getYD(xp, index, D1)
14261453 let dy = (xp[index] - newY)
14271454 let totalGetRaw = max([0, toInt((dy - big1))])
1428- let $t05065150706 = takeFee(totalGetRaw, outFee)
1429- let totalGet = $t05065150706._1
1430- let feeAmount = $t05065150706._2
1455+ let $t05135451409 = takeFee(totalGetRaw, outFee)
1456+ let totalGet = $t05135451409._1
1457+ let feeAmount = $t05135451409._2
14311458 $Tuple2(nil, $Tuple2(totalGet, feeAmount))
14321459 }
14331460
14341461
14351462
14361463 @Callable(i)
14371464 func getOneTknV2WithBonusREADONLY (outAssetId,lpAssetAmount) = {
14381465 let amId = toBase58String(value(cfgAmountAssetId))
14391466 let prId = toBase58String(value(cfgPriceAssetId))
14401467 let lpId = toBase58String(value(cfgLpAssetId))
14411468 let amBalance = getAccBalance(amId)
14421469 let prBalance = getAccBalance(prId)
1443- let $t05108151196 = {
1470+ let $t05178451899 = {
14441471 let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil)
14451472 if ($isInstanceOf(@, "(Int, Int)"))
14461473 then @
14471474 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
14481475 }
1449- let totalGet = $t05108151196._1
1450- let feeAmount = $t05108151196._2
1476+ let totalGet = $t05178451899._1
1477+ let feeAmount = $t05178451899._2
14511478 let r = ego("", lpId, lpAssetAmount, this)
14521479 let outAmAmt = r._1
14531480 let outPrAmt = r._2
14541481 let sumOfGetAssets = (outAmAmt + outPrAmt)
14551482 let bonus = if ((sumOfGetAssets == 0))
14561483 then if ((totalGet == 0))
14571484 then 0
14581485 else throw("bonus calculation error")
14591486 else fraction((totalGet - sumOfGetAssets), scale8, sumOfGetAssets)
14601487 $Tuple2(nil, $Tuple3(totalGet, feeAmount, bonus))
14611488 }
14621489
14631490
14641491
14651492 @Callable(i)
14661493 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
14671494 let r = cg(i)
14681495 let outAmAmt = r._1
14691496 let outPrAmt = r._2
14701497 let pmtAmt = r._3
14711498 let pmtAssetId = r._4
14721499 let state = r._5
14731500 if ((noLessThenAmtAsset > outAmAmt))
14741501 then throw(((("Failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
14751502 else if ((noLessThenPriceAsset > outPrAmt))
14761503 then throw(((("Failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
14771504 else {
14781505 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0))
14791506 if ((currentDLp == currentDLp))
14801507 then {
14811508 let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14821509 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14831510 then {
1484- let $t05236252443 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1485- let refreshDLpActions = $t05236252443._1
1486- let updatedDLp = $t05236252443._2
1511+ let $t05306553146 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1512+ let refreshDLpActions = $t05306553146._1
1513+ let updatedDLp = $t05306553146._2
14871514 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
14881515 if ((isUpdatedDLpValid == isUpdatedDLpValid))
14891516 then (state ++ refreshDLpActions)
14901517 else throw("Strict value is not equal to itself.")
14911518 }
14921519 else throw("Strict value is not equal to itself.")
14931520 }
14941521 else throw("Strict value is not equal to itself.")
14951522 }
14961523 }
14971524
14981525
14991526
15001527 @Callable(i)
15011528 func unstakeAndGet (amount) = {
15021529 let checkPayments = if ((size(i.payments) != 0))
15031530 then throw("No pmnts expd")
15041531 else true
15051532 if ((checkPayments == checkPayments))
15061533 then {
15071534 let factoryCfg = gfc()
15081535 let lpAssetId = cfgLpAssetId
15091536 let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr")
15101537 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0))
15111538 if ((currentDLp == currentDLp))
15121539 then {
15131540 let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil)
15141541 if ((unstakeInv == unstakeInv))
15151542 then {
15161543 let r = ego(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
15171544 let outAmAmt = r._1
15181545 let outPrAmt = r._2
15191546 let sts = parseIntValue(r._9)
15201547 let state = r._10
1521- let v = if (if (igs())
1522- then true
1523- else (sts == PoolShutdown))
1548+ let isGetDisabled = if (!(isAddressWhitelisted(i.caller)))
1549+ then if (igs())
1550+ then true
1551+ else (cfgPoolStatus == PoolShutdown)
1552+ else false
1553+ let v = if (isGetDisabled)
15241554 then throw(("Blocked: " + toString(sts)))
15251555 else true
15261556 if ((v == v))
15271557 then {
15281558 let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
15291559 if ((burnA == burnA))
15301560 then {
1531- let $t05347053551 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1532- let refreshDLpActions = $t05347053551._1
1533- let updatedDLp = $t05347053551._2
1561+ let $t05425654337 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1562+ let refreshDLpActions = $t05425654337._1
1563+ let updatedDLp = $t05425654337._2
15341564 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
15351565 if ((isUpdatedDLpValid == isUpdatedDLpValid))
15361566 then (state ++ refreshDLpActions)
15371567 else throw("Strict value is not equal to itself.")
15381568 }
15391569 else throw("Strict value is not equal to itself.")
15401570 }
15411571 else throw("Strict value is not equal to itself.")
15421572 }
15431573 else throw("Strict value is not equal to itself.")
15441574 }
15451575 else throw("Strict value is not equal to itself.")
15461576 }
15471577 else throw("Strict value is not equal to itself.")
15481578 }
15491579
15501580
15511581
15521582 @Callable(i)
15531583 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
1554- let isGetDisabled = if (igs())
1555- then true
1556- else (cfgPoolStatus == PoolShutdown)
1584+ let isGetDisabled = if (!(isAddressWhitelisted(i.caller)))
1585+ then if (igs())
1586+ then true
1587+ else (cfgPoolStatus == PoolShutdown)
1588+ else false
15571589 let checks = [if (!(isGetDisabled))
15581590 then true
15591591 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
15601592 then true
15611593 else throw("no payments are expected")]
15621594 if ((checks == checks))
15631595 then {
15641596 let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0))
15651597 if ((currentDLp == currentDLp))
15661598 then {
15671599 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
15681600 if ((unstakeInv == unstakeInv))
15691601 then {
15701602 let res = ego(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
15711603 let outAmAmt = res._1
15721604 let outPrAmt = res._2
15731605 let state = res._10
15741606 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
15751607 then true
15761608 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
15771609 then true
15781610 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
15791611 if ((checkAmounts == checkAmounts))
15801612 then {
15811613 let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
15821614 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15831615 then {
1584- let $t05480254883 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1585- let refreshDLpActions = $t05480254883._1
1586- let updatedDLp = $t05480254883._2
1616+ let $t05562555706 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0)
1617+ let refreshDLpActions = $t05562555706._1
1618+ let updatedDLp = $t05562555706._2
15871619 let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp)
15881620 if ((isUpdatedDLpValid == isUpdatedDLpValid))
15891621 then (state ++ refreshDLpActions)
15901622 else throw("Strict value is not equal to itself.")
15911623 }
15921624 else throw("Strict value is not equal to itself.")
15931625 }
15941626 else throw("Strict value is not equal to itself.")
15951627 }
15961628 else throw("Strict value is not equal to itself.")
15971629 }
15981630 else throw("Strict value is not equal to itself.")
15991631 }
16001632 else throw("Strict value is not equal to itself.")
16011633 }
16021634
16031635
16041636
16051637 @Callable(i)
16061638 func unstakeAndGetOneTknV2 (unstakeAmount,outAssetId,minOutAmount) = {
16071639 let isPoolOneTokenOperationsDisabled = {
16081640 let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
16091641 if ($isInstanceOf(@, "Boolean"))
16101642 then @
16111643 else throw(($getType(@) + " couldn't be cast to Boolean"))
16121644 }
1613- let isGetDisabled = if (if (igs())
1614- then true
1615- else (cfgPoolStatus == PoolShutdown))
1616- then true
1617- else isPoolOneTokenOperationsDisabled
1645+ let isGetDisabled = if (!(isAddressWhitelisted(i.caller)))
1646+ then if (if (igs())
1647+ then true
1648+ else (cfgPoolStatus == PoolShutdown))
1649+ then true
1650+ else isPoolOneTokenOperationsDisabled
1651+ else false
16181652 let checks = [if (if (!(isGetDisabled))
16191653 then true
16201654 else isManager(i))
16211655 then true
16221656 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
16231657 then true
16241658 else throwErr("no payments are expected")]
16251659 if ((checks == checks))
16261660 then {
16271661 let factoryCfg = gfc()
16281662 let lpAssetId = cfgLpAssetId
16291663 let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr")
16301664 let userAddress = i.caller
16311665 let lpAssetRecipientAddress = this
16321666 let unstakeInv = invoke(staking, "unstakeINTERNAL", [lpAssetId, unstakeAmount, userAddress.bytes, lpAssetRecipientAddress.bytes], nil)
16331667 if ((unstakeInv == unstakeInv))
16341668 then {
1635- let $t05590556093 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1636- let state = $t05590556093._1
1637- let totalAmount = $t05590556093._2
1669+ let $t05676556953 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId)
1670+ let state = $t05676556953._1
1671+ let totalAmount = $t05676556953._2
16381672 $Tuple2(state, totalAmount)
16391673 }
16401674 else throw("Strict value is not equal to itself.")
16411675 }
16421676 else throw("Strict value is not equal to itself.")
16431677 }
16441678
16451679
16461680
16471681 @Callable(i)
16481682 func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = {
1649- let $t05622156324 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1650- let lpAmount = $t05622156324._1
1651- let state = $t05622156324._2
1652- let feeAmount = $t05622156324._3
1653- let bonus = $t05622156324._4
1683+ let $t05708157184 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true)
1684+ let lpAmount = $t05708157184._1
1685+ let state = $t05708157184._2
1686+ let feeAmount = $t05708157184._3
1687+ let bonus = $t05708157184._4
16541688 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
16551689 }
16561690
16571691
16581692
16591693 @Callable(i)
16601694 func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = {
1661- let $t05647256576 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1662- let lpAmount = $t05647256576._1
1663- let state = $t05647256576._2
1664- let feeAmount = $t05647256576._3
1665- let bonus = $t05647256576._4
1695+ let $t05733257436 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false)
1696+ let lpAmount = $t05733257436._1
1697+ let state = $t05733257436._2
1698+ let feeAmount = $t05733257436._3
1699+ let bonus = $t05733257436._4
16661700 $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus))
16671701 }
16681702
16691703
16701704
16711705 @Callable(i)
16721706 func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString(fca)))
16731707 then throw("denied")
16741708 else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr), StringEntry(amp(), toString(ampInitial)), StringEntry(keyAmpHistory(height), toString(ampInitial))], "success")
16751709
16761710
16771711
16781712 @Callable(i)
16791713 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, gpc())
16801714
16811715
16821716
16831717 @Callable(i)
16841718 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
16851719
16861720
16871721
16881722 @Callable(i)
16891723 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
16901724 let pr = calcPrices(amAmt, prAmt, lpAmt)
16911725 $Tuple2(nil, [toString(pr[0]), toString(pr[1]), toString(pr[2])])
16921726 }
16931727
16941728
16951729
16961730 @Callable(i)
16971731 func fromX18WrapperREADONLY (val,resScaleMult) = $Tuple2(nil, f1(parseBigIntValue(val), resScaleMult))
16981732
16991733
17001734
17011735 @Callable(i)
17021736 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(t1(origVal, origScaleMult)))
17031737
17041738
17051739
17061740 @Callable(i)
17071741 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(cpbi(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
17081742
17091743
17101744
17111745 @Callable(i)
17121746 func estimatePutOperationWrapperREADONLY (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,usrAddr,isEval,emitLp) = $Tuple2(nil, epo(txId58, slippage, inAmAmt, inAmId, inPrAmt, inPrId, usrAddr, isEval, emitLp, true, false, 0, ""))
17131747
17141748
17151749
17161750 @Callable(i)
17171751 func estimateGetOperationWrapperREADONLY (txId58,pmtAsId,pmtLpAmt,usrAddr) = {
17181752 let r = ego(txId58, pmtAsId, pmtLpAmt, addressFromStringValue(usrAddr))
17191753 $Tuple2(nil, $Tuple10(r._1, r._2, r._3, r._4, r._5, r._6, r._7, toString(r._8), r._9, r._10))
17201754 }
17211755
17221756
17231757
17241758 @Callable(i)
17251759 func changeAmp () = {
17261760 let cfg = invoke(fca, "getChangeAmpConfigREADONLY", [toString(this)], nil)
1727- let $t05905659255 = match cfg {
1761+ let $t05991660115 = match cfg {
17281762 case list: List[Any] =>
17291763 $Tuple3({
17301764 let @ = list[0]
17311765 if ($isInstanceOf(@, "Int"))
17321766 then @
17331767 else throw(($getType(@) + " couldn't be cast to Int"))
17341768 }, {
17351769 let @ = list[1]
17361770 if ($isInstanceOf(@, "Int"))
17371771 then @
17381772 else throw(($getType(@) + " couldn't be cast to Int"))
17391773 }, {
17401774 let @ = list[2]
17411775 if ($isInstanceOf(@, "Int"))
17421776 then @
17431777 else throw(($getType(@) + " couldn't be cast to Int"))
17441778 })
17451779 case _ =>
17461780 throwErr("invalid entry type")
17471781 }
1748- let delay = $t05905659255._1
1749- let delta = $t05905659255._2
1750- let target = $t05905659255._3
1782+ let delay = $t05991660115._1
1783+ let delta = $t05991660115._2
1784+ let target = $t05991660115._3
17511785 let curAmp = parseIntValue(getStringValue(amp()))
17521786 let newAmpRaw = (curAmp + delta)
17531787 let newAmp = if ((0 > delta))
17541788 then if ((target > newAmpRaw))
17551789 then target
17561790 else newAmpRaw
17571791 else if ((newAmpRaw > target))
17581792 then target
17591793 else newAmpRaw
17601794 let lastCall = valueOrElse(getInteger(keyChangeAmpLastCall()), 0)
17611795 let wait = (lastCall + delay)
17621796 let checks = [if ((height > wait))
17631797 then true
17641798 else throwErr("try again in few blocks"), if ((curAmp != newAmp))
17651799 then true
17661800 else throwErr("already reached target")]
17671801 if ((checks == checks))
17681802 then [IntegerEntry(keyChangeAmpLastCall(), height), StringEntry(amp(), toString(newAmp)), StringEntry(keyAmpHistory(height), toString(newAmp))]
17691803 else throw("Strict value is not equal to itself.")
17701804 }
17711805
17721806
17731807 @Verifier(tx)
17741808 func verify () = {
17751809 let targetPublicKey = match managerPublicKeyOrUnit() {
17761810 case pk: ByteVector =>
17771811 pk
17781812 case _: Unit =>
17791813 tx.senderPublicKey
17801814 case _ =>
17811815 throw("Match error")
17821816 }
17831817 match tx {
17841818 case order: Order =>
17851819 let matcherPub = mp()
1786- let $t06018860305 = if (skipOrderValidation())
1820+ let $t06104861165 = if (skipOrderValidation())
17871821 then $Tuple2(true, "")
17881822 else validateMatcherOrderAllowed(order)
1789- let orderValid = $t06018860305._1
1790- let orderValidInfo = $t06018860305._2
1823+ let orderValid = $t06104861165._1
1824+ let orderValidInfo = $t06104861165._2
17911825 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
17921826 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
17931827 if (if (if (orderValid)
17941828 then senderValid
17951829 else false)
17961830 then matcherValid
17971831 else false)
17981832 then true
17991833 else throwOrderError(orderValid, orderValidInfo, senderValid, matcherValid)
18001834 case s: SetScriptTransaction =>
18011835 if (sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey))
18021836 then true
18031837 else {
18041838 let newHash = blake2b256(value(s.script))
18051839 let allowedHash = fromBase64String(value(getString(fca, keyAllowedLpStableScriptHash())))
18061840 let currentHash = scriptHash(this)
18071841 if ((allowedHash == newHash))
18081842 then (currentHash != newHash)
18091843 else false
18101844 }
18111845 case _ =>
18121846 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
18131847 }
18141848 }
18151849

github/deemru/w8io/169f3d6 
270.32 ms