tx · 3F8svdZKqfrHECRNtLPTT2My2L9DSe5mKLDme55aQQHG 3MsNhK6uve98J6DeqbuwGFBRh9GoHPGUFgp: -0.02400000 Waves 2023.04.24 15:32 [2548634] smart account 3MsNhK6uve98J6DeqbuwGFBRh9GoHPGUFgp > SELF 0.00000000 Waves
{ "type": 13, "id": "3F8svdZKqfrHECRNtLPTT2My2L9DSe5mKLDme55aQQHG", "fee": 2400000, "feeAssetId": null, "timestamp": 1682339611690, "version": 2, "chainId": 84, "sender": "3MsNhK6uve98J6DeqbuwGFBRh9GoHPGUFgp", "senderPublicKey": "86RHVxKovtU7yKnepY8wKsd8niDxGAsiwuA1XA1DNqrS", "proofs": [ "3mz2QHy8GtFJREhFzLyq6pL9ju2r6ainnwpZCzoZaNwwezVdLA6kKnJRU5Mf9quTtFNgYqKpGJXgiWE4J2G2C9us" ], "script": "base64:BgLqIQgCEgMKAQgSAwoBCBIECgIICBIJCgcBERERGAgYEgcKBRERERgIEgcKBQEBAQgIEgASAwoBCBIECgIIARIECgIIARIECgIIARIDCgEIEgYKBAgBCAESBQoDARgYEgMKARgSAwoBCBIAIgZTQ0FMRTgiBU1VTFQ4IgdTQ0FMRTE4IgZNVUxUMTgiA1NFUCIOUE9PTFdFSUdIVE1VTFQiCnplcm9CaWdJbnQiDmlkeFBvb2xBZGRyZXNzIg1pZHhQb29sU3RhdHVzIhBpZHhQb29sTFBBc3NldElkIg1pZHhBbXRBc3NldElkIg9pZHhQcmljZUFzc2V0SWQiDmlkeEFtdEFzc2V0RGNtIhBpZHhQcmljZUFzc2V0RGNtIg5pZHhJQW10QXNzZXRJZCIQaWR4SVByaWNlQXNzZXRJZCINaWR4TFBBc3NldERjbSIPZ2V0U3RyaW5nT3JGYWlsIgNrZXkiGGdldFN0cmluZ0J5QWRkcmVzc09yRmFpbCIHYWRkcmVzcyIMZ2V0SW50T3JaZXJvIgxnZXRJbnRPckZhaWwiCWFzQW55TGlzdCIDdmFsIgckbWF0Y2gwIgp2YWxBbnl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pcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECZWEBAmViAAQCZWMEAXoJAQJieQADCQABAgUBegIKQnl0ZVZlY3RvcgQCYkcFAXoFAmJHAwkAAQIFAXoCBFVuaXQIBQJlYQ9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCZWEJYm9keUJ5dGVzCQCRAwIIBQJlYQZwcm9vZnMAAAUCZWMMj6X7", "height": 2548634, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Cd4pK1LVmG87fzL3FZmTucckrDB6pBAUrnXXB6TSvakg Next: EXTGNy5Fr5SyrRygF4rQ9pwrcGmJWv5Saq1sAgx6d9qA Diff:
Old | New | Differences | |
---|---|---|---|
78 | 78 | ||
79 | 79 | ||
80 | 80 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
81 | + | ||
82 | + | ||
83 | + | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
81 | 84 | ||
82 | 85 | ||
83 | 86 | let IdxFactoryCfgStakingDapp = 1 | |
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 | - | case _: Unit => | |
299 | - | unit | |
300 | - | case _ => | |
301 | - | throw("Match error") | |
302 | - | } | |
298 | + | func managerPublicKeyOrUnit () = { | |
299 | + | let managerVaultAddress = addressFromStringValue(getStringByAddressOrFail(this, keyManagerVaultAddress())) | |
300 | + | let managerPublicKey = getString(managerVaultAddress, keyManagerPublicKey()) | |
301 | + | match managerPublicKey { | |
302 | + | case s: String => | |
303 | + | fromBase58String(s) | |
304 | + | case _: Unit => | |
305 | + | unit | |
306 | + | case _ => | |
307 | + | throw("Match error") | |
308 | + | } | |
309 | + | } | |
303 | 310 | ||
304 | 311 | ||
305 | 312 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
566 | 573 | let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, MULT18) | |
567 | 574 | let inPrAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inPrAssetAmtX18), priceAssetDcm], nil)) | |
568 | 575 | let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil) | |
569 | - | let $ | |
576 | + | let $t02287323226 = match res { | |
570 | 577 | case _ => | |
571 | 578 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
572 | 579 | then if ($isInstanceOf($match0._3, "Int")) | |
589 | 596 | } | |
590 | 597 | else throw("Couldn't cast types") | |
591 | 598 | } | |
592 | - | let calcLpAmt = $ | |
593 | - | let curPriceCalc = $ | |
594 | - | let amBalance = $ | |
595 | - | let prBalance = $ | |
596 | - | let lpEmission = $ | |
599 | + | let calcLpAmt = $t02287323226._1 | |
600 | + | let curPriceCalc = $t02287323226._2 | |
601 | + | let amBalance = $t02287323226._3 | |
602 | + | let prBalance = $t02287323226._4 | |
603 | + | let lpEmission = $t02287323226._5 | |
597 | 604 | $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 | 605 | } | |
599 | 606 | ||
624 | 631 | let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, MULT18, curPriceX18) | |
625 | 632 | let inAmAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inAmAssetAmtX18), amtAssetDcm], nil)) | |
626 | 633 | let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil) | |
627 | - | let $ | |
634 | + | let $t02579926152 = match res { | |
628 | 635 | case _ => | |
629 | 636 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
630 | 637 | then if ($isInstanceOf($match0._3, "Int")) | |
647 | 654 | } | |
648 | 655 | else throw("Couldn't cast types") | |
649 | 656 | } | |
650 | - | let calcLpAmt = $ | |
651 | - | let curPriceCalc = $ | |
652 | - | let amBalance = $ | |
653 | - | let prBalance = $ | |
654 | - | let lpEmission = $ | |
657 | + | let calcLpAmt = $t02579926152._1 | |
658 | + | let curPriceCalc = $t02579926152._2 | |
659 | + | let amBalance = $t02579926152._3 | |
660 | + | let prBalance = $t02579926152._4 | |
661 | + | let lpEmission = $t02579926152._5 | |
655 | 662 | $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 | 663 | } | |
657 | 664 | ||
661 | 668 | func poolEvaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = { | |
662 | 669 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(paymentLpAssetId))) | |
663 | 670 | let res = invoke(poolAddress, "estimateGetOperationWrapperREADONLY", ["", paymentLpAssetId, paymentLpAmt, toString(poolAddress)], nil) | |
664 | - | let $ | |
671 | + | let $t02684727264 = match res { | |
665 | 672 | case _ => | |
666 | 673 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
667 | 674 | then if ($isInstanceOf($match0._2, "Int")) | |
690 | 697 | } | |
691 | 698 | else throw("Couldn't cast types") | |
692 | 699 | } | |
693 | - | let outAmAmt = $ | |
694 | - | let outPrAmt = $ | |
695 | - | let amBalance = $ | |
696 | - | let prBalance = $ | |
697 | - | let lpEmission = $ | |
698 | - | let curPrice = $ | |
699 | - | let poolStatus = $ | |
700 | + | let outAmAmt = $t02684727264._1 | |
701 | + | let outPrAmt = $t02684727264._2 | |
702 | + | let amBalance = $t02684727264._3 | |
703 | + | let prBalance = $t02684727264._4 | |
704 | + | let lpEmission = $t02684727264._5 | |
705 | + | let curPrice = $t02684727264._6 | |
706 | + | let poolStatus = $t02684727264._7 | |
700 | 707 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(outAmAmt), toString(outPrAmt), toString(amBalance), toString(prBalance), toString(lpEmission), curPrice, poolStatus], SEP)) | |
701 | 708 | } | |
702 | 709 |
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 | 77 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
81 | + | ||
82 | + | ||
83 | + | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
81 | 84 | ||
82 | 85 | ||
83 | 86 | let IdxFactoryCfgStakingDapp = 1 | |
84 | 87 | ||
85 | 88 | let IdxFactoryCfgBoostingDapp = 2 | |
86 | 89 | ||
87 | 90 | let IdxFactoryCfgIdoDapp = 3 | |
88 | 91 | ||
89 | 92 | let IdxFactoryCfgTeamDapp = 4 | |
90 | 93 | ||
91 | 94 | let IdxFactoryCfgEmissionDapp = 5 | |
92 | 95 | ||
93 | 96 | let IdxFactoryCfgRestDapp = 6 | |
94 | 97 | ||
95 | 98 | let IdxFactoryCfgSlippageDapp = 7 | |
96 | 99 | ||
97 | 100 | let IdxFactoryCfgGwxRewardDapp = 8 | |
98 | 101 | ||
99 | 102 | func keyFactoryCfg () = "%s__factoryConfig" | |
100 | 103 | ||
101 | 104 | ||
102 | 105 | func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
103 | 106 | ||
104 | 107 | ||
105 | 108 | func keyFactoryLpList () = "%s__lpTokensList" | |
106 | 109 | ||
107 | 110 | ||
108 | 111 | func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
109 | 112 | ||
110 | 113 | ||
111 | 114 | func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP) | |
112 | 115 | ||
113 | 116 | ||
114 | 117 | func readFactoryAddressOrFail () = addressFromStringValue(getStringOrFail(keyFactoryAddress())) | |
115 | 118 | ||
116 | 119 | ||
117 | 120 | func readLpList () = split(valueOrElse(getString(readFactoryAddressOrFail(), keyFactoryLpList()), ""), SEP) | |
118 | 121 | ||
119 | 122 | ||
120 | 123 | func readFactoryCfgOrFail (factory) = split(getStringByAddressOrFail(factory, keyFactoryCfg()), SEP) | |
121 | 124 | ||
122 | 125 | ||
123 | 126 | func getBoostingAddressOrFail (fCfg) = addressFromStringValue(fCfg[IdxFactoryCfgBoostingDapp]) | |
124 | 127 | ||
125 | 128 | ||
126 | 129 | func getEmissionAddressOrFail (fCfg) = addressFromStringValue(fCfg[IdxFactoryCfgEmissionDapp]) | |
127 | 130 | ||
128 | 131 | ||
129 | 132 | func getStakingAddressOrFail (fCfg) = addressFromStringValue(fCfg[IdxFactoryCfgStakingDapp]) | |
130 | 133 | ||
131 | 134 | ||
132 | 135 | func getGwxRewardAddressOrFail (fCfg) = addressFromStringValue(fCfg[IdxFactoryCfgGwxRewardDapp]) | |
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 | - | case _: Unit => | |
299 | - | unit | |
300 | - | case _ => | |
301 | - | throw("Match error") | |
302 | - | } | |
298 | + | func managerPublicKeyOrUnit () = { | |
299 | + | let managerVaultAddress = addressFromStringValue(getStringByAddressOrFail(this, keyManagerVaultAddress())) | |
300 | + | let managerPublicKey = getString(managerVaultAddress, keyManagerPublicKey()) | |
301 | + | match managerPublicKey { | |
302 | + | case s: String => | |
303 | + | fromBase58String(s) | |
304 | + | case _: Unit => | |
305 | + | unit | |
306 | + | case _ => | |
307 | + | throw("Match error") | |
308 | + | } | |
309 | + | } | |
303 | 310 | ||
304 | 311 | ||
305 | 312 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
306 | 313 | case s: String => | |
307 | 314 | fromBase58String(s) | |
308 | 315 | case _: Unit => | |
309 | 316 | unit | |
310 | 317 | case _ => | |
311 | 318 | throw("Match error") | |
312 | 319 | } | |
313 | 320 | ||
314 | 321 | ||
315 | 322 | func mustManager (i) = { | |
316 | 323 | let pd = throw("Permission denied") | |
317 | 324 | match managerPublicKeyOrUnit() { | |
318 | 325 | case pk: ByteVector => | |
319 | 326 | if ((i.callerPublicKey == pk)) | |
320 | 327 | then true | |
321 | 328 | else pd | |
322 | 329 | case _: Unit => | |
323 | 330 | if ((i.caller == this)) | |
324 | 331 | then true | |
325 | 332 | else pd | |
326 | 333 | case _ => | |
327 | 334 | throw("Match error") | |
328 | 335 | } | |
329 | 336 | } | |
330 | 337 | ||
331 | 338 | ||
332 | 339 | @Callable(i) | |
333 | 340 | func constructor (factoryAddress) = { | |
334 | 341 | let checkCaller = mustManager(i) | |
335 | 342 | if ((checkCaller == checkCaller)) | |
336 | 343 | then [StringEntry(keyFactoryAddress(), factoryAddress)] | |
337 | 344 | else throw("Strict value is not equal to itself.") | |
338 | 345 | } | |
339 | 346 | ||
340 | 347 | ||
341 | 348 | ||
342 | 349 | @Callable(i) | |
343 | 350 | func currentRewardRateREADONLY (lpAssetId) = { | |
344 | 351 | let rewardData = internalCurrentRewardRate(lpAssetId) | |
345 | 352 | let wxEmissionPerBlock = rewardData[0] | |
346 | 353 | let maxFactor = rewardData[1] | |
347 | 354 | let totalLpStaked = rewardData[2] | |
348 | 355 | let votingResultStaked = { | |
349 | 356 | let @ = invoke(boostingDapp, "getVotingResultStakedREADONLY", [lpAssetId], nil) | |
350 | 357 | if ($isInstanceOf(@, "Int")) | |
351 | 358 | then @ | |
352 | 359 | else throw(($getType(@) + " couldn't be cast to Int")) | |
353 | 360 | } | |
354 | 361 | $Tuple2(nil, makeString(["%d%d%d%d", toString(wxEmissionPerBlock), toString(maxFactor), toString(totalLpStaked), toString(votingResultStaked)], SEP)) | |
355 | 362 | } | |
356 | 363 | ||
357 | 364 | ||
358 | 365 | ||
359 | 366 | @Callable(i) | |
360 | 367 | func currentUserRewardRateREADONLY (lpAssetId,userAddress) = { | |
361 | 368 | let rewardData = internalCurrentRewardRate(lpAssetId) | |
362 | 369 | let wxEmissionPerBlock = rewardData[0] | |
363 | 370 | let maxFactor = rewardData[1] | |
364 | 371 | let totalLpStaked = rewardData[2] | |
365 | 372 | let lpStakedByUser = getIntOrZero(stakingDapp, keyStakedByUser(userAddress, lpAssetId)) | |
366 | 373 | let userClaimInfo = split(asString(invoke(stakingDapp, "claimWxREADONLY", [lpAssetId, userAddress], nil)), SEP) | |
367 | 374 | let minRewardPart = valueOrErrorMessage(parseInt(userClaimInfo[5]), "couldn't parse minRewardPart") | |
368 | 375 | let boostRewardPart = valueOrErrorMessage(parseInt(userClaimInfo[6]), "couldn't parse boostRewardPart") | |
369 | 376 | let debug = userClaimInfo[7] | |
370 | 377 | let boostingPower = if ((boostRewardPart == 0)) | |
371 | 378 | then (1 * MULT8) | |
372 | 379 | else fraction((minRewardPart + boostRewardPart), MULT8, minRewardPart) | |
373 | 380 | $Tuple2(nil, makeString(["%d%d%d%d%d%s", toString(wxEmissionPerBlock), toString(maxFactor), toString(totalLpStaked), toString(lpStakedByUser), toString(boostingPower), debug], SEP)) | |
374 | 381 | } | |
375 | 382 | ||
376 | 383 | ||
377 | 384 | ||
378 | 385 | @Callable(i) | |
379 | 386 | func calcBoostBulkInternalREADONLY (currentIter,deltaWxAmountBulk,deltaLockPeriodInBlocksBulk,deltaLpAmountBulk,lpAssetIdOptBulk,userAddressOpt,resAcc) = if ((currentIter == size(deltaWxAmountBulk))) | |
380 | 387 | then $Tuple2(nil, resAcc) | |
381 | 388 | else { | |
382 | 389 | let deltaWxAmount = deltaWxAmountBulk[currentIter] | |
383 | 390 | let deltaLockPeriodInBlocks = deltaLockPeriodInBlocksBulk[currentIter] | |
384 | 391 | let deltaLpAmount = deltaLpAmountBulk[currentIter] | |
385 | 392 | let lpAssetIdOpt = lpAssetIdOptBulk[currentIter] | |
386 | 393 | let info = { | |
387 | 394 | let @ = invoke(this, "calcBoostREADONLY", [deltaWxAmount, deltaLockPeriodInBlocks, deltaLpAmount, lpAssetIdOpt, userAddressOpt], nil) | |
388 | 395 | if ($isInstanceOf(@, "String")) | |
389 | 396 | then @ | |
390 | 397 | else throw(($getType(@) + " couldn't be cast to String")) | |
391 | 398 | } | |
392 | 399 | let res = (resAcc :+ info) | |
393 | 400 | let inv = { | |
394 | 401 | let @ = invoke(this, "calcBoostBulkInternalREADONLY", [(currentIter + 1), deltaWxAmountBulk, deltaLockPeriodInBlocksBulk, deltaLpAmountBulk, lpAssetIdOptBulk, userAddressOpt, res], nil) | |
395 | 402 | if ($isInstanceOf(@, "List[Any]")) | |
396 | 403 | then @ | |
397 | 404 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
398 | 405 | } | |
399 | 406 | if ((inv == inv)) | |
400 | 407 | then $Tuple2(nil, inv) | |
401 | 408 | else throw("Strict value is not equal to itself.") | |
402 | 409 | } | |
403 | 410 | ||
404 | 411 | ||
405 | 412 | ||
406 | 413 | @Callable(i) | |
407 | 414 | func calcBoostBulkREADONLY (deltaWxAmount,deltaLockPeriodInBlocks,deltaLpAmount,lpAssetIdOpt,userAddressOpt) = { | |
408 | 415 | let res = invoke(this, "calcBoostBulkInternalREADONLY", [0, deltaWxAmount, deltaLockPeriodInBlocks, deltaLpAmount, lpAssetIdOpt, userAddressOpt, nil], nil) | |
409 | 416 | $Tuple2(nil, res) | |
410 | 417 | } | |
411 | 418 | ||
412 | 419 | ||
413 | 420 | ||
414 | 421 | @Callable(i) | |
415 | 422 | func calcBoostREADONLY (deltaWxAmount,deltaLockPeriodInBlocks,deltaLpAmount,lpAssetIdOpt,userAddressOpt) = { | |
416 | 423 | let boostCoeff = { | |
417 | 424 | let @ = invoke(emissionDapp, "getBoostCoeffREADONLY", nil, nil) | |
418 | 425 | if ($isInstanceOf(@, "Int")) | |
419 | 426 | then @ | |
420 | 427 | else throw(($getType(@) + " couldn't be cast to Int")) | |
421 | 428 | } | |
422 | 429 | let mathDapp = gwxRewardDapp | |
423 | 430 | let EMPTYSTR = "empty" | |
424 | 431 | let maxLockDurationInBlocks = parseIntValue(split(getStringByAddressOrFail(boostingDapp, keyBoostCfg()), SEP)[4]) | |
425 | 432 | let lpAssetIdStr = if ((lpAssetIdOpt == "")) | |
426 | 433 | then EMPTYSTR | |
427 | 434 | else lpAssetIdOpt | |
428 | 435 | let userAddressStr = if ((userAddressOpt == "")) | |
429 | 436 | then EMPTYSTR | |
430 | 437 | else userAddressOpt | |
431 | 438 | let userNumStr = valueOrElse(getString(boostingDapp, keyUser2NumMapping(userAddressOpt)), EMPTYSTR) | |
432 | 439 | let userAmount = valueOrElse(getInteger(boostingDapp, keyLockParamUserAmount(userNumStr)), 0) | |
433 | 440 | let lockStart = valueOrElse(getInteger(boostingDapp, keyLockParamStartBlock(userNumStr)), height) | |
434 | 441 | let lockDuration = valueOrElse(getInteger(boostingDapp, keyLockParamDuration(userNumStr)), 0) | |
435 | 442 | let lockEnd = (lockStart + lockDuration) | |
436 | 443 | let remainingDuration = max([(lockEnd - height), 0]) | |
437 | 444 | let userAmountNew = (userAmount + deltaWxAmount) | |
438 | 445 | let lockDurationNew = min([(remainingDuration + deltaLockPeriodInBlocks), maxLockDurationInBlocks]) | |
439 | 446 | let userCurrgWxAmount = asInt(asAnyList(invoke(boostingDapp, "gwxUserInfoREADONLY", [userAddressStr], nil))[0]) | |
440 | 447 | let gWxAmountStartNew = calcGwxAmountStartREADONLY(userAmountNew, lockDurationNew, maxLockDurationInBlocks)[0] | |
441 | 448 | let totalCachedGwx = { | |
442 | 449 | let @ = invoke(boostingDapp, "getTotalCachedGwxREADONLY", nil, nil) | |
443 | 450 | if ($isInstanceOf(@, "Int")) | |
444 | 451 | then @ | |
445 | 452 | else throw(($getType(@) + " couldn't be cast to Int")) | |
446 | 453 | } | |
447 | 454 | let MULT3 = 1000 | |
448 | 455 | let wxEmissionPerBlockX3 = (getIntOrFail(emissionDapp, keyEmissionRatePerBlockCurrent()) * MULT3) | |
449 | 456 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
450 | 457 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
451 | 458 | let stakedByUser = readStaked(stakingDapp, stakedByUserKEY) | |
452 | 459 | let stakedTotal = readStaked(stakingDapp, stakedTotalKEY) | |
453 | 460 | let poolWeight = if ((lpAssetIdStr != EMPTYSTR)) | |
454 | 461 | then { | |
455 | 462 | let poolAddressStr = valueOrErrorMessage(getString(factoryDapp, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
456 | 463 | getIntegerValue(factoryDapp, keyFactoryPoolWeight(poolAddressStr)) | |
457 | 464 | } | |
458 | 465 | else 0 | |
459 | 466 | let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * boostCoeff)) | |
460 | 467 | let wxPerLpX3 = if ((stakedTotal != 0)) | |
461 | 468 | then fraction(poolWxEmissionPerBlockX3, MULT8, stakedTotal) | |
462 | 469 | else 0 | |
463 | 470 | let userWxPerBlockX3 = fraction(wxPerLpX3, stakedByUser, MULT8) | |
464 | 471 | let boostEmissionPerBlockX3 = (poolWxEmissionPerBlockX3 * (boostCoeff - 1)) | |
465 | 472 | let tmpUserBoostPerBlockX3 = fraction(userCurrgWxAmount, boostEmissionPerBlockX3, totalCachedGwx) | |
466 | 473 | let userBoostPerBlockX3 = min([tmpUserBoostPerBlockX3, (userWxPerBlockX3 * (boostCoeff - 1))]) | |
467 | 474 | let userBoostCoeff = if ((userWxPerBlockX3 == 0)) | |
468 | 475 | then (1 * MULT8) | |
469 | 476 | else fraction((userBoostPerBlockX3 + userWxPerBlockX3), MULT8, userWxPerBlockX3) | |
470 | 477 | $Tuple2(nil, makeString(["%d%d%s", toString(gWxAmountStartNew), toString(userBoostCoeff), "d"], SEP)) | |
471 | 478 | } | |
472 | 479 | ||
473 | 480 | ||
474 | 481 | ||
475 | 482 | @Callable(i) | |
476 | 483 | func wxEmissionStatsREADONLY () = { | |
477 | 484 | let ONEMULT = toString(MULT8) | |
478 | 485 | let ONE = "1" | |
479 | 486 | let wxEmissionPerBlock = getIntOrFail(emissionDapp, keyEmissionRatePerBlockCurrent()) | |
480 | 487 | let emissionStartBlock = getIntOrFail(emissionDapp, keyEmissionStartBlock()) | |
481 | 488 | let passedBlocks = if ((emissionStartBlock > height)) | |
482 | 489 | then 0 | |
483 | 490 | else (height - emissionStartBlock) | |
484 | 491 | let teamEmDuration = (1440 * 365) | |
485 | 492 | let teamEmMax = (201000000 * MULT8) | |
486 | 493 | let teamEm = if ((passedBlocks > teamEmDuration)) | |
487 | 494 | then teamEmMax | |
488 | 495 | else fraction(teamEmMax, passedBlocks, teamEmDuration) | |
489 | 496 | let totalWxReleased = ((wxEmissionPerBlock * passedBlocks) + teamEm) | |
490 | 497 | let totalWxLocked = getIntOrZero(boostingDapp, keyBoostingLockParamTotalAmount()) | |
491 | 498 | let locksDurationSumInBlocks = getIntOrZero(boostingDapp, keyBoostingStatsLocksDurationSumInBlocks()) | |
492 | 499 | let locksCount = getIntOrZero(boostingDapp, keyBoostingStatsLocksCount()) | |
493 | 500 | $Tuple2(nil, makeString(["%d%d%d%d", toString(totalWxReleased), toString(totalWxLocked), toString(locksDurationSumInBlocks), toString(locksCount)], SEP)) | |
494 | 501 | } | |
495 | 502 | ||
496 | 503 | ||
497 | 504 | ||
498 | 505 | @Callable(i) | |
499 | 506 | func poolStatsREADONLY (lpAsset) = { | |
500 | 507 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAsset))) | |
501 | 508 | let status = { | |
502 | 509 | let @ = invoke(factoryDapp, "getPoolStatusREADONLY", [toString(poolAddress)], nil) | |
503 | 510 | if ($isInstanceOf(@, "Int")) | |
504 | 511 | then @ | |
505 | 512 | else throw(($getType(@) + " couldn't be cast to Int")) | |
506 | 513 | } | |
507 | 514 | let tpl = "%d%d%d%d%d%d%d%d%d%s" | |
508 | 515 | if ((status == 4)) | |
509 | 516 | 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 | 517 | else { | |
511 | 518 | let cfg = asAnyList(invoke(poolAddress, "getPoolConfigWrapperREADONLY", nil, nil)) | |
512 | 519 | let lpAssetId = fromBase58String(asString(cfg[idxPoolLPAssetId])) | |
513 | 520 | let amtAssetId = asString(cfg[idxAmtAssetId]) | |
514 | 521 | let priceAssetId = asString(cfg[idxPriceAssetId]) | |
515 | 522 | let iAmtAssetId = asString(cfg[idxIAmtAssetId]) | |
516 | 523 | let iPriceAssetId = asString(cfg[idxIPriceAssetId]) | |
517 | 524 | let amtAssetDcm = parseIntValue(asString(cfg[idxAmtAssetDcm])) | |
518 | 525 | let priceAssetDcm = parseIntValue(asString(cfg[idxPriceAssetDcm])) | |
519 | 526 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
520 | 527 | let accAmtAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [amtAssetId], nil)) | |
521 | 528 | let accPriceAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [priceAssetId], nil)) | |
522 | 529 | let pricesList = if ((poolLPBalance == 0)) | |
523 | 530 | then [toString(zeroBigInt), toString(zeroBigInt), toString(zeroBigInt)] | |
524 | 531 | else asAnyList(invoke(poolAddress, "calcPricesWrapperREADONLY", [accAmtAssetBalance, accPriceAssetBalance, poolLPBalance], nil)) | |
525 | 532 | let curPrice = 0 | |
526 | 533 | let lpAmtAssetShare = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [pricesList[1], MULT8], nil)) | |
527 | 534 | let lpPriceAssetShare = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [pricesList[2], MULT8], nil)) | |
528 | 535 | let poolWeight = getIntegerValue(factoryDapp, keyFactoryPoolWeight(toString(poolAddress))) | |
529 | 536 | let inFee = getPoolInFee(poolAddress) | |
530 | 537 | let outFee = getPoolOutFee(poolAddress) | |
531 | 538 | let poolOneTokenOperationsDisabled = { | |
532 | 539 | let @ = invoke(factoryDapp, "isPoolOneTokenOperationsDisabledREADONLY", [toString(poolAddress)], nil) | |
533 | 540 | if ($isInstanceOf(@, "Boolean")) | |
534 | 541 | then @ | |
535 | 542 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
536 | 543 | } | |
537 | 544 | let poolOneTokenOperationsEnabled = !(poolOneTokenOperationsDisabled) | |
538 | 545 | $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 | 546 | } | |
540 | 547 | } | |
541 | 548 | ||
542 | 549 | ||
543 | 550 | ||
544 | 551 | @Callable(i) | |
545 | 552 | func poolEvaluatePutByAmountAssetREADONLY (lpAsset,inAmAssetAmt) = { | |
546 | 553 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAsset))) | |
547 | 554 | let cfg = asAnyList(invoke(poolAddress, "getPoolConfigWrapperREADONLY", nil, nil)) | |
548 | 555 | let lpAssetId = fromBase58String(asString(cfg[idxPoolLPAssetId])) | |
549 | 556 | let amAssetIdStr = asString(cfg[idxAmtAssetId]) | |
550 | 557 | let amAssetId = fromBase58String(amAssetIdStr) | |
551 | 558 | let prAssetIdStr = asString(cfg[idxPriceAssetId]) | |
552 | 559 | let prAssetId = fromBase58String(prAssetIdStr) | |
553 | 560 | let amtAssetDcm = parseIntValue(asString(cfg[idxAmtAssetDcm])) | |
554 | 561 | let priceAssetDcm = parseIntValue(asString(cfg[idxPriceAssetDcm])) | |
555 | 562 | let poolStatus = asString(cfg[idxPoolStatus]) | |
556 | 563 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
557 | 564 | let accAmtAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [amAssetIdStr], nil)) | |
558 | 565 | let accPriceAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [prAssetIdStr], nil)) | |
559 | 566 | let amtAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [accAmtAssetBalance, amtAssetDcm], nil))) | |
560 | 567 | let priceAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [accPriceAssetBalance, priceAssetDcm], nil))) | |
561 | 568 | let curPriceX18 = if ((poolLPBalance == 0)) | |
562 | 569 | then zeroBigInt | |
563 | 570 | else parseBigIntValue(asString(invoke(poolAddress, "calcPriceBigIntWrapperREADONLY", [toString(priceAssetAmtX18), toString(amtAssetAmtX18)], nil))) | |
564 | 571 | let curPrice = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(curPriceX18), MULT8], nil)) | |
565 | 572 | let inAmAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [inAmAssetAmt, amtAssetDcm], nil))) | |
566 | 573 | let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, MULT18) | |
567 | 574 | let inPrAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inPrAssetAmtX18), priceAssetDcm], nil)) | |
568 | 575 | let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil) | |
569 | - | let $ | |
576 | + | let $t02287323226 = match res { | |
570 | 577 | case _ => | |
571 | 578 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
572 | 579 | then if ($isInstanceOf($match0._3, "Int")) | |
573 | 580 | then if ($isInstanceOf($match0._4, "Int")) | |
574 | 581 | then if ($isInstanceOf($match0._5, "Int")) | |
575 | 582 | then $isInstanceOf($match0._6, "Int") | |
576 | 583 | else false | |
577 | 584 | else false | |
578 | 585 | else false | |
579 | 586 | else false) | |
580 | 587 | then (size($match0) == 13) | |
581 | 588 | else false) | |
582 | 589 | then { | |
583 | 590 | let calcLpAmt = $match0._1 | |
584 | 591 | let curPriceCalc = $match0._3 | |
585 | 592 | let amBalance = $match0._4 | |
586 | 593 | let prBalance = $match0._5 | |
587 | 594 | let lpEmission = $match0._6 | |
588 | 595 | $Tuple5(calcLpAmt, curPriceCalc, amBalance, prBalance, lpEmission) | |
589 | 596 | } | |
590 | 597 | else throw("Couldn't cast types") | |
591 | 598 | } | |
592 | - | let calcLpAmt = $ | |
593 | - | let curPriceCalc = $ | |
594 | - | let amBalance = $ | |
595 | - | let prBalance = $ | |
596 | - | let lpEmission = $ | |
599 | + | let calcLpAmt = $t02287323226._1 | |
600 | + | let curPriceCalc = $t02287323226._2 | |
601 | + | let amBalance = $t02287323226._3 | |
602 | + | let prBalance = $t02287323226._4 | |
603 | + | let lpEmission = $t02287323226._5 | |
597 | 604 | $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 | 605 | } | |
599 | 606 | ||
600 | 607 | ||
601 | 608 | ||
602 | 609 | @Callable(i) | |
603 | 610 | func poolEvaluatePutByPriceAssetREADONLY (lpAsset,inPrAssetAmt) = { | |
604 | 611 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAsset))) | |
605 | 612 | let cfg = asAnyList(invoke(poolAddress, "getPoolConfigWrapperREADONLY", nil, nil)) | |
606 | 613 | let lpAssetId = fromBase58String(asString(cfg[idxPoolLPAssetId])) | |
607 | 614 | let amAssetIdStr = asString(cfg[idxAmtAssetId]) | |
608 | 615 | let amAssetId = fromBase58String(amAssetIdStr) | |
609 | 616 | let prAssetIdStr = asString(cfg[idxPriceAssetId]) | |
610 | 617 | let prAssetId = fromBase58String(prAssetIdStr) | |
611 | 618 | let amtAssetDcm = parseIntValue(asString(cfg[idxAmtAssetDcm])) | |
612 | 619 | let priceAssetDcm = parseIntValue(asString(cfg[idxPriceAssetDcm])) | |
613 | 620 | let poolStatus = asString(cfg[idxPoolStatus]) | |
614 | 621 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
615 | 622 | let amBalanceRaw = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [amAssetIdStr], nil)) | |
616 | 623 | let prBalanceRaw = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [prAssetIdStr], nil)) | |
617 | 624 | let amBalanceRawX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [amBalanceRaw, amtAssetDcm], nil))) | |
618 | 625 | let prBalanceRawX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [prBalanceRaw, priceAssetDcm], nil))) | |
619 | 626 | let curPriceX18 = if ((poolLPBalance == 0)) | |
620 | 627 | then zeroBigInt | |
621 | 628 | else parseBigIntValue(asString(invoke(poolAddress, "calcPriceBigIntWrapperREADONLY", [toString(prBalanceRawX18), toString(amBalanceRawX18)], nil))) | |
622 | 629 | let curPrice = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(curPriceX18), MULT8], nil)) | |
623 | 630 | let inPrAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [inPrAssetAmt, priceAssetDcm], nil))) | |
624 | 631 | let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, MULT18, curPriceX18) | |
625 | 632 | let inAmAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inAmAssetAmtX18), amtAssetDcm], nil)) | |
626 | 633 | let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil) | |
627 | - | let $ | |
634 | + | let $t02579926152 = match res { | |
628 | 635 | case _ => | |
629 | 636 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
630 | 637 | then if ($isInstanceOf($match0._3, "Int")) | |
631 | 638 | then if ($isInstanceOf($match0._4, "Int")) | |
632 | 639 | then if ($isInstanceOf($match0._5, "Int")) | |
633 | 640 | then $isInstanceOf($match0._6, "Int") | |
634 | 641 | else false | |
635 | 642 | else false | |
636 | 643 | else false | |
637 | 644 | else false) | |
638 | 645 | then (size($match0) == 13) | |
639 | 646 | else false) | |
640 | 647 | then { | |
641 | 648 | let calcLpAmt = $match0._1 | |
642 | 649 | let curPriceCalc = $match0._3 | |
643 | 650 | let amBalance = $match0._4 | |
644 | 651 | let prBalance = $match0._5 | |
645 | 652 | let lpEmission = $match0._6 | |
646 | 653 | $Tuple5(calcLpAmt, curPriceCalc, amBalance, prBalance, lpEmission) | |
647 | 654 | } | |
648 | 655 | else throw("Couldn't cast types") | |
649 | 656 | } | |
650 | - | let calcLpAmt = $ | |
651 | - | let curPriceCalc = $ | |
652 | - | let amBalance = $ | |
653 | - | let prBalance = $ | |
654 | - | let lpEmission = $ | |
657 | + | let calcLpAmt = $t02579926152._1 | |
658 | + | let curPriceCalc = $t02579926152._2 | |
659 | + | let amBalance = $t02579926152._3 | |
660 | + | let prBalance = $t02579926152._4 | |
661 | + | let lpEmission = $t02579926152._5 | |
655 | 662 | $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 | 663 | } | |
657 | 664 | ||
658 | 665 | ||
659 | 666 | ||
660 | 667 | @Callable(i) | |
661 | 668 | func poolEvaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = { | |
662 | 669 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(paymentLpAssetId))) | |
663 | 670 | let res = invoke(poolAddress, "estimateGetOperationWrapperREADONLY", ["", paymentLpAssetId, paymentLpAmt, toString(poolAddress)], nil) | |
664 | - | let $ | |
671 | + | let $t02684727264 = match res { | |
665 | 672 | case _ => | |
666 | 673 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
667 | 674 | then if ($isInstanceOf($match0._2, "Int")) | |
668 | 675 | then if ($isInstanceOf($match0._5, "Int")) | |
669 | 676 | then if ($isInstanceOf($match0._6, "Int")) | |
670 | 677 | then if ($isInstanceOf($match0._7, "Int")) | |
671 | 678 | then if ($isInstanceOf($match0._8, "String")) | |
672 | 679 | then $isInstanceOf($match0._9, "String") | |
673 | 680 | else false | |
674 | 681 | else false | |
675 | 682 | else false | |
676 | 683 | else false | |
677 | 684 | else false | |
678 | 685 | else false) | |
679 | 686 | then (size($match0) == 10) | |
680 | 687 | else false) | |
681 | 688 | then { | |
682 | 689 | let outAmAmt = $match0._1 | |
683 | 690 | let outPrAmt = $match0._2 | |
684 | 691 | let amBalance = $match0._5 | |
685 | 692 | let prBalance = $match0._6 | |
686 | 693 | let lpEmission = $match0._7 | |
687 | 694 | let curPrice = $match0._8 | |
688 | 695 | let poolStatus = $match0._9 | |
689 | 696 | $Tuple7(outAmAmt, outPrAmt, amBalance, prBalance, lpEmission, curPrice, poolStatus) | |
690 | 697 | } | |
691 | 698 | else throw("Couldn't cast types") | |
692 | 699 | } | |
693 | - | let outAmAmt = $ | |
694 | - | let outPrAmt = $ | |
695 | - | let amBalance = $ | |
696 | - | let prBalance = $ | |
697 | - | let lpEmission = $ | |
698 | - | let curPrice = $ | |
699 | - | let poolStatus = $ | |
700 | + | let outAmAmt = $t02684727264._1 | |
701 | + | let outPrAmt = $t02684727264._2 | |
702 | + | let amBalance = $t02684727264._3 | |
703 | + | let prBalance = $t02684727264._4 | |
704 | + | let lpEmission = $t02684727264._5 | |
705 | + | let curPrice = $t02684727264._6 | |
706 | + | let poolStatus = $t02684727264._7 | |
700 | 707 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(outAmAmt), toString(outPrAmt), toString(amBalance), toString(prBalance), toString(lpEmission), curPrice, poolStatus], SEP)) | |
701 | 708 | } | |
702 | 709 | ||
703 | 710 | ||
704 | 711 | ||
705 | 712 | @Callable(i) | |
706 | 713 | func gwxUserInfoREADONLY (userAddress) = { | |
707 | 714 | let gwxUserInfoLIST = asAnyList(invoke(boostingDapp, "gwxUserInfoREADONLY", [userAddress], nil)) | |
708 | 715 | let gwxAmount = asInt(gwxUserInfoLIST[0]) | |
709 | 716 | $Tuple2(nil, makeString(["%d", toString(gwxAmount)], SEP)) | |
710 | 717 | } | |
711 | 718 | ||
712 | 719 | ||
713 | 720 | ||
714 | 721 | @Callable(i) | |
715 | 722 | func unstakeAndGetOneTknV2 (poolAddress,unstakeAmount,outAssetId,minOutAmount) = { | |
716 | 723 | let inv = invoke(addressFromStringValue(poolAddress), "unstakeAndGetOneTknV2", [unstakeAmount, outAssetId, minOutAmount], nil) | |
717 | 724 | if ((inv == inv)) | |
718 | 725 | then $Tuple2(nil, unit) | |
719 | 726 | else throw("Strict value is not equal to itself.") | |
720 | 727 | } | |
721 | 728 | ||
722 | 729 | ||
723 | 730 | ||
724 | 731 | @Callable(i) | |
725 | 732 | func getKeysBulkInternal (currentIter,keys,resAcc) = if ((currentIter == size(keys))) | |
726 | 733 | then $Tuple2(nil, resAcc) | |
727 | 734 | else { | |
728 | 735 | let k = split(keys[currentIter], "++") | |
729 | 736 | let addr = addressFromStringValue(k[0]) | |
730 | 737 | let key = k[1] | |
731 | 738 | let type = k[2] | |
732 | 739 | let val = getKey(addr, key, type) | |
733 | 740 | let res = (resAcc :+ val) | |
734 | 741 | let inv = invoke(this, "getKeysBulkInternal", [(currentIter + 1), keys, res], nil) | |
735 | 742 | if ((inv == inv)) | |
736 | 743 | then $Tuple2(nil, inv) | |
737 | 744 | else throw("Strict value is not equal to itself.") | |
738 | 745 | } | |
739 | 746 | ||
740 | 747 | ||
741 | 748 | ||
742 | 749 | @Callable(i) | |
743 | 750 | func getKeysBulk (keys) = { | |
744 | 751 | let res = invoke(this, "getKeysBulkInternal", [0, keys, nil], nil) | |
745 | 752 | $Tuple2(nil, res) | |
746 | 753 | } | |
747 | 754 | ||
748 | 755 | ||
749 | 756 | ||
750 | 757 | @Callable(i) | |
751 | 758 | func setManager (pendingManagerPublicKey) = { | |
752 | 759 | let checkCaller = mustManager(i) | |
753 | 760 | if ((checkCaller == checkCaller)) | |
754 | 761 | then { | |
755 | 762 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
756 | 763 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
757 | 764 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
758 | 765 | else throw("Strict value is not equal to itself.") | |
759 | 766 | } | |
760 | 767 | else throw("Strict value is not equal to itself.") | |
761 | 768 | } | |
762 | 769 | ||
763 | 770 | ||
764 | 771 | ||
765 | 772 | @Callable(i) | |
766 | 773 | func confirmManager () = { | |
767 | 774 | let pm = pendingManagerPublicKeyOrUnit() | |
768 | 775 | let hasPM = if (isDefined(pm)) | |
769 | 776 | then true | |
770 | 777 | else throw("No pending manager") | |
771 | 778 | if ((hasPM == hasPM)) | |
772 | 779 | then { | |
773 | 780 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
774 | 781 | then true | |
775 | 782 | else throw("You are not pending manager") | |
776 | 783 | if ((checkPM == checkPM)) | |
777 | 784 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
778 | 785 | else throw("Strict value is not equal to itself.") | |
779 | 786 | } | |
780 | 787 | else throw("Strict value is not equal to itself.") | |
781 | 788 | } | |
782 | 789 | ||
783 | 790 | ||
784 | 791 | @Verifier(tx) | |
785 | 792 | func verify () = { | |
786 | 793 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
787 | 794 | case pk: ByteVector => | |
788 | 795 | pk | |
789 | 796 | case _: Unit => | |
790 | 797 | tx.senderPublicKey | |
791 | 798 | case _ => | |
792 | 799 | throw("Match error") | |
793 | 800 | } | |
794 | 801 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
795 | 802 | } | |
796 | 803 |
github/deemru/w8io/169f3d6 121.97 ms ◑