tx · 2dVLCenRoox2uANFrH6VQwTyqVNEZJZ18Q6eDqH5di47

3N4vUDe3oc1YPNwMyQi2h8f2tmGoA7wBZp2:  -0.03500000 Waves

2022.05.24 16:52 [2065854] smart account 3N4vUDe3oc1YPNwMyQi2h8f2tmGoA7wBZp2 > SELF 0.00000000 Waves

{ "type": 13, "id": "2dVLCenRoox2uANFrH6VQwTyqVNEZJZ18Q6eDqH5di47", "fee": 3500000, "feeAssetId": null, "timestamp": 1653400331856, "version": 1, "sender": "3N4vUDe3oc1YPNwMyQi2h8f2tmGoA7wBZp2", "senderPublicKey": "6MuWw1pkme7UgQX2hZh8yTZyoWVkz8A4rmHZ1acrsrVm", "proofs": [ "4UiYbXtcX9vnszg6qJ8AKcUdrgJ1SRhYCChy6UBGcd9479xHGvKo9uZJoZ15vskcuuLQDN9PE2XDiQTARaN8Yfqh" ], "script": "base64:AAIFAAAAAAAAC68IAhIDCgEIEgMKAQgSABIECgIBBBIHCgUBAQEBBBIDCgEBEgASBwoFAQEBCAESBAoCAQESAwoBARIECgIICBIECgIICBIECgIIARIAEgMKAQgSBQoDAQEBEgQKAggBEgQKAgEBEgQKAggIEgsKCQgBAQIBAggEBBIGCgQICAEIIgZzY2FsZTgiDHNjYWxlOEJpZ0ludCIHc2NhbGUxOCIKemVyb0JpZ0ludCIJb25lQmlnSW50IgpzbGlwcGFnZTREIgVBbXVsdCIFRGNvbnYiA1NFUCIFRU1QVFkiClBvb2xBY3RpdmUiClBvb2xQdXREaXMiDlBvb2xNYXRjaGVyRGlzIgxQb29sU2h1dGRvd24iDmlkeFBvb2xBZGRyZXNzIglpZHhQb29sU3QiCWlkeExQQXNJZCIJaWR4QW1Bc0lkIglpZHhQckFzSWQiC2lkeEFtdEFzRGNtIg1pZHhQcmljZUFzRGNtIgtpZHhJQW10QXNJZCINaWR4SVByaWNlQXNJZCIPaWR4RmFjdFN0YWtDbnRyIhBpZHhGYWN0U2xpcHBDbnRyIhFpZHhGYWN0R3d4UmV3Q250ci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AAAmNRAAAAAQUAAAACY1IEAAAAAmVNCQAB9AAAAAMIBQAAAAJjUgAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAmNSAAAABnByb29mcwAAAAAAAAAAAAgFAAAAAmNSAAAAD3NlbmRlclB1YmxpY0tleQQAAAACZU4JAAH0AAAAAwgFAAAAAmNSAAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACY1IAAAAGcHJvb2ZzAAAAAAAAAAABBQAAAAJlTAMDAwUAAAACYW4FAAAAAmVNBwUAAAACZU4HBgkBAAAAAmFtAAAAAwUAAAACYW4FAAAAAmVNBQAAAAJlTgQAAAACZU8EAAAAAmVQCQEAAAACZGoAAAAAAwkAAAEAAAACBQAAAAJlUAIAAAAKQnl0ZVZlY3RvcgQAAAACZG8FAAAAAmVQBQAAAAJkbwMJAAABAAAAAgUAAAACZVACAAAABFVuaXQIBQAAAAJlSgAAAA9zZW5kZXJQdWJsaWNLZXkJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IJAAH0AAAAAwgFAAAAAmVKAAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACZUoAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAJlTw7/YJE=", "chainId": 84, "height": 2065854, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: A5eBjfEsGLxzBn1QCGVMBLzkifw2NxN1CtBPkUNMLKR8 Next: 7MJW1cdV9pbvm3eEtn2rGWvo4AfvBPFCYUZCKZMpXQaS Diff:
OldNewDifferences
5353
5454 let idxFactGwxRewCntr = 10
5555
56+let delay = "%s__delay"
57+
5658 func t1 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
5759
5860
98100
99101
100102 func ada () = "%s__addonAddr"
103+
104+
105+func lgotc (caller) = makeString(["%s%s__lastGetOneTknCall", caller], SEP)
106+
107+
108+func lsotc (caller) = makeString(["%s%s__lastPutOneTknCall", caller], SEP)
101109
102110
103111 func fcfg () = "%s__factoryConfig"
326334 else calcLpAmt
327335 let amDiff = (inAmAmt - calcAmAssetPmt)
328336 let prDiff = (inPrAmt - calcPrAssetPmt)
329- let $t01529615641 = if (if (isOneAsset)
337+ let $t01553115876 = if (if (isOneAsset)
330338 then (pmtId == amIdStr)
331339 else false)
332340 then $Tuple2(pmtAmt, 0)
335343 else false)
336344 then $Tuple2(0, pmtAmt)
337345 else $Tuple2(calcAmAssetPmt, calcPrAssetPmt)
338- let writeAmAmt = $t01529615641._1
339- let writePrAmt = $t01529615641._2
346+ let writeAmAmt = $t01553115876._1
347+ let writePrAmt = $t01553115876._2
340348 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))]
341349 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId)
342350 }
573581 let prId = poolCfg[idxPrAsId]
574582 let amDcm = parseIntValue(poolCfg[idxAmtAsDcm])
575583 let prDcm = parseIntValue(poolCfg[idxPriceAsDcm])
576- if (if (if (if ((0 >= slippage))
577- then true
578- else (0 >= amAssetPart))
579- then true
580- else (0 >= prAssetPart))
581- then true
582- else (0 >= outLp))
583- then throw("Wrong params")
584- else if ((size(i.payments) != 1))
585- then throw("1 pmnt expd")
586- else {
587- let pmt = value(i.payments[0])
588- let pmtAssetId = toBase58String(value(pmt.assetId))
589- let pmtAmt = pmt.amount
590- if (if (if ((amAssetPart > pmtAmt))
591- then true
592- else (prAssetPart > pmtAmt))
593- then true
594- else (10000000 > pmtAmt))
595- then throw("Wrong pmt amt")
596- else {
597- let amBalance = getAccBalance(amId)
598- let prBalance = getAccBalance(prId)
599- let $t02418724567 = if ((pmtAssetId == amId))
600- then $Tuple6((amBalance - pmtAmt), prBalance, (pmtAmt - amAssetPart), prAssetPart, 0, 0)
601- else if ((pmtAssetId == prId))
602- then $Tuple6(amBalance, (prBalance - pmtAmt), 0, 0, (pmtAmt - prAssetPart), amAssetPart)
603- else throw("wrong pmtAssetId")
604- let amBalanceNow = $t02418724567._1
605- let prBalanceNow = $t02418724567._2
606- let virtSwapInAm = $t02418724567._3
607- let virtSwapOutPr = $t02418724567._4
608- let virtSwapInPr = $t02418724567._5
609- let virtSwapOutAm = $t02418724567._6
610- let D0 = invoke(gwxCntr, "calcD", [toString(amBalanceNow), toString(prBalanceNow), A, Amult, Dconv], nil)
611- let D1 = invoke(gwxCntr, "calcD", [toString(toBigInt(((amBalanceNow + virtSwapInAm) - virtSwapOutAm))), toString(toBigInt(((prBalanceNow + virtSwapInPr) - virtSwapOutPr))), A, Amult, Dconv], nil)
612- let D0vsD1 = vd(parseBigIntValue(str(D1)), parseBigIntValue(str(D0)), slippage4D)
613- if ((D0vsD1 == D0vsD1))
614- then {
615- let estPut = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(fromBase58String(amId), amAssetPart), AttachedPayment(fromBase58String(prId), prAssetPart), slippage, true, true, pmtAmt, pmtAssetId)
616- let estimLP = estPut._2
617- let lpAssetId = estPut._7
618- let state = estPut._9
619- let amDiff = estPut._10
620- let prDiff = estPut._11
621- let lpCalcRes = vad(toBigInt(estimLP), toBigInt(outLp), toBigInt(slippage))
622- let emitLpAmt = toInt(lpCalcRes._2)
623- let e = invoke(fca, "emit", [emitLpAmt], nil)
624- if ((e == e))
625- then {
626- let el = match e {
627- case legacy: Address =>
628- invoke(legacy, "emit", [emitLpAmt], nil)
629- case _ =>
630- unit
631- }
632- if ((el == el))
633- then {
634- let sa = if ((amDiff > 0))
635- then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String(amId), amDiff)])
636- else nil
637- if ((sa == sa))
638- then {
639- let sp = if ((prDiff > 0))
640- then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String(prId), prDiff)])
641- else nil
642- if ((sp == sp))
643- then {
644- let lpTrnsfr = if (autoStake)
645- then {
646- let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
647- if ((ss == ss))
648- then nil
649- else throw("Strict value is not equal to itself.")
650- }
651- else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
652- (state ++ lpTrnsfr)
653- }
654- else throw("Strict value is not equal to itself.")
655- }
656- else throw("Strict value is not equal to itself.")
657- }
658- else throw("Strict value is not equal to itself.")
659- }
660- else throw("Strict value is not equal to itself.")
661- }
662- else throw("Strict value is not equal to itself.")
663- }
664- }
584+ let addon = valueOrElse(getString(this, ada()), "")
585+ let userAddress = if ((addon == toString(i.caller)))
586+ then i.originCaller
587+ else i.caller
588+ let addonContract = valueOrErrorMessage(addressFromString(ada()), "no addons")
589+ let check = invoke(addonContract, "ensureCanPutOneTkn", [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 (if (if ((amAssetPart > pmtAmt))
606+ then true
607+ else (prAssetPart > pmtAmt))
608+ then true
609+ else (10000000 > pmtAmt))
610+ then throw("Wrong pmt amt")
611+ else {
612+ let amBalance = getAccBalance(amId)
613+ let prBalance = getAccBalance(prId)
614+ let $t02473725117 = 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 = $t02473725117._1
620+ let prBalanceNow = $t02473725117._2
621+ let virtSwapInAm = $t02473725117._3
622+ let virtSwapOutPr = $t02473725117._4
623+ let virtSwapInPr = $t02473725117._5
624+ let virtSwapOutAm = $t02473725117._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+ then {
641+ let el = match e {
642+ case legacy: Address =>
643+ invoke(legacy, "emit", [emitLpAmt], nil)
644+ case _ =>
645+ unit
646+ }
647+ if ((el == el))
648+ then {
649+ let sa = if ((amDiff > 0))
650+ then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String(amId), amDiff)])
651+ else nil
652+ if ((sa == sa))
653+ then {
654+ let sp = if ((prDiff > 0))
655+ then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String(prId), prDiff)])
656+ else nil
657+ if ((sp == sp))
658+ then {
659+ let lpTrnsfr = if (autoStake)
660+ then {
661+ let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
662+ if ((ss == ss))
663+ then nil
664+ else throw("Strict value is not equal to itself.")
665+ }
666+ else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
667+ (state ++ lpTrnsfr)
668+ }
669+ else throw("Strict value is not equal to itself.")
670+ }
671+ else throw("Strict value is not equal to itself.")
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+ }
680+ else throw("Strict value is not equal to itself.")
665681 }
666682
667683
715731 let txId58 = toBase58String(i.transactionId)
716732 let pmtAssetId = value(pmt.assetId)
717733 let pmtAmt = pmt.amount
718- if ((1000000000 > pmtAmt))
719- then throw("Min pmt 10 LP")
720- else if (if (if ((0 > slippage))
721- then true
722- else (0 > exchResult))
723- then true
724- else (0 > outAmount))
725- then throw("Wrong params")
726- else if ((lpId != toBase58String(pmtAssetId)))
727- then throw("Wrong LP")
728- else {
729- let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
730- let estimAmAmt = r._1
731- let estimPrAmt = r._2
732- let amBalance = getAccBalance(amId)
733- let prBalance = getAccBalance(prId)
734- let $t02934629803 = if ((outAssetId == amId))
735- then $Tuple7((amBalance - estimAmAmt), (prBalance - estimPrAmt), exchResult, estimPrAmt, 0, 0, (estimAmAmt + exchResult))
736- else if ((outAssetId == prId))
737- then $Tuple7((amBalance - estimAmAmt), (prBalance - estimPrAmt), 0, 0, exchResult, estimAmAmt, (estimPrAmt + exchResult))
738- else throw("wrong outAssetId")
739- let amBalanceNow = $t02934629803._1
740- let prBalanceNow = $t02934629803._2
741- let virtSwapInAm = $t02934629803._3
742- let virtSwapOutPr = $t02934629803._4
743- let virtSwapInPr = $t02934629803._5
744- let virtSwapOutAm = $t02934629803._6
745- let totalGet = $t02934629803._7
746- if (if ((0 > virtSwapInAm))
747- then true
748- else (0 > virtSwapInPr))
749- then throw("Wrong calc")
750- else {
751- let D0 = invoke(gwxCntr, "calcD", [toString(amBalanceNow), toString(prBalanceNow), A, Amult, Dconv], nil)
752- let D1 = invoke(gwxCntr, "calcD", [toString(((amBalanceNow - virtSwapInAm) + virtSwapOutAm)), toString(((prBalanceNow + virtSwapOutPr) - virtSwapInPr)), A, Amult, Dconv], nil)
753- let D0vsD1 = vd(parseBigIntValue(str(D1)), parseBigIntValue(str(D0)), slippage4D)
754- if ((D0vsD1 == D0vsD1))
755- then {
756- let finalRes = vad(toBigInt(totalGet), toBigInt(outAmount), toBigInt(slippage))
757- if ((finalRes == finalRes))
758- then {
759- let $t03050830612 = if ((outAssetId == amId))
760- then $Tuple2(toInt(finalRes._2), 0)
761- else $Tuple2(0, toInt(finalRes._2))
762- let outAm = $t03050830612._1
763- let outPr = $t03050830612._2
764- let curPrX18 = cpbi(t1(prBalance, prDcm), t1(amBalance, amDcm))
765- let curPr = f1(curPrX18, scale8)
766- let state = [ScriptTransfer(userAddress, (outAm + outPr), if ((outAssetId == "WAVES"))
767- then unit
768- 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)]
769- if ((state == state))
770- then {
771- let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
772- if ((burn == burn))
773- then state
774- else throw("Strict value is not equal to itself.")
775- }
776- else throw("Strict value is not equal to itself.")
777- }
778- else throw("Strict value is not equal to itself.")
779- }
780- else throw("Strict value is not equal to itself.")
781- }
782- }
734+ let addonContract = valueOrErrorMessage(addressFromString(ada()), "no addons")
735+ let check = invoke(addonContract, "ensureCanGetOneTkn", [userAddress], nil)
736+ if ((check == check))
737+ then if ((1000000000 > pmtAmt))
738+ then throw("Min pmt 10 LP")
739+ else if (if (if ((0 > slippage))
740+ then true
741+ else (0 > exchResult))
742+ then true
743+ else (0 > outAmount))
744+ then throw("Wrong params")
745+ else if ((lpId != toBase58String(pmtAssetId)))
746+ then throw("Wrong LP")
747+ else {
748+ let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
749+ let estimAmAmt = r._1
750+ let estimPrAmt = r._2
751+ let amBalance = getAccBalance(amId)
752+ let prBalance = getAccBalance(prId)
753+ let $t03005830515 = if ((outAssetId == amId))
754+ then $Tuple7((amBalance - estimAmAmt), (prBalance - estimPrAmt), exchResult, estimPrAmt, 0, 0, (estimAmAmt + exchResult))
755+ else if ((outAssetId == prId))
756+ then $Tuple7((amBalance - estimAmAmt), (prBalance - estimPrAmt), 0, 0, exchResult, estimAmAmt, (estimPrAmt + exchResult))
757+ else throw("wrong outAssetId")
758+ let amBalanceNow = $t03005830515._1
759+ let prBalanceNow = $t03005830515._2
760+ let virtSwapInAm = $t03005830515._3
761+ let virtSwapOutPr = $t03005830515._4
762+ let virtSwapInPr = $t03005830515._5
763+ let virtSwapOutAm = $t03005830515._6
764+ let totalGet = $t03005830515._7
765+ if (if ((0 > virtSwapInAm))
766+ then true
767+ else (0 > virtSwapInPr))
768+ then throw("Wrong calc")
769+ else {
770+ let D0 = invoke(gwxCntr, "calcD", [toString(amBalanceNow), toString(prBalanceNow), A, Amult, Dconv], nil)
771+ let D1 = invoke(gwxCntr, "calcD", [toString(((amBalanceNow - virtSwapInAm) + virtSwapOutAm)), toString(((prBalanceNow + virtSwapOutPr) - virtSwapInPr)), A, Amult, Dconv], nil)
772+ let D0vsD1 = vd(parseBigIntValue(str(D1)), parseBigIntValue(str(D0)), slippage4D)
773+ if ((D0vsD1 == D0vsD1))
774+ then {
775+ let finalRes = vad(toBigInt(totalGet), toBigInt(outAmount), toBigInt(slippage))
776+ if ((finalRes == finalRes))
777+ then {
778+ let $t03122031324 = if ((outAssetId == amId))
779+ then $Tuple2(toInt(finalRes._2), 0)
780+ else $Tuple2(0, toInt(finalRes._2))
781+ let outAm = $t03122031324._1
782+ let outPr = $t03122031324._2
783+ let curPrX18 = cpbi(t1(prBalance, prDcm), t1(amBalance, amDcm))
784+ let curPr = f1(curPrX18, scale8)
785+ let state = [ScriptTransfer(userAddress, (outAm + outPr), if ((outAssetId == "WAVES"))
786+ then unit
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)]
788+ if ((state == state))
789+ then {
790+ let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
791+ if ((burn == burn))
792+ then state
793+ else throw("Strict value is not equal to itself.")
794+ }
795+ else throw("Strict value is not equal to itself.")
796+ }
797+ else throw("Strict value is not equal to itself.")
798+ }
799+ else throw("Strict value is not equal to itself.")
800+ }
801+ }
802+ else throw("Strict value is not equal to itself.")
783803 }
784804
785805
859879
860880
861881 @Callable(i)
882+func setI (k,v) = if ((toString(i.caller) != strf(this, ada())))
883+ then pd
884+ else [IntegerEntry(k, v)]
885+
886+
887+
888+@Callable(i)
862889 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, gpc())
863890
864891
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let scale8 = 100000000
55
66 let scale8BigInt = toBigInt(100000000)
77
88 let scale18 = toBigInt(1000000000000000000)
99
1010 let zeroBigInt = toBigInt(0)
1111
1212 let oneBigInt = toBigInt(1)
1313
1414 let slippage4D = toBigInt((scale8 - ((scale8 * 1) / scale8)))
1515
1616 let Amult = "100"
1717
1818 let Dconv = "1"
1919
2020 let SEP = "__"
2121
2222 let EMPTY = ""
2323
2424 let PoolActive = 1
2525
2626 let PoolPutDis = 2
2727
2828 let PoolMatcherDis = 3
2929
3030 let PoolShutdown = 4
3131
3232 let idxPoolAddress = 1
3333
3434 let idxPoolSt = 2
3535
3636 let idxLPAsId = 3
3737
3838 let idxAmAsId = 4
3939
4040 let idxPrAsId = 5
4141
4242 let idxAmtAsDcm = 6
4343
4444 let idxPriceAsDcm = 7
4545
4646 let idxIAmtAsId = 8
4747
4848 let idxIPriceAsId = 9
4949
5050 let idxFactStakCntr = 1
5151
5252 let idxFactSlippCntr = 7
5353
5454 let idxFactGwxRewCntr = 10
5555
56+let delay = "%s__delay"
57+
5658 func t1 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
5759
5860
5961 func f1 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
6062
6163
6264 func ts (amt,resScale,curScale) = fraction(amt, resScale, curScale)
6365
6466
6567 func abs (val) = if ((zeroBigInt > val))
6668 then -(val)
6769 else val
6870
6971
7072 func fc () = "%s__factoryContract"
7173
7274
7375 func mpk () = "%s__managerPublicKey"
7476
7577
7678 func pmpk () = "%s__pendingManagerPublicKey"
7779
7880
7981 func pl () = "%s%s__price__last"
8082
8183
8284 func ph (h,t) = makeString(["%s%s%d%d__price__history", toString(h), toString(t)], SEP)
8385
8486
8587 func pau (ua,txId) = ((("%s%s%s__P__" + ua) + "__") + txId)
8688
8789
8890 func gau (ua,txId) = ((("%s%s%s__G__" + ua) + "__") + txId)
8991
9092
9193 func aa () = "%s__amountAsset"
9294
9395
9496 func pa () = "%s__priceAsset"
9597
9698
9799 func amp () = "%s__amp"
98100
99101
100102 func ada () = "%s__addonAddr"
103+
104+
105+func lgotc (caller) = makeString(["%s%s__lastGetOneTknCall", caller], SEP)
106+
107+
108+func lsotc (caller) = makeString(["%s%s__lastPutOneTknCall", caller], SEP)
101109
102110
103111 func fcfg () = "%s__factoryConfig"
104112
105113
106114 func mtpk () = "%s%s__matcher__publicKey"
107115
108116
109117 func pc (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config")
110118
111119
112120 func mba (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr)
113121
114122
115123 func aps () = "%s__shutdown"
116124
117125
118126 func toe (orV,sendrV,matchV) = throw(((((("Failed: ordValid=" + toString(orV)) + " sndrValid=") + toString(sendrV)) + " mtchrValid=") + toString(matchV)))
119127
120128
121129 func str (val) = match val {
122130 case valStr: String =>
123131 valStr
124132 case _ =>
125133 throw("fail cast to String")
126134 }
127135
128136
129137 func strf (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
130138
131139
132140 func intf (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], ""))
133141
134142
135143 let fca = addressFromStringValue(strf(this, fc()))
136144
137145 let A = strf(this, amp())
138146
139147 func igs () = valueOrElse(getBoolean(fca, aps()), false)
140148
141149
142150 func mp () = fromBase58String(strf(fca, mtpk()))
143151
144152
145153 func gpc () = {
146154 let amtAs = strf(this, aa())
147155 let priceAs = strf(this, pa())
148156 let iPriceAs = intf(fca, mba(priceAs))
149157 let iAmtAs = intf(fca, mba(amtAs))
150158 split(strf(fca, pc(toString(iAmtAs), toString(iPriceAs))), SEP)
151159 }
152160
153161
154162 func gfc () = split(strf(fca, fcfg()), SEP)
155163
156164
157165 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)
158166
159167
160168 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)
161169
162170
163171 func getAccBalance (assetId) = if ((assetId == "WAVES"))
164172 then wavesBalance(this).available
165173 else assetBalance(this, fromBase58String(assetId))
166174
167175
168176 func cpbi (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
169177
170178
171179 func vad (A1,A2,slippage) = {
172180 let diff = fraction((A1 - A2), scale8BigInt, A2)
173181 let pass = ((slippage - abs(diff)) > zeroBigInt)
174182 if (!(pass))
175183 then throw(("Big slpg: " + toString(diff)))
176184 else $Tuple2(pass, min([A1, A2]))
177185 }
178186
179187
180188 func vd (D1,D0,slpg) = {
181189 let diff = fraction(D0, scale8BigInt, D1)
182190 let fail = (slpg > diff)
183191 if (if (fail)
184192 then true
185193 else (D0 > D1))
186194 then throw(((((((toString(D0) + " ") + toString(D1)) + " ") + toString(diff)) + " ") + toString(slpg)))
187195 else fail
188196 }
189197
190198
191199 func pcp (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
192200 let amtAsAmtX18 = t1(amAmt, amAssetDcm)
193201 let prAsAmtX18 = t1(prAmt, prAssetDcm)
194202 cpbi(prAsAmtX18, amtAsAmtX18)
195203 }
196204
197205
198206 func calcPrices (amAmt,prAmt,lpAmt) = {
199207 let cfg = gpc()
200208 let amtAsDcm = parseIntValue(cfg[idxAmtAsDcm])
201209 let prAsDcm = parseIntValue(cfg[idxPriceAsDcm])
202210 let priceX18 = pcp(amtAsDcm, prAsDcm, amAmt, prAmt)
203211 let amAmtX18 = t1(amAmt, amtAsDcm)
204212 let prAmtX18 = t1(prAmt, prAsDcm)
205213 let lpAmtX18 = t1(lpAmt, scale8)
206214 let lpPrInAmAsX18 = cpbi(amAmtX18, lpAmtX18)
207215 let lpPrInPrAsX18 = cpbi(prAmtX18, lpAmtX18)
208216 [priceX18, lpPrInAmAsX18, lpPrInPrAsX18]
209217 }
210218
211219
212220 func calculatePrices (amAmt,prAmt,lpAmt) = {
213221 let p = calcPrices(amAmt, prAmt, lpAmt)
214222 [f1(p[0], scale8), f1(p[1], scale8), f1(p[2], scale8)]
215223 }
216224
217225
218226 func ego (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
219227 let cfg = gpc()
220228 let lpId = cfg[idxLPAsId]
221229 let amId = cfg[idxAmAsId]
222230 let prId = cfg[idxPrAsId]
223231 let amDcm = parseIntValue(cfg[idxAmtAsDcm])
224232 let prDcm = parseIntValue(cfg[idxPriceAsDcm])
225233 let sts = cfg[idxPoolSt]
226234 let lpEmiss = valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "Wrong LP id").quantity
227235 if ((lpId != pmtAssetId))
228236 then throw("Wrong pmt asset")
229237 else {
230238 let amBalance = getAccBalance(amId)
231239 let amBalanceX18 = t1(amBalance, amDcm)
232240 let prBalance = getAccBalance(prId)
233241 let prBalanceX18 = t1(prBalance, prDcm)
234242 let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
235243 let curPrice = f1(curPriceX18, scale8)
236244 let pmtLpAmtX18 = t1(pmtLpAmt, scale8)
237245 let lpEmissX18 = t1(lpEmiss, scale8)
238246 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissX18)
239247 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissX18)
240248 let outAmAmt = f1(outAmAmtX18, amDcm)
241249 let outPrAmt = f1(outPrAmtX18, prDcm)
242250 let state = if ((txId58 == ""))
243251 then nil
244252 else [ScriptTransfer(userAddress, outAmAmt, if ((amId == "WAVES"))
245253 then unit
246254 else fromBase58String(amId)), ScriptTransfer(userAddress, outPrAmt, if ((prId == "WAVES"))
247255 then unit
248256 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)]
249257 $Tuple10(outAmAmt, outPrAmt, amId, prId, amBalance, prBalance, lpEmiss, curPriceX18, sts, state)
250258 }
251259 }
252260
253261
254262 func epo (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEval,emitLp,isOneAsset,pmtAmt,pmtId) = {
255263 let cfg = gpc()
256264 let lpId = fromBase58String(cfg[idxLPAsId])
257265 let amIdStr = cfg[idxAmAsId]
258266 let prIdStr = cfg[idxPrAsId]
259267 let inAmIdStr = cfg[idxIAmtAsId]
260268 let inPrIdStr = cfg[idxIPriceAsId]
261269 let amtDcm = parseIntValue(cfg[idxAmtAsDcm])
262270 let priceDcm = parseIntValue(cfg[idxPriceAsDcm])
263271 let sts = cfg[idxPoolSt]
264272 let lpEm = valueOrErrorMessage(assetInfo(lpId), "Wr lp as").quantity
265273 let amBalance = if (isEval)
266274 then getAccBalance(amIdStr)
267275 else if (if (isOneAsset)
268276 then (pmtId == amIdStr)
269277 else false)
270278 then (getAccBalance(amIdStr) - pmtAmt)
271279 else if (isOneAsset)
272280 then getAccBalance(amIdStr)
273281 else (getAccBalance(amIdStr) - inAmAmt)
274282 let prBalance = if (isEval)
275283 then getAccBalance(prIdStr)
276284 else if (if (isOneAsset)
277285 then (pmtId == prIdStr)
278286 else false)
279287 then (getAccBalance(prIdStr) - pmtAmt)
280288 else if (isOneAsset)
281289 then getAccBalance(prIdStr)
282290 else (getAccBalance(prIdStr) - inPrAmt)
283291 let inAmAssetAmtX18 = t1(inAmAmt, amtDcm)
284292 let inPrAssetAmtX18 = t1(inPrAmt, priceDcm)
285293 let userPriceX18 = cpbi(inPrAssetAmtX18, inAmAssetAmtX18)
286294 let amBalanceX18 = t1(amBalance, amtDcm)
287295 let prBalanceX18 = t1(prBalance, priceDcm)
288296 let r = if ((lpEm == 0))
289297 then {
290298 let curPriceX18 = zeroBigInt
291299 let slippageX18 = zeroBigInt
292300 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
293301 $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
294302 }
295303 else {
296304 let curPriceX18 = cpbi(prBalanceX18, amBalanceX18)
297305 let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18)
298306 let slippageX18 = t1(slippage, scale8)
299307 if (if ((curPriceX18 != zeroBigInt))
300308 then (slippageRealX18 > slippageX18)
301309 else false)
302310 then throw(((("Price slippage " + toString(slippageRealX18)) + " > ") + toString(slippageX18)))
303311 else {
304312 let lpEmissionX18 = t1(lpEm, scale8)
305313 let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
306314 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
307315 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
308316 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
309317 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
310318 let expAmtAssetAmtX18 = expectedAmts._1
311319 let expPriceAssetAmtX18 = expectedAmts._2
312320 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18)
313321 $Tuple5(f1(lpAmtX18, scale8), f1(expAmtAssetAmtX18, amtDcm), f1(expPriceAssetAmtX18, priceDcm), curPriceX18, slippageX18)
314322 }
315323 }
316324 let calcLpAmt = r._1
317325 let calcAmAssetPmt = r._2
318326 let calcPrAssetPmt = r._3
319327 let curPrice = f1(r._4, scale8)
320328 let slippageCalc = f1(r._5, scale8)
321329 if ((0 >= calcLpAmt))
322330 then throw("LP <= 0")
323331 else {
324332 let emitLpAmt = if (!(emitLp))
325333 then 0
326334 else calcLpAmt
327335 let amDiff = (inAmAmt - calcAmAssetPmt)
328336 let prDiff = (inPrAmt - calcPrAssetPmt)
329- let $t01529615641 = if (if (isOneAsset)
337+ let $t01553115876 = if (if (isOneAsset)
330338 then (pmtId == amIdStr)
331339 else false)
332340 then $Tuple2(pmtAmt, 0)
333341 else if (if (isOneAsset)
334342 then (pmtId == prIdStr)
335343 else false)
336344 then $Tuple2(0, pmtAmt)
337345 else $Tuple2(calcAmAssetPmt, calcPrAssetPmt)
338- let writeAmAmt = $t01529615641._1
339- let writePrAmt = $t01529615641._2
346+ let writeAmAmt = $t01553115876._1
347+ let writePrAmt = $t01553115876._2
340348 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))]
341349 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId)
342350 }
343351 }
344352
345353
346354 func moa (order) = {
347355 let cfg = gpc()
348356 let amtAsId = cfg[idxAmAsId]
349357 let prAsId = cfg[idxPrAsId]
350358 let sts = parseIntValue(cfg[idxPoolSt])
351359 let amtAsDcm = parseIntValue(cfg[idxAmtAsDcm])
352360 let prAsDcm = parseIntValue(cfg[idxPriceAsDcm])
353361 let accAmtAsBalance = getAccBalance(amtAsId)
354362 let accPrAsBalance = getAccBalance(prAsId)
355363 let curPriceX18 = if ((order.orderType == Buy))
356364 then pcp(amtAsDcm, prAsDcm, (accAmtAsBalance + order.amount), accPrAsBalance)
357365 else pcp(amtAsDcm, prAsDcm, (accAmtAsBalance - order.amount), accPrAsBalance)
358366 let curPrice = f1(curPriceX18, scale8)
359367 if (if (if (igs())
360368 then true
361369 else (sts == PoolMatcherDis))
362370 then true
363371 else (sts == PoolShutdown))
364372 then throw("Admin blocked")
365373 else {
366374 let orAmtAsset = order.assetPair.amountAsset
367375 let orAmtAsStr = if ((orAmtAsset == unit))
368376 then "WAVES"
369377 else toBase58String(value(orAmtAsset))
370378 let orPrAsset = order.assetPair.priceAsset
371379 let orPrAsStr = if ((orPrAsset == unit))
372380 then "WAVES"
373381 else toBase58String(value(orPrAsset))
374382 if (if ((orAmtAsStr != amtAsId))
375383 then true
376384 else (orPrAsStr != prAsId))
377385 then throw("Wr assets")
378386 else {
379387 let orderPrice = order.price
380388 let priceDcm = fraction(scale8, prAsDcm, amtAsDcm)
381389 let castOrderPrice = ts(orderPrice, scale8, priceDcm)
382390 let isOrderPriceValid = if ((order.orderType == Buy))
383391 then (curPrice >= castOrderPrice)
384392 else (castOrderPrice >= curPrice)
385393 true
386394 }
387395 }
388396 }
389397
390398
391399 func cg (i) = if ((size(i.payments) != 1))
392400 then throw("1 pmnt exp")
393401 else {
394402 let pmt = value(i.payments[0])
395403 let pmtAssetId = value(pmt.assetId)
396404 let pmtAmt = pmt.amount
397405 let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
398406 let outAmAmt = r._1
399407 let outPrAmt = r._2
400408 let sts = parseIntValue(r._9)
401409 let state = r._10
402410 if (if (igs())
403411 then true
404412 else (sts == PoolShutdown))
405413 then throw(("Admin blocked: " + toString(sts)))
406414 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
407415 }
408416
409417
410418 func cp (caller,txId,amAsPmt,prAsPmt,slippage,emitLp,isOneAsset,pmtAmt,pmtId) = {
411419 let r = epo(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, false, emitLp, isOneAsset, pmtAmt, pmtId)
412420 let sts = parseIntValue(r._8)
413421 if (if (if (igs())
414422 then true
415423 else (sts == PoolPutDis))
416424 then true
417425 else (sts == PoolShutdown))
418426 then throw(("Blocked:" + toString(sts)))
419427 else r
420428 }
421429
422430
423431 func m () = match getString(mpk()) {
424432 case s: String =>
425433 fromBase58String(s)
426434 case _: Unit =>
427435 unit
428436 case _ =>
429437 throw("Match error")
430438 }
431439
432440
433441 func pm () = match getString(pmpk()) {
434442 case s: String =>
435443 fromBase58String(s)
436444 case _: Unit =>
437445 unit
438446 case _ =>
439447 throw("Match error")
440448 }
441449
442450
443451 let pd = throw("Permission denied")
444452
445453 func mm (i) = match m() {
446454 case pk: ByteVector =>
447455 if ((i.callerPublicKey == pk))
448456 then true
449457 else pd
450458 case _: Unit =>
451459 if ((i.caller == this))
452460 then true
453461 else pd
454462 case _ =>
455463 throw("Match error")
456464 }
457465
458466
459467 @Callable(i)
460468 func constructor (fc) = {
461469 let c = mm(i)
462470 if ((c == c))
463471 then [StringEntry(fc(), fc)]
464472 else throw("Strict value is not equal to itself.")
465473 }
466474
467475
468476
469477 @Callable(i)
470478 func setManager (pendingManagerPublicKey) = {
471479 let c = mm(i)
472480 if ((c == c))
473481 then {
474482 let cm = fromBase58String(pendingManagerPublicKey)
475483 if ((cm == cm))
476484 then [StringEntry(pmpk(), pendingManagerPublicKey)]
477485 else throw("Strict value is not equal to itself.")
478486 }
479487 else throw("Strict value is not equal to itself.")
480488 }
481489
482490
483491
484492 @Callable(i)
485493 func confirmManager () = {
486494 let p = pm()
487495 let hpm = if (isDefined(p))
488496 then true
489497 else throw("No pending manager")
490498 if ((hpm == hpm))
491499 then {
492500 let cpm = if ((i.callerPublicKey == value(p)))
493501 then true
494502 else throw("You are not pending manager")
495503 if ((cpm == cpm))
496504 then [StringEntry(mpk(), toBase58String(value(p))), DeleteEntry(pmpk())]
497505 else throw("Strict value is not equal to itself.")
498506 }
499507 else throw("Strict value is not equal to itself.")
500508 }
501509
502510
503511
504512 @Callable(i)
505513 func put (slip,autoStake) = {
506514 let factCfg = gfc()
507515 let stakingCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactStakCntr]), "Wr st addr")
508516 let slipCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactSlippCntr]), "Wr sl addr")
509517 if ((0 > slip))
510518 then throw("Wrong slippage")
511519 else if ((size(i.payments) != 2))
512520 then throw("2 pmnts expd")
513521 else {
514522 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, "")
515523 let emitLpAmt = e._2
516524 let lpAssetId = e._7
517525 let state = e._9
518526 let amDiff = e._10
519527 let prDiff = e._11
520528 let amId = e._12
521529 let prId = e._13
522530 let r = invoke(fca, "emit", [emitLpAmt], nil)
523531 if ((r == r))
524532 then {
525533 let el = match r {
526534 case legacy: Address =>
527535 invoke(legacy, "emit", [emitLpAmt], nil)
528536 case _ =>
529537 unit
530538 }
531539 if ((el == el))
532540 then {
533541 let sa = if ((amDiff > 0))
534542 then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)])
535543 else nil
536544 if ((sa == sa))
537545 then {
538546 let sp = if ((prDiff > 0))
539547 then invoke(slipCntr, "put", nil, [AttachedPayment(prId, prDiff)])
540548 else nil
541549 if ((sp == sp))
542550 then {
543551 let lpTrnsfr = if (autoStake)
544552 then {
545553 let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
546554 if ((ss == ss))
547555 then nil
548556 else throw("Strict value is not equal to itself.")
549557 }
550558 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
551559 (state ++ lpTrnsfr)
552560 }
553561 else throw("Strict value is not equal to itself.")
554562 }
555563 else throw("Strict value is not equal to itself.")
556564 }
557565 else throw("Strict value is not equal to itself.")
558566 }
559567 else throw("Strict value is not equal to itself.")
560568 }
561569 }
562570
563571
564572
565573 @Callable(i)
566574 func putOneTkn (amAssetPart,prAssetPart,outLp,slippage,autoStake) = {
567575 let cfg = gfc()
568576 let stakingCntr = valueOrErrorMessage(addressFromString(cfg[idxFactStakCntr]), "Wr st addr")
569577 let slipCntr = valueOrErrorMessage(addressFromString(cfg[idxFactSlippCntr]), "Wr sl addr")
570578 let gwxCntr = valueOrErrorMessage(addressFromString(cfg[idxFactGwxRewCntr]), "Wr gwx addr")
571579 let poolCfg = gpc()
572580 let amId = poolCfg[idxAmAsId]
573581 let prId = poolCfg[idxPrAsId]
574582 let amDcm = parseIntValue(poolCfg[idxAmtAsDcm])
575583 let prDcm = parseIntValue(poolCfg[idxPriceAsDcm])
576- if (if (if (if ((0 >= slippage))
577- then true
578- else (0 >= amAssetPart))
579- then true
580- else (0 >= prAssetPart))
581- then true
582- else (0 >= outLp))
583- then throw("Wrong params")
584- else if ((size(i.payments) != 1))
585- then throw("1 pmnt expd")
586- else {
587- let pmt = value(i.payments[0])
588- let pmtAssetId = toBase58String(value(pmt.assetId))
589- let pmtAmt = pmt.amount
590- if (if (if ((amAssetPart > pmtAmt))
591- then true
592- else (prAssetPart > pmtAmt))
593- then true
594- else (10000000 > pmtAmt))
595- then throw("Wrong pmt amt")
596- else {
597- let amBalance = getAccBalance(amId)
598- let prBalance = getAccBalance(prId)
599- let $t02418724567 = if ((pmtAssetId == amId))
600- then $Tuple6((amBalance - pmtAmt), prBalance, (pmtAmt - amAssetPart), prAssetPart, 0, 0)
601- else if ((pmtAssetId == prId))
602- then $Tuple6(amBalance, (prBalance - pmtAmt), 0, 0, (pmtAmt - prAssetPart), amAssetPart)
603- else throw("wrong pmtAssetId")
604- let amBalanceNow = $t02418724567._1
605- let prBalanceNow = $t02418724567._2
606- let virtSwapInAm = $t02418724567._3
607- let virtSwapOutPr = $t02418724567._4
608- let virtSwapInPr = $t02418724567._5
609- let virtSwapOutAm = $t02418724567._6
610- let D0 = invoke(gwxCntr, "calcD", [toString(amBalanceNow), toString(prBalanceNow), A, Amult, Dconv], nil)
611- let D1 = invoke(gwxCntr, "calcD", [toString(toBigInt(((amBalanceNow + virtSwapInAm) - virtSwapOutAm))), toString(toBigInt(((prBalanceNow + virtSwapInPr) - virtSwapOutPr))), A, Amult, Dconv], nil)
612- let D0vsD1 = vd(parseBigIntValue(str(D1)), parseBigIntValue(str(D0)), slippage4D)
613- if ((D0vsD1 == D0vsD1))
614- then {
615- let estPut = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(fromBase58String(amId), amAssetPart), AttachedPayment(fromBase58String(prId), prAssetPart), slippage, true, true, pmtAmt, pmtAssetId)
616- let estimLP = estPut._2
617- let lpAssetId = estPut._7
618- let state = estPut._9
619- let amDiff = estPut._10
620- let prDiff = estPut._11
621- let lpCalcRes = vad(toBigInt(estimLP), toBigInt(outLp), toBigInt(slippage))
622- let emitLpAmt = toInt(lpCalcRes._2)
623- let e = invoke(fca, "emit", [emitLpAmt], nil)
624- if ((e == e))
625- then {
626- let el = match e {
627- case legacy: Address =>
628- invoke(legacy, "emit", [emitLpAmt], nil)
629- case _ =>
630- unit
631- }
632- if ((el == el))
633- then {
634- let sa = if ((amDiff > 0))
635- then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String(amId), amDiff)])
636- else nil
637- if ((sa == sa))
638- then {
639- let sp = if ((prDiff > 0))
640- then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String(prId), prDiff)])
641- else nil
642- if ((sp == sp))
643- then {
644- let lpTrnsfr = if (autoStake)
645- then {
646- let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
647- if ((ss == ss))
648- then nil
649- else throw("Strict value is not equal to itself.")
650- }
651- else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
652- (state ++ lpTrnsfr)
653- }
654- else throw("Strict value is not equal to itself.")
655- }
656- else throw("Strict value is not equal to itself.")
657- }
658- else throw("Strict value is not equal to itself.")
659- }
660- else throw("Strict value is not equal to itself.")
661- }
662- else throw("Strict value is not equal to itself.")
663- }
664- }
584+ let addon = valueOrElse(getString(this, ada()), "")
585+ let userAddress = if ((addon == toString(i.caller)))
586+ then i.originCaller
587+ else i.caller
588+ let addonContract = valueOrErrorMessage(addressFromString(ada()), "no addons")
589+ let check = invoke(addonContract, "ensureCanPutOneTkn", [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 (if (if ((amAssetPart > pmtAmt))
606+ then true
607+ else (prAssetPart > pmtAmt))
608+ then true
609+ else (10000000 > pmtAmt))
610+ then throw("Wrong pmt amt")
611+ else {
612+ let amBalance = getAccBalance(amId)
613+ let prBalance = getAccBalance(prId)
614+ let $t02473725117 = 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 = $t02473725117._1
620+ let prBalanceNow = $t02473725117._2
621+ let virtSwapInAm = $t02473725117._3
622+ let virtSwapOutPr = $t02473725117._4
623+ let virtSwapInPr = $t02473725117._5
624+ let virtSwapOutAm = $t02473725117._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+ then {
641+ let el = match e {
642+ case legacy: Address =>
643+ invoke(legacy, "emit", [emitLpAmt], nil)
644+ case _ =>
645+ unit
646+ }
647+ if ((el == el))
648+ then {
649+ let sa = if ((amDiff > 0))
650+ then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String(amId), amDiff)])
651+ else nil
652+ if ((sa == sa))
653+ then {
654+ let sp = if ((prDiff > 0))
655+ then invoke(slipCntr, "put", nil, [AttachedPayment(fromBase58String(prId), prDiff)])
656+ else nil
657+ if ((sp == sp))
658+ then {
659+ let lpTrnsfr = if (autoStake)
660+ then {
661+ let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
662+ if ((ss == ss))
663+ then nil
664+ else throw("Strict value is not equal to itself.")
665+ }
666+ else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
667+ (state ++ lpTrnsfr)
668+ }
669+ else throw("Strict value is not equal to itself.")
670+ }
671+ else throw("Strict value is not equal to itself.")
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+ }
680+ else throw("Strict value is not equal to itself.")
665681 }
666682
667683
668684
669685 @Callable(i)
670686 func putForFree (maxSlpg) = if ((0 > maxSlpg))
671687 then throw("Wrong slpg")
672688 else if ((size(i.payments) != 2))
673689 then throw("2 pmnts expd")
674690 else {
675691 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, "")
676692 estPut._9
677693 }
678694
679695
680696
681697 @Callable(i)
682698 func get () = {
683699 let r = cg(i)
684700 let outAmtAmt = r._1
685701 let outPrAmt = r._2
686702 let pmtAmt = r._3
687703 let pmtAssetId = r._4
688704 let state = r._5
689705 let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
690706 if ((b == b))
691707 then state
692708 else throw("Strict value is not equal to itself.")
693709 }
694710
695711
696712
697713 @Callable(i)
698714 func getOneTkn (exchResult,notUsed,outAmount,outAssetId,slippage) = if ((size(i.payments) != 1))
699715 then throw("1 pmnt expd")
700716 else {
701717 let cfg = gpc()
702718 let lpId = cfg[idxLPAsId]
703719 let amId = cfg[idxAmAsId]
704720 let prId = cfg[idxPrAsId]
705721 let amDcm = parseIntValue(cfg[idxAmtAsDcm])
706722 let prDcm = parseIntValue(cfg[idxPriceAsDcm])
707723 let sts = cfg[idxPoolSt]
708724 let factCfg = gfc()
709725 let gwxCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactGwxRewCntr]), "Wr sl addr")
710726 let pmt = value(i.payments[0])
711727 let addon = valueOrElse(getString(this, ada()), "")
712728 let userAddress = if ((addon == toString(i.caller)))
713729 then i.originCaller
714730 else i.caller
715731 let txId58 = toBase58String(i.transactionId)
716732 let pmtAssetId = value(pmt.assetId)
717733 let pmtAmt = pmt.amount
718- if ((1000000000 > pmtAmt))
719- then throw("Min pmt 10 LP")
720- else if (if (if ((0 > slippage))
721- then true
722- else (0 > exchResult))
723- then true
724- else (0 > outAmount))
725- then throw("Wrong params")
726- else if ((lpId != toBase58String(pmtAssetId)))
727- then throw("Wrong LP")
728- else {
729- let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
730- let estimAmAmt = r._1
731- let estimPrAmt = r._2
732- let amBalance = getAccBalance(amId)
733- let prBalance = getAccBalance(prId)
734- let $t02934629803 = if ((outAssetId == amId))
735- then $Tuple7((amBalance - estimAmAmt), (prBalance - estimPrAmt), exchResult, estimPrAmt, 0, 0, (estimAmAmt + exchResult))
736- else if ((outAssetId == prId))
737- then $Tuple7((amBalance - estimAmAmt), (prBalance - estimPrAmt), 0, 0, exchResult, estimAmAmt, (estimPrAmt + exchResult))
738- else throw("wrong outAssetId")
739- let amBalanceNow = $t02934629803._1
740- let prBalanceNow = $t02934629803._2
741- let virtSwapInAm = $t02934629803._3
742- let virtSwapOutPr = $t02934629803._4
743- let virtSwapInPr = $t02934629803._5
744- let virtSwapOutAm = $t02934629803._6
745- let totalGet = $t02934629803._7
746- if (if ((0 > virtSwapInAm))
747- then true
748- else (0 > virtSwapInPr))
749- then throw("Wrong calc")
750- else {
751- let D0 = invoke(gwxCntr, "calcD", [toString(amBalanceNow), toString(prBalanceNow), A, Amult, Dconv], nil)
752- let D1 = invoke(gwxCntr, "calcD", [toString(((amBalanceNow - virtSwapInAm) + virtSwapOutAm)), toString(((prBalanceNow + virtSwapOutPr) - virtSwapInPr)), A, Amult, Dconv], nil)
753- let D0vsD1 = vd(parseBigIntValue(str(D1)), parseBigIntValue(str(D0)), slippage4D)
754- if ((D0vsD1 == D0vsD1))
755- then {
756- let finalRes = vad(toBigInt(totalGet), toBigInt(outAmount), toBigInt(slippage))
757- if ((finalRes == finalRes))
758- then {
759- let $t03050830612 = if ((outAssetId == amId))
760- then $Tuple2(toInt(finalRes._2), 0)
761- else $Tuple2(0, toInt(finalRes._2))
762- let outAm = $t03050830612._1
763- let outPr = $t03050830612._2
764- let curPrX18 = cpbi(t1(prBalance, prDcm), t1(amBalance, amDcm))
765- let curPr = f1(curPrX18, scale8)
766- let state = [ScriptTransfer(userAddress, (outAm + outPr), if ((outAssetId == "WAVES"))
767- then unit
768- 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)]
769- if ((state == state))
770- then {
771- let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
772- if ((burn == burn))
773- then state
774- else throw("Strict value is not equal to itself.")
775- }
776- else throw("Strict value is not equal to itself.")
777- }
778- else throw("Strict value is not equal to itself.")
779- }
780- else throw("Strict value is not equal to itself.")
781- }
782- }
734+ let addonContract = valueOrErrorMessage(addressFromString(ada()), "no addons")
735+ let check = invoke(addonContract, "ensureCanGetOneTkn", [userAddress], nil)
736+ if ((check == check))
737+ then if ((1000000000 > pmtAmt))
738+ then throw("Min pmt 10 LP")
739+ else if (if (if ((0 > slippage))
740+ then true
741+ else (0 > exchResult))
742+ then true
743+ else (0 > outAmount))
744+ then throw("Wrong params")
745+ else if ((lpId != toBase58String(pmtAssetId)))
746+ then throw("Wrong LP")
747+ else {
748+ let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
749+ let estimAmAmt = r._1
750+ let estimPrAmt = r._2
751+ let amBalance = getAccBalance(amId)
752+ let prBalance = getAccBalance(prId)
753+ let $t03005830515 = if ((outAssetId == amId))
754+ then $Tuple7((amBalance - estimAmAmt), (prBalance - estimPrAmt), exchResult, estimPrAmt, 0, 0, (estimAmAmt + exchResult))
755+ else if ((outAssetId == prId))
756+ then $Tuple7((amBalance - estimAmAmt), (prBalance - estimPrAmt), 0, 0, exchResult, estimAmAmt, (estimPrAmt + exchResult))
757+ else throw("wrong outAssetId")
758+ let amBalanceNow = $t03005830515._1
759+ let prBalanceNow = $t03005830515._2
760+ let virtSwapInAm = $t03005830515._3
761+ let virtSwapOutPr = $t03005830515._4
762+ let virtSwapInPr = $t03005830515._5
763+ let virtSwapOutAm = $t03005830515._6
764+ let totalGet = $t03005830515._7
765+ if (if ((0 > virtSwapInAm))
766+ then true
767+ else (0 > virtSwapInPr))
768+ then throw("Wrong calc")
769+ else {
770+ let D0 = invoke(gwxCntr, "calcD", [toString(amBalanceNow), toString(prBalanceNow), A, Amult, Dconv], nil)
771+ let D1 = invoke(gwxCntr, "calcD", [toString(((amBalanceNow - virtSwapInAm) + virtSwapOutAm)), toString(((prBalanceNow + virtSwapOutPr) - virtSwapInPr)), A, Amult, Dconv], nil)
772+ let D0vsD1 = vd(parseBigIntValue(str(D1)), parseBigIntValue(str(D0)), slippage4D)
773+ if ((D0vsD1 == D0vsD1))
774+ then {
775+ let finalRes = vad(toBigInt(totalGet), toBigInt(outAmount), toBigInt(slippage))
776+ if ((finalRes == finalRes))
777+ then {
778+ let $t03122031324 = if ((outAssetId == amId))
779+ then $Tuple2(toInt(finalRes._2), 0)
780+ else $Tuple2(0, toInt(finalRes._2))
781+ let outAm = $t03122031324._1
782+ let outPr = $t03122031324._2
783+ let curPrX18 = cpbi(t1(prBalance, prDcm), t1(amBalance, amDcm))
784+ let curPr = f1(curPrX18, scale8)
785+ let state = [ScriptTransfer(userAddress, (outAm + outPr), if ((outAssetId == "WAVES"))
786+ then unit
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)]
788+ if ((state == state))
789+ then {
790+ let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
791+ if ((burn == burn))
792+ then state
793+ else throw("Strict value is not equal to itself.")
794+ }
795+ else throw("Strict value is not equal to itself.")
796+ }
797+ else throw("Strict value is not equal to itself.")
798+ }
799+ else throw("Strict value is not equal to itself.")
800+ }
801+ }
802+ else throw("Strict value is not equal to itself.")
783803 }
784804
785805
786806
787807 @Callable(i)
788808 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
789809 let r = cg(i)
790810 let outAmAmt = r._1
791811 let outPrAmt = r._2
792812 let pmtAmt = r._3
793813 let pmtAssetId = r._4
794814 let state = r._5
795815 if ((noLessThenAmtAsset > outAmAmt))
796816 then throw(((("Failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
797817 else if ((noLessThenPriceAsset > outPrAmt))
798818 then throw(((("Failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
799819 else {
800820 let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
801821 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
802822 then state
803823 else throw("Strict value is not equal to itself.")
804824 }
805825 }
806826
807827
808828
809829 @Callable(i)
810830 func unstakeAndGet (amount) = {
811831 let checkPayments = if ((size(i.payments) != 0))
812832 then throw("No pmnts expd")
813833 else true
814834 if ((checkPayments == checkPayments))
815835 then {
816836 let cfg = gpc()
817837 let factoryCfg = gfc()
818838 let lpAssetId = fromBase58String(cfg[idxLPAsId])
819839 let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr")
820840 let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil)
821841 if ((unstakeInv == unstakeInv))
822842 then {
823843 let r = ego(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
824844 let sts = parseIntValue(r._9)
825845 let state = r._10
826846 let v = if (if (igs())
827847 then true
828848 else (sts == PoolShutdown))
829849 then throw(("Blocked: " + toString(sts)))
830850 else true
831851 if ((v == v))
832852 then {
833853 let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
834854 if ((burnA == burnA))
835855 then state
836856 else throw("Strict value is not equal to itself.")
837857 }
838858 else throw("Strict value is not equal to itself.")
839859 }
840860 else throw("Strict value is not equal to itself.")
841861 }
842862 else throw("Strict value is not equal to itself.")
843863 }
844864
845865
846866
847867 @Callable(i)
848868 func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString(fca)))
849869 then throw("denied")
850870 else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr)], "success")
851871
852872
853873
854874 @Callable(i)
855875 func setS (k,v) = if ((toString(i.caller) != strf(this, ada())))
856876 then pd
857877 else [StringEntry(k, v)]
858878
859879
860880
861881 @Callable(i)
882+func setI (k,v) = if ((toString(i.caller) != strf(this, ada())))
883+ then pd
884+ else [IntegerEntry(k, v)]
885+
886+
887+
888+@Callable(i)
862889 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, gpc())
863890
864891
865892
866893 @Callable(i)
867894 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
868895
869896
870897
871898 @Callable(i)
872899 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
873900 let pr = calcPrices(amAmt, prAmt, lpAmt)
874901 $Tuple2(nil, [toString(pr[0]), toString(pr[1]), toString(pr[2])])
875902 }
876903
877904
878905
879906 @Callable(i)
880907 func fromX18WrapperREADONLY (val,resScaleMult) = $Tuple2(nil, f1(parseBigIntValue(val), resScaleMult))
881908
882909
883910
884911 @Callable(i)
885912 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(t1(origVal, origScaleMult)))
886913
887914
888915
889916 @Callable(i)
890917 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(cpbi(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
891918
892919
893920
894921 @Callable(i)
895922 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, ""))
896923
897924
898925
899926 @Callable(i)
900927 func estimateGetOperationWrapperREADONLY (txId58,pmtAsId,pmtLpAmt,usrAddr) = {
901928 let r = ego(txId58, pmtAsId, pmtLpAmt, addressFromStringValue(usrAddr))
902929 $Tuple2(nil, $Tuple10(r._1, r._2, r._3, r._4, r._5, r._6, r._7, toString(r._8), r._9, r._10))
903930 }
904931
905932
906933 @Verifier(tx)
907934 func verify () = match tx {
908935 case order: Order =>
909936 let mtchPub = mp()
910937 let orV = moa(order)
911938 let sndrV = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
912939 let mtchV = sigVerify(order.bodyBytes, order.proofs[1], mtchPub)
913940 if (if (if (orV)
914941 then sndrV
915942 else false)
916943 then mtchV
917944 else false)
918945 then true
919946 else toe(orV, sndrV, mtchV)
920947 case _ =>
921948 let targetPublicKey = match m() {
922949 case pk: ByteVector =>
923950 pk
924951 case _: Unit =>
925952 tx.senderPublicKey
926953 case _ =>
927954 throw("Match error")
928955 }
929956 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
930957 }
931958

github/deemru/w8io/169f3d6 
121.09 ms