tx · FhPwoLPNswri7oXo6thhRsowpo7MmaqYx8egkmUd3Bvs 3MsNhK6uve98J6DeqbuwGFBRh9GoHPGUFgp: -0.02300000 Waves 2023.02.20 16:54 [2458061] smart account 3MsNhK6uve98J6DeqbuwGFBRh9GoHPGUFgp > SELF 0.00000000 Waves
{ "type": 13, "id": "FhPwoLPNswri7oXo6thhRsowpo7MmaqYx8egkmUd3Bvs", "fee": 2300000, "feeAssetId": null, "timestamp": 1676901257131, "version": 2, "chainId": 84, "sender": "3MsNhK6uve98J6DeqbuwGFBRh9GoHPGUFgp", "senderPublicKey": "86RHVxKovtU7yKnepY8wKsd8niDxGAsiwuA1XA1DNqrS", "proofs": [ "3418o6W7Uw1pbrmCjKfhCZKxiEK8pZk5c32YwGpm1dUGzEyhbqGPwPvayVxTQz4jyhtqbVu8j6YWT4EMsYGR4kSv" ], "script": "base64:BgKPIggCEgMKAQgSAwoBCBIECgIICBIJCgcBERERGAgYEgcKBRERERgIEgcKBQEBAQgIEgASAwoBCBIECgIIARIECgIIARIECgIIARIDCgEIEgYKBAgBCAESBQoDARgYEgMKARgSAwoBCBIAIgZTQ0FMRTgiBU1VTFQ4IgdTQ0FMRTE4IgZNVUxUMTgiA1NFUCIOUE9PTFdFSUdIVE1VTFQiCnplcm9CaWdJbnQiDmlkeFBvb2xBZGRyZXNzIg1pZHhQb29sU3RhdHVzIhBpZHhQb29sTFBBc3NldElkIg1pZHhBbXRBc3NldElkIg9pZHhQcmljZUFzc2V0SWQiDmlkeEFtdEFzc2V0RGNtIhBpZHhQcmljZUFzc2V0RGNtIg5pZHhJQW10QXNzZXRJZCIQaWR4SVByaWNlQXNzZXRJZCINaWR4TFBBc3NldERjbSIPZ2V0U3RyaW5nT3JGYWlsIgNrZXkiGGdldFN0cmluZ0J5QWRkcmVzc09yRmFpbCIHYWRkcmVzcyIMZ2V0SW50T3JaZXJvIgxnZXRJbnRPckZhaWwiCWFzQW55TGlzdCIDdmFsIgckbWF0Y2gwIgp2YWxBbn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2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAmVkCWJvZHlCeXRlcwkAkQMCCAUCZWQGcHJvb2ZzAAAFAmVm12kILA==", "height": 2458061, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2WczFfc61PGZL5P7As5wtFQX3TKmjE5u7KZyKeXHA3ET Next: 9wffeaxtZvF138KggTXUBRUQ8aawWewMwA2HhPnhHix8 Diff:
Old | New | Differences | |
---|---|---|---|
402 | 402 | ||
403 | 403 | @Callable(i) | |
404 | 404 | func calcBoostREADONLY (deltaWxAmount,deltaLockPeriodInBlocks,deltaLpAmount,lpAssetIdOpt,userAddressOpt) = { | |
405 | - | let boostCoeff = { | |
406 | - | let @ = invoke(emissionDapp, "getBoostCoeffREADONLY", nil, nil) | |
407 | - | if ($isInstanceOf(@, "Int")) | |
408 | - | then @ | |
409 | - | else throw(($getType(@) + " couldn't be cast to Int")) | |
410 | - | } | |
411 | 405 | let mathDapp = gwxRewardDapp | |
412 | 406 | let EMPTYSTR = "empty" | |
413 | 407 | let maxLockDurationInBlocks = parseIntValue(split(getStringByAddressOrFail(boostingDapp, keyBoostCfg()), SEP)[4]) | |
463 | 457 | let boostEmissionPerBlockX3 = (poolWxEmissionPerBlockX3 * 2) | |
464 | 458 | let tmpUserBoostPerBlockX3 = fraction(gWxAmountStartNew, boostEmissionPerBlockX3, (totalCachedGwx + gWxAmountDiff)) | |
465 | 459 | let userBoostPerBlockX3 = min([tmpUserBoostPerBlockX3, (userWxPerBlockX3 * 2)]) | |
466 | - | let | |
460 | + | let boostCoeff = if ((userWxPerBlockX3 == 0)) | |
467 | 461 | then (1 * MULT8) | |
468 | 462 | else fraction((userBoostPerBlockX3 + userWxPerBlockX3), MULT8, userWxPerBlockX3) | |
469 | - | $Tuple2(nil, makeString(["%d%d%s", toString(gWxAmountStartNew), toString( | |
463 | + | $Tuple2(nil, makeString(["%d%d%s", toString(gWxAmountStartNew), toString(boostCoeff), "d"], SEP)) | |
470 | 464 | } | |
471 | 465 | ||
472 | 466 | ||
565 | 559 | let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, MULT18) | |
566 | 560 | let inPrAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inPrAssetAmtX18), priceAssetDcm], nil)) | |
567 | 561 | let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil) | |
568 | - | let $ | |
562 | + | let $t02336423717 = match res { | |
569 | 563 | case _ => | |
570 | 564 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
571 | 565 | then if ($isInstanceOf($match0._3, "Int")) | |
588 | 582 | } | |
589 | 583 | else throw("Couldn't cast types") | |
590 | 584 | } | |
591 | - | let calcLpAmt = $ | |
592 | - | let curPriceCalc = $ | |
593 | - | let amBalance = $ | |
594 | - | let prBalance = $ | |
595 | - | let lpEmission = $ | |
585 | + | let calcLpAmt = $t02336423717._1 | |
586 | + | let curPriceCalc = $t02336423717._2 | |
587 | + | let amBalance = $t02336423717._3 | |
588 | + | let prBalance = $t02336423717._4 | |
589 | + | let lpEmission = $t02336423717._5 | |
596 | 590 | $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)) | |
597 | 591 | } | |
598 | 592 | ||
623 | 617 | let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, MULT18, curPriceX18) | |
624 | 618 | let inAmAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inAmAssetAmtX18), amtAssetDcm], nil)) | |
625 | 619 | let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil) | |
626 | - | let $ | |
620 | + | let $t02629026643 = match res { | |
627 | 621 | case _ => | |
628 | 622 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
629 | 623 | then if ($isInstanceOf($match0._3, "Int")) | |
646 | 640 | } | |
647 | 641 | else throw("Couldn't cast types") | |
648 | 642 | } | |
649 | - | let calcLpAmt = $ | |
650 | - | let curPriceCalc = $ | |
651 | - | let amBalance = $ | |
652 | - | let prBalance = $ | |
653 | - | let lpEmission = $ | |
643 | + | let calcLpAmt = $t02629026643._1 | |
644 | + | let curPriceCalc = $t02629026643._2 | |
645 | + | let amBalance = $t02629026643._3 | |
646 | + | let prBalance = $t02629026643._4 | |
647 | + | let lpEmission = $t02629026643._5 | |
654 | 648 | $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)) | |
655 | 649 | } | |
656 | 650 | ||
660 | 654 | func poolEvaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = { | |
661 | 655 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(paymentLpAssetId))) | |
662 | 656 | let res = invoke(poolAddress, "estimateGetOperationWrapperREADONLY", ["", paymentLpAssetId, paymentLpAmt, toString(poolAddress)], nil) | |
663 | - | let $ | |
657 | + | let $t02733827755 = match res { | |
664 | 658 | case _ => | |
665 | 659 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
666 | 660 | then if ($isInstanceOf($match0._2, "Int")) | |
689 | 683 | } | |
690 | 684 | else throw("Couldn't cast types") | |
691 | 685 | } | |
692 | - | let outAmAmt = $ | |
693 | - | let outPrAmt = $ | |
694 | - | let amBalance = $ | |
695 | - | let prBalance = $ | |
696 | - | let lpEmission = $ | |
697 | - | let curPrice = $ | |
698 | - | let poolStatus = $ | |
686 | + | let outAmAmt = $t02733827755._1 | |
687 | + | let outPrAmt = $t02733827755._2 | |
688 | + | let amBalance = $t02733827755._3 | |
689 | + | let prBalance = $t02733827755._4 | |
690 | + | let lpEmission = $t02733827755._5 | |
691 | + | let curPrice = $t02733827755._6 | |
692 | + | let poolStatus = $t02733827755._7 | |
699 | 693 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(outAmAmt), toString(outPrAmt), toString(amBalance), toString(prBalance), toString(lpEmission), curPrice, poolStatus], SEP)) | |
700 | 694 | } | |
701 | 695 |
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 | - | let boostCoeff = { | |
406 | - | let @ = invoke(emissionDapp, "getBoostCoeffREADONLY", nil, nil) | |
407 | - | if ($isInstanceOf(@, "Int")) | |
408 | - | then @ | |
409 | - | else throw(($getType(@) + " couldn't be cast to Int")) | |
410 | - | } | |
411 | 405 | let mathDapp = gwxRewardDapp | |
412 | 406 | let EMPTYSTR = "empty" | |
413 | 407 | let maxLockDurationInBlocks = parseIntValue(split(getStringByAddressOrFail(boostingDapp, keyBoostCfg()), SEP)[4]) | |
414 | 408 | let lpAssetIdStr = if ((lpAssetIdOpt == "")) | |
415 | 409 | then EMPTYSTR | |
416 | 410 | else lpAssetIdOpt | |
417 | 411 | let userAddressStr = if ((userAddressOpt == "")) | |
418 | 412 | then EMPTYSTR | |
419 | 413 | else userAddressOpt | |
420 | 414 | let userNumStr = valueOrElse(getString(boostingDapp, keyUser2NumMapping(userAddressOpt)), EMPTYSTR) | |
421 | 415 | let userAmount = valueOrElse(getInteger(boostingDapp, keyLockParamUserAmount(userNumStr)), 0) | |
422 | 416 | let lockStart = valueOrElse(getInteger(boostingDapp, keyLockParamStartBlock(userNumStr)), height) | |
423 | 417 | let lockDuration = valueOrElse(getInteger(boostingDapp, keyLockParamDuration(userNumStr)), 0) | |
424 | 418 | let lockEnd = (lockStart + lockDuration) | |
425 | 419 | let remainingDuration = max([(lockEnd - height), 0]) | |
426 | 420 | let userAmountNew = (userAmount + deltaWxAmount) | |
427 | 421 | let lockDurationNew = min([(remainingDuration + deltaLockPeriodInBlocks), maxLockDurationInBlocks]) | |
428 | 422 | let userCurrgWxAmount = asInt(asAnyList(invoke(boostingDapp, "gwxUserInfoREADONLY", [userAddressStr], nil))[0]) | |
429 | 423 | let gWxAmountStartNew = calcGwxAmountStartREADONLY(userAmountNew, lockDurationNew, maxLockDurationInBlocks)[0] | |
430 | 424 | let gWxParamsResultList = asAnyList(invoke(mathDapp, "calcGwxParamsREADONLY", [gWxAmountStartNew, height, lockDurationNew], nil)) | |
431 | 425 | let gWxAmountDiff = (gWxAmountStartNew - userCurrgWxAmount) | |
432 | 426 | let k = asInt(gWxParamsResultList[0]) | |
433 | 427 | let b = asInt(gWxParamsResultList[1]) | |
434 | 428 | let period = toString(asInt(gWxParamsResultList[2])) | |
435 | 429 | let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL() | |
436 | 430 | let userMaxBoostIntNew = ((gWxAmountStartNew * lockDurationNew) / 2) | |
437 | 431 | let totalMaxBoostInt = getIntOrZero(boostingDapp, totalMaxBoostIntegralKEY) | |
438 | 432 | let totalCachedGwx = { | |
439 | 433 | let @ = invoke(boostingDapp, "getTotalCachedGwxREADONLY", nil, nil) | |
440 | 434 | if ($isInstanceOf(@, "Int")) | |
441 | 435 | then @ | |
442 | 436 | else throw(($getType(@) + " couldn't be cast to Int")) | |
443 | 437 | } | |
444 | 438 | let MULT3 = 1000 | |
445 | 439 | let wxEmissionPerBlockX3 = (getIntOrFail(emissionDapp, keyEmissionRatePerBlockCurrent()) * MULT3) | |
446 | 440 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
447 | 441 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
448 | 442 | let stakedByUser = readStaked(stakingDapp, stakedByUserKEY) | |
449 | 443 | let stakedTotal = readStaked(stakingDapp, stakedTotalKEY) | |
450 | 444 | let stakedByUserNew = (stakedByUser + deltaLpAmount) | |
451 | 445 | let stakedTotalNew = (stakedTotal + deltaLpAmount) | |
452 | 446 | let poolWeight = if ((lpAssetIdStr != EMPTYSTR)) | |
453 | 447 | then { | |
454 | 448 | let poolAddressStr = valueOrErrorMessage(getString(factoryDapp, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
455 | 449 | getIntegerValue(factoryDapp, keyFactoryPoolWeight(poolAddressStr)) | |
456 | 450 | } | |
457 | 451 | else 0 | |
458 | 452 | let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * 3)) | |
459 | 453 | let wxPerLpX3 = if ((stakedTotalNew != 0)) | |
460 | 454 | then fraction(poolWxEmissionPerBlockX3, MULT8, stakedTotalNew) | |
461 | 455 | else 0 | |
462 | 456 | let userWxPerBlockX3 = fraction(wxPerLpX3, stakedByUserNew, MULT8) | |
463 | 457 | let boostEmissionPerBlockX3 = (poolWxEmissionPerBlockX3 * 2) | |
464 | 458 | let tmpUserBoostPerBlockX3 = fraction(gWxAmountStartNew, boostEmissionPerBlockX3, (totalCachedGwx + gWxAmountDiff)) | |
465 | 459 | let userBoostPerBlockX3 = min([tmpUserBoostPerBlockX3, (userWxPerBlockX3 * 2)]) | |
466 | - | let | |
460 | + | let boostCoeff = if ((userWxPerBlockX3 == 0)) | |
467 | 461 | then (1 * MULT8) | |
468 | 462 | else fraction((userBoostPerBlockX3 + userWxPerBlockX3), MULT8, userWxPerBlockX3) | |
469 | - | $Tuple2(nil, makeString(["%d%d%s", toString(gWxAmountStartNew), toString( | |
463 | + | $Tuple2(nil, makeString(["%d%d%s", toString(gWxAmountStartNew), toString(boostCoeff), "d"], SEP)) | |
470 | 464 | } | |
471 | 465 | ||
472 | 466 | ||
473 | 467 | ||
474 | 468 | @Callable(i) | |
475 | 469 | func wxEmissionStatsREADONLY () = { | |
476 | 470 | let ONEMULT = toString(MULT8) | |
477 | 471 | let ONE = "1" | |
478 | 472 | let wxEmissionPerBlock = getIntOrFail(emissionDapp, keyEmissionRatePerBlockCurrent()) | |
479 | 473 | let emissionStartBlock = getIntOrFail(emissionDapp, keyEmissionStartBlock()) | |
480 | 474 | let passedBlocks = if ((emissionStartBlock > height)) | |
481 | 475 | then 0 | |
482 | 476 | else (height - emissionStartBlock) | |
483 | 477 | let teamEmDuration = (1440 * 365) | |
484 | 478 | let teamEmMax = (201000000 * MULT8) | |
485 | 479 | let teamEm = if ((passedBlocks > teamEmDuration)) | |
486 | 480 | then teamEmMax | |
487 | 481 | else fraction(teamEmMax, passedBlocks, teamEmDuration) | |
488 | 482 | let totalWxReleased = ((wxEmissionPerBlock * passedBlocks) + teamEm) | |
489 | 483 | let totalWxLocked = getIntOrZero(boostingDapp, keyBoostingLockParamTotalAmount()) | |
490 | 484 | let locksDurationSumInBlocks = getIntOrZero(boostingDapp, keyBoostingStatsLocksDurationSumInBlocks()) | |
491 | 485 | let locksCount = getIntOrZero(boostingDapp, keyBoostingStatsLocksCount()) | |
492 | 486 | $Tuple2(nil, makeString(["%d%d%d%d", toString(totalWxReleased), toString(totalWxLocked), toString(locksDurationSumInBlocks), toString(locksCount)], SEP)) | |
493 | 487 | } | |
494 | 488 | ||
495 | 489 | ||
496 | 490 | ||
497 | 491 | @Callable(i) | |
498 | 492 | func poolStatsREADONLY (lpAsset) = { | |
499 | 493 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAsset))) | |
500 | 494 | let status = { | |
501 | 495 | let @ = invoke(factoryDapp, "getPoolStatusREADONLY", [toString(poolAddress)], nil) | |
502 | 496 | if ($isInstanceOf(@, "Int")) | |
503 | 497 | then @ | |
504 | 498 | else throw(($getType(@) + " couldn't be cast to Int")) | |
505 | 499 | } | |
506 | 500 | let tpl = "%d%d%d%d%d%d%d%d%d%s" | |
507 | 501 | if ((status == 4)) | |
508 | 502 | 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)) | |
509 | 503 | else { | |
510 | 504 | let cfg = asAnyList(invoke(poolAddress, "getPoolConfigWrapperREADONLY", nil, nil)) | |
511 | 505 | let lpAssetId = fromBase58String(asString(cfg[idxPoolLPAssetId])) | |
512 | 506 | let amtAssetId = asString(cfg[idxAmtAssetId]) | |
513 | 507 | let priceAssetId = asString(cfg[idxPriceAssetId]) | |
514 | 508 | let iAmtAssetId = asString(cfg[idxIAmtAssetId]) | |
515 | 509 | let iPriceAssetId = asString(cfg[idxIPriceAssetId]) | |
516 | 510 | let amtAssetDcm = parseIntValue(asString(cfg[idxAmtAssetDcm])) | |
517 | 511 | let priceAssetDcm = parseIntValue(asString(cfg[idxPriceAssetDcm])) | |
518 | 512 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
519 | 513 | let accAmtAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [amtAssetId], nil)) | |
520 | 514 | let accPriceAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [priceAssetId], nil)) | |
521 | 515 | let pricesList = if ((poolLPBalance == 0)) | |
522 | 516 | then [toString(zeroBigInt), toString(zeroBigInt), toString(zeroBigInt)] | |
523 | 517 | else asAnyList(invoke(poolAddress, "calcPricesWrapperREADONLY", [accAmtAssetBalance, accPriceAssetBalance, poolLPBalance], nil)) | |
524 | 518 | let curPrice = 0 | |
525 | 519 | let lpAmtAssetShare = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [pricesList[1], MULT8], nil)) | |
526 | 520 | let lpPriceAssetShare = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [pricesList[2], MULT8], nil)) | |
527 | 521 | let poolWeight = getIntegerValue(factoryDapp, keyFactoryPoolWeight(toString(poolAddress))) | |
528 | 522 | let inFee = getPoolInFee(poolAddress) | |
529 | 523 | let outFee = getPoolOutFee(poolAddress) | |
530 | 524 | let poolOneTokenOperationsDisabled = { | |
531 | 525 | let @ = invoke(factoryDapp, "isPoolOneTokenOperationsDisabledREADONLY", [toString(poolAddress)], nil) | |
532 | 526 | if ($isInstanceOf(@, "Boolean")) | |
533 | 527 | then @ | |
534 | 528 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
535 | 529 | } | |
536 | 530 | let poolOneTokenOperationsEnabled = !(poolOneTokenOperationsDisabled) | |
537 | 531 | $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)) | |
538 | 532 | } | |
539 | 533 | } | |
540 | 534 | ||
541 | 535 | ||
542 | 536 | ||
543 | 537 | @Callable(i) | |
544 | 538 | func poolEvaluatePutByAmountAssetREADONLY (lpAsset,inAmAssetAmt) = { | |
545 | 539 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAsset))) | |
546 | 540 | let cfg = asAnyList(invoke(poolAddress, "getPoolConfigWrapperREADONLY", nil, nil)) | |
547 | 541 | let lpAssetId = fromBase58String(asString(cfg[idxPoolLPAssetId])) | |
548 | 542 | let amAssetIdStr = asString(cfg[idxAmtAssetId]) | |
549 | 543 | let amAssetId = fromBase58String(amAssetIdStr) | |
550 | 544 | let prAssetIdStr = asString(cfg[idxPriceAssetId]) | |
551 | 545 | let prAssetId = fromBase58String(prAssetIdStr) | |
552 | 546 | let amtAssetDcm = parseIntValue(asString(cfg[idxAmtAssetDcm])) | |
553 | 547 | let priceAssetDcm = parseIntValue(asString(cfg[idxPriceAssetDcm])) | |
554 | 548 | let poolStatus = asString(cfg[idxPoolStatus]) | |
555 | 549 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
556 | 550 | let accAmtAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [amAssetIdStr], nil)) | |
557 | 551 | let accPriceAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [prAssetIdStr], nil)) | |
558 | 552 | let amtAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [accAmtAssetBalance, amtAssetDcm], nil))) | |
559 | 553 | let priceAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [accPriceAssetBalance, priceAssetDcm], nil))) | |
560 | 554 | let curPriceX18 = if ((poolLPBalance == 0)) | |
561 | 555 | then zeroBigInt | |
562 | 556 | else parseBigIntValue(asString(invoke(poolAddress, "calcPriceBigIntWrapperREADONLY", [toString(priceAssetAmtX18), toString(amtAssetAmtX18)], nil))) | |
563 | 557 | let curPrice = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(curPriceX18), MULT8], nil)) | |
564 | 558 | let inAmAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [inAmAssetAmt, amtAssetDcm], nil))) | |
565 | 559 | let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, MULT18) | |
566 | 560 | let inPrAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inPrAssetAmtX18), priceAssetDcm], nil)) | |
567 | 561 | let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil) | |
568 | - | let $ | |
562 | + | let $t02336423717 = match res { | |
569 | 563 | case _ => | |
570 | 564 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
571 | 565 | then if ($isInstanceOf($match0._3, "Int")) | |
572 | 566 | then if ($isInstanceOf($match0._4, "Int")) | |
573 | 567 | then if ($isInstanceOf($match0._5, "Int")) | |
574 | 568 | then $isInstanceOf($match0._6, "Int") | |
575 | 569 | else false | |
576 | 570 | else false | |
577 | 571 | else false | |
578 | 572 | else false) | |
579 | 573 | then (size($match0) == 13) | |
580 | 574 | else false) | |
581 | 575 | then { | |
582 | 576 | let calcLpAmt = $match0._1 | |
583 | 577 | let curPriceCalc = $match0._3 | |
584 | 578 | let amBalance = $match0._4 | |
585 | 579 | let prBalance = $match0._5 | |
586 | 580 | let lpEmission = $match0._6 | |
587 | 581 | $Tuple5(calcLpAmt, curPriceCalc, amBalance, prBalance, lpEmission) | |
588 | 582 | } | |
589 | 583 | else throw("Couldn't cast types") | |
590 | 584 | } | |
591 | - | let calcLpAmt = $ | |
592 | - | let curPriceCalc = $ | |
593 | - | let amBalance = $ | |
594 | - | let prBalance = $ | |
595 | - | let lpEmission = $ | |
585 | + | let calcLpAmt = $t02336423717._1 | |
586 | + | let curPriceCalc = $t02336423717._2 | |
587 | + | let amBalance = $t02336423717._3 | |
588 | + | let prBalance = $t02336423717._4 | |
589 | + | let lpEmission = $t02336423717._5 | |
596 | 590 | $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)) | |
597 | 591 | } | |
598 | 592 | ||
599 | 593 | ||
600 | 594 | ||
601 | 595 | @Callable(i) | |
602 | 596 | func poolEvaluatePutByPriceAssetREADONLY (lpAsset,inPrAssetAmt) = { | |
603 | 597 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAsset))) | |
604 | 598 | let cfg = asAnyList(invoke(poolAddress, "getPoolConfigWrapperREADONLY", nil, nil)) | |
605 | 599 | let lpAssetId = fromBase58String(asString(cfg[idxPoolLPAssetId])) | |
606 | 600 | let amAssetIdStr = asString(cfg[idxAmtAssetId]) | |
607 | 601 | let amAssetId = fromBase58String(amAssetIdStr) | |
608 | 602 | let prAssetIdStr = asString(cfg[idxPriceAssetId]) | |
609 | 603 | let prAssetId = fromBase58String(prAssetIdStr) | |
610 | 604 | let amtAssetDcm = parseIntValue(asString(cfg[idxAmtAssetDcm])) | |
611 | 605 | let priceAssetDcm = parseIntValue(asString(cfg[idxPriceAssetDcm])) | |
612 | 606 | let poolStatus = asString(cfg[idxPoolStatus]) | |
613 | 607 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
614 | 608 | let amBalanceRaw = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [amAssetIdStr], nil)) | |
615 | 609 | let prBalanceRaw = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [prAssetIdStr], nil)) | |
616 | 610 | let amBalanceRawX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [amBalanceRaw, amtAssetDcm], nil))) | |
617 | 611 | let prBalanceRawX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [prBalanceRaw, priceAssetDcm], nil))) | |
618 | 612 | let curPriceX18 = if ((poolLPBalance == 0)) | |
619 | 613 | then zeroBigInt | |
620 | 614 | else parseBigIntValue(asString(invoke(poolAddress, "calcPriceBigIntWrapperREADONLY", [toString(prBalanceRawX18), toString(amBalanceRawX18)], nil))) | |
621 | 615 | let curPrice = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(curPriceX18), MULT8], nil)) | |
622 | 616 | let inPrAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [inPrAssetAmt, priceAssetDcm], nil))) | |
623 | 617 | let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, MULT18, curPriceX18) | |
624 | 618 | let inAmAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inAmAssetAmtX18), amtAssetDcm], nil)) | |
625 | 619 | let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil) | |
626 | - | let $ | |
620 | + | let $t02629026643 = match res { | |
627 | 621 | case _ => | |
628 | 622 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
629 | 623 | then if ($isInstanceOf($match0._3, "Int")) | |
630 | 624 | then if ($isInstanceOf($match0._4, "Int")) | |
631 | 625 | then if ($isInstanceOf($match0._5, "Int")) | |
632 | 626 | then $isInstanceOf($match0._6, "Int") | |
633 | 627 | else false | |
634 | 628 | else false | |
635 | 629 | else false | |
636 | 630 | else false) | |
637 | 631 | then (size($match0) == 13) | |
638 | 632 | else false) | |
639 | 633 | then { | |
640 | 634 | let calcLpAmt = $match0._1 | |
641 | 635 | let curPriceCalc = $match0._3 | |
642 | 636 | let amBalance = $match0._4 | |
643 | 637 | let prBalance = $match0._5 | |
644 | 638 | let lpEmission = $match0._6 | |
645 | 639 | $Tuple5(calcLpAmt, curPriceCalc, amBalance, prBalance, lpEmission) | |
646 | 640 | } | |
647 | 641 | else throw("Couldn't cast types") | |
648 | 642 | } | |
649 | - | let calcLpAmt = $ | |
650 | - | let curPriceCalc = $ | |
651 | - | let amBalance = $ | |
652 | - | let prBalance = $ | |
653 | - | let lpEmission = $ | |
643 | + | let calcLpAmt = $t02629026643._1 | |
644 | + | let curPriceCalc = $t02629026643._2 | |
645 | + | let amBalance = $t02629026643._3 | |
646 | + | let prBalance = $t02629026643._4 | |
647 | + | let lpEmission = $t02629026643._5 | |
654 | 648 | $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)) | |
655 | 649 | } | |
656 | 650 | ||
657 | 651 | ||
658 | 652 | ||
659 | 653 | @Callable(i) | |
660 | 654 | func poolEvaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = { | |
661 | 655 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(paymentLpAssetId))) | |
662 | 656 | let res = invoke(poolAddress, "estimateGetOperationWrapperREADONLY", ["", paymentLpAssetId, paymentLpAmt, toString(poolAddress)], nil) | |
663 | - | let $ | |
657 | + | let $t02733827755 = match res { | |
664 | 658 | case _ => | |
665 | 659 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
666 | 660 | then if ($isInstanceOf($match0._2, "Int")) | |
667 | 661 | then if ($isInstanceOf($match0._5, "Int")) | |
668 | 662 | then if ($isInstanceOf($match0._6, "Int")) | |
669 | 663 | then if ($isInstanceOf($match0._7, "Int")) | |
670 | 664 | then if ($isInstanceOf($match0._8, "String")) | |
671 | 665 | then $isInstanceOf($match0._9, "String") | |
672 | 666 | else false | |
673 | 667 | else false | |
674 | 668 | else false | |
675 | 669 | else false | |
676 | 670 | else false | |
677 | 671 | else false) | |
678 | 672 | then (size($match0) == 10) | |
679 | 673 | else false) | |
680 | 674 | then { | |
681 | 675 | let outAmAmt = $match0._1 | |
682 | 676 | let outPrAmt = $match0._2 | |
683 | 677 | let amBalance = $match0._5 | |
684 | 678 | let prBalance = $match0._6 | |
685 | 679 | let lpEmission = $match0._7 | |
686 | 680 | let curPrice = $match0._8 | |
687 | 681 | let poolStatus = $match0._9 | |
688 | 682 | $Tuple7(outAmAmt, outPrAmt, amBalance, prBalance, lpEmission, curPrice, poolStatus) | |
689 | 683 | } | |
690 | 684 | else throw("Couldn't cast types") | |
691 | 685 | } | |
692 | - | let outAmAmt = $ | |
693 | - | let outPrAmt = $ | |
694 | - | let amBalance = $ | |
695 | - | let prBalance = $ | |
696 | - | let lpEmission = $ | |
697 | - | let curPrice = $ | |
698 | - | let poolStatus = $ | |
686 | + | let outAmAmt = $t02733827755._1 | |
687 | + | let outPrAmt = $t02733827755._2 | |
688 | + | let amBalance = $t02733827755._3 | |
689 | + | let prBalance = $t02733827755._4 | |
690 | + | let lpEmission = $t02733827755._5 | |
691 | + | let curPrice = $t02733827755._6 | |
692 | + | let poolStatus = $t02733827755._7 | |
699 | 693 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(outAmAmt), toString(outPrAmt), toString(amBalance), toString(prBalance), toString(lpEmission), curPrice, poolStatus], SEP)) | |
700 | 694 | } | |
701 | 695 | ||
702 | 696 | ||
703 | 697 | ||
704 | 698 | @Callable(i) | |
705 | 699 | func gwxUserInfoREADONLY (userAddress) = { | |
706 | 700 | let gwxUserInfoLIST = asAnyList(invoke(boostingDapp, "gwxUserInfoREADONLY", [userAddress], nil)) | |
707 | 701 | let gwxAmount = asInt(gwxUserInfoLIST[0]) | |
708 | 702 | $Tuple2(nil, makeString(["%d", toString(gwxAmount)], SEP)) | |
709 | 703 | } | |
710 | 704 | ||
711 | 705 | ||
712 | 706 | ||
713 | 707 | @Callable(i) | |
714 | 708 | func unstakeAndGetOneTknV2 (poolAddress,unstakeAmount,outAssetId,minOutAmount) = { | |
715 | 709 | let inv = invoke(addressFromStringValue(poolAddress), "unstakeAndGetOneTknV2", [unstakeAmount, outAssetId, minOutAmount], nil) | |
716 | 710 | if ((inv == inv)) | |
717 | 711 | then $Tuple2(nil, unit) | |
718 | 712 | else throw("Strict value is not equal to itself.") | |
719 | 713 | } | |
720 | 714 | ||
721 | 715 | ||
722 | 716 | ||
723 | 717 | @Callable(i) | |
724 | 718 | func getKeysBulkInternal (currentIter,keys,resAcc) = if ((currentIter == size(keys))) | |
725 | 719 | then $Tuple2(nil, resAcc) | |
726 | 720 | else { | |
727 | 721 | let k = split(keys[currentIter], "++") | |
728 | 722 | let addr = addressFromStringValue(k[0]) | |
729 | 723 | let key = k[1] | |
730 | 724 | let type = k[2] | |
731 | 725 | let val = getKey(addr, key, type) | |
732 | 726 | let res = (resAcc :+ val) | |
733 | 727 | let inv = invoke(this, "getKeysBulkInternal", [(currentIter + 1), keys, res], nil) | |
734 | 728 | if ((inv == inv)) | |
735 | 729 | then $Tuple2(nil, inv) | |
736 | 730 | else throw("Strict value is not equal to itself.") | |
737 | 731 | } | |
738 | 732 | ||
739 | 733 | ||
740 | 734 | ||
741 | 735 | @Callable(i) | |
742 | 736 | func getKeysBulk (keys) = { | |
743 | 737 | let res = invoke(this, "getKeysBulkInternal", [0, keys, nil], nil) | |
744 | 738 | $Tuple2(nil, res) | |
745 | 739 | } | |
746 | 740 | ||
747 | 741 | ||
748 | 742 | ||
749 | 743 | @Callable(i) | |
750 | 744 | func setManager (pendingManagerPublicKey) = { | |
751 | 745 | let checkCaller = mustManager(i) | |
752 | 746 | if ((checkCaller == checkCaller)) | |
753 | 747 | then { | |
754 | 748 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
755 | 749 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
756 | 750 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
757 | 751 | else throw("Strict value is not equal to itself.") | |
758 | 752 | } | |
759 | 753 | else throw("Strict value is not equal to itself.") | |
760 | 754 | } | |
761 | 755 | ||
762 | 756 | ||
763 | 757 | ||
764 | 758 | @Callable(i) | |
765 | 759 | func confirmManager () = { | |
766 | 760 | let pm = pendingManagerPublicKeyOrUnit() | |
767 | 761 | let hasPM = if (isDefined(pm)) | |
768 | 762 | then true | |
769 | 763 | else throw("No pending manager") | |
770 | 764 | if ((hasPM == hasPM)) | |
771 | 765 | then { | |
772 | 766 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
773 | 767 | then true | |
774 | 768 | else throw("You are not pending manager") | |
775 | 769 | if ((checkPM == checkPM)) | |
776 | 770 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
777 | 771 | else throw("Strict value is not equal to itself.") | |
778 | 772 | } | |
779 | 773 | else throw("Strict value is not equal to itself.") | |
780 | 774 | } | |
781 | 775 | ||
782 | 776 | ||
783 | 777 | @Verifier(tx) | |
784 | 778 | func verify () = { | |
785 | 779 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
786 | 780 | case pk: ByteVector => | |
787 | 781 | pk | |
788 | 782 | case _: Unit => | |
789 | 783 | tx.senderPublicKey | |
790 | 784 | case _ => | |
791 | 785 | throw("Match error") | |
792 | 786 | } | |
793 | 787 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
794 | 788 | } | |
795 | 789 |
github/deemru/w8io/fabc49c 79.30 ms ◑