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