tx · 71xkSAXJ22iimyFGHFKUNYC9w1bgyd7tEqfSwaxCKLME 3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA: -0.03600000 Waves 2023.01.20 14:24 [2413226] smart account 3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA > SELF 0.00000000 Waves
{ "type": 13, "id": "71xkSAXJ22iimyFGHFKUNYC9w1bgyd7tEqfSwaxCKLME", "fee": 3600000, "feeAssetId": null, "timestamp": 1674213939620, "version": 1, "sender": "3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA", "senderPublicKey": "35yd3qw1gxKDxKwGAykHN9fANbXNWwseaUwbWDj24o3x", "proofs": [ "5f69Ui8Z4VxiMEYxunSTE8CHhxFQpye564ZMxe9K5aA5Qtjc6df47vREzayDzZLzq1jW8e5Kc3qcd3s7rNwSaT69" ], "script": "base64:BgKJKQgCEgMKAQgSAwoBCBIAEgQKAgEEEgQKAgEEEgMKAQESABIECgIIARIAEgQKAggBEgQKAggBEgQKAgEBEgMKAQESBQoDAQEBEgUKAwEIARIECgIBCBIECgIBCBIECgIICBIECgIICBIECgIIARIAEgMKAQgSBQoDAQEBEgQKAggBEgQKAgEBEgQKAggIEgsKCQgBAQIBAggEBBIGCgQICAEIIgZzY2FsZTgiDHNjYWxlOEJpZ0ludCIHc2NhbGUxOCIKemVyb0JpZ0ludCIEYmlnMCIEYmlnMSIEYmlnMiIEYmlnMyIEYmlnNCIKc2xpcHBhZ2U0RCILd2F2ZXNTdHJpbmciBUFtdWx0IgVEY29udiIDU0VQIgVFTVBUWSIKUG9vbEFjdGl2ZSIKUG9vbFB1dERpcyIOUG9vbE1hdGNoZXJEaXMiDFBvb2xTaHV0ZG93biIOaWR4UG9vbEFkZHJlc3MiCWlkeFBvb2xTdCIJaWR4TFBBc0lkIglpZHhBbUFzSWQiCWlkeFByQXNJZCILaWR4QW10QXNEY20iDWlkeFByaWNlQXNEY20iC2lkeElBbXRBc0lkIg1pZHhJUHJpY2VBc0lk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IKQnl0ZVZlY3RvcgQCZ3AFAmdsBQJncAMJAAECBQJnbAIEVW5pdAgFAmhRD3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yBAJnbAUCaFEDCQABAgUCZ2wCBU9yZGVyBAJlWgUCZ2wEAmhUCQECYVcABAJoVQkBAmVZAQUCZVoEAmFGCAUCaFUCXzEEAmFHCAUCaFUCXzIEAmFICQD0AwMIBQJlWglib2R5Qnl0ZXMJAJEDAggFAmVaBnByb29mcwAACAUCZVoPc2VuZGVyUHVibGljS2V5BAJhSQkA9AMDCAUCZVoJYm9keUJ5dGVzCQCRAwIIBQJlWgZwcm9vZnMAAQUCaFQDAwMFAmFGBQJhSAcFAmFJBwYJAQJhRQQFAmFGBQJhRwUCYUgFAmFJAwkAAQIFAmdsAhRTZXRTY3JpcHRUcmFuc2FjdGlvbgQCY0MFAmdsAwkA9AMDCAUCaFEJYm9keUJ5dGVzCQCRAwIIBQJoUQZwcm9vZnMAAAUCaFMGBAJoVgkA9gMBCQEFdmFsdWUBCAUCY0MGc2NyaXB0BAJoVwkA2wQBCQEFdmFsdWUBCQCdCAIFAmFRCQECYUMABAJoWAkA8QcBBQR0aGlzAwkAAAIFAmhXBQJoVgkBAiE9AgUCaFgFAmhWBwkA9AMDCAUCaFEJYm9keUJ5dGVzCQCRAwIIBQJoUQZwcm9vZnMAAAUCaFNP7bKc", "chainId": 84, "height": 2413226, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EEUA7MRyYeN4rfsuJ1TUjAmwrk8zBS4f9xsPRh8PnNQU Next: ADcQZgf6hwDqSmrYcYLdcpB1qXEL8oueK2UDM9GYVgrA Diff:
Old | New | Differences | |
---|---|---|---|
19 | 19 | ||
20 | 20 | let big4 = toBigInt(4) | |
21 | 21 | ||
22 | + | let slippage4D = toBigInt((scale8 - ((scale8 * 1) / scale8))) | |
23 | + | ||
22 | 24 | let wavesString = "WAVES" | |
23 | 25 | ||
24 | 26 | let Amult = "100" | |
25 | 27 | ||
28 | + | let Dconv = "1" | |
29 | + | ||
26 | 30 | let SEP = "__" | |
31 | + | ||
32 | + | let EMPTY = "" | |
33 | + | ||
34 | + | let PoolActive = 1 | |
27 | 35 | ||
28 | 36 | let PoolPutDis = 2 | |
29 | 37 | ||
55 | 63 | ||
56 | 64 | let idxFactSlippCntr = 7 | |
57 | 65 | ||
66 | + | let idxFactGwxRewCntr = 10 | |
67 | + | ||
58 | 68 | let feeDefault = fraction(10, scale8, 10000) | |
59 | 69 | ||
60 | 70 | func t1 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult)) | |
67 | 77 | ||
68 | 78 | ||
69 | 79 | func fromX18Round (val,resultScaleMult,round) = toInt(fraction(val, toBigInt(resultScaleMult), scale18, round)) | |
80 | + | ||
81 | + | ||
82 | + | func t2 (origVal,origScaleMult) = fraction(origVal, scale18, toBigInt(origScaleMult)) | |
83 | + | ||
84 | + | ||
85 | + | func f2 (val,resultScaleMult) = fraction(val, toBigInt(resultScaleMult), scale18) | |
86 | + | ||
87 | + | ||
88 | + | func ts (amt,resScale,curScale) = fraction(amt, resScale, curScale) | |
70 | 89 | ||
71 | 90 | ||
72 | 91 | func abs (val) = if ((zeroBigInt > val)) | |
214 | 233 | ||
215 | 234 | let $t079648193 = poolConfigParsed | |
216 | 235 | ||
236 | + | let cfgPoolAddress = $t079648193._1 | |
237 | + | ||
217 | 238 | let cfgPoolStatus = $t079648193._2 | |
218 | 239 | ||
219 | 240 | let cfgLpAssetId = $t079648193._3 | |
237 | 258 | ||
238 | 259 | let stakingContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactStakCntr]), "Invalid staking contract address") | |
239 | 260 | ||
261 | + | let slipageContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactSlippCntr]), "Invalid slipage contract address") | |
262 | + | ||
263 | + | let gwxContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactGwxRewCntr]), "Invalid gwx contract address") | |
264 | + | ||
240 | 265 | let restContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactoryRestCntr]), "Invalid gwx contract address") | |
241 | 266 | ||
242 | 267 | 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) | |
256 | 281 | func cpbir (prAmtX18,amAmtX18,round) = fraction(prAmtX18, scale18, amAmtX18, round) | |
257 | 282 | ||
258 | 283 | ||
284 | + | func vad (A1,A2,slippage) = { | |
285 | + | let diff = fraction((A1 - A2), scale8BigInt, A2) | |
286 | + | let pass = ((slippage - abs(diff)) > zeroBigInt) | |
287 | + | if (!(pass)) | |
288 | + | then throw(("Big slpg: " + toString(diff))) | |
289 | + | else $Tuple2(pass, min([A1, A2])) | |
290 | + | } | |
291 | + | ||
292 | + | ||
293 | + | func vd (D1,D0,slpg) = { | |
294 | + | let diff = fraction(D0, scale8BigInt, D1) | |
295 | + | let fail = (slpg > diff) | |
296 | + | if (if (fail) | |
297 | + | then true | |
298 | + | else (D0 > D1)) | |
299 | + | then throw(((((((toString(D0) + " ") + toString(D1)) + " ") + toString(diff)) + " ") + toString(slpg))) | |
300 | + | else fail | |
301 | + | } | |
302 | + | ||
303 | + | ||
259 | 304 | func pcp (amAssetDcm,prAssetDcm,amAmt,prAmt) = { | |
260 | 305 | let amtAsAmtX18 = t1(amAmt, amAssetDcm) | |
261 | 306 | let prAsAmtX18 = t1(prAmt, prAssetDcm) | |
273 | 318 | let lpPrInAmAsX18 = cpbi(amAmtX18, lpAmtX18) | |
274 | 319 | let lpPrInPrAsX18 = cpbi(prAmtX18, lpAmtX18) | |
275 | 320 | [priceX18, lpPrInAmAsX18, lpPrInPrAsX18] | |
321 | + | } | |
322 | + | ||
323 | + | ||
324 | + | func calculatePrices (amAmt,prAmt,lpAmt) = { | |
325 | + | let p = calcPrices(amAmt, prAmt, lpAmt) | |
326 | + | [f1(p[0], scale8), f1(p[1], scale8), f1(p[2], scale8)] | |
276 | 327 | } | |
277 | 328 | ||
278 | 329 | ||
421 | 472 | then { | |
422 | 473 | let curPriceX18 = zeroBigInt | |
423 | 474 | let slippageX18 = zeroBigInt | |
424 | - | let lpAmtX18 = | |
475 | + | let lpAmtX18 = D1 | |
425 | 476 | $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18) | |
426 | 477 | } | |
427 | 478 | else throw("Strict value is not equal to itself.") | |
445 | 496 | else $Tuple2(inAmAssetAmtX18, prViaAmX18) | |
446 | 497 | let expAmtAssetAmtX18 = expectedAmts._1 | |
447 | 498 | let expPriceAssetAmtX18 = expectedAmts._2 | |
448 | - | let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18, FLOOR) | |
449 | - | $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceDcm, CEILING), curPriceX18, slippageX18) | |
499 | + | let D1 = getD([(amBalanceX18 + expAmtAssetAmtX18), (prBalanceX18 + expPriceAssetAmtX18)]) | |
500 | + | let checkD = if ((D1 > D0)) | |
501 | + | then true | |
502 | + | else throw("D1 should be greater than D0") | |
503 | + | if ((checkD == checkD)) | |
504 | + | then { | |
505 | + | let lpAmtX18 = fraction(lpEmissionX18, (D1 - D0), D0) | |
506 | + | $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceDcm, CEILING), curPriceX18, slippageX18) | |
507 | + | } | |
508 | + | else throw("Strict value is not equal to itself.") | |
450 | 509 | } | |
451 | 510 | } | |
452 | 511 | let calcLpAmt = r._1 | |
462 | 521 | else calcLpAmt | |
463 | 522 | let amDiff = (inAmAmt - calcAmAssetPmt) | |
464 | 523 | let prDiff = (inPrAmt - calcPrAssetPmt) | |
465 | - | let $ | |
524 | + | let $t02057720922 = if (if (isOneAsset) | |
466 | 525 | then (pmtId == amIdStr) | |
467 | 526 | else false) | |
468 | 527 | then $Tuple2(pmtAmt, 0) | |
471 | 530 | else false) | |
472 | 531 | then $Tuple2(0, pmtAmt) | |
473 | 532 | else $Tuple2(calcAmAssetPmt, calcPrAssetPmt) | |
474 | - | let writeAmAmt = $ | |
475 | - | let writePrAmt = $ | |
533 | + | let writeAmAmt = $t02057720922._1 | |
534 | + | let writePrAmt = $t02057720922._2 | |
476 | 535 | 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))] | |
477 | 536 | $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId) | |
478 | 537 | } | |
491 | 550 | let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n)) | |
492 | 551 | let b = ((s + ((D * aPrecision) / ann)) - D) | |
493 | 552 | func calc (acc,cur) = { | |
494 | - | let $ | |
495 | - | let y = $ | |
496 | - | let found = $ | |
553 | + | let $t02211722137 = acc | |
554 | + | let y = $t02211722137._1 | |
555 | + | let found = $t02211722137._2 | |
497 | 556 | if ((found != unit)) | |
498 | 557 | then acc | |
499 | 558 | else { | |
506 | 565 | } | |
507 | 566 | ||
508 | 567 | let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
509 | - | let $ | |
568 | + | let $t02244422491 = { | |
510 | 569 | let $l = arr | |
511 | 570 | let $s = size($l) | |
512 | 571 | let $acc0 = $Tuple2(D, unit) | |
520 | 579 | ||
521 | 580 | $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) | |
522 | 581 | } | |
523 | - | let y = $ | |
524 | - | let found = $ | |
582 | + | let y = $t02244422491._1 | |
583 | + | let found = $t02244422491._2 | |
525 | 584 | if ((found != unit)) | |
526 | 585 | then y | |
527 | 586 | else throw(("Y calculation error, Y = " + toString(y))) | |
563 | 622 | func validateMatcherOrderAllowed (order) = { | |
564 | 623 | let amountAssetAmount = order.amount | |
565 | 624 | let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR) | |
566 | - | let $ | |
625 | + | let $t02453524747 = if ((order.orderType == Buy)) | |
567 | 626 | then $Tuple2(amountAssetAmount, -(priceAssetAmount)) | |
568 | 627 | else $Tuple2(-(amountAssetAmount), priceAssetAmount) | |
569 | - | let amountAssetBalanceDelta = $ | |
570 | - | let priceAssetBalanceDelta = $ | |
628 | + | let amountAssetBalanceDelta = $t02453524747._1 | |
629 | + | let priceAssetBalanceDelta = $t02453524747._2 | |
571 | 630 | if (if (if (igs()) | |
572 | 631 | then true | |
573 | 632 | else (cfgPoolStatus == PoolMatcherDis)) | |
580 | 639 | then throw("Wr assets") | |
581 | 640 | else { | |
582 | 641 | let dLp = parseBigIntValue(getStringValue(this, keyDLp)) | |
583 | - | let $ | |
584 | - | let unusedActions = $ | |
585 | - | let dLpNew = $ | |
642 | + | let $t02507725177 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
643 | + | let unusedActions = $t02507725177._1 | |
644 | + | let dLpNew = $t02507725177._2 | |
586 | 645 | let isOrderValid = (dLpNew >= dLp) | |
587 | 646 | let info = makeString([toString(dLp), toString(dLpNew)], " ") | |
588 | 647 | $Tuple2(isOrderValid, info) | |
636 | 695 | then { | |
637 | 696 | let amBalance = getAccBalance(amId) | |
638 | 697 | let prBalance = getAccBalance(prId) | |
639 | - | let $ | |
698 | + | let $t02752927991 = if ((txId == "")) | |
640 | 699 | then $Tuple2(amBalance, prBalance) | |
641 | 700 | else if ((pmtAssetId == amId)) | |
642 | 701 | then if ((pmtAmtRaw > amBalance)) | |
647 | 706 | then throw("invalid payment amount") | |
648 | 707 | else $Tuple2(amBalance, (prBalance - pmtAmtRaw)) | |
649 | 708 | else throw("wrong pmtAssetId") | |
650 | - | let amBalanceOld = $ | |
651 | - | let prBalanceOld = $ | |
652 | - | let $ | |
709 | + | let amBalanceOld = $t02752927991._1 | |
710 | + | let prBalanceOld = $t02752927991._2 | |
711 | + | let $t02799728173 = if ((pmtAssetId == amId)) | |
653 | 712 | then $Tuple2(pmtAmtRaw, 0) | |
654 | 713 | else if ((pmtAssetId == prId)) | |
655 | 714 | then $Tuple2(0, pmtAmtRaw) | |
656 | 715 | else throw("invalid payment") | |
657 | - | let amAmountRaw = $ | |
658 | - | let prAmountRaw = $ | |
659 | - | let $ | |
716 | + | let amAmountRaw = $t02799728173._1 | |
717 | + | let prAmountRaw = $t02799728173._2 | |
718 | + | let $t02817728431 = if (withTakeFee) | |
660 | 719 | then $Tuple3(takeFee(amAmountRaw, inFee)._1, takeFee(prAmountRaw, inFee)._1, takeFee(pmtAmtRaw, inFee)._2) | |
661 | 720 | else $Tuple3(amAmountRaw, prAmountRaw, 0) | |
662 | - | let amAmount = $ | |
663 | - | let prAmount = $ | |
664 | - | let feeAmount = $ | |
721 | + | let amAmount = $t02817728431._1 | |
722 | + | let prAmount = $t02817728431._2 | |
723 | + | let feeAmount = $t02817728431._3 | |
665 | 724 | let amBalanceNew = (amBalanceOld + amAmount) | |
666 | 725 | let prBalanceNew = (prBalanceOld + prAmount) | |
667 | 726 | let D0 = getD([t1(amBalanceOld, cfgAmountAssetDecimals), t1(prBalanceOld, cfgPriceAssetDecimals)]) | |
709 | 768 | else { | |
710 | 769 | let amBalance = getAccBalance(amId) | |
711 | 770 | let prBalance = getAccBalance(prId) | |
712 | - | let $ | |
771 | + | let $t03054330654 = { | |
713 | 772 | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil) | |
714 | 773 | if ($isInstanceOf(@, "(Int, Int)")) | |
715 | 774 | then @ | |
716 | 775 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
717 | 776 | } | |
718 | - | if (($ | |
777 | + | if (($t03054330654 == $t03054330654)) | |
719 | 778 | then { | |
720 | - | let feeAmount = $ | |
721 | - | let totalGet = $ | |
779 | + | let feeAmount = $t03054330654._2 | |
780 | + | let totalGet = $t03054330654._1 | |
722 | 781 | let totalAmount = if (if ((minOutAmount > 0)) | |
723 | 782 | then (minOutAmount > totalGet) | |
724 | 783 | else false) | |
725 | 784 | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
726 | 785 | else totalGet | |
727 | - | let $ | |
786 | + | let $t03084431151 = if ((outAssetId == amId)) | |
728 | 787 | then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance) | |
729 | 788 | else if ((outAssetId == prId)) | |
730 | 789 | then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount)) | |
731 | 790 | else throw("invalid out asset id") | |
732 | - | let outAm = $ | |
733 | - | let outPr = $ | |
734 | - | let amBalanceNew = $ | |
735 | - | let prBalanceNew = $ | |
791 | + | let outAm = $t03084431151._1 | |
792 | + | let outPr = $t03084431151._2 | |
793 | + | let amBalanceNew = $t03084431151._3 | |
794 | + | let prBalanceNew = $t03084431151._4 | |
736 | 795 | let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals)) | |
737 | 796 | let curPr = f1(curPrX18, scale8) | |
738 | 797 | let outAssetIdOrWaves = if ((outAssetId == "WAVES")) | |
747 | 806 | let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
748 | 807 | if ((burn == burn)) | |
749 | 808 | then { | |
750 | - | let $ | |
809 | + | let $t03193632286 = { | |
751 | 810 | let feeAmountForCalc = if ((this == feeCollectorAddress)) | |
752 | 811 | then 0 | |
753 | 812 | else feeAmount | |
758 | 817 | then $Tuple2(-((totalGet + feeAmountForCalc)), 0) | |
759 | 818 | else $Tuple2(0, -((totalGet + feeAmountForCalc))) | |
760 | 819 | } | |
761 | - | let amountAssetBalanceDelta = $ | |
762 | - | let priceAssetBalanceDelta = $ | |
763 | - | let $ | |
764 | - | let refreshDLpActions = $ | |
765 | - | let updatedDLp = $ | |
820 | + | let amountAssetBalanceDelta = $t03193632286._1 | |
821 | + | let priceAssetBalanceDelta = $t03193632286._2 | |
822 | + | let $t03228932397 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
823 | + | let refreshDLpActions = $t03228932397._1 | |
824 | + | let updatedDLp = $t03228932397._2 | |
766 | 825 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
767 | 826 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
768 | 827 | then $Tuple2((state ++ refreshDLpActions), totalAmount) | |
931 | 990 | else throw("Strict value is not equal to itself.") | |
932 | 991 | } | |
933 | 992 | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
934 | - | let $ | |
935 | - | let refreshDLpActions = $ | |
936 | - | let updatedDLp = $ | |
993 | + | let $t03654636688 = refreshDLpInternal(0, 0, 0) | |
994 | + | let refreshDLpActions = $t03654636688._1 | |
995 | + | let updatedDLp = $t03654636688._2 | |
937 | 996 | let check = if ((updatedDLp >= currentDLp)) | |
938 | 997 | then true | |
939 | 998 | else throwErr(makeString(["updated DLp lower than current DLp", toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentDLp), toString(updatedDLp), toString(amDiff), toString(prDiff)], " ")) | |
1006 | 1065 | else calcCurrentDLp(toBigInt(0), toBigInt(pmtAmt), toBigInt(0)) | |
1007 | 1066 | if ((currentDLp == currentDLp)) | |
1008 | 1067 | then { | |
1009 | - | let $ | |
1010 | - | if (($ | |
1068 | + | let $t03832938487 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true) | |
1069 | + | if (($t03832938487 == $t03832938487)) | |
1011 | 1070 | then { | |
1012 | - | let feeAmount = $ | |
1013 | - | let state = $ | |
1014 | - | let estimLP = $ | |
1071 | + | let feeAmount = $t03832938487._3 | |
1072 | + | let state = $t03832938487._2 | |
1073 | + | let estimLP = $t03832938487._1 | |
1015 | 1074 | let emitLpAmt = if (if ((minOutAmount > 0)) | |
1016 | 1075 | then (minOutAmount > estimLP) | |
1017 | 1076 | else false) | |
1039 | 1098 | let sendFeeToMatcher = if ((feeAmount > 0)) | |
1040 | 1099 | then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))] | |
1041 | 1100 | else nil | |
1042 | - | let $ | |
1101 | + | let $t03930239651 = if ((this == feeCollectorAddress)) | |
1043 | 1102 | then $Tuple2(0, 0) | |
1044 | 1103 | else { | |
1045 | 1104 | let paymentInAmountAsset = if ((pmt.assetId == cfgAmountAssetId)) | |
1049 | 1108 | then $Tuple2(-(feeAmount), 0) | |
1050 | 1109 | else $Tuple2(0, -(feeAmount)) | |
1051 | 1110 | } | |
1052 | - | let amountAssetBalanceDelta = $ | |
1053 | - | let priceAssetBalanceDelta = $ | |
1054 | - | let $ | |
1055 | - | let refreshDLpActions = $ | |
1056 | - | let updatedDLp = $ | |
1111 | + | let amountAssetBalanceDelta = $t03930239651._1 | |
1112 | + | let priceAssetBalanceDelta = $t03930239651._2 | |
1113 | + | let $t03965439762 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
1114 | + | let refreshDLpActions = $t03965439762._1 | |
1115 | + | let updatedDLp = $t03965439762._2 | |
1057 | 1116 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1058 | 1117 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1059 | 1118 | then $Tuple2((((state ++ lpTrnsfr) ++ sendFeeToMatcher) ++ refreshDLpActions), emitLpAmt) | |
1085 | 1144 | let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0)) | |
1086 | 1145 | if ((currentDLp == currentDLp)) | |
1087 | 1146 | then { | |
1088 | - | let $ | |
1089 | - | let refreshDLpActions = $ | |
1090 | - | let updatedDLp = $ | |
1147 | + | let $t04079240857 = refreshDLpInternal(0, 0, 0) | |
1148 | + | let refreshDLpActions = $t04079240857._1 | |
1149 | + | let updatedDLp = $t04079240857._2 | |
1091 | 1150 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1092 | 1151 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1093 | 1152 | then (state ++ refreshDLpActions) | |
1112 | 1171 | let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1113 | 1172 | if ((b == b)) | |
1114 | 1173 | then { | |
1115 | - | let $ | |
1116 | - | let refreshDLpActions = $ | |
1117 | - | let updatedDLp = $ | |
1174 | + | let $t04203042112 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0) | |
1175 | + | let refreshDLpActions = $t04203042112._1 | |
1176 | + | let updatedDLp = $t04203042112._2 | |
1118 | 1177 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1119 | 1178 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1120 | 1179 | then (state ++ refreshDLpActions) | |
1149 | 1208 | else throwErr("exactly 1 payment are expected")] | |
1150 | 1209 | if ((checks == checks)) | |
1151 | 1210 | then { | |
1152 | - | let $ | |
1153 | - | let state = $ | |
1154 | - | let totalAmount = $ | |
1211 | + | let $t04273042885 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId) | |
1212 | + | let state = $t04273042885._1 | |
1213 | + | let totalAmount = $t04273042885._2 | |
1155 | 1214 | $Tuple2(state, totalAmount) | |
1156 | 1215 | } | |
1157 | 1216 | else throw("Strict value is not equal to itself.") | |
1168 | 1227 | if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight)) | |
1169 | 1228 | then { | |
1170 | 1229 | let dLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyDLp), "0")), fmtErr("invalid dLp")) | |
1171 | - | let $ | |
1172 | - | let dLpUpdateActions = $ | |
1173 | - | let updatedDLp = $ | |
1230 | + | let $t04340943473 = refreshDLpInternal(0, 0, 0) | |
1231 | + | let dLpUpdateActions = $t04340943473._1 | |
1232 | + | let updatedDLp = $t04340943473._2 | |
1174 | 1233 | let actions = if ((dLp != updatedDLp)) | |
1175 | 1234 | then dLpUpdateActions | |
1176 | 1235 | else throwErr("nothing to refresh") | |
1198 | 1257 | let newY = getYD(xp, index, D1) | |
1199 | 1258 | let dy = (xp[index] - newY) | |
1200 | 1259 | let totalGetRaw = max([0, toInt((dy - big1))]) | |
1201 | - | let $ | |
1202 | - | let totalGet = $ | |
1203 | - | let feeAmount = $ | |
1260 | + | let $t04440344458 = takeFee(totalGetRaw, outFee) | |
1261 | + | let totalGet = $t04440344458._1 | |
1262 | + | let feeAmount = $t04440344458._2 | |
1204 | 1263 | $Tuple2(nil, $Tuple2(totalGet, feeAmount)) | |
1205 | 1264 | } | |
1206 | 1265 | ||
1213 | 1272 | let lpId = toBase58String(value(cfgLpAssetId)) | |
1214 | 1273 | let amBalance = getAccBalance(amId) | |
1215 | 1274 | let prBalance = getAccBalance(prId) | |
1216 | - | let $ | |
1275 | + | let $t04483344948 = { | |
1217 | 1276 | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil) | |
1218 | 1277 | if ($isInstanceOf(@, "(Int, Int)")) | |
1219 | 1278 | then @ | |
1220 | 1279 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
1221 | 1280 | } | |
1222 | - | let totalGet = $ | |
1223 | - | let feeAmount = $ | |
1281 | + | let totalGet = $t04483344948._1 | |
1282 | + | let feeAmount = $t04483344948._2 | |
1224 | 1283 | let r = ego("", lpId, lpAssetAmount, this) | |
1225 | 1284 | let outAmAmt = r._1 | |
1226 | 1285 | let outPrAmt = r._2 | |
1254 | 1313 | let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1255 | 1314 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1256 | 1315 | then { | |
1257 | - | let $ | |
1258 | - | let refreshDLpActions = $ | |
1259 | - | let updatedDLp = $ | |
1316 | + | let $t04611446195 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1317 | + | let refreshDLpActions = $t04611446195._1 | |
1318 | + | let updatedDLp = $t04611446195._2 | |
1260 | 1319 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1261 | 1320 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1262 | 1321 | then (state ++ refreshDLpActions) | |
1301 | 1360 | let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)]) | |
1302 | 1361 | if ((burnA == burnA)) | |
1303 | 1362 | then { | |
1304 | - | let $ | |
1305 | - | let refreshDLpActions = $ | |
1306 | - | let updatedDLp = $ | |
1363 | + | let $t04722247303 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1364 | + | let refreshDLpActions = $t04722247303._1 | |
1365 | + | let updatedDLp = $t04722247303._2 | |
1307 | 1366 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1308 | 1367 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1309 | 1368 | then (state ++ refreshDLpActions) | |
1354 | 1413 | let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)]) | |
1355 | 1414 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1356 | 1415 | then { | |
1357 | - | let $ | |
1358 | - | let refreshDLpActions = $ | |
1359 | - | let updatedDLp = $ | |
1416 | + | let $t04855448635 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1417 | + | let refreshDLpActions = $t04855448635._1 | |
1418 | + | let updatedDLp = $t04855448635._2 | |
1360 | 1419 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1361 | 1420 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1362 | 1421 | then (state ++ refreshDLpActions) | |
1403 | 1462 | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), unstakeAmount], nil) | |
1404 | 1463 | if ((unstakeInv == unstakeInv)) | |
1405 | 1464 | then { | |
1406 | - | let $ | |
1407 | - | let state = $ | |
1408 | - | let totalAmount = $ | |
1465 | + | let $t04953049718 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId) | |
1466 | + | let state = $t04953049718._1 | |
1467 | + | let totalAmount = $t04953049718._2 | |
1409 | 1468 | $Tuple2(state, totalAmount) | |
1410 | 1469 | } | |
1411 | 1470 | else throw("Strict value is not equal to itself.") | |
1417 | 1476 | ||
1418 | 1477 | @Callable(i) | |
1419 | 1478 | func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = { | |
1420 | - | let $ | |
1421 | - | let lpAmount = $ | |
1422 | - | let state = $ | |
1423 | - | let feeAmount = $ | |
1424 | - | let bonus = $ | |
1479 | + | let $t04984649949 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true) | |
1480 | + | let lpAmount = $t04984649949._1 | |
1481 | + | let state = $t04984649949._2 | |
1482 | + | let feeAmount = $t04984649949._3 | |
1483 | + | let bonus = $t04984649949._4 | |
1425 | 1484 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1426 | 1485 | } | |
1427 | 1486 | ||
1429 | 1488 | ||
1430 | 1489 | @Callable(i) | |
1431 | 1490 | func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = { | |
1432 | - | let $ | |
1433 | - | let lpAmount = $ | |
1434 | - | let state = $ | |
1435 | - | let feeAmount = $ | |
1436 | - | let bonus = $ | |
1491 | + | let $t05009750201 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false) | |
1492 | + | let lpAmount = $t05009750201._1 | |
1493 | + | let state = $t05009750201._2 | |
1494 | + | let feeAmount = $t05009750201._3 | |
1495 | + | let bonus = $t05009750201._4 | |
1437 | 1496 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1438 | 1497 | } | |
1439 | 1498 | ||
1518 | 1577 | match tx { | |
1519 | 1578 | case order: Order => | |
1520 | 1579 | let matcherPub = mp() | |
1521 | - | let $ | |
1522 | - | let orderValid = $ | |
1523 | - | let orderValidInfo = $ | |
1580 | + | let $t05299353062 = validateMatcherOrderAllowed(order) | |
1581 | + | let orderValid = $t05299353062._1 | |
1582 | + | let orderValidInfo = $t05299353062._2 | |
1524 | 1583 | let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey) | |
1525 | 1584 | let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub) | |
1526 | 1585 | if (if (if (orderValid) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let scale8 = 100000000 | |
5 | 5 | ||
6 | 6 | let scale8BigInt = toBigInt(100000000) | |
7 | 7 | ||
8 | 8 | let scale18 = toBigInt(1000000000000000000) | |
9 | 9 | ||
10 | 10 | let zeroBigInt = toBigInt(0) | |
11 | 11 | ||
12 | 12 | let big0 = toBigInt(0) | |
13 | 13 | ||
14 | 14 | let big1 = toBigInt(1) | |
15 | 15 | ||
16 | 16 | let big2 = toBigInt(2) | |
17 | 17 | ||
18 | 18 | let big3 = toBigInt(3) | |
19 | 19 | ||
20 | 20 | let big4 = toBigInt(4) | |
21 | 21 | ||
22 | + | let slippage4D = toBigInt((scale8 - ((scale8 * 1) / scale8))) | |
23 | + | ||
22 | 24 | let wavesString = "WAVES" | |
23 | 25 | ||
24 | 26 | let Amult = "100" | |
25 | 27 | ||
28 | + | let Dconv = "1" | |
29 | + | ||
26 | 30 | let SEP = "__" | |
31 | + | ||
32 | + | let EMPTY = "" | |
33 | + | ||
34 | + | let PoolActive = 1 | |
27 | 35 | ||
28 | 36 | let PoolPutDis = 2 | |
29 | 37 | ||
30 | 38 | let PoolMatcherDis = 3 | |
31 | 39 | ||
32 | 40 | let PoolShutdown = 4 | |
33 | 41 | ||
34 | 42 | let idxPoolAddress = 1 | |
35 | 43 | ||
36 | 44 | let idxPoolSt = 2 | |
37 | 45 | ||
38 | 46 | let idxLPAsId = 3 | |
39 | 47 | ||
40 | 48 | let idxAmAsId = 4 | |
41 | 49 | ||
42 | 50 | let idxPrAsId = 5 | |
43 | 51 | ||
44 | 52 | let idxAmtAsDcm = 6 | |
45 | 53 | ||
46 | 54 | let idxPriceAsDcm = 7 | |
47 | 55 | ||
48 | 56 | let idxIAmtAsId = 8 | |
49 | 57 | ||
50 | 58 | let idxIPriceAsId = 9 | |
51 | 59 | ||
52 | 60 | let idxFactStakCntr = 1 | |
53 | 61 | ||
54 | 62 | let idxFactoryRestCntr = 6 | |
55 | 63 | ||
56 | 64 | let idxFactSlippCntr = 7 | |
57 | 65 | ||
66 | + | let idxFactGwxRewCntr = 10 | |
67 | + | ||
58 | 68 | let feeDefault = fraction(10, scale8, 10000) | |
59 | 69 | ||
60 | 70 | func t1 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult)) | |
61 | 71 | ||
62 | 72 | ||
63 | 73 | func t1BigInt (origVal,origScaleMult) = fraction(origVal, scale18, origScaleMult) | |
64 | 74 | ||
65 | 75 | ||
66 | 76 | func f1 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18)) | |
67 | 77 | ||
68 | 78 | ||
69 | 79 | func fromX18Round (val,resultScaleMult,round) = toInt(fraction(val, toBigInt(resultScaleMult), scale18, round)) | |
80 | + | ||
81 | + | ||
82 | + | func t2 (origVal,origScaleMult) = fraction(origVal, scale18, toBigInt(origScaleMult)) | |
83 | + | ||
84 | + | ||
85 | + | func f2 (val,resultScaleMult) = fraction(val, toBigInt(resultScaleMult), scale18) | |
86 | + | ||
87 | + | ||
88 | + | func ts (amt,resScale,curScale) = fraction(amt, resScale, curScale) | |
70 | 89 | ||
71 | 90 | ||
72 | 91 | func abs (val) = if ((zeroBigInt > val)) | |
73 | 92 | then -(val) | |
74 | 93 | else val | |
75 | 94 | ||
76 | 95 | ||
77 | 96 | func absBigInt (val) = if ((zeroBigInt > val)) | |
78 | 97 | then -(val) | |
79 | 98 | else val | |
80 | 99 | ||
81 | 100 | ||
82 | 101 | func fc () = "%s__factoryContract" | |
83 | 102 | ||
84 | 103 | ||
85 | 104 | func mpk () = "%s__managerPublicKey" | |
86 | 105 | ||
87 | 106 | ||
88 | 107 | func pmpk () = "%s__pendingManagerPublicKey" | |
89 | 108 | ||
90 | 109 | ||
91 | 110 | func pl () = "%s%s__price__last" | |
92 | 111 | ||
93 | 112 | ||
94 | 113 | func ph (h,t) = makeString(["%s%s%d%d__price__history", toString(h), toString(t)], SEP) | |
95 | 114 | ||
96 | 115 | ||
97 | 116 | func pau (ua,txId) = ((("%s%s%s__P__" + ua) + "__") + txId) | |
98 | 117 | ||
99 | 118 | ||
100 | 119 | func gau (ua,txId) = ((("%s%s%s__G__" + ua) + "__") + txId) | |
101 | 120 | ||
102 | 121 | ||
103 | 122 | func aa () = "%s__amountAsset" | |
104 | 123 | ||
105 | 124 | ||
106 | 125 | func pa () = "%s__priceAsset" | |
107 | 126 | ||
108 | 127 | ||
109 | 128 | func amp () = "%s__amp" | |
110 | 129 | ||
111 | 130 | ||
112 | 131 | func ada () = "%s__addonAddr" | |
113 | 132 | ||
114 | 133 | ||
115 | 134 | let keyFee = "%s__fee" | |
116 | 135 | ||
117 | 136 | let fee = valueOrElse(getInteger(this, keyFee), feeDefault) | |
118 | 137 | ||
119 | 138 | let keyDLp = makeString(["%s", "dLp"], SEP) | |
120 | 139 | ||
121 | 140 | let keyDLpRefreshedHeight = makeString(["%s", "dLpRefreshedHeight"], SEP) | |
122 | 141 | ||
123 | 142 | let keyDLpRefreshDelay = makeString(["%s", "refreshDLpDelay"], SEP) | |
124 | 143 | ||
125 | 144 | let dLpRefreshDelayDefault = 1 | |
126 | 145 | ||
127 | 146 | let dLpRefreshDelay = valueOrElse(getInteger(this, keyDLpRefreshDelay), dLpRefreshDelayDefault) | |
128 | 147 | ||
129 | 148 | func fcfg () = "%s__factoryConfig" | |
130 | 149 | ||
131 | 150 | ||
132 | 151 | func mtpk () = "%s%s__matcher__publicKey" | |
133 | 152 | ||
134 | 153 | ||
135 | 154 | func pc (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config") | |
136 | 155 | ||
137 | 156 | ||
138 | 157 | func mba (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr) | |
139 | 158 | ||
140 | 159 | ||
141 | 160 | func aps () = "%s__shutdown" | |
142 | 161 | ||
143 | 162 | ||
144 | 163 | func keyAllowedLpStableScriptHash () = "%s__allowedLpStableScriptHash" | |
145 | 164 | ||
146 | 165 | ||
147 | 166 | func keyFeeCollectorAddress () = "%s__feeCollectorAddress" | |
148 | 167 | ||
149 | 168 | ||
150 | 169 | func throwOrderError (orderValid,orderValidInfo,senderValid,matcherValid) = throw((((((((("order validation failed: orderValid=" + toString(orderValid)) + " (") + orderValidInfo) + ")") + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid))) | |
151 | 170 | ||
152 | 171 | ||
153 | 172 | func strf (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], "")) | |
154 | 173 | ||
155 | 174 | ||
156 | 175 | func intf (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], "")) | |
157 | 176 | ||
158 | 177 | ||
159 | 178 | func throwErr (msg) = throw(makeString(["lp_stable.ride:", msg], " ")) | |
160 | 179 | ||
161 | 180 | ||
162 | 181 | func fmtErr (msg) = makeString(["lp_stable.ride:", msg], " ") | |
163 | 182 | ||
164 | 183 | ||
165 | 184 | let fca = addressFromStringValue(strf(this, fc())) | |
166 | 185 | ||
167 | 186 | let inFee = { | |
168 | 187 | let @ = invoke(fca, "getInFeeREADONLY", [toString(this)], nil) | |
169 | 188 | if ($isInstanceOf(@, "Int")) | |
170 | 189 | then @ | |
171 | 190 | else throw(($getType(@) + " couldn't be cast to Int")) | |
172 | 191 | } | |
173 | 192 | ||
174 | 193 | let outFee = { | |
175 | 194 | let @ = invoke(fca, "getOutFeeREADONLY", [toString(this)], nil) | |
176 | 195 | if ($isInstanceOf(@, "Int")) | |
177 | 196 | then @ | |
178 | 197 | else throw(($getType(@) + " couldn't be cast to Int")) | |
179 | 198 | } | |
180 | 199 | ||
181 | 200 | let A = strf(this, amp()) | |
182 | 201 | ||
183 | 202 | func igs () = valueOrElse(getBoolean(fca, aps()), false) | |
184 | 203 | ||
185 | 204 | ||
186 | 205 | func mp () = fromBase58String(strf(fca, mtpk())) | |
187 | 206 | ||
188 | 207 | ||
189 | 208 | let feeCollectorAddress = addressFromStringValue(strf(fca, keyFeeCollectorAddress())) | |
190 | 209 | ||
191 | 210 | func gpc () = { | |
192 | 211 | let amtAs = strf(this, aa()) | |
193 | 212 | let priceAs = strf(this, pa()) | |
194 | 213 | let iPriceAs = intf(fca, mba(priceAs)) | |
195 | 214 | let iAmtAs = intf(fca, mba(amtAs)) | |
196 | 215 | split(strf(fca, pc(toString(iAmtAs), toString(iPriceAs))), SEP) | |
197 | 216 | } | |
198 | 217 | ||
199 | 218 | ||
200 | 219 | func parseAssetId (input) = if ((input == wavesString)) | |
201 | 220 | then unit | |
202 | 221 | else fromBase58String(input) | |
203 | 222 | ||
204 | 223 | ||
205 | 224 | func assetIdToString (input) = if ((input == unit)) | |
206 | 225 | then wavesString | |
207 | 226 | else toBase58String(value(input)) | |
208 | 227 | ||
209 | 228 | ||
210 | 229 | func parsePoolConfig (poolConfig) = $Tuple9(addressFromStringValue(poolConfig[idxPoolAddress]), parseIntValue(poolConfig[idxPoolSt]), fromBase58String(poolConfig[idxLPAsId]), parseAssetId(poolConfig[idxAmAsId]), parseAssetId(poolConfig[idxPrAsId]), parseIntValue(poolConfig[idxAmtAsDcm]), parseIntValue(poolConfig[idxPriceAsDcm]), fromBase58String(poolConfig[idxIAmtAsId]), fromBase58String(poolConfig[idxIPriceAsId])) | |
211 | 230 | ||
212 | 231 | ||
213 | 232 | let poolConfigParsed = parsePoolConfig(gpc()) | |
214 | 233 | ||
215 | 234 | let $t079648193 = poolConfigParsed | |
216 | 235 | ||
236 | + | let cfgPoolAddress = $t079648193._1 | |
237 | + | ||
217 | 238 | let cfgPoolStatus = $t079648193._2 | |
218 | 239 | ||
219 | 240 | let cfgLpAssetId = $t079648193._3 | |
220 | 241 | ||
221 | 242 | let cfgAmountAssetId = $t079648193._4 | |
222 | 243 | ||
223 | 244 | let cfgPriceAssetId = $t079648193._5 | |
224 | 245 | ||
225 | 246 | let cfgAmountAssetDecimals = $t079648193._6 | |
226 | 247 | ||
227 | 248 | let cfgPriceAssetDecimals = $t079648193._7 | |
228 | 249 | ||
229 | 250 | let cfgInAmountAssedId = $t079648193._8 | |
230 | 251 | ||
231 | 252 | let cfgInPriceAssetId = $t079648193._9 | |
232 | 253 | ||
233 | 254 | func gfc () = split(strf(fca, fcfg()), SEP) | |
234 | 255 | ||
235 | 256 | ||
236 | 257 | let factoryConfig = gfc() | |
237 | 258 | ||
238 | 259 | let stakingContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactStakCntr]), "Invalid staking contract address") | |
239 | 260 | ||
261 | + | let slipageContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactSlippCntr]), "Invalid slipage contract address") | |
262 | + | ||
263 | + | let gwxContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactGwxRewCntr]), "Invalid gwx contract address") | |
264 | + | ||
240 | 265 | let restContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactoryRestCntr]), "Invalid gwx contract address") | |
241 | 266 | ||
242 | 267 | 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) | |
243 | 268 | ||
244 | 269 | ||
245 | 270 | 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) | |
246 | 271 | ||
247 | 272 | ||
248 | 273 | func getAccBalance (assetId) = if ((assetId == "WAVES")) | |
249 | 274 | then wavesBalance(this).available | |
250 | 275 | else assetBalance(this, fromBase58String(assetId)) | |
251 | 276 | ||
252 | 277 | ||
253 | 278 | func cpbi (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18) | |
254 | 279 | ||
255 | 280 | ||
256 | 281 | func cpbir (prAmtX18,amAmtX18,round) = fraction(prAmtX18, scale18, amAmtX18, round) | |
257 | 282 | ||
258 | 283 | ||
284 | + | func vad (A1,A2,slippage) = { | |
285 | + | let diff = fraction((A1 - A2), scale8BigInt, A2) | |
286 | + | let pass = ((slippage - abs(diff)) > zeroBigInt) | |
287 | + | if (!(pass)) | |
288 | + | then throw(("Big slpg: " + toString(diff))) | |
289 | + | else $Tuple2(pass, min([A1, A2])) | |
290 | + | } | |
291 | + | ||
292 | + | ||
293 | + | func vd (D1,D0,slpg) = { | |
294 | + | let diff = fraction(D0, scale8BigInt, D1) | |
295 | + | let fail = (slpg > diff) | |
296 | + | if (if (fail) | |
297 | + | then true | |
298 | + | else (D0 > D1)) | |
299 | + | then throw(((((((toString(D0) + " ") + toString(D1)) + " ") + toString(diff)) + " ") + toString(slpg))) | |
300 | + | else fail | |
301 | + | } | |
302 | + | ||
303 | + | ||
259 | 304 | func pcp (amAssetDcm,prAssetDcm,amAmt,prAmt) = { | |
260 | 305 | let amtAsAmtX18 = t1(amAmt, amAssetDcm) | |
261 | 306 | let prAsAmtX18 = t1(prAmt, prAssetDcm) | |
262 | 307 | cpbi(prAsAmtX18, amtAsAmtX18) | |
263 | 308 | } | |
264 | 309 | ||
265 | 310 | ||
266 | 311 | func calcPrices (amAmt,prAmt,lpAmt) = { | |
267 | 312 | let amtAsDcm = cfgAmountAssetDecimals | |
268 | 313 | let prAsDcm = cfgPriceAssetDecimals | |
269 | 314 | let priceX18 = pcp(amtAsDcm, prAsDcm, amAmt, prAmt) | |
270 | 315 | let amAmtX18 = t1(amAmt, amtAsDcm) | |
271 | 316 | let prAmtX18 = t1(prAmt, prAsDcm) | |
272 | 317 | let lpAmtX18 = t1(lpAmt, scale8) | |
273 | 318 | let lpPrInAmAsX18 = cpbi(amAmtX18, lpAmtX18) | |
274 | 319 | let lpPrInPrAsX18 = cpbi(prAmtX18, lpAmtX18) | |
275 | 320 | [priceX18, lpPrInAmAsX18, lpPrInPrAsX18] | |
321 | + | } | |
322 | + | ||
323 | + | ||
324 | + | func calculatePrices (amAmt,prAmt,lpAmt) = { | |
325 | + | let p = calcPrices(amAmt, prAmt, lpAmt) | |
326 | + | [f1(p[0], scale8), f1(p[1], scale8), f1(p[2], scale8)] | |
276 | 327 | } | |
277 | 328 | ||
278 | 329 | ||
279 | 330 | func takeFee (amount,fee) = { | |
280 | 331 | let feeAmount = if ((fee == 0)) | |
281 | 332 | then 0 | |
282 | 333 | else fraction(amount, fee, scale8) | |
283 | 334 | $Tuple2((amount - feeAmount), feeAmount) | |
284 | 335 | } | |
285 | 336 | ||
286 | 337 | ||
287 | 338 | func getD (xp) = { | |
288 | 339 | let xp0 = xp[0] | |
289 | 340 | let xp1 = xp[1] | |
290 | 341 | let s = (xp0 + xp1) | |
291 | 342 | if ((s == big0)) | |
292 | 343 | then big0 | |
293 | 344 | else { | |
294 | 345 | let a = parseIntValue(A) | |
295 | 346 | let ann = (a * 2) | |
296 | 347 | let p = fraction(xp0, xp1, big1) | |
297 | 348 | let xp0_xp1_n_n = fraction(p, big4, big1) | |
298 | 349 | let ann_s = fraction(toBigInt(ann), s, big1) | |
299 | 350 | let ann_1 = toBigInt((ann - 1)) | |
300 | 351 | func calcDNext (d) = { | |
301 | 352 | let dd = fraction(d, d, big1) | |
302 | 353 | let ddd = fraction(dd, d, big1) | |
303 | 354 | let dp = fraction(ddd, big1, xp0_xp1_n_n) | |
304 | 355 | fraction((ann_s + fraction(dp, big2, big1)), d, (fraction(ann_1, d, big1) + fraction(big3, dp, big1))) | |
305 | 356 | } | |
306 | 357 | ||
307 | 358 | func calc (acc,i) = if (acc._2) | |
308 | 359 | then acc | |
309 | 360 | else { | |
310 | 361 | let d = acc._1 | |
311 | 362 | let dNext = calcDNext(d) | |
312 | 363 | let dDiffRaw = (dNext - value(d)) | |
313 | 364 | let dDiff = if ((big0 > dDiffRaw)) | |
314 | 365 | then -(dDiffRaw) | |
315 | 366 | else dDiffRaw | |
316 | 367 | if ((big1 >= dDiff)) | |
317 | 368 | then $Tuple2(dNext, true) | |
318 | 369 | else $Tuple2(dNext, false) | |
319 | 370 | } | |
320 | 371 | ||
321 | 372 | let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
322 | 373 | let $t01269012738 = { | |
323 | 374 | let $l = arr | |
324 | 375 | let $s = size($l) | |
325 | 376 | let $acc0 = $Tuple2(s, false) | |
326 | 377 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
327 | 378 | then $a | |
328 | 379 | else calc($a, $l[$i]) | |
329 | 380 | ||
330 | 381 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
331 | 382 | then $a | |
332 | 383 | else throw("List size exceeds 15") | |
333 | 384 | ||
334 | 385 | $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) | |
335 | 386 | } | |
336 | 387 | let d = $t01269012738._1 | |
337 | 388 | let found = $t01269012738._2 | |
338 | 389 | if (found) | |
339 | 390 | then d | |
340 | 391 | else throw(("D calculation error, D = " + toString(d))) | |
341 | 392 | } | |
342 | 393 | } | |
343 | 394 | ||
344 | 395 | ||
345 | 396 | func ego (txId58,pmtAssetId,pmtLpAmt,userAddress) = { | |
346 | 397 | let lpId = cfgLpAssetId | |
347 | 398 | let amId = toBase58String(value(cfgAmountAssetId)) | |
348 | 399 | let prId = toBase58String(value(cfgPriceAssetId)) | |
349 | 400 | let amDcm = cfgAmountAssetDecimals | |
350 | 401 | let prDcm = cfgPriceAssetDecimals | |
351 | 402 | let sts = toString(cfgPoolStatus) | |
352 | 403 | let lpEmiss = valueOrErrorMessage(assetInfo(lpId), "Wrong LP id").quantity | |
353 | 404 | if ((toBase58String(lpId) != pmtAssetId)) | |
354 | 405 | then throw("Wrong pmt asset") | |
355 | 406 | else { | |
356 | 407 | let amBalance = getAccBalance(amId) | |
357 | 408 | let amBalanceX18 = t1(amBalance, amDcm) | |
358 | 409 | let prBalance = getAccBalance(prId) | |
359 | 410 | let prBalanceX18 = t1(prBalance, prDcm) | |
360 | 411 | let curPriceX18 = cpbi(prBalanceX18, amBalanceX18) | |
361 | 412 | let curPrice = f1(curPriceX18, scale8) | |
362 | 413 | let pmtLpAmtX18 = t1(pmtLpAmt, scale8) | |
363 | 414 | let lpEmissX18 = t1(lpEmiss, scale8) | |
364 | 415 | let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissX18) | |
365 | 416 | let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissX18) | |
366 | 417 | let outAmAmt = fromX18Round(outAmAmtX18, amDcm, FLOOR) | |
367 | 418 | let outPrAmt = fromX18Round(outPrAmtX18, prDcm, FLOOR) | |
368 | 419 | let state = if ((txId58 == "")) | |
369 | 420 | then nil | |
370 | 421 | else [ScriptTransfer(userAddress, outAmAmt, if ((amId == "WAVES")) | |
371 | 422 | then unit | |
372 | 423 | else fromBase58String(amId)), ScriptTransfer(userAddress, outPrAmt, if ((prId == "WAVES")) | |
373 | 424 | then unit | |
374 | 425 | 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)] | |
375 | 426 | $Tuple10(outAmAmt, outPrAmt, amId, prId, amBalance, prBalance, lpEmiss, curPriceX18, sts, state) | |
376 | 427 | } | |
377 | 428 | } | |
378 | 429 | ||
379 | 430 | ||
380 | 431 | func epo (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEval,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = { | |
381 | 432 | let lpId = cfgLpAssetId | |
382 | 433 | let amIdStr = toBase58String(value(cfgAmountAssetId)) | |
383 | 434 | let prIdStr = toBase58String(value(cfgPriceAssetId)) | |
384 | 435 | let inAmIdStr = cfgInAmountAssedId | |
385 | 436 | let inPrIdStr = cfgInPriceAssetId | |
386 | 437 | let amtDcm = cfgAmountAssetDecimals | |
387 | 438 | let priceDcm = cfgPriceAssetDecimals | |
388 | 439 | let sts = toString(cfgPoolStatus) | |
389 | 440 | let lpEm = valueOrErrorMessage(assetInfo(lpId), "Wr lp as").quantity | |
390 | 441 | let amBalance = if (isEval) | |
391 | 442 | then getAccBalance(amIdStr) | |
392 | 443 | else if (if (isOneAsset) | |
393 | 444 | then (pmtId == amIdStr) | |
394 | 445 | else false) | |
395 | 446 | then (getAccBalance(amIdStr) - pmtAmt) | |
396 | 447 | else if (isOneAsset) | |
397 | 448 | then getAccBalance(amIdStr) | |
398 | 449 | else (getAccBalance(amIdStr) - inAmAmt) | |
399 | 450 | let prBalance = if (isEval) | |
400 | 451 | then getAccBalance(prIdStr) | |
401 | 452 | else if (if (isOneAsset) | |
402 | 453 | then (pmtId == prIdStr) | |
403 | 454 | else false) | |
404 | 455 | then (getAccBalance(prIdStr) - pmtAmt) | |
405 | 456 | else if (isOneAsset) | |
406 | 457 | then getAccBalance(prIdStr) | |
407 | 458 | else (getAccBalance(prIdStr) - inPrAmt) | |
408 | 459 | let inAmAssetAmtX18 = t1(inAmAmt, amtDcm) | |
409 | 460 | let inPrAssetAmtX18 = t1(inPrAmt, priceDcm) | |
410 | 461 | let userPriceX18 = cpbi(inPrAssetAmtX18, inAmAssetAmtX18) | |
411 | 462 | let amBalanceX18 = t1(amBalance, amtDcm) | |
412 | 463 | let prBalanceX18 = t1(prBalance, priceDcm) | |
413 | 464 | let D0 = getD([amBalanceX18, prBalanceX18]) | |
414 | 465 | let r = if ((lpEm == 0)) | |
415 | 466 | then { | |
416 | 467 | let D1 = getD([(amBalanceX18 + inAmAssetAmtX18), (prBalanceX18 + inPrAssetAmtX18)]) | |
417 | 468 | let checkD = if ((D1 > D0)) | |
418 | 469 | then true | |
419 | 470 | else throw("D1 should be greater than D0") | |
420 | 471 | if ((checkD == checkD)) | |
421 | 472 | then { | |
422 | 473 | let curPriceX18 = zeroBigInt | |
423 | 474 | let slippageX18 = zeroBigInt | |
424 | - | let lpAmtX18 = | |
475 | + | let lpAmtX18 = D1 | |
425 | 476 | $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18) | |
426 | 477 | } | |
427 | 478 | else throw("Strict value is not equal to itself.") | |
428 | 479 | } | |
429 | 480 | else { | |
430 | 481 | let curPriceX18 = cpbi(prBalanceX18, amBalanceX18) | |
431 | 482 | let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18) | |
432 | 483 | let slippageX18 = t1(slippage, scale8) | |
433 | 484 | if (if (if (validateSlippage) | |
434 | 485 | then (curPriceX18 != zeroBigInt) | |
435 | 486 | else false) | |
436 | 487 | then (slippageRealX18 > slippageX18) | |
437 | 488 | else false) | |
438 | 489 | then throw(((("Price slippage " + toString(slippageRealX18)) + " > ") + toString(slippageX18))) | |
439 | 490 | else { | |
440 | 491 | let lpEmissionX18 = t1(lpEm, scale8) | |
441 | 492 | let prViaAmX18 = fraction(inAmAssetAmtX18, cpbir(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING) | |
442 | 493 | let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, cpbir(prBalanceX18, amBalanceX18, FLOOR), CEILING) | |
443 | 494 | let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18)) | |
444 | 495 | then $Tuple2(amViaPrX18, inPrAssetAmtX18) | |
445 | 496 | else $Tuple2(inAmAssetAmtX18, prViaAmX18) | |
446 | 497 | let expAmtAssetAmtX18 = expectedAmts._1 | |
447 | 498 | let expPriceAssetAmtX18 = expectedAmts._2 | |
448 | - | let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18, FLOOR) | |
449 | - | $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceDcm, CEILING), curPriceX18, slippageX18) | |
499 | + | let D1 = getD([(amBalanceX18 + expAmtAssetAmtX18), (prBalanceX18 + expPriceAssetAmtX18)]) | |
500 | + | let checkD = if ((D1 > D0)) | |
501 | + | then true | |
502 | + | else throw("D1 should be greater than D0") | |
503 | + | if ((checkD == checkD)) | |
504 | + | then { | |
505 | + | let lpAmtX18 = fraction(lpEmissionX18, (D1 - D0), D0) | |
506 | + | $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceDcm, CEILING), curPriceX18, slippageX18) | |
507 | + | } | |
508 | + | else throw("Strict value is not equal to itself.") | |
450 | 509 | } | |
451 | 510 | } | |
452 | 511 | let calcLpAmt = r._1 | |
453 | 512 | let calcAmAssetPmt = r._2 | |
454 | 513 | let calcPrAssetPmt = r._3 | |
455 | 514 | let curPrice = f1(r._4, scale8) | |
456 | 515 | let slippageCalc = f1(r._5, scale8) | |
457 | 516 | if ((0 >= calcLpAmt)) | |
458 | 517 | then throw("LP <= 0") | |
459 | 518 | else { | |
460 | 519 | let emitLpAmt = if (!(emitLp)) | |
461 | 520 | then 0 | |
462 | 521 | else calcLpAmt | |
463 | 522 | let amDiff = (inAmAmt - calcAmAssetPmt) | |
464 | 523 | let prDiff = (inPrAmt - calcPrAssetPmt) | |
465 | - | let $ | |
524 | + | let $t02057720922 = if (if (isOneAsset) | |
466 | 525 | then (pmtId == amIdStr) | |
467 | 526 | else false) | |
468 | 527 | then $Tuple2(pmtAmt, 0) | |
469 | 528 | else if (if (isOneAsset) | |
470 | 529 | then (pmtId == prIdStr) | |
471 | 530 | else false) | |
472 | 531 | then $Tuple2(0, pmtAmt) | |
473 | 532 | else $Tuple2(calcAmAssetPmt, calcPrAssetPmt) | |
474 | - | let writeAmAmt = $ | |
475 | - | let writePrAmt = $ | |
533 | + | let writeAmAmt = $t02057720922._1 | |
534 | + | let writePrAmt = $t02057720922._2 | |
476 | 535 | 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))] | |
477 | 536 | $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId) | |
478 | 537 | } | |
479 | 538 | } | |
480 | 539 | ||
481 | 540 | ||
482 | 541 | func getYD (xp,i,D) = { | |
483 | 542 | let n = big2 | |
484 | 543 | let x = xp[if ((i == 0)) | |
485 | 544 | then 1 | |
486 | 545 | else 0] | |
487 | 546 | let aPrecision = parseBigIntValue(Amult) | |
488 | 547 | let a = (parseBigIntValue(A) * aPrecision) | |
489 | 548 | let s = x | |
490 | 549 | let ann = (a * n) | |
491 | 550 | let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n)) | |
492 | 551 | let b = ((s + ((D * aPrecision) / ann)) - D) | |
493 | 552 | func calc (acc,cur) = { | |
494 | - | let $ | |
495 | - | let y = $ | |
496 | - | let found = $ | |
553 | + | let $t02211722137 = acc | |
554 | + | let y = $t02211722137._1 | |
555 | + | let found = $t02211722137._2 | |
497 | 556 | if ((found != unit)) | |
498 | 557 | then acc | |
499 | 558 | else { | |
500 | 559 | let yNext = (((y * y) + c) / ((big2 * y) + b)) | |
501 | 560 | let yDiff = absBigInt((yNext - value(y))) | |
502 | 561 | if ((big1 >= yDiff)) | |
503 | 562 | then $Tuple2(yNext, cur) | |
504 | 563 | else $Tuple2(yNext, unit) | |
505 | 564 | } | |
506 | 565 | } | |
507 | 566 | ||
508 | 567 | let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
509 | - | let $ | |
568 | + | let $t02244422491 = { | |
510 | 569 | let $l = arr | |
511 | 570 | let $s = size($l) | |
512 | 571 | let $acc0 = $Tuple2(D, unit) | |
513 | 572 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
514 | 573 | then $a | |
515 | 574 | else calc($a, $l[$i]) | |
516 | 575 | ||
517 | 576 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
518 | 577 | then $a | |
519 | 578 | else throw("List size exceeds 15") | |
520 | 579 | ||
521 | 580 | $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) | |
522 | 581 | } | |
523 | - | let y = $ | |
524 | - | let found = $ | |
582 | + | let y = $t02244422491._1 | |
583 | + | let found = $t02244422491._2 | |
525 | 584 | if ((found != unit)) | |
526 | 585 | then y | |
527 | 586 | else throw(("Y calculation error, Y = " + toString(y))) | |
528 | 587 | } | |
529 | 588 | ||
530 | 589 | ||
531 | 590 | func calcDLp (amountBalance,priceBalance,lpEmission) = { | |
532 | 591 | let updatedDLp = fraction(getD([t1BigInt(amountBalance, toBigInt(cfgAmountAssetDecimals)), t1BigInt(priceBalance, toBigInt(cfgPriceAssetDecimals))]), scale18, lpEmission) | |
533 | 592 | if ((lpEmission == big0)) | |
534 | 593 | then big0 | |
535 | 594 | else updatedDLp | |
536 | 595 | } | |
537 | 596 | ||
538 | 597 | ||
539 | 598 | func calcCurrentDLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = { | |
540 | 599 | let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta) | |
541 | 600 | let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta) | |
542 | 601 | let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta) | |
543 | 602 | let currentDLp = calcDLp(amountAssetBalance, priceAssetBalance, lpAssetEmission) | |
544 | 603 | currentDLp | |
545 | 604 | } | |
546 | 605 | ||
547 | 606 | ||
548 | 607 | func refreshDLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = { | |
549 | 608 | let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta) | |
550 | 609 | let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta) | |
551 | 610 | let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta) | |
552 | 611 | let updatedDLp = calcDLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission)) | |
553 | 612 | let actions = [IntegerEntry(keyDLpRefreshedHeight, height), StringEntry(keyDLp, toString(updatedDLp))] | |
554 | 613 | $Tuple2(actions, updatedDLp) | |
555 | 614 | } | |
556 | 615 | ||
557 | 616 | ||
558 | 617 | func validateUpdatedDLp (oldDLp,updatedDLp) = if ((updatedDLp >= oldDLp)) | |
559 | 618 | then true | |
560 | 619 | else throwErr("updated DLp lower than current DLp") | |
561 | 620 | ||
562 | 621 | ||
563 | 622 | func validateMatcherOrderAllowed (order) = { | |
564 | 623 | let amountAssetAmount = order.amount | |
565 | 624 | let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR) | |
566 | - | let $ | |
625 | + | let $t02453524747 = if ((order.orderType == Buy)) | |
567 | 626 | then $Tuple2(amountAssetAmount, -(priceAssetAmount)) | |
568 | 627 | else $Tuple2(-(amountAssetAmount), priceAssetAmount) | |
569 | - | let amountAssetBalanceDelta = $ | |
570 | - | let priceAssetBalanceDelta = $ | |
628 | + | let amountAssetBalanceDelta = $t02453524747._1 | |
629 | + | let priceAssetBalanceDelta = $t02453524747._2 | |
571 | 630 | if (if (if (igs()) | |
572 | 631 | then true | |
573 | 632 | else (cfgPoolStatus == PoolMatcherDis)) | |
574 | 633 | then true | |
575 | 634 | else (cfgPoolStatus == PoolShutdown)) | |
576 | 635 | then throw("Admin blocked") | |
577 | 636 | else if (if ((order.assetPair.amountAsset != cfgAmountAssetId)) | |
578 | 637 | then true | |
579 | 638 | else (order.assetPair.priceAsset != cfgPriceAssetId)) | |
580 | 639 | then throw("Wr assets") | |
581 | 640 | else { | |
582 | 641 | let dLp = parseBigIntValue(getStringValue(this, keyDLp)) | |
583 | - | let $ | |
584 | - | let unusedActions = $ | |
585 | - | let dLpNew = $ | |
642 | + | let $t02507725177 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
643 | + | let unusedActions = $t02507725177._1 | |
644 | + | let dLpNew = $t02507725177._2 | |
586 | 645 | let isOrderValid = (dLpNew >= dLp) | |
587 | 646 | let info = makeString([toString(dLp), toString(dLpNew)], " ") | |
588 | 647 | $Tuple2(isOrderValid, info) | |
589 | 648 | } | |
590 | 649 | } | |
591 | 650 | ||
592 | 651 | ||
593 | 652 | func cg (i) = if ((size(i.payments) != 1)) | |
594 | 653 | then throw("1 pmnt exp") | |
595 | 654 | else { | |
596 | 655 | let pmt = value(i.payments[0]) | |
597 | 656 | let pmtAssetId = value(pmt.assetId) | |
598 | 657 | let pmtAmt = pmt.amount | |
599 | 658 | let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller) | |
600 | 659 | let outAmAmt = r._1 | |
601 | 660 | let outPrAmt = r._2 | |
602 | 661 | let sts = parseIntValue(r._9) | |
603 | 662 | let state = r._10 | |
604 | 663 | if (if (igs()) | |
605 | 664 | then true | |
606 | 665 | else (sts == PoolShutdown)) | |
607 | 666 | then throw(("Admin blocked: " + toString(sts))) | |
608 | 667 | else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state) | |
609 | 668 | } | |
610 | 669 | ||
611 | 670 | ||
612 | 671 | func cp (caller,txId,amAsPmt,prAsPmt,slippage,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = { | |
613 | 672 | let r = epo(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, (txId == ""), emitLp, isOneAsset, validateSlippage, pmtAmt, pmtId) | |
614 | 673 | let sts = parseIntValue(r._8) | |
615 | 674 | if (if (if (igs()) | |
616 | 675 | then true | |
617 | 676 | else (sts == PoolPutDis)) | |
618 | 677 | then true | |
619 | 678 | else (sts == PoolShutdown)) | |
620 | 679 | then throw(("Blocked:" + toString(sts))) | |
621 | 680 | else r | |
622 | 681 | } | |
623 | 682 | ||
624 | 683 | ||
625 | 684 | func calcPutOneTkn (pmtAmtRaw,pmtAssetId,userAddress,txId,withTakeFee) = { | |
626 | 685 | let amId = toBase58String(value(cfgAmountAssetId)) | |
627 | 686 | let prId = toBase58String(value(cfgPriceAssetId)) | |
628 | 687 | let lpId = cfgLpAssetId | |
629 | 688 | let amtDcm = cfgAmountAssetDecimals | |
630 | 689 | let priceDcm = cfgPriceAssetDecimals | |
631 | 690 | let lpAssetEmission = toBigInt(valueOrErrorMessage(assetInfo(lpId), "invalid lp asset").quantity) | |
632 | 691 | let chechEmission = if ((lpAssetEmission > big0)) | |
633 | 692 | then true | |
634 | 693 | else throw("initial deposit requires all coins") | |
635 | 694 | if ((chechEmission == chechEmission)) | |
636 | 695 | then { | |
637 | 696 | let amBalance = getAccBalance(amId) | |
638 | 697 | let prBalance = getAccBalance(prId) | |
639 | - | let $ | |
698 | + | let $t02752927991 = if ((txId == "")) | |
640 | 699 | then $Tuple2(amBalance, prBalance) | |
641 | 700 | else if ((pmtAssetId == amId)) | |
642 | 701 | then if ((pmtAmtRaw > amBalance)) | |
643 | 702 | then throw("invalid payment amount") | |
644 | 703 | else $Tuple2((amBalance - pmtAmtRaw), prBalance) | |
645 | 704 | else if ((pmtAssetId == prId)) | |
646 | 705 | then if ((pmtAmtRaw > prBalance)) | |
647 | 706 | then throw("invalid payment amount") | |
648 | 707 | else $Tuple2(amBalance, (prBalance - pmtAmtRaw)) | |
649 | 708 | else throw("wrong pmtAssetId") | |
650 | - | let amBalanceOld = $ | |
651 | - | let prBalanceOld = $ | |
652 | - | let $ | |
709 | + | let amBalanceOld = $t02752927991._1 | |
710 | + | let prBalanceOld = $t02752927991._2 | |
711 | + | let $t02799728173 = if ((pmtAssetId == amId)) | |
653 | 712 | then $Tuple2(pmtAmtRaw, 0) | |
654 | 713 | else if ((pmtAssetId == prId)) | |
655 | 714 | then $Tuple2(0, pmtAmtRaw) | |
656 | 715 | else throw("invalid payment") | |
657 | - | let amAmountRaw = $ | |
658 | - | let prAmountRaw = $ | |
659 | - | let $ | |
716 | + | let amAmountRaw = $t02799728173._1 | |
717 | + | let prAmountRaw = $t02799728173._2 | |
718 | + | let $t02817728431 = if (withTakeFee) | |
660 | 719 | then $Tuple3(takeFee(amAmountRaw, inFee)._1, takeFee(prAmountRaw, inFee)._1, takeFee(pmtAmtRaw, inFee)._2) | |
661 | 720 | else $Tuple3(amAmountRaw, prAmountRaw, 0) | |
662 | - | let amAmount = $ | |
663 | - | let prAmount = $ | |
664 | - | let feeAmount = $ | |
721 | + | let amAmount = $t02817728431._1 | |
722 | + | let prAmount = $t02817728431._2 | |
723 | + | let feeAmount = $t02817728431._3 | |
665 | 724 | let amBalanceNew = (amBalanceOld + amAmount) | |
666 | 725 | let prBalanceNew = (prBalanceOld + prAmount) | |
667 | 726 | let D0 = getD([t1(amBalanceOld, cfgAmountAssetDecimals), t1(prBalanceOld, cfgPriceAssetDecimals)]) | |
668 | 727 | let D1 = getD([t1(amBalanceNew, cfgAmountAssetDecimals), t1(prBalanceNew, cfgPriceAssetDecimals)]) | |
669 | 728 | let checkD = if ((D1 > D0)) | |
670 | 729 | then true | |
671 | 730 | else throw() | |
672 | 731 | if ((checkD == checkD)) | |
673 | 732 | then { | |
674 | 733 | let lpAmount = fraction(lpAssetEmission, (D1 - D0), D0, FLOOR) | |
675 | 734 | let curPrice = f1(cpbi(t1(prBalanceNew, priceDcm), t1(amBalanceNew, amtDcm)), scale8) | |
676 | 735 | 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))] | |
677 | 736 | let poolProportion = fraction(prBalanceOld, scale8, amBalanceOld) | |
678 | 737 | let amountAssetPart = fraction(pmtAmtRaw, scale8, (poolProportion + scale8)) | |
679 | 738 | let priceAssetPart = (pmtAmtRaw - amountAssetPart) | |
680 | 739 | let lpAmtBoth = fraction(lpAssetEmission, toBigInt(priceAssetPart), toBigInt(prBalanceOld)) | |
681 | 740 | let bonus = toInt(fraction((lpAmount - lpAmtBoth), scale8BigInt, lpAmtBoth)) | |
682 | 741 | $Tuple4(toInt(lpAmount), commonState, feeAmount, bonus) | |
683 | 742 | } | |
684 | 743 | else throw("Strict value is not equal to itself.") | |
685 | 744 | } | |
686 | 745 | else throw("Strict value is not equal to itself.") | |
687 | 746 | } | |
688 | 747 | ||
689 | 748 | ||
690 | 749 | func getOneTknV2Internal (outAssetId,minOutAmount,payments,caller,originCaller,transactionId) = { | |
691 | 750 | let lpId = toBase58String(value(cfgLpAssetId)) | |
692 | 751 | let amId = toBase58String(value(cfgAmountAssetId)) | |
693 | 752 | let prId = toBase58String(value(cfgPriceAssetId)) | |
694 | 753 | let amDecimals = cfgAmountAssetDecimals | |
695 | 754 | let prDecimals = cfgPriceAssetDecimals | |
696 | 755 | let poolStatus = cfgPoolStatus | |
697 | 756 | let userAddress = if ((caller == restContract)) | |
698 | 757 | then originCaller | |
699 | 758 | else caller | |
700 | 759 | let pmt = value(payments[0]) | |
701 | 760 | let pmtAssetId = value(pmt.assetId) | |
702 | 761 | let pmtAmt = pmt.amount | |
703 | 762 | let currentDLp = calcCurrentDLp(big0, big0, big0) | |
704 | 763 | if ((currentDLp == currentDLp)) | |
705 | 764 | then { | |
706 | 765 | let txId58 = toBase58String(transactionId) | |
707 | 766 | if ((lpId != toBase58String(pmtAssetId))) | |
708 | 767 | then throw("Wrong LP") | |
709 | 768 | else { | |
710 | 769 | let amBalance = getAccBalance(amId) | |
711 | 770 | let prBalance = getAccBalance(prId) | |
712 | - | let $ | |
771 | + | let $t03054330654 = { | |
713 | 772 | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil) | |
714 | 773 | if ($isInstanceOf(@, "(Int, Int)")) | |
715 | 774 | then @ | |
716 | 775 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
717 | 776 | } | |
718 | - | if (($ | |
777 | + | if (($t03054330654 == $t03054330654)) | |
719 | 778 | then { | |
720 | - | let feeAmount = $ | |
721 | - | let totalGet = $ | |
779 | + | let feeAmount = $t03054330654._2 | |
780 | + | let totalGet = $t03054330654._1 | |
722 | 781 | let totalAmount = if (if ((minOutAmount > 0)) | |
723 | 782 | then (minOutAmount > totalGet) | |
724 | 783 | else false) | |
725 | 784 | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
726 | 785 | else totalGet | |
727 | - | let $ | |
786 | + | let $t03084431151 = if ((outAssetId == amId)) | |
728 | 787 | then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance) | |
729 | 788 | else if ((outAssetId == prId)) | |
730 | 789 | then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount)) | |
731 | 790 | else throw("invalid out asset id") | |
732 | - | let outAm = $ | |
733 | - | let outPr = $ | |
734 | - | let amBalanceNew = $ | |
735 | - | let prBalanceNew = $ | |
791 | + | let outAm = $t03084431151._1 | |
792 | + | let outPr = $t03084431151._2 | |
793 | + | let amBalanceNew = $t03084431151._3 | |
794 | + | let prBalanceNew = $t03084431151._4 | |
736 | 795 | let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals)) | |
737 | 796 | let curPr = f1(curPrX18, scale8) | |
738 | 797 | let outAssetIdOrWaves = if ((outAssetId == "WAVES")) | |
739 | 798 | then unit | |
740 | 799 | else fromBase58String(outAssetId) | |
741 | 800 | let sendFeeToMatcher = if ((feeAmount > 0)) | |
742 | 801 | then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetIdOrWaves)] | |
743 | 802 | else nil | |
744 | 803 | 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) | |
745 | 804 | if ((state == state)) | |
746 | 805 | then { | |
747 | 806 | let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
748 | 807 | if ((burn == burn)) | |
749 | 808 | then { | |
750 | - | let $ | |
809 | + | let $t03193632286 = { | |
751 | 810 | let feeAmountForCalc = if ((this == feeCollectorAddress)) | |
752 | 811 | then 0 | |
753 | 812 | else feeAmount | |
754 | 813 | let outInAmountAsset = if ((parseAssetId(outAssetId) == cfgAmountAssetId)) | |
755 | 814 | then true | |
756 | 815 | else false | |
757 | 816 | if (outInAmountAsset) | |
758 | 817 | then $Tuple2(-((totalGet + feeAmountForCalc)), 0) | |
759 | 818 | else $Tuple2(0, -((totalGet + feeAmountForCalc))) | |
760 | 819 | } | |
761 | - | let amountAssetBalanceDelta = $ | |
762 | - | let priceAssetBalanceDelta = $ | |
763 | - | let $ | |
764 | - | let refreshDLpActions = $ | |
765 | - | let updatedDLp = $ | |
820 | + | let amountAssetBalanceDelta = $t03193632286._1 | |
821 | + | let priceAssetBalanceDelta = $t03193632286._2 | |
822 | + | let $t03228932397 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
823 | + | let refreshDLpActions = $t03228932397._1 | |
824 | + | let updatedDLp = $t03228932397._2 | |
766 | 825 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
767 | 826 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
768 | 827 | then $Tuple2((state ++ refreshDLpActions), totalAmount) | |
769 | 828 | else throw("Strict value is not equal to itself.") | |
770 | 829 | } | |
771 | 830 | else throw("Strict value is not equal to itself.") | |
772 | 831 | } | |
773 | 832 | else throw("Strict value is not equal to itself.") | |
774 | 833 | } | |
775 | 834 | else throw("Strict value is not equal to itself.") | |
776 | 835 | } | |
777 | 836 | } | |
778 | 837 | else throw("Strict value is not equal to itself.") | |
779 | 838 | } | |
780 | 839 | ||
781 | 840 | ||
782 | 841 | func m () = match getString(mpk()) { | |
783 | 842 | case s: String => | |
784 | 843 | fromBase58String(s) | |
785 | 844 | case _: Unit => | |
786 | 845 | unit | |
787 | 846 | case _ => | |
788 | 847 | throw("Match error") | |
789 | 848 | } | |
790 | 849 | ||
791 | 850 | ||
792 | 851 | func pm () = match getString(pmpk()) { | |
793 | 852 | case s: String => | |
794 | 853 | fromBase58String(s) | |
795 | 854 | case _: Unit => | |
796 | 855 | unit | |
797 | 856 | case _ => | |
798 | 857 | throw("Match error") | |
799 | 858 | } | |
800 | 859 | ||
801 | 860 | ||
802 | 861 | let pd = throw("Permission denied") | |
803 | 862 | ||
804 | 863 | func isManager (i) = match m() { | |
805 | 864 | case pk: ByteVector => | |
806 | 865 | (i.callerPublicKey == pk) | |
807 | 866 | case _: Unit => | |
808 | 867 | (i.caller == this) | |
809 | 868 | case _ => | |
810 | 869 | throw("Match error") | |
811 | 870 | } | |
812 | 871 | ||
813 | 872 | ||
814 | 873 | func mm (i) = match m() { | |
815 | 874 | case pk: ByteVector => | |
816 | 875 | if ((i.callerPublicKey == pk)) | |
817 | 876 | then true | |
818 | 877 | else pd | |
819 | 878 | case _: Unit => | |
820 | 879 | if ((i.caller == this)) | |
821 | 880 | then true | |
822 | 881 | else pd | |
823 | 882 | case _ => | |
824 | 883 | throw("Match error") | |
825 | 884 | } | |
826 | 885 | ||
827 | 886 | ||
828 | 887 | @Callable(i) | |
829 | 888 | func constructor (fc) = { | |
830 | 889 | let c = mm(i) | |
831 | 890 | if ((c == c)) | |
832 | 891 | then [StringEntry(fc(), fc)] | |
833 | 892 | else throw("Strict value is not equal to itself.") | |
834 | 893 | } | |
835 | 894 | ||
836 | 895 | ||
837 | 896 | ||
838 | 897 | @Callable(i) | |
839 | 898 | func setManager (pendingManagerPublicKey) = { | |
840 | 899 | let c = mm(i) | |
841 | 900 | if ((c == c)) | |
842 | 901 | then { | |
843 | 902 | let cm = fromBase58String(pendingManagerPublicKey) | |
844 | 903 | if ((cm == cm)) | |
845 | 904 | then [StringEntry(pmpk(), pendingManagerPublicKey)] | |
846 | 905 | else throw("Strict value is not equal to itself.") | |
847 | 906 | } | |
848 | 907 | else throw("Strict value is not equal to itself.") | |
849 | 908 | } | |
850 | 909 | ||
851 | 910 | ||
852 | 911 | ||
853 | 912 | @Callable(i) | |
854 | 913 | func confirmManager () = { | |
855 | 914 | let p = pm() | |
856 | 915 | let hpm = if (isDefined(p)) | |
857 | 916 | then true | |
858 | 917 | else throw("No pending manager") | |
859 | 918 | if ((hpm == hpm)) | |
860 | 919 | then { | |
861 | 920 | let cpm = if ((i.callerPublicKey == value(p))) | |
862 | 921 | then true | |
863 | 922 | else throw("You are not pending manager") | |
864 | 923 | if ((cpm == cpm)) | |
865 | 924 | then [StringEntry(mpk(), toBase58String(value(p))), DeleteEntry(pmpk())] | |
866 | 925 | else throw("Strict value is not equal to itself.") | |
867 | 926 | } | |
868 | 927 | else throw("Strict value is not equal to itself.") | |
869 | 928 | } | |
870 | 929 | ||
871 | 930 | ||
872 | 931 | ||
873 | 932 | @Callable(i) | |
874 | 933 | func put (slip,autoStake) = { | |
875 | 934 | let factCfg = gfc() | |
876 | 935 | let stakingCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactStakCntr]), "Wr st addr") | |
877 | 936 | let slipCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactSlippCntr]), "Wr sl addr") | |
878 | 937 | if ((0 > slip)) | |
879 | 938 | then throw("Wrong slippage") | |
880 | 939 | else if ((size(i.payments) != 2)) | |
881 | 940 | then throw("2 pmnts expd") | |
882 | 941 | else { | |
883 | 942 | let amAssetPmt = toBigInt(value(i.payments[0]).amount) | |
884 | 943 | let prAssetPmt = toBigInt(value(i.payments[1]).amount) | |
885 | 944 | let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amAssetPmt) | |
886 | 945 | if ((amountAssetBalance == amountAssetBalance)) | |
887 | 946 | then { | |
888 | 947 | let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - prAssetPmt) | |
889 | 948 | if ((priceAssetBalance == priceAssetBalance)) | |
890 | 949 | then { | |
891 | 950 | let lpAssetEmission = toBigInt(value(assetInfo(cfgLpAssetId)).quantity) | |
892 | 951 | if ((lpAssetEmission == lpAssetEmission)) | |
893 | 952 | then { | |
894 | 953 | let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0)) | |
895 | 954 | if ((currentDLp == currentDLp)) | |
896 | 955 | then { | |
897 | 956 | 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, "") | |
898 | 957 | let emitLpAmt = e._2 | |
899 | 958 | let lpAssetId = e._7 | |
900 | 959 | let state = e._9 | |
901 | 960 | let amDiff = e._10 | |
902 | 961 | let prDiff = e._11 | |
903 | 962 | let amId = e._12 | |
904 | 963 | let prId = e._13 | |
905 | 964 | let r = invoke(fca, "emit", [emitLpAmt], nil) | |
906 | 965 | if ((r == r)) | |
907 | 966 | then { | |
908 | 967 | let el = match r { | |
909 | 968 | case legacy: Address => | |
910 | 969 | invoke(legacy, "emit", [emitLpAmt], nil) | |
911 | 970 | case _ => | |
912 | 971 | unit | |
913 | 972 | } | |
914 | 973 | if ((el == el)) | |
915 | 974 | then { | |
916 | 975 | let sa = if ((amDiff > 0)) | |
917 | 976 | then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)]) | |
918 | 977 | else nil | |
919 | 978 | if ((sa == sa)) | |
920 | 979 | then { | |
921 | 980 | let sp = if ((prDiff > 0)) | |
922 | 981 | then invoke(slipCntr, "put", nil, [AttachedPayment(prId, prDiff)]) | |
923 | 982 | else nil | |
924 | 983 | if ((sp == sp)) | |
925 | 984 | then { | |
926 | 985 | let lpTrnsfr = if (autoStake) | |
927 | 986 | then { | |
928 | 987 | let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
929 | 988 | if ((ss == ss)) | |
930 | 989 | then nil | |
931 | 990 | else throw("Strict value is not equal to itself.") | |
932 | 991 | } | |
933 | 992 | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
934 | - | let $ | |
935 | - | let refreshDLpActions = $ | |
936 | - | let updatedDLp = $ | |
993 | + | let $t03654636688 = refreshDLpInternal(0, 0, 0) | |
994 | + | let refreshDLpActions = $t03654636688._1 | |
995 | + | let updatedDLp = $t03654636688._2 | |
937 | 996 | let check = if ((updatedDLp >= currentDLp)) | |
938 | 997 | then true | |
939 | 998 | else throwErr(makeString(["updated DLp lower than current DLp", toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentDLp), toString(updatedDLp), toString(amDiff), toString(prDiff)], " ")) | |
940 | 999 | if ((check == check)) | |
941 | 1000 | then { | |
942 | 1001 | let lpAssetEmissionAfter = value(assetInfo(cfgLpAssetId)).quantity | |
943 | 1002 | if ((lpAssetEmissionAfter == lpAssetEmissionAfter)) | |
944 | 1003 | then ((state ++ lpTrnsfr) ++ refreshDLpActions) | |
945 | 1004 | else throw("Strict value is not equal to itself.") | |
946 | 1005 | } | |
947 | 1006 | else throw("Strict value is not equal to itself.") | |
948 | 1007 | } | |
949 | 1008 | else throw("Strict value is not equal to itself.") | |
950 | 1009 | } | |
951 | 1010 | else throw("Strict value is not equal to itself.") | |
952 | 1011 | } | |
953 | 1012 | else throw("Strict value is not equal to itself.") | |
954 | 1013 | } | |
955 | 1014 | else throw("Strict value is not equal to itself.") | |
956 | 1015 | } | |
957 | 1016 | else throw("Strict value is not equal to itself.") | |
958 | 1017 | } | |
959 | 1018 | else throw("Strict value is not equal to itself.") | |
960 | 1019 | } | |
961 | 1020 | else throw("Strict value is not equal to itself.") | |
962 | 1021 | } | |
963 | 1022 | else throw("Strict value is not equal to itself.") | |
964 | 1023 | } | |
965 | 1024 | } | |
966 | 1025 | ||
967 | 1026 | ||
968 | 1027 | ||
969 | 1028 | @Callable(i) | |
970 | 1029 | func putOneTknV2 (minOutAmount,autoStake) = { | |
971 | 1030 | let isPoolOneTokenOperationsDisabled = { | |
972 | 1031 | let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
973 | 1032 | if ($isInstanceOf(@, "Boolean")) | |
974 | 1033 | then @ | |
975 | 1034 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
976 | 1035 | } | |
977 | 1036 | let isPutDisabled = if (if (if (igs()) | |
978 | 1037 | then true | |
979 | 1038 | else (cfgPoolStatus == PoolPutDis)) | |
980 | 1039 | then true | |
981 | 1040 | else (cfgPoolStatus == PoolShutdown)) | |
982 | 1041 | then true | |
983 | 1042 | else isPoolOneTokenOperationsDisabled | |
984 | 1043 | let checks = [if (if (!(isPutDisabled)) | |
985 | 1044 | then true | |
986 | 1045 | else isManager(i)) | |
987 | 1046 | then true | |
988 | 1047 | else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1)) | |
989 | 1048 | then true | |
990 | 1049 | else throwErr("exactly 1 payment are expected")] | |
991 | 1050 | if ((checks == checks)) | |
992 | 1051 | then { | |
993 | 1052 | let amId = toBase58String(value(cfgAmountAssetId)) | |
994 | 1053 | let prId = toBase58String(value(cfgPriceAssetId)) | |
995 | 1054 | let lpId = cfgLpAssetId | |
996 | 1055 | let amDecimals = cfgAmountAssetDecimals | |
997 | 1056 | let prDecimals = cfgPriceAssetDecimals | |
998 | 1057 | let userAddress = if ((i.caller == this)) | |
999 | 1058 | then i.originCaller | |
1000 | 1059 | else i.caller | |
1001 | 1060 | let pmt = value(i.payments[0]) | |
1002 | 1061 | let pmtAssetId = toBase58String(value(pmt.assetId)) | |
1003 | 1062 | let pmtAmt = pmt.amount | |
1004 | 1063 | let currentDLp = if ((pmt.assetId == cfgAmountAssetId)) | |
1005 | 1064 | then calcCurrentDLp(toBigInt(pmtAmt), toBigInt(0), toBigInt(0)) | |
1006 | 1065 | else calcCurrentDLp(toBigInt(0), toBigInt(pmtAmt), toBigInt(0)) | |
1007 | 1066 | if ((currentDLp == currentDLp)) | |
1008 | 1067 | then { | |
1009 | - | let $ | |
1010 | - | if (($ | |
1068 | + | let $t03832938487 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true) | |
1069 | + | if (($t03832938487 == $t03832938487)) | |
1011 | 1070 | then { | |
1012 | - | let feeAmount = $ | |
1013 | - | let state = $ | |
1014 | - | let estimLP = $ | |
1071 | + | let feeAmount = $t03832938487._3 | |
1072 | + | let state = $t03832938487._2 | |
1073 | + | let estimLP = $t03832938487._1 | |
1015 | 1074 | let emitLpAmt = if (if ((minOutAmount > 0)) | |
1016 | 1075 | then (minOutAmount > estimLP) | |
1017 | 1076 | else false) | |
1018 | 1077 | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
1019 | 1078 | else estimLP | |
1020 | 1079 | let e = invoke(fca, "emit", [emitLpAmt], nil) | |
1021 | 1080 | if ((e == e)) | |
1022 | 1081 | then { | |
1023 | 1082 | let el = match e { | |
1024 | 1083 | case legacy: Address => | |
1025 | 1084 | invoke(legacy, "emit", [emitLpAmt], nil) | |
1026 | 1085 | case _ => | |
1027 | 1086 | unit | |
1028 | 1087 | } | |
1029 | 1088 | if ((el == el)) | |
1030 | 1089 | then { | |
1031 | 1090 | let lpTrnsfr = if (autoStake) | |
1032 | 1091 | then { | |
1033 | 1092 | let ss = invoke(stakingContract, "stake", nil, [AttachedPayment(lpId, emitLpAmt)]) | |
1034 | 1093 | if ((ss == ss)) | |
1035 | 1094 | then nil | |
1036 | 1095 | else throw("Strict value is not equal to itself.") | |
1037 | 1096 | } | |
1038 | 1097 | else [ScriptTransfer(i.caller, emitLpAmt, lpId)] | |
1039 | 1098 | let sendFeeToMatcher = if ((feeAmount > 0)) | |
1040 | 1099 | then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))] | |
1041 | 1100 | else nil | |
1042 | - | let $ | |
1101 | + | let $t03930239651 = if ((this == feeCollectorAddress)) | |
1043 | 1102 | then $Tuple2(0, 0) | |
1044 | 1103 | else { | |
1045 | 1104 | let paymentInAmountAsset = if ((pmt.assetId == cfgAmountAssetId)) | |
1046 | 1105 | then true | |
1047 | 1106 | else false | |
1048 | 1107 | if (paymentInAmountAsset) | |
1049 | 1108 | then $Tuple2(-(feeAmount), 0) | |
1050 | 1109 | else $Tuple2(0, -(feeAmount)) | |
1051 | 1110 | } | |
1052 | - | let amountAssetBalanceDelta = $ | |
1053 | - | let priceAssetBalanceDelta = $ | |
1054 | - | let $ | |
1055 | - | let refreshDLpActions = $ | |
1056 | - | let updatedDLp = $ | |
1111 | + | let amountAssetBalanceDelta = $t03930239651._1 | |
1112 | + | let priceAssetBalanceDelta = $t03930239651._2 | |
1113 | + | let $t03965439762 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
1114 | + | let refreshDLpActions = $t03965439762._1 | |
1115 | + | let updatedDLp = $t03965439762._2 | |
1057 | 1116 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1058 | 1117 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1059 | 1118 | then $Tuple2((((state ++ lpTrnsfr) ++ sendFeeToMatcher) ++ refreshDLpActions), emitLpAmt) | |
1060 | 1119 | else throw("Strict value is not equal to itself.") | |
1061 | 1120 | } | |
1062 | 1121 | else throw("Strict value is not equal to itself.") | |
1063 | 1122 | } | |
1064 | 1123 | else throw("Strict value is not equal to itself.") | |
1065 | 1124 | } | |
1066 | 1125 | else throw("Strict value is not equal to itself.") | |
1067 | 1126 | } | |
1068 | 1127 | else throw("Strict value is not equal to itself.") | |
1069 | 1128 | } | |
1070 | 1129 | else throw("Strict value is not equal to itself.") | |
1071 | 1130 | } | |
1072 | 1131 | ||
1073 | 1132 | ||
1074 | 1133 | ||
1075 | 1134 | @Callable(i) | |
1076 | 1135 | func putForFree (maxSlpg) = if ((0 > maxSlpg)) | |
1077 | 1136 | then throw("Wrong slpg") | |
1078 | 1137 | else if ((size(i.payments) != 2)) | |
1079 | 1138 | then throw("2 pmnts expd") | |
1080 | 1139 | else { | |
1081 | 1140 | 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, "") | |
1082 | 1141 | let state = estPut._9 | |
1083 | 1142 | let amAssetPmt = toBigInt(value(i.payments[0]).amount) | |
1084 | 1143 | let prAssetPmt = toBigInt(value(i.payments[1]).amount) | |
1085 | 1144 | let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0)) | |
1086 | 1145 | if ((currentDLp == currentDLp)) | |
1087 | 1146 | then { | |
1088 | - | let $ | |
1089 | - | let refreshDLpActions = $ | |
1090 | - | let updatedDLp = $ | |
1147 | + | let $t04079240857 = refreshDLpInternal(0, 0, 0) | |
1148 | + | let refreshDLpActions = $t04079240857._1 | |
1149 | + | let updatedDLp = $t04079240857._2 | |
1091 | 1150 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1092 | 1151 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1093 | 1152 | then (state ++ refreshDLpActions) | |
1094 | 1153 | else throw("Strict value is not equal to itself.") | |
1095 | 1154 | } | |
1096 | 1155 | else throw("Strict value is not equal to itself.") | |
1097 | 1156 | } | |
1098 | 1157 | ||
1099 | 1158 | ||
1100 | 1159 | ||
1101 | 1160 | @Callable(i) | |
1102 | 1161 | func get () = { | |
1103 | 1162 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1104 | 1163 | if ((currentDLp == currentDLp)) | |
1105 | 1164 | then { | |
1106 | 1165 | let r = cg(i) | |
1107 | 1166 | let outAmtAmt = r._1 | |
1108 | 1167 | let outPrAmt = r._2 | |
1109 | 1168 | let pmtAmt = r._3 | |
1110 | 1169 | let pmtAssetId = r._4 | |
1111 | 1170 | let state = r._5 | |
1112 | 1171 | let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1113 | 1172 | if ((b == b)) | |
1114 | 1173 | then { | |
1115 | - | let $ | |
1116 | - | let refreshDLpActions = $ | |
1117 | - | let updatedDLp = $ | |
1174 | + | let $t04203042112 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0) | |
1175 | + | let refreshDLpActions = $t04203042112._1 | |
1176 | + | let updatedDLp = $t04203042112._2 | |
1118 | 1177 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1119 | 1178 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1120 | 1179 | then (state ++ refreshDLpActions) | |
1121 | 1180 | else throw("Strict value is not equal to itself.") | |
1122 | 1181 | } | |
1123 | 1182 | else throw("Strict value is not equal to itself.") | |
1124 | 1183 | } | |
1125 | 1184 | else throw("Strict value is not equal to itself.") | |
1126 | 1185 | } | |
1127 | 1186 | ||
1128 | 1187 | ||
1129 | 1188 | ||
1130 | 1189 | @Callable(i) | |
1131 | 1190 | func getOneTknV2 (outAssetId,minOutAmount) = { | |
1132 | 1191 | let isPoolOneTokenOperationsDisabled = { | |
1133 | 1192 | let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1134 | 1193 | if ($isInstanceOf(@, "Boolean")) | |
1135 | 1194 | then @ | |
1136 | 1195 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
1137 | 1196 | } | |
1138 | 1197 | let isGetDisabled = if (if (igs()) | |
1139 | 1198 | then true | |
1140 | 1199 | else (cfgPoolStatus == PoolShutdown)) | |
1141 | 1200 | then true | |
1142 | 1201 | else isPoolOneTokenOperationsDisabled | |
1143 | 1202 | let checks = [if (if (!(isGetDisabled)) | |
1144 | 1203 | then true | |
1145 | 1204 | else isManager(i)) | |
1146 | 1205 | then true | |
1147 | 1206 | else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1)) | |
1148 | 1207 | then true | |
1149 | 1208 | else throwErr("exactly 1 payment are expected")] | |
1150 | 1209 | if ((checks == checks)) | |
1151 | 1210 | then { | |
1152 | - | let $ | |
1153 | - | let state = $ | |
1154 | - | let totalAmount = $ | |
1211 | + | let $t04273042885 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId) | |
1212 | + | let state = $t04273042885._1 | |
1213 | + | let totalAmount = $t04273042885._2 | |
1155 | 1214 | $Tuple2(state, totalAmount) | |
1156 | 1215 | } | |
1157 | 1216 | else throw("Strict value is not equal to itself.") | |
1158 | 1217 | } | |
1159 | 1218 | ||
1160 | 1219 | ||
1161 | 1220 | ||
1162 | 1221 | @Callable(i) | |
1163 | 1222 | func refreshDLp () = { | |
1164 | 1223 | let lastRefreshedBlockHeight = valueOrElse(getInteger(keyDLpRefreshedHeight), 0) | |
1165 | 1224 | let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= dLpRefreshDelay)) | |
1166 | 1225 | then unit | |
1167 | 1226 | else throwErr(makeString([toString(dLpRefreshDelay), " blocks have not passed since the previous call"], "")) | |
1168 | 1227 | if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight)) | |
1169 | 1228 | then { | |
1170 | 1229 | let dLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyDLp), "0")), fmtErr("invalid dLp")) | |
1171 | - | let $ | |
1172 | - | let dLpUpdateActions = $ | |
1173 | - | let updatedDLp = $ | |
1230 | + | let $t04340943473 = refreshDLpInternal(0, 0, 0) | |
1231 | + | let dLpUpdateActions = $t04340943473._1 | |
1232 | + | let updatedDLp = $t04340943473._2 | |
1174 | 1233 | let actions = if ((dLp != updatedDLp)) | |
1175 | 1234 | then dLpUpdateActions | |
1176 | 1235 | else throwErr("nothing to refresh") | |
1177 | 1236 | $Tuple2(actions, toString(updatedDLp)) | |
1178 | 1237 | } | |
1179 | 1238 | else throw("Strict value is not equal to itself.") | |
1180 | 1239 | } | |
1181 | 1240 | ||
1182 | 1241 | ||
1183 | 1242 | ||
1184 | 1243 | @Callable(i) | |
1185 | 1244 | func getOneTknV2READONLY (outAssetId,lpAssetAmount) = { | |
1186 | 1245 | let amId = toBase58String(value(cfgAmountAssetId)) | |
1187 | 1246 | let prId = toBase58String(value(cfgPriceAssetId)) | |
1188 | 1247 | let lpId = toBase58String(value(cfgLpAssetId)) | |
1189 | 1248 | let xp = [toBigInt(getAccBalance(amId)), toBigInt(getAccBalance(prId))] | |
1190 | 1249 | let lpEmission = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "invalid lp asset").quantity) | |
1191 | 1250 | let D0 = getD(xp) | |
1192 | 1251 | let D1 = (D0 - fraction(toBigInt(lpAssetAmount), D0, lpEmission)) | |
1193 | 1252 | let index = if ((outAssetId == amId)) | |
1194 | 1253 | then 0 | |
1195 | 1254 | else if ((outAssetId == prId)) | |
1196 | 1255 | then 1 | |
1197 | 1256 | else throw("invalid out asset id") | |
1198 | 1257 | let newY = getYD(xp, index, D1) | |
1199 | 1258 | let dy = (xp[index] - newY) | |
1200 | 1259 | let totalGetRaw = max([0, toInt((dy - big1))]) | |
1201 | - | let $ | |
1202 | - | let totalGet = $ | |
1203 | - | let feeAmount = $ | |
1260 | + | let $t04440344458 = takeFee(totalGetRaw, outFee) | |
1261 | + | let totalGet = $t04440344458._1 | |
1262 | + | let feeAmount = $t04440344458._2 | |
1204 | 1263 | $Tuple2(nil, $Tuple2(totalGet, feeAmount)) | |
1205 | 1264 | } | |
1206 | 1265 | ||
1207 | 1266 | ||
1208 | 1267 | ||
1209 | 1268 | @Callable(i) | |
1210 | 1269 | func getOneTknV2WithBonusREADONLY (outAssetId,lpAssetAmount) = { | |
1211 | 1270 | let amId = toBase58String(value(cfgAmountAssetId)) | |
1212 | 1271 | let prId = toBase58String(value(cfgPriceAssetId)) | |
1213 | 1272 | let lpId = toBase58String(value(cfgLpAssetId)) | |
1214 | 1273 | let amBalance = getAccBalance(amId) | |
1215 | 1274 | let prBalance = getAccBalance(prId) | |
1216 | - | let $ | |
1275 | + | let $t04483344948 = { | |
1217 | 1276 | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil) | |
1218 | 1277 | if ($isInstanceOf(@, "(Int, Int)")) | |
1219 | 1278 | then @ | |
1220 | 1279 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
1221 | 1280 | } | |
1222 | - | let totalGet = $ | |
1223 | - | let feeAmount = $ | |
1281 | + | let totalGet = $t04483344948._1 | |
1282 | + | let feeAmount = $t04483344948._2 | |
1224 | 1283 | let r = ego("", lpId, lpAssetAmount, this) | |
1225 | 1284 | let outAmAmt = r._1 | |
1226 | 1285 | let outPrAmt = r._2 | |
1227 | 1286 | let sumOfGetAssets = (outAmAmt + outPrAmt) | |
1228 | 1287 | let bonus = if ((sumOfGetAssets == 0)) | |
1229 | 1288 | then if ((totalGet == 0)) | |
1230 | 1289 | then 0 | |
1231 | 1290 | else throw("bonus calculation error") | |
1232 | 1291 | else fraction((totalGet - sumOfGetAssets), scale8, sumOfGetAssets) | |
1233 | 1292 | $Tuple2(nil, $Tuple3(totalGet, feeAmount, bonus)) | |
1234 | 1293 | } | |
1235 | 1294 | ||
1236 | 1295 | ||
1237 | 1296 | ||
1238 | 1297 | @Callable(i) | |
1239 | 1298 | func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = { | |
1240 | 1299 | let r = cg(i) | |
1241 | 1300 | let outAmAmt = r._1 | |
1242 | 1301 | let outPrAmt = r._2 | |
1243 | 1302 | let pmtAmt = r._3 | |
1244 | 1303 | let pmtAssetId = r._4 | |
1245 | 1304 | let state = r._5 | |
1246 | 1305 | if ((noLessThenAmtAsset > outAmAmt)) | |
1247 | 1306 | then throw(((("Failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset))) | |
1248 | 1307 | else if ((noLessThenPriceAsset > outPrAmt)) | |
1249 | 1308 | then throw(((("Failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset))) | |
1250 | 1309 | else { | |
1251 | 1310 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1252 | 1311 | if ((currentDLp == currentDLp)) | |
1253 | 1312 | then { | |
1254 | 1313 | let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1255 | 1314 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1256 | 1315 | then { | |
1257 | - | let $ | |
1258 | - | let refreshDLpActions = $ | |
1259 | - | let updatedDLp = $ | |
1316 | + | let $t04611446195 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1317 | + | let refreshDLpActions = $t04611446195._1 | |
1318 | + | let updatedDLp = $t04611446195._2 | |
1260 | 1319 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1261 | 1320 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1262 | 1321 | then (state ++ refreshDLpActions) | |
1263 | 1322 | else throw("Strict value is not equal to itself.") | |
1264 | 1323 | } | |
1265 | 1324 | else throw("Strict value is not equal to itself.") | |
1266 | 1325 | } | |
1267 | 1326 | else throw("Strict value is not equal to itself.") | |
1268 | 1327 | } | |
1269 | 1328 | } | |
1270 | 1329 | ||
1271 | 1330 | ||
1272 | 1331 | ||
1273 | 1332 | @Callable(i) | |
1274 | 1333 | func unstakeAndGet (amount) = { | |
1275 | 1334 | let checkPayments = if ((size(i.payments) != 0)) | |
1276 | 1335 | then throw("No pmnts expd") | |
1277 | 1336 | else true | |
1278 | 1337 | if ((checkPayments == checkPayments)) | |
1279 | 1338 | then { | |
1280 | 1339 | let factoryCfg = gfc() | |
1281 | 1340 | let lpAssetId = cfgLpAssetId | |
1282 | 1341 | let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr") | |
1283 | 1342 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1284 | 1343 | if ((currentDLp == currentDLp)) | |
1285 | 1344 | then { | |
1286 | 1345 | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil) | |
1287 | 1346 | if ((unstakeInv == unstakeInv)) | |
1288 | 1347 | then { | |
1289 | 1348 | let r = ego(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller) | |
1290 | 1349 | let outAmAmt = r._1 | |
1291 | 1350 | let outPrAmt = r._2 | |
1292 | 1351 | let sts = parseIntValue(r._9) | |
1293 | 1352 | let state = r._10 | |
1294 | 1353 | let v = if (if (igs()) | |
1295 | 1354 | then true | |
1296 | 1355 | else (sts == PoolShutdown)) | |
1297 | 1356 | then throw(("Blocked: " + toString(sts))) | |
1298 | 1357 | else true | |
1299 | 1358 | if ((v == v)) | |
1300 | 1359 | then { | |
1301 | 1360 | let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)]) | |
1302 | 1361 | if ((burnA == burnA)) | |
1303 | 1362 | then { | |
1304 | - | let $ | |
1305 | - | let refreshDLpActions = $ | |
1306 | - | let updatedDLp = $ | |
1363 | + | let $t04722247303 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1364 | + | let refreshDLpActions = $t04722247303._1 | |
1365 | + | let updatedDLp = $t04722247303._2 | |
1307 | 1366 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1308 | 1367 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1309 | 1368 | then (state ++ refreshDLpActions) | |
1310 | 1369 | else throw("Strict value is not equal to itself.") | |
1311 | 1370 | } | |
1312 | 1371 | else throw("Strict value is not equal to itself.") | |
1313 | 1372 | } | |
1314 | 1373 | else throw("Strict value is not equal to itself.") | |
1315 | 1374 | } | |
1316 | 1375 | else throw("Strict value is not equal to itself.") | |
1317 | 1376 | } | |
1318 | 1377 | else throw("Strict value is not equal to itself.") | |
1319 | 1378 | } | |
1320 | 1379 | else throw("Strict value is not equal to itself.") | |
1321 | 1380 | } | |
1322 | 1381 | ||
1323 | 1382 | ||
1324 | 1383 | ||
1325 | 1384 | @Callable(i) | |
1326 | 1385 | func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = { | |
1327 | 1386 | let isGetDisabled = if (igs()) | |
1328 | 1387 | then true | |
1329 | 1388 | else (cfgPoolStatus == PoolShutdown) | |
1330 | 1389 | let checks = [if (!(isGetDisabled)) | |
1331 | 1390 | then true | |
1332 | 1391 | else throw("get operation is blocked by admin"), if ((size(i.payments) == 0)) | |
1333 | 1392 | then true | |
1334 | 1393 | else throw("no payments are expected")] | |
1335 | 1394 | if ((checks == checks)) | |
1336 | 1395 | then { | |
1337 | 1396 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1338 | 1397 | if ((currentDLp == currentDLp)) | |
1339 | 1398 | then { | |
1340 | 1399 | let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil) | |
1341 | 1400 | if ((unstakeInv == unstakeInv)) | |
1342 | 1401 | then { | |
1343 | 1402 | let res = ego(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller) | |
1344 | 1403 | let outAmAmt = res._1 | |
1345 | 1404 | let outPrAmt = res._2 | |
1346 | 1405 | let state = res._10 | |
1347 | 1406 | let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset)) | |
1348 | 1407 | then true | |
1349 | 1408 | else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset)) | |
1350 | 1409 | then true | |
1351 | 1410 | else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))] | |
1352 | 1411 | if ((checkAmounts == checkAmounts)) | |
1353 | 1412 | then { | |
1354 | 1413 | let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)]) | |
1355 | 1414 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1356 | 1415 | then { | |
1357 | - | let $ | |
1358 | - | let refreshDLpActions = $ | |
1359 | - | let updatedDLp = $ | |
1416 | + | let $t04855448635 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1417 | + | let refreshDLpActions = $t04855448635._1 | |
1418 | + | let updatedDLp = $t04855448635._2 | |
1360 | 1419 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1361 | 1420 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1362 | 1421 | then (state ++ refreshDLpActions) | |
1363 | 1422 | else throw("Strict value is not equal to itself.") | |
1364 | 1423 | } | |
1365 | 1424 | else throw("Strict value is not equal to itself.") | |
1366 | 1425 | } | |
1367 | 1426 | else throw("Strict value is not equal to itself.") | |
1368 | 1427 | } | |
1369 | 1428 | else throw("Strict value is not equal to itself.") | |
1370 | 1429 | } | |
1371 | 1430 | else throw("Strict value is not equal to itself.") | |
1372 | 1431 | } | |
1373 | 1432 | else throw("Strict value is not equal to itself.") | |
1374 | 1433 | } | |
1375 | 1434 | ||
1376 | 1435 | ||
1377 | 1436 | ||
1378 | 1437 | @Callable(i) | |
1379 | 1438 | func unstakeAndGetOneTknV2 (unstakeAmount,outAssetId,minOutAmount) = { | |
1380 | 1439 | let isPoolOneTokenOperationsDisabled = { | |
1381 | 1440 | let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1382 | 1441 | if ($isInstanceOf(@, "Boolean")) | |
1383 | 1442 | then @ | |
1384 | 1443 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
1385 | 1444 | } | |
1386 | 1445 | let isGetDisabled = if (if (igs()) | |
1387 | 1446 | then true | |
1388 | 1447 | else (cfgPoolStatus == PoolShutdown)) | |
1389 | 1448 | then true | |
1390 | 1449 | else isPoolOneTokenOperationsDisabled | |
1391 | 1450 | let checks = [if (if (!(isGetDisabled)) | |
1392 | 1451 | then true | |
1393 | 1452 | else isManager(i)) | |
1394 | 1453 | then true | |
1395 | 1454 | else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0)) | |
1396 | 1455 | then true | |
1397 | 1456 | else throwErr("no payments are expected")] | |
1398 | 1457 | if ((checks == checks)) | |
1399 | 1458 | then { | |
1400 | 1459 | let factoryCfg = gfc() | |
1401 | 1460 | let lpAssetId = cfgLpAssetId | |
1402 | 1461 | let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr") | |
1403 | 1462 | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), unstakeAmount], nil) | |
1404 | 1463 | if ((unstakeInv == unstakeInv)) | |
1405 | 1464 | then { | |
1406 | - | let $ | |
1407 | - | let state = $ | |
1408 | - | let totalAmount = $ | |
1465 | + | let $t04953049718 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId) | |
1466 | + | let state = $t04953049718._1 | |
1467 | + | let totalAmount = $t04953049718._2 | |
1409 | 1468 | $Tuple2(state, totalAmount) | |
1410 | 1469 | } | |
1411 | 1470 | else throw("Strict value is not equal to itself.") | |
1412 | 1471 | } | |
1413 | 1472 | else throw("Strict value is not equal to itself.") | |
1414 | 1473 | } | |
1415 | 1474 | ||
1416 | 1475 | ||
1417 | 1476 | ||
1418 | 1477 | @Callable(i) | |
1419 | 1478 | func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = { | |
1420 | - | let $ | |
1421 | - | let lpAmount = $ | |
1422 | - | let state = $ | |
1423 | - | let feeAmount = $ | |
1424 | - | let bonus = $ | |
1479 | + | let $t04984649949 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true) | |
1480 | + | let lpAmount = $t04984649949._1 | |
1481 | + | let state = $t04984649949._2 | |
1482 | + | let feeAmount = $t04984649949._3 | |
1483 | + | let bonus = $t04984649949._4 | |
1425 | 1484 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1426 | 1485 | } | |
1427 | 1486 | ||
1428 | 1487 | ||
1429 | 1488 | ||
1430 | 1489 | @Callable(i) | |
1431 | 1490 | func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = { | |
1432 | - | let $ | |
1433 | - | let lpAmount = $ | |
1434 | - | let state = $ | |
1435 | - | let feeAmount = $ | |
1436 | - | let bonus = $ | |
1491 | + | let $t05009750201 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false) | |
1492 | + | let lpAmount = $t05009750201._1 | |
1493 | + | let state = $t05009750201._2 | |
1494 | + | let feeAmount = $t05009750201._3 | |
1495 | + | let bonus = $t05009750201._4 | |
1437 | 1496 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1438 | 1497 | } | |
1439 | 1498 | ||
1440 | 1499 | ||
1441 | 1500 | ||
1442 | 1501 | @Callable(i) | |
1443 | 1502 | func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString(fca))) | |
1444 | 1503 | then throw("denied") | |
1445 | 1504 | else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr)], "success") | |
1446 | 1505 | ||
1447 | 1506 | ||
1448 | 1507 | ||
1449 | 1508 | @Callable(i) | |
1450 | 1509 | func setS (k,v) = if ((toString(i.caller) != strf(this, ada()))) | |
1451 | 1510 | then pd | |
1452 | 1511 | else [StringEntry(k, v)] | |
1453 | 1512 | ||
1454 | 1513 | ||
1455 | 1514 | ||
1456 | 1515 | @Callable(i) | |
1457 | 1516 | func setI (k,v) = if ((toString(i.caller) != strf(this, ada()))) | |
1458 | 1517 | then pd | |
1459 | 1518 | else [IntegerEntry(k, v)] | |
1460 | 1519 | ||
1461 | 1520 | ||
1462 | 1521 | ||
1463 | 1522 | @Callable(i) | |
1464 | 1523 | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, gpc()) | |
1465 | 1524 | ||
1466 | 1525 | ||
1467 | 1526 | ||
1468 | 1527 | @Callable(i) | |
1469 | 1528 | func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId)) | |
1470 | 1529 | ||
1471 | 1530 | ||
1472 | 1531 | ||
1473 | 1532 | @Callable(i) | |
1474 | 1533 | func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = { | |
1475 | 1534 | let pr = calcPrices(amAmt, prAmt, lpAmt) | |
1476 | 1535 | $Tuple2(nil, [toString(pr[0]), toString(pr[1]), toString(pr[2])]) | |
1477 | 1536 | } | |
1478 | 1537 | ||
1479 | 1538 | ||
1480 | 1539 | ||
1481 | 1540 | @Callable(i) | |
1482 | 1541 | func fromX18WrapperREADONLY (val,resScaleMult) = $Tuple2(nil, f1(parseBigIntValue(val), resScaleMult)) | |
1483 | 1542 | ||
1484 | 1543 | ||
1485 | 1544 | ||
1486 | 1545 | @Callable(i) | |
1487 | 1546 | func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(t1(origVal, origScaleMult))) | |
1488 | 1547 | ||
1489 | 1548 | ||
1490 | 1549 | ||
1491 | 1550 | @Callable(i) | |
1492 | 1551 | func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(cpbi(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18)))) | |
1493 | 1552 | ||
1494 | 1553 | ||
1495 | 1554 | ||
1496 | 1555 | @Callable(i) | |
1497 | 1556 | 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, "")) | |
1498 | 1557 | ||
1499 | 1558 | ||
1500 | 1559 | ||
1501 | 1560 | @Callable(i) | |
1502 | 1561 | func estimateGetOperationWrapperREADONLY (txId58,pmtAsId,pmtLpAmt,usrAddr) = { | |
1503 | 1562 | let r = ego(txId58, pmtAsId, pmtLpAmt, addressFromStringValue(usrAddr)) | |
1504 | 1563 | $Tuple2(nil, $Tuple10(r._1, r._2, r._3, r._4, r._5, r._6, r._7, toString(r._8), r._9, r._10)) | |
1505 | 1564 | } | |
1506 | 1565 | ||
1507 | 1566 | ||
1508 | 1567 | @Verifier(tx) | |
1509 | 1568 | func verify () = { | |
1510 | 1569 | let targetPublicKey = match m() { | |
1511 | 1570 | case pk: ByteVector => | |
1512 | 1571 | pk | |
1513 | 1572 | case _: Unit => | |
1514 | 1573 | tx.senderPublicKey | |
1515 | 1574 | case _ => | |
1516 | 1575 | throw("Match error") | |
1517 | 1576 | } | |
1518 | 1577 | match tx { | |
1519 | 1578 | case order: Order => | |
1520 | 1579 | let matcherPub = mp() | |
1521 | - | let $ | |
1522 | - | let orderValid = $ | |
1523 | - | let orderValidInfo = $ | |
1580 | + | let $t05299353062 = validateMatcherOrderAllowed(order) | |
1581 | + | let orderValid = $t05299353062._1 | |
1582 | + | let orderValidInfo = $t05299353062._2 | |
1524 | 1583 | let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey) | |
1525 | 1584 | let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub) | |
1526 | 1585 | if (if (if (orderValid) | |
1527 | 1586 | then senderValid | |
1528 | 1587 | else false) | |
1529 | 1588 | then matcherValid | |
1530 | 1589 | else false) | |
1531 | 1590 | then true | |
1532 | 1591 | else throwOrderError(orderValid, orderValidInfo, senderValid, matcherValid) | |
1533 | 1592 | case s: SetScriptTransaction => | |
1534 | 1593 | if (sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)) | |
1535 | 1594 | then true | |
1536 | 1595 | else { | |
1537 | 1596 | let newHash = blake2b256(value(s.script)) | |
1538 | 1597 | let allowedHash = fromBase64String(value(getString(fca, keyAllowedLpStableScriptHash()))) | |
1539 | 1598 | let currentHash = scriptHash(this) | |
1540 | 1599 | if ((allowedHash == newHash)) | |
1541 | 1600 | then (currentHash != newHash) | |
1542 | 1601 | else false | |
1543 | 1602 | } | |
1544 | 1603 | case _ => | |
1545 | 1604 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
1546 | 1605 | } | |
1547 | 1606 | } | |
1548 | 1607 |
github/deemru/w8io/026f985 219.12 ms ◑