tx · 617TnknFNAwzizwCivsmUUzV6gsPn5JUdC7pZg7jrRtZ 3MsNhK6uve98J6DeqbuwGFBRh9GoHPGUFgp: -0.02300000 Waves 2023.05.02 09:54 [2559810] smart account 3MsNhK6uve98J6DeqbuwGFBRh9GoHPGUFgp > SELF 0.00000000 Waves
{ "type": 13, "id": "617TnknFNAwzizwCivsmUUzV6gsPn5JUdC7pZg7jrRtZ", "fee": 2300000, "feeAssetId": null, "timestamp": 1683010485139, "version": 2, "chainId": 84, "sender": "3MsNhK6uve98J6DeqbuwGFBRh9GoHPGUFgp", "senderPublicKey": "86RHVxKovtU7yKnepY8wKsd8niDxGAsiwuA1XA1DNqrS", "proofs": [ "4HjPk7Pdty2C4yTZrQDeACzsmcYfpoAvSAEAuSPLqusyR9sh2D7r2bipLGSTx3wyzsLcURtHgYKGmPGZy8cDADt1" ], "script": "base64:BgLyIAgCEgMKAQgSAwoBCBIECgIICBIJCgcBERERGAgYEgcKBRERERgIEgcKBQEBAQgIEgASAwoBCBIECgIIARIECgIIARIECgIIARIDCgEIEgYKBAgBCAESBQoDARgYEgMKARgiBlNDQUxFOCIFTVVMVDgiB1NDQUxFMTgiBk1VTFQxOCIDU0VQIg5QT09MV0VJR0hUTVVMVCIKemVyb0JpZ0ludCIOaWR4UG9vbEFkZHJlc3MiDWlkeFBvb2xTdGF0dXMiEGlkeFBvb2xMUEFzc2V0SWQiDWlkeEFtdEFzc2V0SWQiD2lkeFByaWNlQXNzZXRJZCIOaWR4QW10QXNzZXREY20iEGlkeFByaWNlQXNzZXREY20iDmlkeElBbXRBc3NldElkIhBpZHhJUHJpY2VBc3NldElkIg1pZHhMUEFzc2V0RGNtIg9nZXRTdHJpbmdPckZhaWwiA2tleSIYZ2V0U3RyaW5nQnlBZGRyZXNzT3JGYWlsIgdhZGRyZXNzIgxnZXRJbnRPclplcm8iDGdldEludE9yRmFpbCIJYXNBbnlMaXN0IgN2YWwiByRtYXRjaDAiCnZhbEFueUx5c3QiBWFzSW50IgZ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LgJiQwELZ2V0S2V5c0J1bGsBAmRSBAJjYgkA/AcEBQR0aGlzAhNnZXRLZXlzQnVsa0ludGVybmFsCQDMCAIAAAkAzAgCBQJkUgkAzAgCBQNuaWwFA25pbAUDbmlsCQCUCgIFA25pbAUCY2IBAmRUAQJkVQAEAmRWBAF6CQECYnkAAwkAAQIFAXoCCkJ5dGVWZWN0b3IEAmJEBQF6BQJiRAMJAAECBQF6AgRVbml0CAUCZFQPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAmRUCWJvZHlCeXRlcwkAkQMCCAUCZFQGcHJvb2ZzAAAFAmRWLDV5sg==", "height": 2559810, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EXTGNy5Fr5SyrRygF4rQ9pwrcGmJWv5Saq1sAgx6d9qA Next: FYMgaBisNouzjQoPkZXzt89ineHNvhD7b7Q3ZBhh71aZ Diff:
Old | New | Differences | |
---|---|---|---|
74 | 74 | func keyFactoryAddress () = "%s%s__config__factoryAddress" | |
75 | 75 | ||
76 | 76 | ||
77 | - | func keyManagerPublicKey () = "%s__managerPublicKey" | |
78 | - | ||
79 | - | ||
80 | - | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
81 | - | ||
82 | - | ||
83 | 77 | let IdxFactoryCfgStakingDapp = 1 | |
84 | 78 | ||
85 | 79 | let IdxFactoryCfgBoostingDapp = 2 | |
111 | 105 | func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP) | |
112 | 106 | ||
113 | 107 | ||
108 | + | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
109 | + | ||
110 | + | ||
111 | + | func keyManagerPublicKey () = "%s__managerPublicKey" | |
112 | + | ||
113 | + | ||
114 | 114 | func readFactoryAddressOrFail () = addressFromStringValue(getStringOrFail(keyFactoryAddress())) | |
115 | 115 | ||
116 | 116 | ||
130 | 130 | ||
131 | 131 | ||
132 | 132 | func getGwxRewardAddressOrFail (fCfg) = addressFromStringValue(fCfg[IdxFactoryCfgGwxRewardDapp]) | |
133 | + | ||
134 | + | ||
135 | + | func getManagerAddressOrFail () = addressFromStringValue(getStringValue(keyManagerVaultAddress())) | |
133 | 136 | ||
134 | 137 | ||
135 | 138 | func keyBoostCfg () = "%s__config" | |
292 | 295 | else throw("unknown type. expected string/integer/boolean") | |
293 | 296 | ||
294 | 297 | ||
295 | - | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
296 | - | case s: String => | |
297 | - | fromBase58String(s) | |
298 | + | func managerPublicKeyOrUnit () = { | |
299 | + | let managerVaultAddress = getManagerAddressOrFail() | |
300 | + | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
301 | + | case s: String => | |
302 | + | fromBase58String(s) | |
303 | + | case _: Unit => | |
304 | + | unit | |
305 | + | case _ => | |
306 | + | throw("Match error") | |
307 | + | } | |
308 | + | } | |
309 | + | ||
310 | + | ||
311 | + | func isManager (i) = match managerPublicKeyOrUnit() { | |
312 | + | case pk: ByteVector => | |
313 | + | (i.callerPublicKey == pk) | |
298 | 314 | case _: Unit => | |
299 | - | | |
315 | + | (i.caller == this) | |
300 | 316 | case _ => | |
301 | 317 | throw("Match error") | |
302 | 318 | } | |
303 | 319 | ||
304 | 320 | ||
305 | - | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
306 | - | case s: String => | |
307 | - | fromBase58String(s) | |
308 | - | case _: Unit => | |
309 | - | unit | |
310 | - | case _ => | |
311 | - | throw("Match error") | |
312 | - | } | |
313 | - | ||
314 | - | ||
315 | - | func mustManager (i) = { | |
316 | - | let pd = throw("Permission denied") | |
317 | - | match managerPublicKeyOrUnit() { | |
318 | - | case pk: ByteVector => | |
319 | - | if ((i.callerPublicKey == pk)) | |
320 | - | then true | |
321 | - | else pd | |
322 | - | case _: Unit => | |
323 | - | if ((i.caller == this)) | |
324 | - | then true | |
325 | - | else pd | |
326 | - | case _ => | |
327 | - | throw("Match error") | |
328 | - | } | |
329 | - | } | |
321 | + | func mustManager (i) = if (isManager(i)) | |
322 | + | then true | |
323 | + | else throw("permission denied") | |
330 | 324 | ||
331 | 325 | ||
332 | 326 | @Callable(i) | |
566 | 560 | let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, MULT18) | |
567 | 561 | let inPrAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inPrAssetAmtX18), priceAssetDcm], nil)) | |
568 | 562 | let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil) | |
569 | - | let $ | |
563 | + | let $t02268423037 = match res { | |
570 | 564 | case _ => | |
571 | 565 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
572 | 566 | then if ($isInstanceOf($match0._3, "Int")) | |
589 | 583 | } | |
590 | 584 | else throw("Couldn't cast types") | |
591 | 585 | } | |
592 | - | let calcLpAmt = $ | |
593 | - | let curPriceCalc = $ | |
594 | - | let amBalance = $ | |
595 | - | let prBalance = $ | |
596 | - | let lpEmission = $ | |
586 | + | let calcLpAmt = $t02268423037._1 | |
587 | + | let curPriceCalc = $t02268423037._2 | |
588 | + | let amBalance = $t02268423037._3 | |
589 | + | let prBalance = $t02268423037._4 | |
590 | + | let lpEmission = $t02268423037._5 | |
597 | 591 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(calcLpAmt), toString(curPrice), toString(amBalance), toString(prBalance), toString(lpEmission), poolStatus, toString(inAmAssetAmt), toString(inPrAssetAmt)], SEP)) | |
598 | 592 | } | |
599 | 593 | ||
624 | 618 | let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, MULT18, curPriceX18) | |
625 | 619 | let inAmAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inAmAssetAmtX18), amtAssetDcm], nil)) | |
626 | 620 | let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil) | |
627 | - | let $ | |
621 | + | let $t02561025963 = match res { | |
628 | 622 | case _ => | |
629 | 623 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
630 | 624 | then if ($isInstanceOf($match0._3, "Int")) | |
647 | 641 | } | |
648 | 642 | else throw("Couldn't cast types") | |
649 | 643 | } | |
650 | - | let calcLpAmt = $ | |
651 | - | let curPriceCalc = $ | |
652 | - | let amBalance = $ | |
653 | - | let prBalance = $ | |
654 | - | let lpEmission = $ | |
644 | + | let calcLpAmt = $t02561025963._1 | |
645 | + | let curPriceCalc = $t02561025963._2 | |
646 | + | let amBalance = $t02561025963._3 | |
647 | + | let prBalance = $t02561025963._4 | |
648 | + | let lpEmission = $t02561025963._5 | |
655 | 649 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(calcLpAmt), toString(curPrice), toString(amBalance), toString(prBalance), toString(lpEmission), poolStatus, toString(inAmAssetAmt), toString(inPrAssetAmt)], SEP)) | |
656 | 650 | } | |
657 | 651 | ||
661 | 655 | func poolEvaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = { | |
662 | 656 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(paymentLpAssetId))) | |
663 | 657 | let res = invoke(poolAddress, "estimateGetOperationWrapperREADONLY", ["", paymentLpAssetId, paymentLpAmt, toString(poolAddress)], nil) | |
664 | - | let $ | |
658 | + | let $t02665827075 = match res { | |
665 | 659 | case _ => | |
666 | 660 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
667 | 661 | then if ($isInstanceOf($match0._2, "Int")) | |
690 | 684 | } | |
691 | 685 | else throw("Couldn't cast types") | |
692 | 686 | } | |
693 | - | let outAmAmt = $ | |
694 | - | let outPrAmt = $ | |
695 | - | let amBalance = $ | |
696 | - | let prBalance = $ | |
697 | - | let lpEmission = $ | |
698 | - | let curPrice = $ | |
699 | - | let poolStatus = $ | |
687 | + | let outAmAmt = $t02665827075._1 | |
688 | + | let outPrAmt = $t02665827075._2 | |
689 | + | let amBalance = $t02665827075._3 | |
690 | + | let prBalance = $t02665827075._4 | |
691 | + | let lpEmission = $t02665827075._5 | |
692 | + | let curPrice = $t02665827075._6 | |
693 | + | let poolStatus = $t02665827075._7 | |
700 | 694 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(outAmAmt), toString(outPrAmt), toString(amBalance), toString(prBalance), toString(lpEmission), curPrice, poolStatus], SEP)) | |
701 | 695 | } | |
702 | 696 | ||
746 | 740 | } | |
747 | 741 | ||
748 | 742 | ||
749 | - | ||
750 | - | @Callable(i) | |
751 | - | func setManager (pendingManagerPublicKey) = { | |
752 | - | let checkCaller = mustManager(i) | |
753 | - | if ((checkCaller == checkCaller)) | |
754 | - | then { | |
755 | - | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
756 | - | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
757 | - | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
758 | - | else throw("Strict value is not equal to itself.") | |
759 | - | } | |
760 | - | else throw("Strict value is not equal to itself.") | |
761 | - | } | |
762 | - | ||
763 | - | ||
764 | - | ||
765 | - | @Callable(i) | |
766 | - | func confirmManager () = { | |
767 | - | let pm = pendingManagerPublicKeyOrUnit() | |
768 | - | let hasPM = if (isDefined(pm)) | |
769 | - | then true | |
770 | - | else throw("No pending manager") | |
771 | - | if ((hasPM == hasPM)) | |
772 | - | then { | |
773 | - | let checkPM = if ((i.callerPublicKey == value(pm))) | |
774 | - | then true | |
775 | - | else throw("You are not pending manager") | |
776 | - | if ((checkPM == checkPM)) | |
777 | - | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
778 | - | else throw("Strict value is not equal to itself.") | |
779 | - | } | |
780 | - | else throw("Strict value is not equal to itself.") | |
781 | - | } | |
782 | - | ||
783 | - | ||
784 | 743 | @Verifier(tx) | |
785 | 744 | func verify () = { | |
786 | 745 | let targetPublicKey = match managerPublicKeyOrUnit() { |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SCALE8 = 8 | |
5 | 5 | ||
6 | 6 | let MULT8 = 100000000 | |
7 | 7 | ||
8 | 8 | let SCALE18 = 18 | |
9 | 9 | ||
10 | 10 | let MULT18 = toBigInt(1000000000000000000) | |
11 | 11 | ||
12 | 12 | let SEP = "__" | |
13 | 13 | ||
14 | 14 | let POOLWEIGHTMULT = MULT8 | |
15 | 15 | ||
16 | 16 | let zeroBigInt = toBigInt(0) | |
17 | 17 | ||
18 | 18 | let idxPoolAddress = 1 | |
19 | 19 | ||
20 | 20 | let idxPoolStatus = 2 | |
21 | 21 | ||
22 | 22 | let idxPoolLPAssetId = 3 | |
23 | 23 | ||
24 | 24 | let idxAmtAssetId = 4 | |
25 | 25 | ||
26 | 26 | let idxPriceAssetId = 5 | |
27 | 27 | ||
28 | 28 | let idxAmtAssetDcm = 6 | |
29 | 29 | ||
30 | 30 | let idxPriceAssetDcm = 7 | |
31 | 31 | ||
32 | 32 | let idxIAmtAssetId = 8 | |
33 | 33 | ||
34 | 34 | let idxIPriceAssetId = 9 | |
35 | 35 | ||
36 | 36 | let idxLPAssetDcm = 10 | |
37 | 37 | ||
38 | 38 | func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined")) | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined")) | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0) | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined")) | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | func asAnyList (val) = match val { | |
51 | 51 | case valAnyLyst: List[Any] => | |
52 | 52 | valAnyLyst | |
53 | 53 | case _ => | |
54 | 54 | throw("fail to cast into List[Any]") | |
55 | 55 | } | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func asInt (val) = match val { | |
59 | 59 | case valInt: Int => | |
60 | 60 | valInt | |
61 | 61 | case _ => | |
62 | 62 | throw("fail to cast into Int") | |
63 | 63 | } | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func asString (val) = match val { | |
67 | 67 | case valStr: String => | |
68 | 68 | valStr | |
69 | 69 | case _ => | |
70 | 70 | throw("fail to cast into String") | |
71 | 71 | } | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func keyFactoryAddress () = "%s%s__config__factoryAddress" | |
75 | 75 | ||
76 | 76 | ||
77 | - | func keyManagerPublicKey () = "%s__managerPublicKey" | |
78 | - | ||
79 | - | ||
80 | - | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
81 | - | ||
82 | - | ||
83 | 77 | let IdxFactoryCfgStakingDapp = 1 | |
84 | 78 | ||
85 | 79 | let IdxFactoryCfgBoostingDapp = 2 | |
86 | 80 | ||
87 | 81 | let IdxFactoryCfgIdoDapp = 3 | |
88 | 82 | ||
89 | 83 | let IdxFactoryCfgTeamDapp = 4 | |
90 | 84 | ||
91 | 85 | let IdxFactoryCfgEmissionDapp = 5 | |
92 | 86 | ||
93 | 87 | let IdxFactoryCfgRestDapp = 6 | |
94 | 88 | ||
95 | 89 | let IdxFactoryCfgSlippageDapp = 7 | |
96 | 90 | ||
97 | 91 | let IdxFactoryCfgGwxRewardDapp = 8 | |
98 | 92 | ||
99 | 93 | func keyFactoryCfg () = "%s__factoryConfig" | |
100 | 94 | ||
101 | 95 | ||
102 | 96 | func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
103 | 97 | ||
104 | 98 | ||
105 | 99 | func keyFactoryLpList () = "%s__lpTokensList" | |
106 | 100 | ||
107 | 101 | ||
108 | 102 | func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
109 | 103 | ||
110 | 104 | ||
111 | 105 | func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP) | |
112 | 106 | ||
113 | 107 | ||
108 | + | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
109 | + | ||
110 | + | ||
111 | + | func keyManagerPublicKey () = "%s__managerPublicKey" | |
112 | + | ||
113 | + | ||
114 | 114 | func readFactoryAddressOrFail () = addressFromStringValue(getStringOrFail(keyFactoryAddress())) | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func readLpList () = split(valueOrElse(getString(readFactoryAddressOrFail(), keyFactoryLpList()), ""), SEP) | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func readFactoryCfgOrFail (factory) = split(getStringByAddressOrFail(factory, keyFactoryCfg()), SEP) | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func getBoostingAddressOrFail (fCfg) = addressFromStringValue(fCfg[IdxFactoryCfgBoostingDapp]) | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func getEmissionAddressOrFail (fCfg) = addressFromStringValue(fCfg[IdxFactoryCfgEmissionDapp]) | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func getStakingAddressOrFail (fCfg) = addressFromStringValue(fCfg[IdxFactoryCfgStakingDapp]) | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func getGwxRewardAddressOrFail (fCfg) = addressFromStringValue(fCfg[IdxFactoryCfgGwxRewardDapp]) | |
133 | + | ||
134 | + | ||
135 | + | func getManagerAddressOrFail () = addressFromStringValue(getStringValue(keyManagerVaultAddress())) | |
133 | 136 | ||
134 | 137 | ||
135 | 138 | func keyBoostCfg () = "%s__config" | |
136 | 139 | ||
137 | 140 | ||
138 | 141 | func keyBoostingLockParamTotalAmount () = "%s%s__stats__activeTotalLocked" | |
139 | 142 | ||
140 | 143 | ||
141 | 144 | func keyBoostingStatsLocksDurationSumInBlocks () = "%s%s__stats__locksDurationSumInBlocks" | |
142 | 145 | ||
143 | 146 | ||
144 | 147 | func keyBoostingStatsLocksCount () = "%s%s__stats__locksCount" | |
145 | 148 | ||
146 | 149 | ||
147 | 150 | func keyBoostingStatsUsersCount () = "%s%s__stats__activeUsersCount" | |
148 | 151 | ||
149 | 152 | ||
150 | 153 | func keyUser2NumMapping (userAddress) = makeString(["%s%s%s__mapping__user2num", userAddress], SEP) | |
151 | 154 | ||
152 | 155 | ||
153 | 156 | func keyNum2UserMapping (num) = makeString(["%s%s%s__mapping__num2user", num], SEP) | |
154 | 157 | ||
155 | 158 | ||
156 | 159 | func keyLockParamUserAmount (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "amount"], SEP) | |
157 | 160 | ||
158 | 161 | ||
159 | 162 | func keyLockParamStartBlock (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "start"], SEP) | |
160 | 163 | ||
161 | 164 | ||
162 | 165 | func keyLockParamDuration (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "duration"], SEP) | |
163 | 166 | ||
164 | 167 | ||
165 | 168 | func keyLockParamK (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "k"], SEP) | |
166 | 169 | ||
167 | 170 | ||
168 | 171 | func keyLockParamB (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "b"], SEP) | |
169 | 172 | ||
170 | 173 | ||
171 | 174 | func keyLockParamByPeriodK (userNum,period) = makeString(["%s%d%s%d__paramByPeriod", userNum, "k", period], SEP) | |
172 | 175 | ||
173 | 176 | ||
174 | 177 | func keyLockParamByPeriodB (userNum,period) = makeString(["%s%d%s%d__paramByPeriod", userNum, "b", period], SEP) | |
175 | 178 | ||
176 | 179 | ||
177 | 180 | func keyUserBoostEmissionLastINTEGRAL (userNum) = makeString(["%s%d__userBoostEmissionLastInt", userNum], SEP) | |
178 | 181 | ||
179 | 182 | ||
180 | 183 | func keyUserMaxBoostINTEGRAL (userNum) = makeString(["%s%d__maxBoostInt", userNum], SEP) | |
181 | 184 | ||
182 | 185 | ||
183 | 186 | func keyTotalMaxBoostINTEGRAL () = "%s%s__maxBoostInt__total" | |
184 | 187 | ||
185 | 188 | ||
186 | 189 | func keyUserBoostAvalaibleToClaimTotal (userNum) = makeString(["%s%d__userBoostAvaliableToClaimTotal", userNum], SEP) | |
187 | 190 | ||
188 | 191 | ||
189 | 192 | func keyUserBoostClaimed (userNum) = makeString(["%s%d__userBoostClaimed", userNum], SEP) | |
190 | 193 | ||
191 | 194 | ||
192 | 195 | func keyTotalCachedGwx () = "%s%s__gwxCached__total" | |
193 | 196 | ||
194 | 197 | ||
195 | 198 | func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s__staked", userAddressStr, lpAssetIdStr], SEP) | |
196 | 199 | ||
197 | 200 | ||
198 | 201 | func keyStakedTotal (lpAssetIdStr) = ("%s%s%s__staked__total__" + lpAssetIdStr) | |
199 | 202 | ||
200 | 203 | ||
201 | 204 | func keyClaimedByUser (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimed", userAddressStr, lpAssetIdStr], SEP) | |
202 | 205 | ||
203 | 206 | ||
204 | 207 | func keyClaimedByUserMinReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedMinReward", userAddressStr, lpAssetIdStr], SEP) | |
205 | 208 | ||
206 | 209 | ||
207 | 210 | func keyClaimedByUserBoostReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedBoostReward", userAddressStr, lpAssetIdStr], SEP) | |
208 | 211 | ||
209 | 212 | ||
210 | 213 | func readStaked (stakingDapp,key) = valueOrElse(getInteger(stakingDapp, key), 0) | |
211 | 214 | ||
212 | 215 | ||
213 | 216 | func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current" | |
214 | 217 | ||
215 | 218 | ||
216 | 219 | func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current" | |
217 | 220 | ||
218 | 221 | ||
219 | 222 | func keyEmissionStartBlock () = "%s%s__emission__startBlock" | |
220 | 223 | ||
221 | 224 | ||
222 | 225 | func keyEmissionDurationInBlocks () = "%s%s__emission__duration" | |
223 | 226 | ||
224 | 227 | ||
225 | 228 | func keyEmissionEndBlock () = "%s%s__emission__endBlock" | |
226 | 229 | ||
227 | 230 | ||
228 | 231 | func keyAddonAddr () = "%s__addonAddr" | |
229 | 232 | ||
230 | 233 | ||
231 | 234 | let factoryDapp = readFactoryAddressOrFail() | |
232 | 235 | ||
233 | 236 | let factoryCfg = readFactoryCfgOrFail(factoryDapp) | |
234 | 237 | ||
235 | 238 | let emissionDapp = getEmissionAddressOrFail(factoryCfg) | |
236 | 239 | ||
237 | 240 | let stakingDapp = getStakingAddressOrFail(factoryCfg) | |
238 | 241 | ||
239 | 242 | let gwxRewardDapp = getGwxRewardAddressOrFail(factoryCfg) | |
240 | 243 | ||
241 | 244 | let boostingDapp = getBoostingAddressOrFail(factoryCfg) | |
242 | 245 | ||
243 | 246 | func getPoolInFee (poolAddress) = { | |
244 | 247 | let @ = invoke(factoryDapp, "getInFeeREADONLY", [toString(poolAddress)], nil) | |
245 | 248 | if ($isInstanceOf(@, "Int")) | |
246 | 249 | then @ | |
247 | 250 | else throw(($getType(@) + " couldn't be cast to Int")) | |
248 | 251 | } | |
249 | 252 | ||
250 | 253 | ||
251 | 254 | func getPoolOutFee (poolAddress) = { | |
252 | 255 | let @ = invoke(factoryDapp, "getOutFeeREADONLY", [toString(poolAddress)], nil) | |
253 | 256 | if ($isInstanceOf(@, "Int")) | |
254 | 257 | then @ | |
255 | 258 | else throw(($getType(@) + " couldn't be cast to Int")) | |
256 | 259 | } | |
257 | 260 | ||
258 | 261 | ||
259 | 262 | func internalCurrentRewardRate (lpAssetId) = { | |
260 | 263 | let poolAddressStr = getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAssetId)) | |
261 | 264 | let poolWeightMult = MULT8 | |
262 | 265 | let poolWeight = getIntegerValue(factoryDapp, keyFactoryPoolWeight(poolAddressStr)) | |
263 | 266 | let wxEmissionPerBlock = getIntOrFail(emissionDapp, keyEmissionRatePerBlockCurrent()) | |
264 | 267 | let wxEmissionPerBlockMax = getIntOrFail(emissionDapp, keyEmissionRatePerBlockMaxCurrent()) | |
265 | 268 | let boostMaxCoeff = { | |
266 | 269 | let @ = invoke(emissionDapp, "getBoostCoeffREADONLY", nil, nil) | |
267 | 270 | if ($isInstanceOf(@, "Int")) | |
268 | 271 | then @ | |
269 | 272 | else throw(($getType(@) + " couldn't be cast to Int")) | |
270 | 273 | } | |
271 | 274 | let poolWxEmissionPerBlock = (fraction(wxEmissionPerBlock, poolWeight, poolWeightMult) / boostMaxCoeff) | |
272 | 275 | let poolWxEmissionPerBlockMax = fraction(wxEmissionPerBlockMax, poolWeight, poolWeightMult) | |
273 | 276 | let maxFactor = (boostMaxCoeff * MULT8) | |
274 | 277 | let totalLpStaked = getIntOrZero(stakingDapp, keyStakedTotal(lpAssetId)) | |
275 | 278 | [poolWxEmissionPerBlock, maxFactor, totalLpStaked] | |
276 | 279 | } | |
277 | 280 | ||
278 | 281 | ||
279 | 282 | func calcGwxAmountStartREADONLY (lockAmount,lockDuration,maxLockDuration) = { | |
280 | 283 | let coeffX8 = fraction(lockDuration, MULT8, maxLockDuration) | |
281 | 284 | let gWxAmountStart = fraction(lockAmount, coeffX8, MULT8) | |
282 | 285 | [gWxAmountStart] | |
283 | 286 | } | |
284 | 287 | ||
285 | 288 | ||
286 | 289 | func getKey (addr,key,type) = if ((type == "string")) | |
287 | 290 | then getStringValue(addr, key) | |
288 | 291 | else if ((type == "integer")) | |
289 | 292 | then toString(getIntegerValue(addr, key)) | |
290 | 293 | else if ((type == "boolean")) | |
291 | 294 | then toString(getBooleanValue(addr, key)) | |
292 | 295 | else throw("unknown type. expected string/integer/boolean") | |
293 | 296 | ||
294 | 297 | ||
295 | - | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
296 | - | case s: String => | |
297 | - | fromBase58String(s) | |
298 | + | func managerPublicKeyOrUnit () = { | |
299 | + | let managerVaultAddress = getManagerAddressOrFail() | |
300 | + | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
301 | + | case s: String => | |
302 | + | fromBase58String(s) | |
303 | + | case _: Unit => | |
304 | + | unit | |
305 | + | case _ => | |
306 | + | throw("Match error") | |
307 | + | } | |
308 | + | } | |
309 | + | ||
310 | + | ||
311 | + | func isManager (i) = match managerPublicKeyOrUnit() { | |
312 | + | case pk: ByteVector => | |
313 | + | (i.callerPublicKey == pk) | |
298 | 314 | case _: Unit => | |
299 | - | | |
315 | + | (i.caller == this) | |
300 | 316 | case _ => | |
301 | 317 | throw("Match error") | |
302 | 318 | } | |
303 | 319 | ||
304 | 320 | ||
305 | - | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
306 | - | case s: String => | |
307 | - | fromBase58String(s) | |
308 | - | case _: Unit => | |
309 | - | unit | |
310 | - | case _ => | |
311 | - | throw("Match error") | |
312 | - | } | |
313 | - | ||
314 | - | ||
315 | - | func mustManager (i) = { | |
316 | - | let pd = throw("Permission denied") | |
317 | - | match managerPublicKeyOrUnit() { | |
318 | - | case pk: ByteVector => | |
319 | - | if ((i.callerPublicKey == pk)) | |
320 | - | then true | |
321 | - | else pd | |
322 | - | case _: Unit => | |
323 | - | if ((i.caller == this)) | |
324 | - | then true | |
325 | - | else pd | |
326 | - | case _ => | |
327 | - | throw("Match error") | |
328 | - | } | |
329 | - | } | |
321 | + | func mustManager (i) = if (isManager(i)) | |
322 | + | then true | |
323 | + | else throw("permission denied") | |
330 | 324 | ||
331 | 325 | ||
332 | 326 | @Callable(i) | |
333 | 327 | func constructor (factoryAddress) = { | |
334 | 328 | let checkCaller = mustManager(i) | |
335 | 329 | if ((checkCaller == checkCaller)) | |
336 | 330 | then [StringEntry(keyFactoryAddress(), factoryAddress)] | |
337 | 331 | else throw("Strict value is not equal to itself.") | |
338 | 332 | } | |
339 | 333 | ||
340 | 334 | ||
341 | 335 | ||
342 | 336 | @Callable(i) | |
343 | 337 | func currentRewardRateREADONLY (lpAssetId) = { | |
344 | 338 | let rewardData = internalCurrentRewardRate(lpAssetId) | |
345 | 339 | let wxEmissionPerBlock = rewardData[0] | |
346 | 340 | let maxFactor = rewardData[1] | |
347 | 341 | let totalLpStaked = rewardData[2] | |
348 | 342 | let votingResultStaked = { | |
349 | 343 | let @ = invoke(boostingDapp, "getVotingResultStakedREADONLY", [lpAssetId], nil) | |
350 | 344 | if ($isInstanceOf(@, "Int")) | |
351 | 345 | then @ | |
352 | 346 | else throw(($getType(@) + " couldn't be cast to Int")) | |
353 | 347 | } | |
354 | 348 | $Tuple2(nil, makeString(["%d%d%d%d", toString(wxEmissionPerBlock), toString(maxFactor), toString(totalLpStaked), toString(votingResultStaked)], SEP)) | |
355 | 349 | } | |
356 | 350 | ||
357 | 351 | ||
358 | 352 | ||
359 | 353 | @Callable(i) | |
360 | 354 | func currentUserRewardRateREADONLY (lpAssetId,userAddress) = { | |
361 | 355 | let rewardData = internalCurrentRewardRate(lpAssetId) | |
362 | 356 | let wxEmissionPerBlock = rewardData[0] | |
363 | 357 | let maxFactor = rewardData[1] | |
364 | 358 | let totalLpStaked = rewardData[2] | |
365 | 359 | let lpStakedByUser = getIntOrZero(stakingDapp, keyStakedByUser(userAddress, lpAssetId)) | |
366 | 360 | let userClaimInfo = split(asString(invoke(stakingDapp, "claimWxREADONLY", [lpAssetId, userAddress], nil)), SEP) | |
367 | 361 | let minRewardPart = valueOrErrorMessage(parseInt(userClaimInfo[5]), "couldn't parse minRewardPart") | |
368 | 362 | let boostRewardPart = valueOrErrorMessage(parseInt(userClaimInfo[6]), "couldn't parse boostRewardPart") | |
369 | 363 | let debug = userClaimInfo[7] | |
370 | 364 | let boostingPower = if ((boostRewardPart == 0)) | |
371 | 365 | then (1 * MULT8) | |
372 | 366 | else fraction((minRewardPart + boostRewardPart), MULT8, minRewardPart) | |
373 | 367 | $Tuple2(nil, makeString(["%d%d%d%d%d%s", toString(wxEmissionPerBlock), toString(maxFactor), toString(totalLpStaked), toString(lpStakedByUser), toString(boostingPower), debug], SEP)) | |
374 | 368 | } | |
375 | 369 | ||
376 | 370 | ||
377 | 371 | ||
378 | 372 | @Callable(i) | |
379 | 373 | func calcBoostBulkInternalREADONLY (currentIter,deltaWxAmountBulk,deltaLockPeriodInBlocksBulk,deltaLpAmountBulk,lpAssetIdOptBulk,userAddressOpt,resAcc) = if ((currentIter == size(deltaWxAmountBulk))) | |
380 | 374 | then $Tuple2(nil, resAcc) | |
381 | 375 | else { | |
382 | 376 | let deltaWxAmount = deltaWxAmountBulk[currentIter] | |
383 | 377 | let deltaLockPeriodInBlocks = deltaLockPeriodInBlocksBulk[currentIter] | |
384 | 378 | let deltaLpAmount = deltaLpAmountBulk[currentIter] | |
385 | 379 | let lpAssetIdOpt = lpAssetIdOptBulk[currentIter] | |
386 | 380 | let info = { | |
387 | 381 | let @ = invoke(this, "calcBoostREADONLY", [deltaWxAmount, deltaLockPeriodInBlocks, deltaLpAmount, lpAssetIdOpt, userAddressOpt], nil) | |
388 | 382 | if ($isInstanceOf(@, "String")) | |
389 | 383 | then @ | |
390 | 384 | else throw(($getType(@) + " couldn't be cast to String")) | |
391 | 385 | } | |
392 | 386 | let res = (resAcc :+ info) | |
393 | 387 | let inv = { | |
394 | 388 | let @ = invoke(this, "calcBoostBulkInternalREADONLY", [(currentIter + 1), deltaWxAmountBulk, deltaLockPeriodInBlocksBulk, deltaLpAmountBulk, lpAssetIdOptBulk, userAddressOpt, res], nil) | |
395 | 389 | if ($isInstanceOf(@, "List[Any]")) | |
396 | 390 | then @ | |
397 | 391 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
398 | 392 | } | |
399 | 393 | if ((inv == inv)) | |
400 | 394 | then $Tuple2(nil, inv) | |
401 | 395 | else throw("Strict value is not equal to itself.") | |
402 | 396 | } | |
403 | 397 | ||
404 | 398 | ||
405 | 399 | ||
406 | 400 | @Callable(i) | |
407 | 401 | func calcBoostBulkREADONLY (deltaWxAmount,deltaLockPeriodInBlocks,deltaLpAmount,lpAssetIdOpt,userAddressOpt) = { | |
408 | 402 | let res = invoke(this, "calcBoostBulkInternalREADONLY", [0, deltaWxAmount, deltaLockPeriodInBlocks, deltaLpAmount, lpAssetIdOpt, userAddressOpt, nil], nil) | |
409 | 403 | $Tuple2(nil, res) | |
410 | 404 | } | |
411 | 405 | ||
412 | 406 | ||
413 | 407 | ||
414 | 408 | @Callable(i) | |
415 | 409 | func calcBoostREADONLY (deltaWxAmount,deltaLockPeriodInBlocks,deltaLpAmount,lpAssetIdOpt,userAddressOpt) = { | |
416 | 410 | let boostCoeff = { | |
417 | 411 | let @ = invoke(emissionDapp, "getBoostCoeffREADONLY", nil, nil) | |
418 | 412 | if ($isInstanceOf(@, "Int")) | |
419 | 413 | then @ | |
420 | 414 | else throw(($getType(@) + " couldn't be cast to Int")) | |
421 | 415 | } | |
422 | 416 | let mathDapp = gwxRewardDapp | |
423 | 417 | let EMPTYSTR = "empty" | |
424 | 418 | let maxLockDurationInBlocks = parseIntValue(split(getStringByAddressOrFail(boostingDapp, keyBoostCfg()), SEP)[4]) | |
425 | 419 | let lpAssetIdStr = if ((lpAssetIdOpt == "")) | |
426 | 420 | then EMPTYSTR | |
427 | 421 | else lpAssetIdOpt | |
428 | 422 | let userAddressStr = if ((userAddressOpt == "")) | |
429 | 423 | then EMPTYSTR | |
430 | 424 | else userAddressOpt | |
431 | 425 | let userNumStr = valueOrElse(getString(boostingDapp, keyUser2NumMapping(userAddressOpt)), EMPTYSTR) | |
432 | 426 | let userAmount = valueOrElse(getInteger(boostingDapp, keyLockParamUserAmount(userNumStr)), 0) | |
433 | 427 | let lockStart = valueOrElse(getInteger(boostingDapp, keyLockParamStartBlock(userNumStr)), height) | |
434 | 428 | let lockDuration = valueOrElse(getInteger(boostingDapp, keyLockParamDuration(userNumStr)), 0) | |
435 | 429 | let lockEnd = (lockStart + lockDuration) | |
436 | 430 | let remainingDuration = max([(lockEnd - height), 0]) | |
437 | 431 | let userAmountNew = (userAmount + deltaWxAmount) | |
438 | 432 | let lockDurationNew = min([(remainingDuration + deltaLockPeriodInBlocks), maxLockDurationInBlocks]) | |
439 | 433 | let userCurrgWxAmount = asInt(asAnyList(invoke(boostingDapp, "gwxUserInfoREADONLY", [userAddressStr], nil))[0]) | |
440 | 434 | let gWxAmountStartNew = calcGwxAmountStartREADONLY(userAmountNew, lockDurationNew, maxLockDurationInBlocks)[0] | |
441 | 435 | let totalCachedGwx = { | |
442 | 436 | let @ = invoke(boostingDapp, "getTotalCachedGwxREADONLY", nil, nil) | |
443 | 437 | if ($isInstanceOf(@, "Int")) | |
444 | 438 | then @ | |
445 | 439 | else throw(($getType(@) + " couldn't be cast to Int")) | |
446 | 440 | } | |
447 | 441 | let MULT3 = 1000 | |
448 | 442 | let wxEmissionPerBlockX3 = (getIntOrFail(emissionDapp, keyEmissionRatePerBlockCurrent()) * MULT3) | |
449 | 443 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
450 | 444 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
451 | 445 | let stakedByUser = readStaked(stakingDapp, stakedByUserKEY) | |
452 | 446 | let stakedTotal = readStaked(stakingDapp, stakedTotalKEY) | |
453 | 447 | let poolWeight = if ((lpAssetIdStr != EMPTYSTR)) | |
454 | 448 | then { | |
455 | 449 | let poolAddressStr = valueOrErrorMessage(getString(factoryDapp, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
456 | 450 | getIntegerValue(factoryDapp, keyFactoryPoolWeight(poolAddressStr)) | |
457 | 451 | } | |
458 | 452 | else 0 | |
459 | 453 | let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * boostCoeff)) | |
460 | 454 | let wxPerLpX3 = if ((stakedTotal != 0)) | |
461 | 455 | then fraction(poolWxEmissionPerBlockX3, MULT8, stakedTotal) | |
462 | 456 | else 0 | |
463 | 457 | let userWxPerBlockX3 = fraction(wxPerLpX3, stakedByUser, MULT8) | |
464 | 458 | let boostEmissionPerBlockX3 = (poolWxEmissionPerBlockX3 * (boostCoeff - 1)) | |
465 | 459 | let tmpUserBoostPerBlockX3 = fraction(userCurrgWxAmount, boostEmissionPerBlockX3, totalCachedGwx) | |
466 | 460 | let userBoostPerBlockX3 = min([tmpUserBoostPerBlockX3, (userWxPerBlockX3 * (boostCoeff - 1))]) | |
467 | 461 | let userBoostCoeff = if ((userWxPerBlockX3 == 0)) | |
468 | 462 | then (1 * MULT8) | |
469 | 463 | else fraction((userBoostPerBlockX3 + userWxPerBlockX3), MULT8, userWxPerBlockX3) | |
470 | 464 | $Tuple2(nil, makeString(["%d%d%s", toString(gWxAmountStartNew), toString(userBoostCoeff), "d"], SEP)) | |
471 | 465 | } | |
472 | 466 | ||
473 | 467 | ||
474 | 468 | ||
475 | 469 | @Callable(i) | |
476 | 470 | func wxEmissionStatsREADONLY () = { | |
477 | 471 | let ONEMULT = toString(MULT8) | |
478 | 472 | let ONE = "1" | |
479 | 473 | let wxEmissionPerBlock = getIntOrFail(emissionDapp, keyEmissionRatePerBlockCurrent()) | |
480 | 474 | let emissionStartBlock = getIntOrFail(emissionDapp, keyEmissionStartBlock()) | |
481 | 475 | let passedBlocks = if ((emissionStartBlock > height)) | |
482 | 476 | then 0 | |
483 | 477 | else (height - emissionStartBlock) | |
484 | 478 | let teamEmDuration = (1440 * 365) | |
485 | 479 | let teamEmMax = (201000000 * MULT8) | |
486 | 480 | let teamEm = if ((passedBlocks > teamEmDuration)) | |
487 | 481 | then teamEmMax | |
488 | 482 | else fraction(teamEmMax, passedBlocks, teamEmDuration) | |
489 | 483 | let totalWxReleased = ((wxEmissionPerBlock * passedBlocks) + teamEm) | |
490 | 484 | let totalWxLocked = getIntOrZero(boostingDapp, keyBoostingLockParamTotalAmount()) | |
491 | 485 | let locksDurationSumInBlocks = getIntOrZero(boostingDapp, keyBoostingStatsLocksDurationSumInBlocks()) | |
492 | 486 | let locksCount = getIntOrZero(boostingDapp, keyBoostingStatsLocksCount()) | |
493 | 487 | $Tuple2(nil, makeString(["%d%d%d%d", toString(totalWxReleased), toString(totalWxLocked), toString(locksDurationSumInBlocks), toString(locksCount)], SEP)) | |
494 | 488 | } | |
495 | 489 | ||
496 | 490 | ||
497 | 491 | ||
498 | 492 | @Callable(i) | |
499 | 493 | func poolStatsREADONLY (lpAsset) = { | |
500 | 494 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAsset))) | |
501 | 495 | let status = { | |
502 | 496 | let @ = invoke(factoryDapp, "getPoolStatusREADONLY", [toString(poolAddress)], nil) | |
503 | 497 | if ($isInstanceOf(@, "Int")) | |
504 | 498 | then @ | |
505 | 499 | else throw(($getType(@) + " couldn't be cast to Int")) | |
506 | 500 | } | |
507 | 501 | let tpl = "%d%d%d%d%d%d%d%d%d%s" | |
508 | 502 | if ((status == 4)) | |
509 | 503 | then $Tuple2(nil, makeString([tpl, toString(0), toString(0), toString(0), toString(0), toString(0), toString(0), toString(0), toString(0), toString(0), toString(false)], SEP)) | |
510 | 504 | else { | |
511 | 505 | let cfg = asAnyList(invoke(poolAddress, "getPoolConfigWrapperREADONLY", nil, nil)) | |
512 | 506 | let lpAssetId = fromBase58String(asString(cfg[idxPoolLPAssetId])) | |
513 | 507 | let amtAssetId = asString(cfg[idxAmtAssetId]) | |
514 | 508 | let priceAssetId = asString(cfg[idxPriceAssetId]) | |
515 | 509 | let iAmtAssetId = asString(cfg[idxIAmtAssetId]) | |
516 | 510 | let iPriceAssetId = asString(cfg[idxIPriceAssetId]) | |
517 | 511 | let amtAssetDcm = parseIntValue(asString(cfg[idxAmtAssetDcm])) | |
518 | 512 | let priceAssetDcm = parseIntValue(asString(cfg[idxPriceAssetDcm])) | |
519 | 513 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
520 | 514 | let accAmtAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [amtAssetId], nil)) | |
521 | 515 | let accPriceAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [priceAssetId], nil)) | |
522 | 516 | let pricesList = if ((poolLPBalance == 0)) | |
523 | 517 | then [toString(zeroBigInt), toString(zeroBigInt), toString(zeroBigInt)] | |
524 | 518 | else asAnyList(invoke(poolAddress, "calcPricesWrapperREADONLY", [accAmtAssetBalance, accPriceAssetBalance, poolLPBalance], nil)) | |
525 | 519 | let curPrice = 0 | |
526 | 520 | let lpAmtAssetShare = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [pricesList[1], MULT8], nil)) | |
527 | 521 | let lpPriceAssetShare = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [pricesList[2], MULT8], nil)) | |
528 | 522 | let poolWeight = getIntegerValue(factoryDapp, keyFactoryPoolWeight(toString(poolAddress))) | |
529 | 523 | let inFee = getPoolInFee(poolAddress) | |
530 | 524 | let outFee = getPoolOutFee(poolAddress) | |
531 | 525 | let poolOneTokenOperationsDisabled = { | |
532 | 526 | let @ = invoke(factoryDapp, "isPoolOneTokenOperationsDisabledREADONLY", [toString(poolAddress)], nil) | |
533 | 527 | if ($isInstanceOf(@, "Boolean")) | |
534 | 528 | then @ | |
535 | 529 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
536 | 530 | } | |
537 | 531 | let poolOneTokenOperationsEnabled = !(poolOneTokenOperationsDisabled) | |
538 | 532 | $Tuple2(nil, makeString([tpl, toString(accAmtAssetBalance), toString(accPriceAssetBalance), toString(poolLPBalance), toString(curPrice), toString(lpAmtAssetShare), toString(lpPriceAssetShare), toString(poolWeight), toString(inFee), toString(outFee), toString(poolOneTokenOperationsEnabled)], SEP)) | |
539 | 533 | } | |
540 | 534 | } | |
541 | 535 | ||
542 | 536 | ||
543 | 537 | ||
544 | 538 | @Callable(i) | |
545 | 539 | func poolEvaluatePutByAmountAssetREADONLY (lpAsset,inAmAssetAmt) = { | |
546 | 540 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAsset))) | |
547 | 541 | let cfg = asAnyList(invoke(poolAddress, "getPoolConfigWrapperREADONLY", nil, nil)) | |
548 | 542 | let lpAssetId = fromBase58String(asString(cfg[idxPoolLPAssetId])) | |
549 | 543 | let amAssetIdStr = asString(cfg[idxAmtAssetId]) | |
550 | 544 | let amAssetId = fromBase58String(amAssetIdStr) | |
551 | 545 | let prAssetIdStr = asString(cfg[idxPriceAssetId]) | |
552 | 546 | let prAssetId = fromBase58String(prAssetIdStr) | |
553 | 547 | let amtAssetDcm = parseIntValue(asString(cfg[idxAmtAssetDcm])) | |
554 | 548 | let priceAssetDcm = parseIntValue(asString(cfg[idxPriceAssetDcm])) | |
555 | 549 | let poolStatus = asString(cfg[idxPoolStatus]) | |
556 | 550 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
557 | 551 | let accAmtAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [amAssetIdStr], nil)) | |
558 | 552 | let accPriceAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [prAssetIdStr], nil)) | |
559 | 553 | let amtAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [accAmtAssetBalance, amtAssetDcm], nil))) | |
560 | 554 | let priceAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [accPriceAssetBalance, priceAssetDcm], nil))) | |
561 | 555 | let curPriceX18 = if ((poolLPBalance == 0)) | |
562 | 556 | then zeroBigInt | |
563 | 557 | else parseBigIntValue(asString(invoke(poolAddress, "calcPriceBigIntWrapperREADONLY", [toString(priceAssetAmtX18), toString(amtAssetAmtX18)], nil))) | |
564 | 558 | let curPrice = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(curPriceX18), MULT8], nil)) | |
565 | 559 | let inAmAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [inAmAssetAmt, amtAssetDcm], nil))) | |
566 | 560 | let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, MULT18) | |
567 | 561 | let inPrAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inPrAssetAmtX18), priceAssetDcm], nil)) | |
568 | 562 | let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil) | |
569 | - | let $ | |
563 | + | let $t02268423037 = match res { | |
570 | 564 | case _ => | |
571 | 565 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
572 | 566 | then if ($isInstanceOf($match0._3, "Int")) | |
573 | 567 | then if ($isInstanceOf($match0._4, "Int")) | |
574 | 568 | then if ($isInstanceOf($match0._5, "Int")) | |
575 | 569 | then $isInstanceOf($match0._6, "Int") | |
576 | 570 | else false | |
577 | 571 | else false | |
578 | 572 | else false | |
579 | 573 | else false) | |
580 | 574 | then (size($match0) == 13) | |
581 | 575 | else false) | |
582 | 576 | then { | |
583 | 577 | let calcLpAmt = $match0._1 | |
584 | 578 | let curPriceCalc = $match0._3 | |
585 | 579 | let amBalance = $match0._4 | |
586 | 580 | let prBalance = $match0._5 | |
587 | 581 | let lpEmission = $match0._6 | |
588 | 582 | $Tuple5(calcLpAmt, curPriceCalc, amBalance, prBalance, lpEmission) | |
589 | 583 | } | |
590 | 584 | else throw("Couldn't cast types") | |
591 | 585 | } | |
592 | - | let calcLpAmt = $ | |
593 | - | let curPriceCalc = $ | |
594 | - | let amBalance = $ | |
595 | - | let prBalance = $ | |
596 | - | let lpEmission = $ | |
586 | + | let calcLpAmt = $t02268423037._1 | |
587 | + | let curPriceCalc = $t02268423037._2 | |
588 | + | let amBalance = $t02268423037._3 | |
589 | + | let prBalance = $t02268423037._4 | |
590 | + | let lpEmission = $t02268423037._5 | |
597 | 591 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(calcLpAmt), toString(curPrice), toString(amBalance), toString(prBalance), toString(lpEmission), poolStatus, toString(inAmAssetAmt), toString(inPrAssetAmt)], SEP)) | |
598 | 592 | } | |
599 | 593 | ||
600 | 594 | ||
601 | 595 | ||
602 | 596 | @Callable(i) | |
603 | 597 | func poolEvaluatePutByPriceAssetREADONLY (lpAsset,inPrAssetAmt) = { | |
604 | 598 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAsset))) | |
605 | 599 | let cfg = asAnyList(invoke(poolAddress, "getPoolConfigWrapperREADONLY", nil, nil)) | |
606 | 600 | let lpAssetId = fromBase58String(asString(cfg[idxPoolLPAssetId])) | |
607 | 601 | let amAssetIdStr = asString(cfg[idxAmtAssetId]) | |
608 | 602 | let amAssetId = fromBase58String(amAssetIdStr) | |
609 | 603 | let prAssetIdStr = asString(cfg[idxPriceAssetId]) | |
610 | 604 | let prAssetId = fromBase58String(prAssetIdStr) | |
611 | 605 | let amtAssetDcm = parseIntValue(asString(cfg[idxAmtAssetDcm])) | |
612 | 606 | let priceAssetDcm = parseIntValue(asString(cfg[idxPriceAssetDcm])) | |
613 | 607 | let poolStatus = asString(cfg[idxPoolStatus]) | |
614 | 608 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
615 | 609 | let amBalanceRaw = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [amAssetIdStr], nil)) | |
616 | 610 | let prBalanceRaw = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [prAssetIdStr], nil)) | |
617 | 611 | let amBalanceRawX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [amBalanceRaw, amtAssetDcm], nil))) | |
618 | 612 | let prBalanceRawX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [prBalanceRaw, priceAssetDcm], nil))) | |
619 | 613 | let curPriceX18 = if ((poolLPBalance == 0)) | |
620 | 614 | then zeroBigInt | |
621 | 615 | else parseBigIntValue(asString(invoke(poolAddress, "calcPriceBigIntWrapperREADONLY", [toString(prBalanceRawX18), toString(amBalanceRawX18)], nil))) | |
622 | 616 | let curPrice = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(curPriceX18), MULT8], nil)) | |
623 | 617 | let inPrAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [inPrAssetAmt, priceAssetDcm], nil))) | |
624 | 618 | let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, MULT18, curPriceX18) | |
625 | 619 | let inAmAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inAmAssetAmtX18), amtAssetDcm], nil)) | |
626 | 620 | let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil) | |
627 | - | let $ | |
621 | + | let $t02561025963 = match res { | |
628 | 622 | case _ => | |
629 | 623 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
630 | 624 | then if ($isInstanceOf($match0._3, "Int")) | |
631 | 625 | then if ($isInstanceOf($match0._4, "Int")) | |
632 | 626 | then if ($isInstanceOf($match0._5, "Int")) | |
633 | 627 | then $isInstanceOf($match0._6, "Int") | |
634 | 628 | else false | |
635 | 629 | else false | |
636 | 630 | else false | |
637 | 631 | else false) | |
638 | 632 | then (size($match0) == 13) | |
639 | 633 | else false) | |
640 | 634 | then { | |
641 | 635 | let calcLpAmt = $match0._1 | |
642 | 636 | let curPriceCalc = $match0._3 | |
643 | 637 | let amBalance = $match0._4 | |
644 | 638 | let prBalance = $match0._5 | |
645 | 639 | let lpEmission = $match0._6 | |
646 | 640 | $Tuple5(calcLpAmt, curPriceCalc, amBalance, prBalance, lpEmission) | |
647 | 641 | } | |
648 | 642 | else throw("Couldn't cast types") | |
649 | 643 | } | |
650 | - | let calcLpAmt = $ | |
651 | - | let curPriceCalc = $ | |
652 | - | let amBalance = $ | |
653 | - | let prBalance = $ | |
654 | - | let lpEmission = $ | |
644 | + | let calcLpAmt = $t02561025963._1 | |
645 | + | let curPriceCalc = $t02561025963._2 | |
646 | + | let amBalance = $t02561025963._3 | |
647 | + | let prBalance = $t02561025963._4 | |
648 | + | let lpEmission = $t02561025963._5 | |
655 | 649 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(calcLpAmt), toString(curPrice), toString(amBalance), toString(prBalance), toString(lpEmission), poolStatus, toString(inAmAssetAmt), toString(inPrAssetAmt)], SEP)) | |
656 | 650 | } | |
657 | 651 | ||
658 | 652 | ||
659 | 653 | ||
660 | 654 | @Callable(i) | |
661 | 655 | func poolEvaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = { | |
662 | 656 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(paymentLpAssetId))) | |
663 | 657 | let res = invoke(poolAddress, "estimateGetOperationWrapperREADONLY", ["", paymentLpAssetId, paymentLpAmt, toString(poolAddress)], nil) | |
664 | - | let $ | |
658 | + | let $t02665827075 = match res { | |
665 | 659 | case _ => | |
666 | 660 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
667 | 661 | then if ($isInstanceOf($match0._2, "Int")) | |
668 | 662 | then if ($isInstanceOf($match0._5, "Int")) | |
669 | 663 | then if ($isInstanceOf($match0._6, "Int")) | |
670 | 664 | then if ($isInstanceOf($match0._7, "Int")) | |
671 | 665 | then if ($isInstanceOf($match0._8, "String")) | |
672 | 666 | then $isInstanceOf($match0._9, "String") | |
673 | 667 | else false | |
674 | 668 | else false | |
675 | 669 | else false | |
676 | 670 | else false | |
677 | 671 | else false | |
678 | 672 | else false) | |
679 | 673 | then (size($match0) == 10) | |
680 | 674 | else false) | |
681 | 675 | then { | |
682 | 676 | let outAmAmt = $match0._1 | |
683 | 677 | let outPrAmt = $match0._2 | |
684 | 678 | let amBalance = $match0._5 | |
685 | 679 | let prBalance = $match0._6 | |
686 | 680 | let lpEmission = $match0._7 | |
687 | 681 | let curPrice = $match0._8 | |
688 | 682 | let poolStatus = $match0._9 | |
689 | 683 | $Tuple7(outAmAmt, outPrAmt, amBalance, prBalance, lpEmission, curPrice, poolStatus) | |
690 | 684 | } | |
691 | 685 | else throw("Couldn't cast types") | |
692 | 686 | } | |
693 | - | let outAmAmt = $ | |
694 | - | let outPrAmt = $ | |
695 | - | let amBalance = $ | |
696 | - | let prBalance = $ | |
697 | - | let lpEmission = $ | |
698 | - | let curPrice = $ | |
699 | - | let poolStatus = $ | |
687 | + | let outAmAmt = $t02665827075._1 | |
688 | + | let outPrAmt = $t02665827075._2 | |
689 | + | let amBalance = $t02665827075._3 | |
690 | + | let prBalance = $t02665827075._4 | |
691 | + | let lpEmission = $t02665827075._5 | |
692 | + | let curPrice = $t02665827075._6 | |
693 | + | let poolStatus = $t02665827075._7 | |
700 | 694 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(outAmAmt), toString(outPrAmt), toString(amBalance), toString(prBalance), toString(lpEmission), curPrice, poolStatus], SEP)) | |
701 | 695 | } | |
702 | 696 | ||
703 | 697 | ||
704 | 698 | ||
705 | 699 | @Callable(i) | |
706 | 700 | func gwxUserInfoREADONLY (userAddress) = { | |
707 | 701 | let gwxUserInfoLIST = asAnyList(invoke(boostingDapp, "gwxUserInfoREADONLY", [userAddress], nil)) | |
708 | 702 | let gwxAmount = asInt(gwxUserInfoLIST[0]) | |
709 | 703 | $Tuple2(nil, makeString(["%d", toString(gwxAmount)], SEP)) | |
710 | 704 | } | |
711 | 705 | ||
712 | 706 | ||
713 | 707 | ||
714 | 708 | @Callable(i) | |
715 | 709 | func unstakeAndGetOneTknV2 (poolAddress,unstakeAmount,outAssetId,minOutAmount) = { | |
716 | 710 | let inv = invoke(addressFromStringValue(poolAddress), "unstakeAndGetOneTknV2", [unstakeAmount, outAssetId, minOutAmount], nil) | |
717 | 711 | if ((inv == inv)) | |
718 | 712 | then $Tuple2(nil, unit) | |
719 | 713 | else throw("Strict value is not equal to itself.") | |
720 | 714 | } | |
721 | 715 | ||
722 | 716 | ||
723 | 717 | ||
724 | 718 | @Callable(i) | |
725 | 719 | func getKeysBulkInternal (currentIter,keys,resAcc) = if ((currentIter == size(keys))) | |
726 | 720 | then $Tuple2(nil, resAcc) | |
727 | 721 | else { | |
728 | 722 | let k = split(keys[currentIter], "++") | |
729 | 723 | let addr = addressFromStringValue(k[0]) | |
730 | 724 | let key = k[1] | |
731 | 725 | let type = k[2] | |
732 | 726 | let val = getKey(addr, key, type) | |
733 | 727 | let res = (resAcc :+ val) | |
734 | 728 | let inv = invoke(this, "getKeysBulkInternal", [(currentIter + 1), keys, res], nil) | |
735 | 729 | if ((inv == inv)) | |
736 | 730 | then $Tuple2(nil, inv) | |
737 | 731 | else throw("Strict value is not equal to itself.") | |
738 | 732 | } | |
739 | 733 | ||
740 | 734 | ||
741 | 735 | ||
742 | 736 | @Callable(i) | |
743 | 737 | func getKeysBulk (keys) = { | |
744 | 738 | let res = invoke(this, "getKeysBulkInternal", [0, keys, nil], nil) | |
745 | 739 | $Tuple2(nil, res) | |
746 | 740 | } | |
747 | 741 | ||
748 | 742 | ||
749 | - | ||
750 | - | @Callable(i) | |
751 | - | func setManager (pendingManagerPublicKey) = { | |
752 | - | let checkCaller = mustManager(i) | |
753 | - | if ((checkCaller == checkCaller)) | |
754 | - | then { | |
755 | - | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
756 | - | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
757 | - | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
758 | - | else throw("Strict value is not equal to itself.") | |
759 | - | } | |
760 | - | else throw("Strict value is not equal to itself.") | |
761 | - | } | |
762 | - | ||
763 | - | ||
764 | - | ||
765 | - | @Callable(i) | |
766 | - | func confirmManager () = { | |
767 | - | let pm = pendingManagerPublicKeyOrUnit() | |
768 | - | let hasPM = if (isDefined(pm)) | |
769 | - | then true | |
770 | - | else throw("No pending manager") | |
771 | - | if ((hasPM == hasPM)) | |
772 | - | then { | |
773 | - | let checkPM = if ((i.callerPublicKey == value(pm))) | |
774 | - | then true | |
775 | - | else throw("You are not pending manager") | |
776 | - | if ((checkPM == checkPM)) | |
777 | - | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
778 | - | else throw("Strict value is not equal to itself.") | |
779 | - | } | |
780 | - | else throw("Strict value is not equal to itself.") | |
781 | - | } | |
782 | - | ||
783 | - | ||
784 | 743 | @Verifier(tx) | |
785 | 744 | func verify () = { | |
786 | 745 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
787 | 746 | case pk: ByteVector => | |
788 | 747 | pk | |
789 | 748 | case _: Unit => | |
790 | 749 | tx.senderPublicKey | |
791 | 750 | case _ => | |
792 | 751 | throw("Match error") | |
793 | 752 | } | |
794 | 753 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
795 | 754 | } | |
796 | 755 |
github/deemru/w8io/169f3d6 115.84 ms ◑