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