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