tx · 54CZLDCgVHrgGpa5uHB5BXC5Geb1HYrXtQt8SMbTpDNx 3Mz51suw3H98TBYJHSra1k2uSYQMv2vUkzt: -0.03600000 Waves 2022.06.06 23:39 [2084983] smart account 3Mz51suw3H98TBYJHSra1k2uSYQMv2vUkzt > SELF 0.00000000 Waves
{ "type": 13, "id": "54CZLDCgVHrgGpa5uHB5BXC5Geb1HYrXtQt8SMbTpDNx", "fee": 3600000, "feeAssetId": null, "timestamp": 1654548013875, "version": 1, "sender": "3Mz51suw3H98TBYJHSra1k2uSYQMv2vUkzt", "senderPublicKey": "8RPibCyjGbPr7troJPW7WTXkrbynj8HwkrckopSZoYVn", "proofs": [ "5ixDHjBmc8GTLwwezvpcsfsAyDMdCefTXGGoEGABXpanedXfykS7f62SqjzrqM6GfdwPTZ4MTKhAi9Y3QRG8fN8w" ], "script": "base64:AAIFAAAAAAAAEo8IAhIDCgEIEgMKAQgSABIECgIBBBIHCgUBAQEBBBIDCgEBEgASBwoFAQEBCAESBAoCAQESAwoBARIECgIICBIECgIICBIECgIIARIAEgMKAQgSBQoDAQEBEgQKAggBEgQKAgEBEgQKAggIEgsKCQgBAQIBAggEBBIGCgQICAEIGgoKAUESBWRlbGF5GgcKAUISAnQxGgwKAUMSB29yaWdWYWwaEgoBRBINb3JpZ1NjYWxlTXVsdBoHCgFFEgJmMRoICgFGEgN2YWwaFAoBRxIPcmVzdWx0U2NhbGVNdWx0GgcKAUgSAnRzGggKAUkSA2FtdBoNCgFKEghyZXNTY2FsZRoNCgFLEghjdXJTY2FsZRoICgFMEgNhYnMaBwoBTRICZmMaCAoBThIDbXBrGgkKAU8SBHBtcGsaBwoBUBICcGwaBwoBURICcGgaBgoBUhIBaBoGCgFTEgF0GggKAVQSA3BhdRoHCgFVEgJ1YRoJCgFWEgR0eElkGggKAVcSA2dhdRoHCgFYEgJhYRoHCgFZEgJwYRoICgFaEgNhbXAaCwoBYRIGc2NhbGU4GggKAmFBEgJtcBoJCgJhQhIDZ3BjGgs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", "chainId": 84, "height": 2084983, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: C484A7DPDaRJEqhvW9bet9MHSAxLUuTSKtfFxbhqqU2d Next: 62d83Zvmpq7eF9FjcGYKqtzQkVeTziJzH9mqowoE4Zuk Diff:
Old | New | Differences | |
---|---|---|---|
187 | 187 | ||
188 | 188 | func vd (D1,D0,slpg) = { | |
189 | 189 | let diff = fraction(D0, scale8BigInt, D1) | |
190 | - | if ((diff == diff)) | |
191 | - | then { | |
192 | - | let error = throw("after diff error") | |
193 | - | if ((error == error)) | |
194 | - | then { | |
195 | - | let fail = (slpg > diff) | |
196 | - | if (if (fail) | |
197 | - | then true | |
198 | - | else (D0 > D1)) | |
199 | - | then throw(((((((toString(D0) + " ") + toString(D1)) + " ") + toString(diff)) + " ") + toString(slpg))) | |
200 | - | else fail | |
201 | - | } | |
202 | - | else throw("Strict value is not equal to itself.") | |
203 | - | } | |
204 | - | else throw("Strict value is not equal to itself.") | |
190 | + | let fail = (slpg > diff) | |
191 | + | if (if (fail) | |
192 | + | then true | |
193 | + | else (D0 > D1)) | |
194 | + | then throw(((((((toString(D0) + " ") + toString(D1)) + " ") + toString(diff)) + " ") + toString(slpg))) | |
195 | + | else fail | |
205 | 196 | } | |
206 | 197 | ||
207 | 198 | ||
343 | 334 | else calcLpAmt | |
344 | 335 | let amDiff = (inAmAmt - calcAmAssetPmt) | |
345 | 336 | let prDiff = (inPrAmt - calcPrAssetPmt) | |
346 | - | let $ | |
337 | + | let $t01553115876 = if (if (isOneAsset) | |
347 | 338 | then (pmtId == amIdStr) | |
348 | 339 | else false) | |
349 | 340 | then $Tuple2(pmtAmt, 0) | |
352 | 343 | else false) | |
353 | 344 | then $Tuple2(0, pmtAmt) | |
354 | 345 | else $Tuple2(calcAmAssetPmt, calcPrAssetPmt) | |
355 | - | let writeAmAmt = $ | |
356 | - | let writePrAmt = $ | |
346 | + | let writeAmAmt = $t01553115876._1 | |
347 | + | let writePrAmt = $t01553115876._2 | |
357 | 348 | 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))] | |
358 | 349 | $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId) | |
359 | 350 | } | |
595 | 586 | then i.originCaller | |
596 | 587 | else i.caller | |
597 | 588 | let addonContract = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(ada()), "no addons")), "addon address in not valid") | |
598 | - | let check = reentrantInvoke(addonContract, " | |
589 | + | let check = reentrantInvoke(addonContract, "ensureCanGetOrPutOneTkn", [toString(userAddress)], nil) | |
599 | 590 | if ((check == check)) | |
600 | - | then { | |
601 | - | let afterCheckError = throw("after check") | |
602 | - | if ((afterCheckError == afterCheckError)) | |
603 | - | then if (if (if (if ((0 >= slippage)) | |
604 | - | then true | |
605 | - | else (0 >= amAssetPart)) | |
606 | - | then true | |
607 | - | else (0 >= prAssetPart)) | |
608 | - | then true | |
609 | - | else (0 >= outLp)) | |
610 | - | then throw("Wrong params") | |
611 | - | else if ((size(i.payments) != 1)) | |
612 | - | then throw("1 pmnt expd") | |
591 | + | then if (if (if (if ((0 >= slippage)) | |
592 | + | then true | |
593 | + | else (0 >= amAssetPart)) | |
594 | + | then true | |
595 | + | else (0 >= prAssetPart)) | |
596 | + | then true | |
597 | + | else (0 >= outLp)) | |
598 | + | then throw("Wrong params") | |
599 | + | else if ((size(i.payments) != 1)) | |
600 | + | then throw("1 pmnt expd") | |
601 | + | else { | |
602 | + | let pmt = value(i.payments[0]) | |
603 | + | let pmtAssetId = toBase58String(value(pmt.assetId)) | |
604 | + | let pmtAmt = pmt.amount | |
605 | + | if (if (if ((amAssetPart > pmtAmt)) | |
606 | + | then true | |
607 | + | else (prAssetPart > pmtAmt)) | |
608 | + | then true | |
609 | + | else (10000000 > pmtAmt)) | |
610 | + | then throw("Wrong pmt amt") | |
613 | 611 | else { | |
614 | - | let pmt = value(i.payments[0]) | |
615 | - | let pmtAssetId = toBase58String(value(pmt.assetId)) | |
616 | - | let pmtAmt = pmt.amount | |
617 | - | if (if (if ((amAssetPart > pmtAmt)) | |
618 | - | then true | |
619 | - | else (prAssetPart > pmtAmt)) | |
620 | - | then true | |
621 | - | else (10000000 > pmtAmt)) | |
622 | - | then throw("Wrong pmt amt") | |
623 | - | else { | |
624 | - | let amBalance = getAccBalance(amId) | |
625 | - | let prBalance = getAccBalance(prId) | |
626 | - | let $t02493025310 = if ((pmtAssetId == amId)) | |
627 | - | then $Tuple6((amBalance - pmtAmt), prBalance, (pmtAmt - amAssetPart), prAssetPart, 0, 0) | |
628 | - | else if ((pmtAssetId == prId)) | |
629 | - | then $Tuple6(amBalance, (prBalance - pmtAmt), 0, 0, (pmtAmt - prAssetPart), amAssetPart) | |
630 | - | else throw("wrong pmtAssetId") | |
631 | - | let amBalanceNow = $t02493025310._1 | |
632 | - | let prBalanceNow = $t02493025310._2 | |
633 | - | let virtSwapInAm = $t02493025310._3 | |
634 | - | let virtSwapOutPr = $t02493025310._4 | |
635 | - | let virtSwapInPr = $t02493025310._5 | |
636 | - | let virtSwapOutAm = $t02493025310._6 | |
637 | - | let D0 = invoke(gwxCntr, "calcD", [toString(amBalanceNow), toString(prBalanceNow), A, Amult, Dconv], nil) | |
638 | - | let errorAfterD0 = throw("error after D0") | |
639 | - | if ((errorAfterD0 == errorAfterD0)) | |
612 | + | let amBalance = getAccBalance(amId) | |
613 | + | let prBalance = getAccBalance(prId) | |
614 | + | let $t02483725217 = if ((pmtAssetId == amId)) | |
615 | + | then $Tuple6((amBalance - pmtAmt), prBalance, (pmtAmt - amAssetPart), prAssetPart, 0, 0) | |
616 | + | else if ((pmtAssetId == prId)) | |
617 | + | then $Tuple6(amBalance, (prBalance - pmtAmt), 0, 0, (pmtAmt - prAssetPart), amAssetPart) | |
618 | + | else throw("wrong pmtAssetId") | |
619 | + | let amBalanceNow = $t02483725217._1 | |
620 | + | let prBalanceNow = $t02483725217._2 | |
621 | + | let virtSwapInAm = $t02483725217._3 | |
622 | + | let virtSwapOutPr = $t02483725217._4 | |
623 | + | let virtSwapInPr = $t02483725217._5 | |
624 | + | let virtSwapOutAm = $t02483725217._6 | |
625 | + | let D0 = invoke(gwxCntr, "calcD", [toString(amBalanceNow), toString(prBalanceNow), A, Amult, Dconv], nil) | |
626 | + | let D1 = invoke(gwxCntr, "calcD", [toString(toBigInt(((amBalanceNow + virtSwapInAm) - virtSwapOutAm))), toString(toBigInt(((prBalanceNow + virtSwapInPr) - virtSwapOutPr))), A, Amult, Dconv], nil) | |
627 | + | let D0vsD1 = vd(parseBigIntValue(str(D1)), parseBigIntValue(str(D0)), slippage4D) | |
628 | + | if ((D0vsD1 == D0vsD1)) | |
629 | + | then { | |
630 | + | let estPut = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(fromBase58String(amId), amAssetPart), AttachedPayment(fromBase58String(prId), prAssetPart), slippage, true, true, pmtAmt, pmtAssetId) | |
631 | + | let estimLP = estPut._2 | |
632 | + | let lpAssetId = estPut._7 | |
633 | + | let state = estPut._9 | |
634 | + | let amDiff = estPut._10 | |
635 | + | let prDiff = estPut._11 | |
636 | + | let lpCalcRes = vad(toBigInt(estimLP), toBigInt(outLp), toBigInt(slippage)) | |
637 | + | let emitLpAmt = toInt(lpCalcRes._2) | |
638 | + | let e = invoke(fca, "emit", [emitLpAmt], nil) | |
639 | + | if ((e == e)) | |
640 | 640 | then { | |
641 | - | let D1 = invoke(gwxCntr, "calcD", [toString(toBigInt(((amBalanceNow + virtSwapInAm) - virtSwapOutAm))), toString(toBigInt(((prBalanceNow + virtSwapInPr) - virtSwapOutPr))), A, Amult, Dconv], nil) | |
642 | - | let error1 = throw("error after D1") | |
643 | - | if ((error1 == error1)) | |
641 | + | let el = match e { | |
642 | + | case legacy: Address => | |
643 | + | invoke(legacy, "emit", [emitLpAmt], nil) | |
644 | + | case _ => | |
645 | + | unit | |
646 | + | } | |
647 | + | if ((el == el)) | |
644 | 648 | then { | |
645 | - | let D0vsD1 = vd(parseBigIntValue(str(D1)), parseBigIntValue(str(D0)), slippage4D) | |
646 | - | if ((D0vsD1 == D0vsD1)) | |
649 | + | let sa = if ((amDiff > 0)) | |
650 | + | then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String(amId), amDiff)]) | |
651 | + | else nil | |
652 | + | if ((sa == sa)) | |
647 | 653 | then { | |
648 | - | let estPut = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(fromBase58String(amId), amAssetPart), AttachedPayment(fromBase58String(prId), prAssetPart), slippage, true, true, pmtAmt, pmtAssetId) | |
649 | - | let estimLP = estPut._2 | |
650 | - | let lpAssetId = estPut._7 | |
651 | - | let state = estPut._9 | |
652 | - | let amDiff = estPut._10 | |
653 | - | let prDiff = estPut._11 | |
654 | - | let lpCalcRes = vad(toBigInt(estimLP), toBigInt(outLp), toBigInt(slippage)) | |
655 | - | let emitLpAmt = toInt(lpCalcRes._2) | |
656 | - | let e = invoke(fca, "emit", [emitLpAmt], nil) | |
657 | - | if ((e == e)) | |
654 | + | let sp = if ((prDiff > 0)) | |
655 | + | then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String(prId), prDiff)]) | |
656 | + | else nil | |
657 | + | if ((sp == sp)) | |
658 | 658 | then { | |
659 | - | let el = match e { | |
660 | - | case legacy: Address => | |
661 | - | invoke(legacy, "emit", [emitLpAmt], nil) | |
662 | - | case _ => | |
663 | - | unit | |
664 | - | } | |
665 | - | if ((el == el)) | |
659 | + | let lpTrnsfr = if (autoStake) | |
666 | 660 | then { | |
667 | - | let sa = if ((amDiff > 0)) | |
668 | - | then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String(amId), amDiff)]) | |
669 | - | else nil | |
670 | - | if ((sa == sa)) | |
671 | - | then { | |
672 | - | let sp = if ((prDiff > 0)) | |
673 | - | then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String(prId), prDiff)]) | |
674 | - | else nil | |
675 | - | if ((sp == sp)) | |
676 | - | then { | |
677 | - | let lpTrnsfr = if (autoStake) | |
678 | - | then { | |
679 | - | let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
680 | - | if ((ss == ss)) | |
681 | - | then nil | |
682 | - | else throw("Strict value is not equal to itself.") | |
683 | - | } | |
684 | - | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
685 | - | (state ++ lpTrnsfr) | |
686 | - | } | |
687 | - | else throw("Strict value is not equal to itself.") | |
688 | - | } | |
661 | + | let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
662 | + | if ((ss == ss)) | |
663 | + | then nil | |
689 | 664 | else throw("Strict value is not equal to itself.") | |
690 | 665 | } | |
691 | - | else throw("Strict value is not equal to itself.") | |
666 | + | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
667 | + | (state ++ lpTrnsfr) | |
692 | 668 | } | |
693 | 669 | else throw("Strict value is not equal to itself.") | |
694 | 670 | } | |
698 | 674 | } | |
699 | 675 | else throw("Strict value is not equal to itself.") | |
700 | 676 | } | |
677 | + | else throw("Strict value is not equal to itself.") | |
701 | 678 | } | |
702 | - | else throw("Strict value is not equal to itself.") | |
703 | - | } | |
679 | + | } | |
704 | 680 | else throw("Strict value is not equal to itself.") | |
705 | 681 | } | |
706 | 682 | ||
756 | 732 | let pmtAssetId = value(pmt.assetId) | |
757 | 733 | let pmtAmt = pmt.amount | |
758 | 734 | let addonContract = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(ada()), "no addons")), "addon address in not valid") | |
759 | - | let check = reentrantInvoke(addonContract, " | |
735 | + | let check = reentrantInvoke(addonContract, "ensureCanGetOrPutOneTkn", [toString(userAddress)], nil) | |
760 | 736 | if ((check == check)) | |
761 | 737 | then if ((1000000000 > pmtAmt)) | |
762 | 738 | then throw("Min pmt 10 LP") | |
774 | 750 | let estimPrAmt = r._2 | |
775 | 751 | let amBalance = getAccBalance(amId) | |
776 | 752 | let prBalance = getAccBalance(prId) | |
777 | - | let $ | |
753 | + | let $t03025330710 = if ((outAssetId == amId)) | |
778 | 754 | then $Tuple7((amBalance - estimAmAmt), (prBalance - estimPrAmt), exchResult, estimPrAmt, 0, 0, (estimAmAmt + exchResult)) | |
779 | 755 | else if ((outAssetId == prId)) | |
780 | 756 | then $Tuple7((amBalance - estimAmAmt), (prBalance - estimPrAmt), 0, 0, exchResult, estimAmAmt, (estimPrAmt + exchResult)) | |
781 | 757 | else throw("wrong outAssetId") | |
782 | - | let amBalanceNow = $ | |
783 | - | let prBalanceNow = $ | |
784 | - | let virtSwapInAm = $ | |
785 | - | let virtSwapOutPr = $ | |
786 | - | let virtSwapInPr = $ | |
787 | - | let virtSwapOutAm = $ | |
788 | - | let totalGet = $ | |
758 | + | let amBalanceNow = $t03025330710._1 | |
759 | + | let prBalanceNow = $t03025330710._2 | |
760 | + | let virtSwapInAm = $t03025330710._3 | |
761 | + | let virtSwapOutPr = $t03025330710._4 | |
762 | + | let virtSwapInPr = $t03025330710._5 | |
763 | + | let virtSwapOutAm = $t03025330710._6 | |
764 | + | let totalGet = $t03025330710._7 | |
789 | 765 | if (if ((0 > virtSwapInAm)) | |
790 | 766 | then true | |
791 | 767 | else (0 > virtSwapInPr)) | |
799 | 775 | let finalRes = vad(toBigInt(totalGet), toBigInt(outAmount), toBigInt(slippage)) | |
800 | 776 | if ((finalRes == finalRes)) | |
801 | 777 | then { | |
802 | - | let $ | |
778 | + | let $t03141531519 = if ((outAssetId == amId)) | |
803 | 779 | then $Tuple2(toInt(finalRes._2), 0) | |
804 | 780 | else $Tuple2(0, toInt(finalRes._2)) | |
805 | - | let outAm = $ | |
806 | - | let outPr = $ | |
781 | + | let outAm = $t03141531519._1 | |
782 | + | let outPr = $t03141531519._2 | |
807 | 783 | let curPrX18 = cpbi(t1(prBalance, prDcm), t1(amBalance, amDcm)) | |
808 | 784 | let curPr = f1(curPrX18, scale8) | |
809 | 785 | let state = [ScriptTransfer(userAddress, (outAm + outPr), if ((outAssetId == "WAVES")) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
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 oneBigInt = toBigInt(1) | |
13 | 13 | ||
14 | 14 | let slippage4D = toBigInt((scale8 - ((scale8 * 1) / scale8))) | |
15 | 15 | ||
16 | 16 | let Amult = "100" | |
17 | 17 | ||
18 | 18 | let Dconv = "1" | |
19 | 19 | ||
20 | 20 | let SEP = "__" | |
21 | 21 | ||
22 | 22 | let EMPTY = "" | |
23 | 23 | ||
24 | 24 | let PoolActive = 1 | |
25 | 25 | ||
26 | 26 | let PoolPutDis = 2 | |
27 | 27 | ||
28 | 28 | let PoolMatcherDis = 3 | |
29 | 29 | ||
30 | 30 | let PoolShutdown = 4 | |
31 | 31 | ||
32 | 32 | let idxPoolAddress = 1 | |
33 | 33 | ||
34 | 34 | let idxPoolSt = 2 | |
35 | 35 | ||
36 | 36 | let idxLPAsId = 3 | |
37 | 37 | ||
38 | 38 | let idxAmAsId = 4 | |
39 | 39 | ||
40 | 40 | let idxPrAsId = 5 | |
41 | 41 | ||
42 | 42 | let idxAmtAsDcm = 6 | |
43 | 43 | ||
44 | 44 | let idxPriceAsDcm = 7 | |
45 | 45 | ||
46 | 46 | let idxIAmtAsId = 8 | |
47 | 47 | ||
48 | 48 | let idxIPriceAsId = 9 | |
49 | 49 | ||
50 | 50 | let idxFactStakCntr = 1 | |
51 | 51 | ||
52 | 52 | let idxFactSlippCntr = 7 | |
53 | 53 | ||
54 | 54 | let idxFactGwxRewCntr = 10 | |
55 | 55 | ||
56 | 56 | let delay = "%s__delay" | |
57 | 57 | ||
58 | 58 | func t1 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult)) | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func f1 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18)) | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func ts (amt,resScale,curScale) = fraction(amt, resScale, curScale) | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func abs (val) = if ((zeroBigInt > val)) | |
68 | 68 | then -(val) | |
69 | 69 | else val | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func fc () = "%s__factoryContract" | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func mpk () = "%s__managerPublicKey" | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func pmpk () = "%s__pendingManagerPublicKey" | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func pl () = "%s%s__price__last" | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func ph (h,t) = makeString(["%s%s%d%d__price__history", toString(h), toString(t)], SEP) | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func pau (ua,txId) = ((("%s%s%s__P__" + ua) + "__") + txId) | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func gau (ua,txId) = ((("%s%s%s__G__" + ua) + "__") + txId) | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func aa () = "%s__amountAsset" | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func pa () = "%s__priceAsset" | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func amp () = "%s__amp" | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func ada () = "%s__addonAddr" | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func lgotc (caller) = makeString(["%s%s__lastGetOneTknCall", caller], SEP) | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func lsotc (caller) = makeString(["%s%s__lastPutOneTknCall", caller], SEP) | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func fcfg () = "%s__factoryConfig" | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func mtpk () = "%s%s__matcher__publicKey" | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func pc (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config") | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func mba (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr) | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func aps () = "%s__shutdown" | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func toe (orV,sendrV,matchV) = throw(((((("Failed: ordValid=" + toString(orV)) + " sndrValid=") + toString(sendrV)) + " mtchrValid=") + toString(matchV))) | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func str (val) = match val { | |
130 | 130 | case valStr: String => | |
131 | 131 | valStr | |
132 | 132 | case _ => | |
133 | 133 | throw("fail cast to String") | |
134 | 134 | } | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | func strf (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], "")) | |
138 | 138 | ||
139 | 139 | ||
140 | 140 | func intf (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], "")) | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | let fca = addressFromStringValue(strf(this, fc())) | |
144 | 144 | ||
145 | 145 | let A = strf(this, amp()) | |
146 | 146 | ||
147 | 147 | func igs () = valueOrElse(getBoolean(fca, aps()), false) | |
148 | 148 | ||
149 | 149 | ||
150 | 150 | func mp () = fromBase58String(strf(fca, mtpk())) | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | func gpc () = { | |
154 | 154 | let amtAs = strf(this, aa()) | |
155 | 155 | let priceAs = strf(this, pa()) | |
156 | 156 | let iPriceAs = intf(fca, mba(priceAs)) | |
157 | 157 | let iAmtAs = intf(fca, mba(amtAs)) | |
158 | 158 | split(strf(fca, pc(toString(iAmtAs), toString(iPriceAs))), SEP) | |
159 | 159 | } | |
160 | 160 | ||
161 | 161 | ||
162 | 162 | func gfc () = split(strf(fca, fcfg()), SEP) | |
163 | 163 | ||
164 | 164 | ||
165 | 165 | 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) | |
166 | 166 | ||
167 | 167 | ||
168 | 168 | 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) | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | func getAccBalance (assetId) = if ((assetId == "WAVES")) | |
172 | 172 | then wavesBalance(this).available | |
173 | 173 | else assetBalance(this, fromBase58String(assetId)) | |
174 | 174 | ||
175 | 175 | ||
176 | 176 | func cpbi (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18) | |
177 | 177 | ||
178 | 178 | ||
179 | 179 | func vad (A1,A2,slippage) = { | |
180 | 180 | let diff = fraction((A1 - A2), scale8BigInt, A2) | |
181 | 181 | let pass = ((slippage - abs(diff)) > zeroBigInt) | |
182 | 182 | if (!(pass)) | |
183 | 183 | then throw(("Big slpg: " + toString(diff))) | |
184 | 184 | else $Tuple2(pass, min([A1, A2])) | |
185 | 185 | } | |
186 | 186 | ||
187 | 187 | ||
188 | 188 | func vd (D1,D0,slpg) = { | |
189 | 189 | let diff = fraction(D0, scale8BigInt, D1) | |
190 | - | if ((diff == diff)) | |
191 | - | then { | |
192 | - | let error = throw("after diff error") | |
193 | - | if ((error == error)) | |
194 | - | then { | |
195 | - | let fail = (slpg > diff) | |
196 | - | if (if (fail) | |
197 | - | then true | |
198 | - | else (D0 > D1)) | |
199 | - | then throw(((((((toString(D0) + " ") + toString(D1)) + " ") + toString(diff)) + " ") + toString(slpg))) | |
200 | - | else fail | |
201 | - | } | |
202 | - | else throw("Strict value is not equal to itself.") | |
203 | - | } | |
204 | - | else throw("Strict value is not equal to itself.") | |
190 | + | let fail = (slpg > diff) | |
191 | + | if (if (fail) | |
192 | + | then true | |
193 | + | else (D0 > D1)) | |
194 | + | then throw(((((((toString(D0) + " ") + toString(D1)) + " ") + toString(diff)) + " ") + toString(slpg))) | |
195 | + | else fail | |
205 | 196 | } | |
206 | 197 | ||
207 | 198 | ||
208 | 199 | func pcp (amAssetDcm,prAssetDcm,amAmt,prAmt) = { | |
209 | 200 | let amtAsAmtX18 = t1(amAmt, amAssetDcm) | |
210 | 201 | let prAsAmtX18 = t1(prAmt, prAssetDcm) | |
211 | 202 | cpbi(prAsAmtX18, amtAsAmtX18) | |
212 | 203 | } | |
213 | 204 | ||
214 | 205 | ||
215 | 206 | func calcPrices (amAmt,prAmt,lpAmt) = { | |
216 | 207 | let cfg = gpc() | |
217 | 208 | let amtAsDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
218 | 209 | let prAsDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
219 | 210 | let priceX18 = pcp(amtAsDcm, prAsDcm, amAmt, prAmt) | |
220 | 211 | let amAmtX18 = t1(amAmt, amtAsDcm) | |
221 | 212 | let prAmtX18 = t1(prAmt, prAsDcm) | |
222 | 213 | let lpAmtX18 = t1(lpAmt, scale8) | |
223 | 214 | let lpPrInAmAsX18 = cpbi(amAmtX18, lpAmtX18) | |
224 | 215 | let lpPrInPrAsX18 = cpbi(prAmtX18, lpAmtX18) | |
225 | 216 | [priceX18, lpPrInAmAsX18, lpPrInPrAsX18] | |
226 | 217 | } | |
227 | 218 | ||
228 | 219 | ||
229 | 220 | func calculatePrices (amAmt,prAmt,lpAmt) = { | |
230 | 221 | let p = calcPrices(amAmt, prAmt, lpAmt) | |
231 | 222 | [f1(p[0], scale8), f1(p[1], scale8), f1(p[2], scale8)] | |
232 | 223 | } | |
233 | 224 | ||
234 | 225 | ||
235 | 226 | func ego (txId58,pmtAssetId,pmtLpAmt,userAddress) = { | |
236 | 227 | let cfg = gpc() | |
237 | 228 | let lpId = cfg[idxLPAsId] | |
238 | 229 | let amId = cfg[idxAmAsId] | |
239 | 230 | let prId = cfg[idxPrAsId] | |
240 | 231 | let amDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
241 | 232 | let prDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
242 | 233 | let sts = cfg[idxPoolSt] | |
243 | 234 | let lpEmiss = valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "Wrong LP id").quantity | |
244 | 235 | if ((lpId != pmtAssetId)) | |
245 | 236 | then throw("Wrong pmt asset") | |
246 | 237 | else { | |
247 | 238 | let amBalance = getAccBalance(amId) | |
248 | 239 | let amBalanceX18 = t1(amBalance, amDcm) | |
249 | 240 | let prBalance = getAccBalance(prId) | |
250 | 241 | let prBalanceX18 = t1(prBalance, prDcm) | |
251 | 242 | let curPriceX18 = cpbi(prBalanceX18, amBalanceX18) | |
252 | 243 | let curPrice = f1(curPriceX18, scale8) | |
253 | 244 | let pmtLpAmtX18 = t1(pmtLpAmt, scale8) | |
254 | 245 | let lpEmissX18 = t1(lpEmiss, scale8) | |
255 | 246 | let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissX18) | |
256 | 247 | let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissX18) | |
257 | 248 | let outAmAmt = f1(outAmAmtX18, amDcm) | |
258 | 249 | let outPrAmt = f1(outPrAmtX18, prDcm) | |
259 | 250 | let state = if ((txId58 == "")) | |
260 | 251 | then nil | |
261 | 252 | else [ScriptTransfer(userAddress, outAmAmt, if ((amId == "WAVES")) | |
262 | 253 | then unit | |
263 | 254 | else fromBase58String(amId)), ScriptTransfer(userAddress, outPrAmt, if ((prId == "WAVES")) | |
264 | 255 | then unit | |
265 | 256 | 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)] | |
266 | 257 | $Tuple10(outAmAmt, outPrAmt, amId, prId, amBalance, prBalance, lpEmiss, curPriceX18, sts, state) | |
267 | 258 | } | |
268 | 259 | } | |
269 | 260 | ||
270 | 261 | ||
271 | 262 | func epo (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEval,emitLp,isOneAsset,pmtAmt,pmtId) = { | |
272 | 263 | let cfg = gpc() | |
273 | 264 | let lpId = fromBase58String(cfg[idxLPAsId]) | |
274 | 265 | let amIdStr = cfg[idxAmAsId] | |
275 | 266 | let prIdStr = cfg[idxPrAsId] | |
276 | 267 | let inAmIdStr = cfg[idxIAmtAsId] | |
277 | 268 | let inPrIdStr = cfg[idxIPriceAsId] | |
278 | 269 | let amtDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
279 | 270 | let priceDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
280 | 271 | let sts = cfg[idxPoolSt] | |
281 | 272 | let lpEm = valueOrErrorMessage(assetInfo(lpId), "Wr lp as").quantity | |
282 | 273 | let amBalance = if (isEval) | |
283 | 274 | then getAccBalance(amIdStr) | |
284 | 275 | else if (if (isOneAsset) | |
285 | 276 | then (pmtId == amIdStr) | |
286 | 277 | else false) | |
287 | 278 | then (getAccBalance(amIdStr) - pmtAmt) | |
288 | 279 | else if (isOneAsset) | |
289 | 280 | then getAccBalance(amIdStr) | |
290 | 281 | else (getAccBalance(amIdStr) - inAmAmt) | |
291 | 282 | let prBalance = if (isEval) | |
292 | 283 | then getAccBalance(prIdStr) | |
293 | 284 | else if (if (isOneAsset) | |
294 | 285 | then (pmtId == prIdStr) | |
295 | 286 | else false) | |
296 | 287 | then (getAccBalance(prIdStr) - pmtAmt) | |
297 | 288 | else if (isOneAsset) | |
298 | 289 | then getAccBalance(prIdStr) | |
299 | 290 | else (getAccBalance(prIdStr) - inPrAmt) | |
300 | 291 | let inAmAssetAmtX18 = t1(inAmAmt, amtDcm) | |
301 | 292 | let inPrAssetAmtX18 = t1(inPrAmt, priceDcm) | |
302 | 293 | let userPriceX18 = cpbi(inPrAssetAmtX18, inAmAssetAmtX18) | |
303 | 294 | let amBalanceX18 = t1(amBalance, amtDcm) | |
304 | 295 | let prBalanceX18 = t1(prBalance, priceDcm) | |
305 | 296 | let r = if ((lpEm == 0)) | |
306 | 297 | then { | |
307 | 298 | let curPriceX18 = zeroBigInt | |
308 | 299 | let slippageX18 = zeroBigInt | |
309 | 300 | let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN) | |
310 | 301 | $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18) | |
311 | 302 | } | |
312 | 303 | else { | |
313 | 304 | let curPriceX18 = cpbi(prBalanceX18, amBalanceX18) | |
314 | 305 | let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18) | |
315 | 306 | let slippageX18 = t1(slippage, scale8) | |
316 | 307 | if (if ((curPriceX18 != zeroBigInt)) | |
317 | 308 | then (slippageRealX18 > slippageX18) | |
318 | 309 | else false) | |
319 | 310 | then throw(((("Price slippage " + toString(slippageRealX18)) + " > ") + toString(slippageX18))) | |
320 | 311 | else { | |
321 | 312 | let lpEmissionX18 = t1(lpEm, scale8) | |
322 | 313 | let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18) | |
323 | 314 | let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18) | |
324 | 315 | let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18)) | |
325 | 316 | then $Tuple2(amViaPrX18, inPrAssetAmtX18) | |
326 | 317 | else $Tuple2(inAmAssetAmtX18, prViaAmX18) | |
327 | 318 | let expAmtAssetAmtX18 = expectedAmts._1 | |
328 | 319 | let expPriceAssetAmtX18 = expectedAmts._2 | |
329 | 320 | let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18) | |
330 | 321 | $Tuple5(f1(lpAmtX18, scale8), f1(expAmtAssetAmtX18, amtDcm), f1(expPriceAssetAmtX18, priceDcm), curPriceX18, slippageX18) | |
331 | 322 | } | |
332 | 323 | } | |
333 | 324 | let calcLpAmt = r._1 | |
334 | 325 | let calcAmAssetPmt = r._2 | |
335 | 326 | let calcPrAssetPmt = r._3 | |
336 | 327 | let curPrice = f1(r._4, scale8) | |
337 | 328 | let slippageCalc = f1(r._5, scale8) | |
338 | 329 | if ((0 >= calcLpAmt)) | |
339 | 330 | then throw("LP <= 0") | |
340 | 331 | else { | |
341 | 332 | let emitLpAmt = if (!(emitLp)) | |
342 | 333 | then 0 | |
343 | 334 | else calcLpAmt | |
344 | 335 | let amDiff = (inAmAmt - calcAmAssetPmt) | |
345 | 336 | let prDiff = (inPrAmt - calcPrAssetPmt) | |
346 | - | let $ | |
337 | + | let $t01553115876 = if (if (isOneAsset) | |
347 | 338 | then (pmtId == amIdStr) | |
348 | 339 | else false) | |
349 | 340 | then $Tuple2(pmtAmt, 0) | |
350 | 341 | else if (if (isOneAsset) | |
351 | 342 | then (pmtId == prIdStr) | |
352 | 343 | else false) | |
353 | 344 | then $Tuple2(0, pmtAmt) | |
354 | 345 | else $Tuple2(calcAmAssetPmt, calcPrAssetPmt) | |
355 | - | let writeAmAmt = $ | |
356 | - | let writePrAmt = $ | |
346 | + | let writeAmAmt = $t01553115876._1 | |
347 | + | let writePrAmt = $t01553115876._2 | |
357 | 348 | 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))] | |
358 | 349 | $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId) | |
359 | 350 | } | |
360 | 351 | } | |
361 | 352 | ||
362 | 353 | ||
363 | 354 | func moa (order) = { | |
364 | 355 | let cfg = gpc() | |
365 | 356 | let amtAsId = cfg[idxAmAsId] | |
366 | 357 | let prAsId = cfg[idxPrAsId] | |
367 | 358 | let sts = parseIntValue(cfg[idxPoolSt]) | |
368 | 359 | let amtAsDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
369 | 360 | let prAsDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
370 | 361 | let accAmtAsBalance = getAccBalance(amtAsId) | |
371 | 362 | let accPrAsBalance = getAccBalance(prAsId) | |
372 | 363 | let curPriceX18 = if ((order.orderType == Buy)) | |
373 | 364 | then pcp(amtAsDcm, prAsDcm, (accAmtAsBalance + order.amount), accPrAsBalance) | |
374 | 365 | else pcp(amtAsDcm, prAsDcm, (accAmtAsBalance - order.amount), accPrAsBalance) | |
375 | 366 | let curPrice = f1(curPriceX18, scale8) | |
376 | 367 | if (if (if (igs()) | |
377 | 368 | then true | |
378 | 369 | else (sts == PoolMatcherDis)) | |
379 | 370 | then true | |
380 | 371 | else (sts == PoolShutdown)) | |
381 | 372 | then throw("Admin blocked") | |
382 | 373 | else { | |
383 | 374 | let orAmtAsset = order.assetPair.amountAsset | |
384 | 375 | let orAmtAsStr = if ((orAmtAsset == unit)) | |
385 | 376 | then "WAVES" | |
386 | 377 | else toBase58String(value(orAmtAsset)) | |
387 | 378 | let orPrAsset = order.assetPair.priceAsset | |
388 | 379 | let orPrAsStr = if ((orPrAsset == unit)) | |
389 | 380 | then "WAVES" | |
390 | 381 | else toBase58String(value(orPrAsset)) | |
391 | 382 | if (if ((orAmtAsStr != amtAsId)) | |
392 | 383 | then true | |
393 | 384 | else (orPrAsStr != prAsId)) | |
394 | 385 | then throw("Wr assets") | |
395 | 386 | else { | |
396 | 387 | let orderPrice = order.price | |
397 | 388 | let priceDcm = fraction(scale8, prAsDcm, amtAsDcm) | |
398 | 389 | let castOrderPrice = ts(orderPrice, scale8, priceDcm) | |
399 | 390 | let isOrderPriceValid = if ((order.orderType == Buy)) | |
400 | 391 | then (curPrice >= castOrderPrice) | |
401 | 392 | else (castOrderPrice >= curPrice) | |
402 | 393 | true | |
403 | 394 | } | |
404 | 395 | } | |
405 | 396 | } | |
406 | 397 | ||
407 | 398 | ||
408 | 399 | func cg (i) = if ((size(i.payments) != 1)) | |
409 | 400 | then throw("1 pmnt exp") | |
410 | 401 | else { | |
411 | 402 | let pmt = value(i.payments[0]) | |
412 | 403 | let pmtAssetId = value(pmt.assetId) | |
413 | 404 | let pmtAmt = pmt.amount | |
414 | 405 | let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller) | |
415 | 406 | let outAmAmt = r._1 | |
416 | 407 | let outPrAmt = r._2 | |
417 | 408 | let sts = parseIntValue(r._9) | |
418 | 409 | let state = r._10 | |
419 | 410 | if (if (igs()) | |
420 | 411 | then true | |
421 | 412 | else (sts == PoolShutdown)) | |
422 | 413 | then throw(("Admin blocked: " + toString(sts))) | |
423 | 414 | else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state) | |
424 | 415 | } | |
425 | 416 | ||
426 | 417 | ||
427 | 418 | func cp (caller,txId,amAsPmt,prAsPmt,slippage,emitLp,isOneAsset,pmtAmt,pmtId) = { | |
428 | 419 | let r = epo(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, false, emitLp, isOneAsset, pmtAmt, pmtId) | |
429 | 420 | let sts = parseIntValue(r._8) | |
430 | 421 | if (if (if (igs()) | |
431 | 422 | then true | |
432 | 423 | else (sts == PoolPutDis)) | |
433 | 424 | then true | |
434 | 425 | else (sts == PoolShutdown)) | |
435 | 426 | then throw(("Blocked:" + toString(sts))) | |
436 | 427 | else r | |
437 | 428 | } | |
438 | 429 | ||
439 | 430 | ||
440 | 431 | func m () = match getString(mpk()) { | |
441 | 432 | case s: String => | |
442 | 433 | fromBase58String(s) | |
443 | 434 | case _: Unit => | |
444 | 435 | unit | |
445 | 436 | case _ => | |
446 | 437 | throw("Match error") | |
447 | 438 | } | |
448 | 439 | ||
449 | 440 | ||
450 | 441 | func pm () = match getString(pmpk()) { | |
451 | 442 | case s: String => | |
452 | 443 | fromBase58String(s) | |
453 | 444 | case _: Unit => | |
454 | 445 | unit | |
455 | 446 | case _ => | |
456 | 447 | throw("Match error") | |
457 | 448 | } | |
458 | 449 | ||
459 | 450 | ||
460 | 451 | let pd = throw("Permission denied") | |
461 | 452 | ||
462 | 453 | func mm (i) = match m() { | |
463 | 454 | case pk: ByteVector => | |
464 | 455 | if ((i.callerPublicKey == pk)) | |
465 | 456 | then true | |
466 | 457 | else pd | |
467 | 458 | case _: Unit => | |
468 | 459 | if ((i.caller == this)) | |
469 | 460 | then true | |
470 | 461 | else pd | |
471 | 462 | case _ => | |
472 | 463 | throw("Match error") | |
473 | 464 | } | |
474 | 465 | ||
475 | 466 | ||
476 | 467 | @Callable(i) | |
477 | 468 | func constructor (fc) = { | |
478 | 469 | let c = mm(i) | |
479 | 470 | if ((c == c)) | |
480 | 471 | then [StringEntry(fc(), fc)] | |
481 | 472 | else throw("Strict value is not equal to itself.") | |
482 | 473 | } | |
483 | 474 | ||
484 | 475 | ||
485 | 476 | ||
486 | 477 | @Callable(i) | |
487 | 478 | func setManager (pendingManagerPublicKey) = { | |
488 | 479 | let c = mm(i) | |
489 | 480 | if ((c == c)) | |
490 | 481 | then { | |
491 | 482 | let cm = fromBase58String(pendingManagerPublicKey) | |
492 | 483 | if ((cm == cm)) | |
493 | 484 | then [StringEntry(pmpk(), pendingManagerPublicKey)] | |
494 | 485 | else throw("Strict value is not equal to itself.") | |
495 | 486 | } | |
496 | 487 | else throw("Strict value is not equal to itself.") | |
497 | 488 | } | |
498 | 489 | ||
499 | 490 | ||
500 | 491 | ||
501 | 492 | @Callable(i) | |
502 | 493 | func confirmManager () = { | |
503 | 494 | let p = pm() | |
504 | 495 | let hpm = if (isDefined(p)) | |
505 | 496 | then true | |
506 | 497 | else throw("No pending manager") | |
507 | 498 | if ((hpm == hpm)) | |
508 | 499 | then { | |
509 | 500 | let cpm = if ((i.callerPublicKey == value(p))) | |
510 | 501 | then true | |
511 | 502 | else throw("You are not pending manager") | |
512 | 503 | if ((cpm == cpm)) | |
513 | 504 | then [StringEntry(mpk(), toBase58String(value(p))), DeleteEntry(pmpk())] | |
514 | 505 | else throw("Strict value is not equal to itself.") | |
515 | 506 | } | |
516 | 507 | else throw("Strict value is not equal to itself.") | |
517 | 508 | } | |
518 | 509 | ||
519 | 510 | ||
520 | 511 | ||
521 | 512 | @Callable(i) | |
522 | 513 | func put (slip,autoStake) = { | |
523 | 514 | let factCfg = gfc() | |
524 | 515 | let stakingCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactStakCntr]), "Wr st addr") | |
525 | 516 | let slipCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactSlippCntr]), "Wr sl addr") | |
526 | 517 | if ((0 > slip)) | |
527 | 518 | then throw("Wrong slippage") | |
528 | 519 | else if ((size(i.payments) != 2)) | |
529 | 520 | then throw("2 pmnts expd") | |
530 | 521 | else { | |
531 | 522 | 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, 0, "") | |
532 | 523 | let emitLpAmt = e._2 | |
533 | 524 | let lpAssetId = e._7 | |
534 | 525 | let state = e._9 | |
535 | 526 | let amDiff = e._10 | |
536 | 527 | let prDiff = e._11 | |
537 | 528 | let amId = e._12 | |
538 | 529 | let prId = e._13 | |
539 | 530 | let r = invoke(fca, "emit", [emitLpAmt], nil) | |
540 | 531 | if ((r == r)) | |
541 | 532 | then { | |
542 | 533 | let el = match r { | |
543 | 534 | case legacy: Address => | |
544 | 535 | invoke(legacy, "emit", [emitLpAmt], nil) | |
545 | 536 | case _ => | |
546 | 537 | unit | |
547 | 538 | } | |
548 | 539 | if ((el == el)) | |
549 | 540 | then { | |
550 | 541 | let sa = if ((amDiff > 0)) | |
551 | 542 | then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)]) | |
552 | 543 | else nil | |
553 | 544 | if ((sa == sa)) | |
554 | 545 | then { | |
555 | 546 | let sp = if ((prDiff > 0)) | |
556 | 547 | then invoke(slipCntr, "put", nil, [AttachedPayment(prId, prDiff)]) | |
557 | 548 | else nil | |
558 | 549 | if ((sp == sp)) | |
559 | 550 | then { | |
560 | 551 | let lpTrnsfr = if (autoStake) | |
561 | 552 | then { | |
562 | 553 | let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
563 | 554 | if ((ss == ss)) | |
564 | 555 | then nil | |
565 | 556 | else throw("Strict value is not equal to itself.") | |
566 | 557 | } | |
567 | 558 | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
568 | 559 | (state ++ lpTrnsfr) | |
569 | 560 | } | |
570 | 561 | else throw("Strict value is not equal to itself.") | |
571 | 562 | } | |
572 | 563 | else throw("Strict value is not equal to itself.") | |
573 | 564 | } | |
574 | 565 | else throw("Strict value is not equal to itself.") | |
575 | 566 | } | |
576 | 567 | else throw("Strict value is not equal to itself.") | |
577 | 568 | } | |
578 | 569 | } | |
579 | 570 | ||
580 | 571 | ||
581 | 572 | ||
582 | 573 | @Callable(i) | |
583 | 574 | func putOneTkn (amAssetPart,prAssetPart,outLp,slippage,autoStake) = { | |
584 | 575 | let cfg = gfc() | |
585 | 576 | let stakingCntr = valueOrErrorMessage(addressFromString(cfg[idxFactStakCntr]), "Wr st addr") | |
586 | 577 | let slipCntr = valueOrErrorMessage(addressFromString(cfg[idxFactSlippCntr]), "Wr sl addr") | |
587 | 578 | let gwxCntr = valueOrErrorMessage(addressFromString(cfg[idxFactGwxRewCntr]), "Wr gwx addr") | |
588 | 579 | let poolCfg = gpc() | |
589 | 580 | let amId = poolCfg[idxAmAsId] | |
590 | 581 | let prId = poolCfg[idxPrAsId] | |
591 | 582 | let amDcm = parseIntValue(poolCfg[idxAmtAsDcm]) | |
592 | 583 | let prDcm = parseIntValue(poolCfg[idxPriceAsDcm]) | |
593 | 584 | let addon = valueOrElse(getString(this, ada()), "") | |
594 | 585 | let userAddress = if ((addon == toString(i.caller))) | |
595 | 586 | then i.originCaller | |
596 | 587 | else i.caller | |
597 | 588 | let addonContract = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(ada()), "no addons")), "addon address in not valid") | |
598 | - | let check = reentrantInvoke(addonContract, " | |
589 | + | let check = reentrantInvoke(addonContract, "ensureCanGetOrPutOneTkn", [toString(userAddress)], nil) | |
599 | 590 | if ((check == check)) | |
600 | - | then { | |
601 | - | let afterCheckError = throw("after check") | |
602 | - | if ((afterCheckError == afterCheckError)) | |
603 | - | then if (if (if (if ((0 >= slippage)) | |
604 | - | then true | |
605 | - | else (0 >= amAssetPart)) | |
606 | - | then true | |
607 | - | else (0 >= prAssetPart)) | |
608 | - | then true | |
609 | - | else (0 >= outLp)) | |
610 | - | then throw("Wrong params") | |
611 | - | else if ((size(i.payments) != 1)) | |
612 | - | then throw("1 pmnt expd") | |
591 | + | then if (if (if (if ((0 >= slippage)) | |
592 | + | then true | |
593 | + | else (0 >= amAssetPart)) | |
594 | + | then true | |
595 | + | else (0 >= prAssetPart)) | |
596 | + | then true | |
597 | + | else (0 >= outLp)) | |
598 | + | then throw("Wrong params") | |
599 | + | else if ((size(i.payments) != 1)) | |
600 | + | then throw("1 pmnt expd") | |
601 | + | else { | |
602 | + | let pmt = value(i.payments[0]) | |
603 | + | let pmtAssetId = toBase58String(value(pmt.assetId)) | |
604 | + | let pmtAmt = pmt.amount | |
605 | + | if (if (if ((amAssetPart > pmtAmt)) | |
606 | + | then true | |
607 | + | else (prAssetPart > pmtAmt)) | |
608 | + | then true | |
609 | + | else (10000000 > pmtAmt)) | |
610 | + | then throw("Wrong pmt amt") | |
613 | 611 | else { | |
614 | - | let pmt = value(i.payments[0]) | |
615 | - | let pmtAssetId = toBase58String(value(pmt.assetId)) | |
616 | - | let pmtAmt = pmt.amount | |
617 | - | if (if (if ((amAssetPart > pmtAmt)) | |
618 | - | then true | |
619 | - | else (prAssetPart > pmtAmt)) | |
620 | - | then true | |
621 | - | else (10000000 > pmtAmt)) | |
622 | - | then throw("Wrong pmt amt") | |
623 | - | else { | |
624 | - | let amBalance = getAccBalance(amId) | |
625 | - | let prBalance = getAccBalance(prId) | |
626 | - | let $t02493025310 = if ((pmtAssetId == amId)) | |
627 | - | then $Tuple6((amBalance - pmtAmt), prBalance, (pmtAmt - amAssetPart), prAssetPart, 0, 0) | |
628 | - | else if ((pmtAssetId == prId)) | |
629 | - | then $Tuple6(amBalance, (prBalance - pmtAmt), 0, 0, (pmtAmt - prAssetPart), amAssetPart) | |
630 | - | else throw("wrong pmtAssetId") | |
631 | - | let amBalanceNow = $t02493025310._1 | |
632 | - | let prBalanceNow = $t02493025310._2 | |
633 | - | let virtSwapInAm = $t02493025310._3 | |
634 | - | let virtSwapOutPr = $t02493025310._4 | |
635 | - | let virtSwapInPr = $t02493025310._5 | |
636 | - | let virtSwapOutAm = $t02493025310._6 | |
637 | - | let D0 = invoke(gwxCntr, "calcD", [toString(amBalanceNow), toString(prBalanceNow), A, Amult, Dconv], nil) | |
638 | - | let errorAfterD0 = throw("error after D0") | |
639 | - | if ((errorAfterD0 == errorAfterD0)) | |
612 | + | let amBalance = getAccBalance(amId) | |
613 | + | let prBalance = getAccBalance(prId) | |
614 | + | let $t02483725217 = if ((pmtAssetId == amId)) | |
615 | + | then $Tuple6((amBalance - pmtAmt), prBalance, (pmtAmt - amAssetPart), prAssetPart, 0, 0) | |
616 | + | else if ((pmtAssetId == prId)) | |
617 | + | then $Tuple6(amBalance, (prBalance - pmtAmt), 0, 0, (pmtAmt - prAssetPart), amAssetPart) | |
618 | + | else throw("wrong pmtAssetId") | |
619 | + | let amBalanceNow = $t02483725217._1 | |
620 | + | let prBalanceNow = $t02483725217._2 | |
621 | + | let virtSwapInAm = $t02483725217._3 | |
622 | + | let virtSwapOutPr = $t02483725217._4 | |
623 | + | let virtSwapInPr = $t02483725217._5 | |
624 | + | let virtSwapOutAm = $t02483725217._6 | |
625 | + | let D0 = invoke(gwxCntr, "calcD", [toString(amBalanceNow), toString(prBalanceNow), A, Amult, Dconv], nil) | |
626 | + | let D1 = invoke(gwxCntr, "calcD", [toString(toBigInt(((amBalanceNow + virtSwapInAm) - virtSwapOutAm))), toString(toBigInt(((prBalanceNow + virtSwapInPr) - virtSwapOutPr))), A, Amult, Dconv], nil) | |
627 | + | let D0vsD1 = vd(parseBigIntValue(str(D1)), parseBigIntValue(str(D0)), slippage4D) | |
628 | + | if ((D0vsD1 == D0vsD1)) | |
629 | + | then { | |
630 | + | let estPut = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(fromBase58String(amId), amAssetPart), AttachedPayment(fromBase58String(prId), prAssetPart), slippage, true, true, pmtAmt, pmtAssetId) | |
631 | + | let estimLP = estPut._2 | |
632 | + | let lpAssetId = estPut._7 | |
633 | + | let state = estPut._9 | |
634 | + | let amDiff = estPut._10 | |
635 | + | let prDiff = estPut._11 | |
636 | + | let lpCalcRes = vad(toBigInt(estimLP), toBigInt(outLp), toBigInt(slippage)) | |
637 | + | let emitLpAmt = toInt(lpCalcRes._2) | |
638 | + | let e = invoke(fca, "emit", [emitLpAmt], nil) | |
639 | + | if ((e == e)) | |
640 | 640 | then { | |
641 | - | let D1 = invoke(gwxCntr, "calcD", [toString(toBigInt(((amBalanceNow + virtSwapInAm) - virtSwapOutAm))), toString(toBigInt(((prBalanceNow + virtSwapInPr) - virtSwapOutPr))), A, Amult, Dconv], nil) | |
642 | - | let error1 = throw("error after D1") | |
643 | - | if ((error1 == error1)) | |
641 | + | let el = match e { | |
642 | + | case legacy: Address => | |
643 | + | invoke(legacy, "emit", [emitLpAmt], nil) | |
644 | + | case _ => | |
645 | + | unit | |
646 | + | } | |
647 | + | if ((el == el)) | |
644 | 648 | then { | |
645 | - | let D0vsD1 = vd(parseBigIntValue(str(D1)), parseBigIntValue(str(D0)), slippage4D) | |
646 | - | if ((D0vsD1 == D0vsD1)) | |
649 | + | let sa = if ((amDiff > 0)) | |
650 | + | then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String(amId), amDiff)]) | |
651 | + | else nil | |
652 | + | if ((sa == sa)) | |
647 | 653 | then { | |
648 | - | let estPut = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(fromBase58String(amId), amAssetPart), AttachedPayment(fromBase58String(prId), prAssetPart), slippage, true, true, pmtAmt, pmtAssetId) | |
649 | - | let estimLP = estPut._2 | |
650 | - | let lpAssetId = estPut._7 | |
651 | - | let state = estPut._9 | |
652 | - | let amDiff = estPut._10 | |
653 | - | let prDiff = estPut._11 | |
654 | - | let lpCalcRes = vad(toBigInt(estimLP), toBigInt(outLp), toBigInt(slippage)) | |
655 | - | let emitLpAmt = toInt(lpCalcRes._2) | |
656 | - | let e = invoke(fca, "emit", [emitLpAmt], nil) | |
657 | - | if ((e == e)) | |
654 | + | let sp = if ((prDiff > 0)) | |
655 | + | then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String(prId), prDiff)]) | |
656 | + | else nil | |
657 | + | if ((sp == sp)) | |
658 | 658 | then { | |
659 | - | let el = match e { | |
660 | - | case legacy: Address => | |
661 | - | invoke(legacy, "emit", [emitLpAmt], nil) | |
662 | - | case _ => | |
663 | - | unit | |
664 | - | } | |
665 | - | if ((el == el)) | |
659 | + | let lpTrnsfr = if (autoStake) | |
666 | 660 | then { | |
667 | - | let sa = if ((amDiff > 0)) | |
668 | - | then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String(amId), amDiff)]) | |
669 | - | else nil | |
670 | - | if ((sa == sa)) | |
671 | - | then { | |
672 | - | let sp = if ((prDiff > 0)) | |
673 | - | then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String(prId), prDiff)]) | |
674 | - | else nil | |
675 | - | if ((sp == sp)) | |
676 | - | then { | |
677 | - | let lpTrnsfr = if (autoStake) | |
678 | - | then { | |
679 | - | let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
680 | - | if ((ss == ss)) | |
681 | - | then nil | |
682 | - | else throw("Strict value is not equal to itself.") | |
683 | - | } | |
684 | - | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
685 | - | (state ++ lpTrnsfr) | |
686 | - | } | |
687 | - | else throw("Strict value is not equal to itself.") | |
688 | - | } | |
661 | + | let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
662 | + | if ((ss == ss)) | |
663 | + | then nil | |
689 | 664 | else throw("Strict value is not equal to itself.") | |
690 | 665 | } | |
691 | - | else throw("Strict value is not equal to itself.") | |
666 | + | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
667 | + | (state ++ lpTrnsfr) | |
692 | 668 | } | |
693 | 669 | else throw("Strict value is not equal to itself.") | |
694 | 670 | } | |
695 | 671 | else throw("Strict value is not equal to itself.") | |
696 | 672 | } | |
697 | 673 | else throw("Strict value is not equal to itself.") | |
698 | 674 | } | |
699 | 675 | else throw("Strict value is not equal to itself.") | |
700 | 676 | } | |
677 | + | else throw("Strict value is not equal to itself.") | |
701 | 678 | } | |
702 | - | else throw("Strict value is not equal to itself.") | |
703 | - | } | |
679 | + | } | |
704 | 680 | else throw("Strict value is not equal to itself.") | |
705 | 681 | } | |
706 | 682 | ||
707 | 683 | ||
708 | 684 | ||
709 | 685 | @Callable(i) | |
710 | 686 | func putForFree (maxSlpg) = if ((0 > maxSlpg)) | |
711 | 687 | then throw("Wrong slpg") | |
712 | 688 | else if ((size(i.payments) != 2)) | |
713 | 689 | then throw("2 pmnts expd") | |
714 | 690 | else { | |
715 | 691 | 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, 0, "") | |
716 | 692 | estPut._9 | |
717 | 693 | } | |
718 | 694 | ||
719 | 695 | ||
720 | 696 | ||
721 | 697 | @Callable(i) | |
722 | 698 | func get () = { | |
723 | 699 | let r = cg(i) | |
724 | 700 | let outAmtAmt = r._1 | |
725 | 701 | let outPrAmt = r._2 | |
726 | 702 | let pmtAmt = r._3 | |
727 | 703 | let pmtAssetId = r._4 | |
728 | 704 | let state = r._5 | |
729 | 705 | let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
730 | 706 | if ((b == b)) | |
731 | 707 | then state | |
732 | 708 | else throw("Strict value is not equal to itself.") | |
733 | 709 | } | |
734 | 710 | ||
735 | 711 | ||
736 | 712 | ||
737 | 713 | @Callable(i) | |
738 | 714 | func getOneTkn (exchResult,notUsed,outAmount,outAssetId,slippage) = if ((size(i.payments) != 1)) | |
739 | 715 | then throw("1 pmnt expd") | |
740 | 716 | else { | |
741 | 717 | let cfg = gpc() | |
742 | 718 | let lpId = cfg[idxLPAsId] | |
743 | 719 | let amId = cfg[idxAmAsId] | |
744 | 720 | let prId = cfg[idxPrAsId] | |
745 | 721 | let amDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
746 | 722 | let prDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
747 | 723 | let sts = cfg[idxPoolSt] | |
748 | 724 | let factCfg = gfc() | |
749 | 725 | let gwxCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactGwxRewCntr]), "Wr sl addr") | |
750 | 726 | let pmt = value(i.payments[0]) | |
751 | 727 | let addon = valueOrElse(getString(this, ada()), "") | |
752 | 728 | let userAddress = if ((addon == toString(i.caller))) | |
753 | 729 | then i.originCaller | |
754 | 730 | else i.caller | |
755 | 731 | let txId58 = toBase58String(i.transactionId) | |
756 | 732 | let pmtAssetId = value(pmt.assetId) | |
757 | 733 | let pmtAmt = pmt.amount | |
758 | 734 | let addonContract = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(ada()), "no addons")), "addon address in not valid") | |
759 | - | let check = reentrantInvoke(addonContract, " | |
735 | + | let check = reentrantInvoke(addonContract, "ensureCanGetOrPutOneTkn", [toString(userAddress)], nil) | |
760 | 736 | if ((check == check)) | |
761 | 737 | then if ((1000000000 > pmtAmt)) | |
762 | 738 | then throw("Min pmt 10 LP") | |
763 | 739 | else if (if (if ((0 > slippage)) | |
764 | 740 | then true | |
765 | 741 | else (0 > exchResult)) | |
766 | 742 | then true | |
767 | 743 | else (0 > outAmount)) | |
768 | 744 | then throw("Wrong params") | |
769 | 745 | else if ((lpId != toBase58String(pmtAssetId))) | |
770 | 746 | then throw("Wrong LP") | |
771 | 747 | else { | |
772 | 748 | let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller) | |
773 | 749 | let estimAmAmt = r._1 | |
774 | 750 | let estimPrAmt = r._2 | |
775 | 751 | let amBalance = getAccBalance(amId) | |
776 | 752 | let prBalance = getAccBalance(prId) | |
777 | - | let $ | |
753 | + | let $t03025330710 = if ((outAssetId == amId)) | |
778 | 754 | then $Tuple7((amBalance - estimAmAmt), (prBalance - estimPrAmt), exchResult, estimPrAmt, 0, 0, (estimAmAmt + exchResult)) | |
779 | 755 | else if ((outAssetId == prId)) | |
780 | 756 | then $Tuple7((amBalance - estimAmAmt), (prBalance - estimPrAmt), 0, 0, exchResult, estimAmAmt, (estimPrAmt + exchResult)) | |
781 | 757 | else throw("wrong outAssetId") | |
782 | - | let amBalanceNow = $ | |
783 | - | let prBalanceNow = $ | |
784 | - | let virtSwapInAm = $ | |
785 | - | let virtSwapOutPr = $ | |
786 | - | let virtSwapInPr = $ | |
787 | - | let virtSwapOutAm = $ | |
788 | - | let totalGet = $ | |
758 | + | let amBalanceNow = $t03025330710._1 | |
759 | + | let prBalanceNow = $t03025330710._2 | |
760 | + | let virtSwapInAm = $t03025330710._3 | |
761 | + | let virtSwapOutPr = $t03025330710._4 | |
762 | + | let virtSwapInPr = $t03025330710._5 | |
763 | + | let virtSwapOutAm = $t03025330710._6 | |
764 | + | let totalGet = $t03025330710._7 | |
789 | 765 | if (if ((0 > virtSwapInAm)) | |
790 | 766 | then true | |
791 | 767 | else (0 > virtSwapInPr)) | |
792 | 768 | then throw("Wrong calc") | |
793 | 769 | else { | |
794 | 770 | let D0 = invoke(gwxCntr, "calcD", [toString(amBalanceNow), toString(prBalanceNow), A, Amult, Dconv], nil) | |
795 | 771 | let D1 = invoke(gwxCntr, "calcD", [toString(((amBalanceNow - virtSwapInAm) + virtSwapOutAm)), toString(((prBalanceNow + virtSwapOutPr) - virtSwapInPr)), A, Amult, Dconv], nil) | |
796 | 772 | let D0vsD1 = vd(parseBigIntValue(str(D1)), parseBigIntValue(str(D0)), slippage4D) | |
797 | 773 | if ((D0vsD1 == D0vsD1)) | |
798 | 774 | then { | |
799 | 775 | let finalRes = vad(toBigInt(totalGet), toBigInt(outAmount), toBigInt(slippage)) | |
800 | 776 | if ((finalRes == finalRes)) | |
801 | 777 | then { | |
802 | - | let $ | |
778 | + | let $t03141531519 = if ((outAssetId == amId)) | |
803 | 779 | then $Tuple2(toInt(finalRes._2), 0) | |
804 | 780 | else $Tuple2(0, toInt(finalRes._2)) | |
805 | - | let outAm = $ | |
806 | - | let outPr = $ | |
781 | + | let outAm = $t03141531519._1 | |
782 | + | let outPr = $t03141531519._2 | |
807 | 783 | let curPrX18 = cpbi(t1(prBalance, prDcm), t1(amBalance, amDcm)) | |
808 | 784 | let curPr = f1(curPrX18, scale8) | |
809 | 785 | let state = [ScriptTransfer(userAddress, (outAm + outPr), if ((outAssetId == "WAVES")) | |
810 | 786 | then unit | |
811 | 787 | else fromBase58String(outAssetId)), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAm, outPr, pmtAmt, curPr, height, lastBlock.timestamp)), IntegerEntry(pl(), curPr), IntegerEntry(ph(height, lastBlock.timestamp), curPr)] | |
812 | 788 | if ((state == state)) | |
813 | 789 | then { | |
814 | 790 | let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
815 | 791 | if ((burn == burn)) | |
816 | 792 | then state | |
817 | 793 | else throw("Strict value is not equal to itself.") | |
818 | 794 | } | |
819 | 795 | else throw("Strict value is not equal to itself.") | |
820 | 796 | } | |
821 | 797 | else throw("Strict value is not equal to itself.") | |
822 | 798 | } | |
823 | 799 | else throw("Strict value is not equal to itself.") | |
824 | 800 | } | |
825 | 801 | } | |
826 | 802 | else throw("Strict value is not equal to itself.") | |
827 | 803 | } | |
828 | 804 | ||
829 | 805 | ||
830 | 806 | ||
831 | 807 | @Callable(i) | |
832 | 808 | func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = { | |
833 | 809 | let r = cg(i) | |
834 | 810 | let outAmAmt = r._1 | |
835 | 811 | let outPrAmt = r._2 | |
836 | 812 | let pmtAmt = r._3 | |
837 | 813 | let pmtAssetId = r._4 | |
838 | 814 | let state = r._5 | |
839 | 815 | if ((noLessThenAmtAsset > outAmAmt)) | |
840 | 816 | then throw(((("Failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset))) | |
841 | 817 | else if ((noLessThenPriceAsset > outPrAmt)) | |
842 | 818 | then throw(((("Failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset))) | |
843 | 819 | else { | |
844 | 820 | let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
845 | 821 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
846 | 822 | then state | |
847 | 823 | else throw("Strict value is not equal to itself.") | |
848 | 824 | } | |
849 | 825 | } | |
850 | 826 | ||
851 | 827 | ||
852 | 828 | ||
853 | 829 | @Callable(i) | |
854 | 830 | func unstakeAndGet (amount) = { | |
855 | 831 | let checkPayments = if ((size(i.payments) != 0)) | |
856 | 832 | then throw("No pmnts expd") | |
857 | 833 | else true | |
858 | 834 | if ((checkPayments == checkPayments)) | |
859 | 835 | then { | |
860 | 836 | let cfg = gpc() | |
861 | 837 | let factoryCfg = gfc() | |
862 | 838 | let lpAssetId = fromBase58String(cfg[idxLPAsId]) | |
863 | 839 | let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr") | |
864 | 840 | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil) | |
865 | 841 | if ((unstakeInv == unstakeInv)) | |
866 | 842 | then { | |
867 | 843 | let r = ego(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller) | |
868 | 844 | let sts = parseIntValue(r._9) | |
869 | 845 | let state = r._10 | |
870 | 846 | let v = if (if (igs()) | |
871 | 847 | then true | |
872 | 848 | else (sts == PoolShutdown)) | |
873 | 849 | then throw(("Blocked: " + toString(sts))) | |
874 | 850 | else true | |
875 | 851 | if ((v == v)) | |
876 | 852 | then { | |
877 | 853 | let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)]) | |
878 | 854 | if ((burnA == burnA)) | |
879 | 855 | then state | |
880 | 856 | else throw("Strict value is not equal to itself.") | |
881 | 857 | } | |
882 | 858 | else throw("Strict value is not equal to itself.") | |
883 | 859 | } | |
884 | 860 | else throw("Strict value is not equal to itself.") | |
885 | 861 | } | |
886 | 862 | else throw("Strict value is not equal to itself.") | |
887 | 863 | } | |
888 | 864 | ||
889 | 865 | ||
890 | 866 | ||
891 | 867 | @Callable(i) | |
892 | 868 | func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString(fca))) | |
893 | 869 | then throw("denied") | |
894 | 870 | else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr)], "success") | |
895 | 871 | ||
896 | 872 | ||
897 | 873 | ||
898 | 874 | @Callable(i) | |
899 | 875 | func setS (k,v) = if ((toString(i.caller) != strf(this, ada()))) | |
900 | 876 | then pd | |
901 | 877 | else [StringEntry(k, v)] | |
902 | 878 | ||
903 | 879 | ||
904 | 880 | ||
905 | 881 | @Callable(i) | |
906 | 882 | func setI (k,v) = if ((toString(i.caller) != strf(this, ada()))) | |
907 | 883 | then pd | |
908 | 884 | else [IntegerEntry(k, v)] | |
909 | 885 | ||
910 | 886 | ||
911 | 887 | ||
912 | 888 | @Callable(i) | |
913 | 889 | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, gpc()) | |
914 | 890 | ||
915 | 891 | ||
916 | 892 | ||
917 | 893 | @Callable(i) | |
918 | 894 | func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId)) | |
919 | 895 | ||
920 | 896 | ||
921 | 897 | ||
922 | 898 | @Callable(i) | |
923 | 899 | func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = { | |
924 | 900 | let pr = calcPrices(amAmt, prAmt, lpAmt) | |
925 | 901 | $Tuple2(nil, [toString(pr[0]), toString(pr[1]), toString(pr[2])]) | |
926 | 902 | } | |
927 | 903 | ||
928 | 904 | ||
929 | 905 | ||
930 | 906 | @Callable(i) | |
931 | 907 | func fromX18WrapperREADONLY (val,resScaleMult) = $Tuple2(nil, f1(parseBigIntValue(val), resScaleMult)) | |
932 | 908 | ||
933 | 909 | ||
934 | 910 | ||
935 | 911 | @Callable(i) | |
936 | 912 | func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(t1(origVal, origScaleMult))) | |
937 | 913 | ||
938 | 914 | ||
939 | 915 | ||
940 | 916 | @Callable(i) | |
941 | 917 | func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(cpbi(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18)))) | |
942 | 918 | ||
943 | 919 | ||
944 | 920 | ||
945 | 921 | @Callable(i) | |
946 | 922 | func estimatePutOperationWrapperREADONLY (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,usrAddr,isEval,emitLp) = $Tuple2(nil, epo(txId58, slippage, inAmAmt, inAmId, inPrAmt, inPrId, usrAddr, isEval, emitLp, false, 0, "")) | |
947 | 923 | ||
948 | 924 | ||
949 | 925 | ||
950 | 926 | @Callable(i) | |
951 | 927 | func estimateGetOperationWrapperREADONLY (txId58,pmtAsId,pmtLpAmt,usrAddr) = { | |
952 | 928 | let r = ego(txId58, pmtAsId, pmtLpAmt, addressFromStringValue(usrAddr)) | |
953 | 929 | $Tuple2(nil, $Tuple10(r._1, r._2, r._3, r._4, r._5, r._6, r._7, toString(r._8), r._9, r._10)) | |
954 | 930 | } | |
955 | 931 | ||
956 | 932 | ||
957 | 933 | @Verifier(tx) | |
958 | 934 | func verify () = match tx { | |
959 | 935 | case order: Order => | |
960 | 936 | let mtchPub = mp() | |
961 | 937 | let orV = moa(order) | |
962 | 938 | let sndrV = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey) | |
963 | 939 | let mtchV = sigVerify(order.bodyBytes, order.proofs[1], mtchPub) | |
964 | 940 | if (if (if (orV) | |
965 | 941 | then sndrV | |
966 | 942 | else false) | |
967 | 943 | then mtchV | |
968 | 944 | else false) | |
969 | 945 | then true | |
970 | 946 | else toe(orV, sndrV, mtchV) | |
971 | 947 | case _ => | |
972 | 948 | let targetPublicKey = match m() { | |
973 | 949 | case pk: ByteVector => | |
974 | 950 | pk | |
975 | 951 | case _: Unit => | |
976 | 952 | tx.senderPublicKey | |
977 | 953 | case _ => | |
978 | 954 | throw("Match error") | |
979 | 955 | } | |
980 | 956 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
981 | 957 | } | |
982 | 958 |
github/deemru/w8io/026f985 104.15 ms ◑