tx · oZphfpjiAh6XS7JGv64HBkSi5Zx1xfzAiYepE8CJrQP 3MsNhK6uve98J6DeqbuwGFBRh9GoHPGUFgp: -0.02200000 Waves 2022.11.01 14:15 [2297978] smart account 3MsNhK6uve98J6DeqbuwGFBRh9GoHPGUFgp > SELF 0.00000000 Waves
{ "type": 13, "id": "oZphfpjiAh6XS7JGv64HBkSi5Zx1xfzAiYepE8CJrQP", "fee": 2200000, "feeAssetId": null, "timestamp": 1667301276590, "version": 1, "sender": "3MsNhK6uve98J6DeqbuwGFBRh9GoHPGUFgp", "senderPublicKey": "86RHVxKovtU7yKnepY8wKsd8niDxGAsiwuA1XA1DNqrS", "proofs": [ "3XvJLca41LH91e76Ar9eypvXw1B29unHpM4G95Y4AFSvqPbRtV3a58WHxWnwFFbdCWoA9nyVNaNFJ45b96bmP1Qe" ], "script": "base64:BgK3IQgCEgMKAQgSAwoBCBIECgIICBIJCgcBERERGAgYEgcKBRERERgIEgcKBQEBAQgIEgASAwoBCBIECgIIARIECgIIARIECgIIARIDCgEIEgMKAQgSACIGU0NBTEU4IgVNVUxUOCIHU0NBTEUxOCIGTVVMVDE4IgNTRVAiDlBPT0xXRUlHSFRNVUxUIgp6ZXJvQmlnSW50Ig5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFzc2V0SWQiEGlkeElQcmljZUFzc2V0SWQiDWlkeExQQXNzZXREY20iD2dldFN0cmluZ09yRmFpbCIDa2V5IhhnZXRTdHJpbmdCeUFkZHJlc3NPckZhaWwiB2FkZHJlc3MiDGdldEludE9yWmVybyIMZ2V0SW50T3JGYWlsIglhc0FueUxpc3QiA3ZhbCIHJG1hdGNoMCIKdmFsQW55THlzdCIFYXNJbnQiBnZhbEludCIIYXNTdHJpbmciBnZhbFN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ECYnUAAwkAAQIFAXoCCkJ5dGVWZWN0b3IEAmJBBQF6BQJiQQMJAAECBQF6AgRVbml0CAUCZFYPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAmRWCWJvZHlCeXRlcwkAkQMCCAUCZFYGcHJvb2ZzAAAFAmRYBNNwrw==", "chainId": 84, "height": 2297978, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EZNFSYbgohqpQ45C95hGygTi21AKPpukwGDFVVBYLwaU Next: Brua41sNS1zpvgVF94FQr2H65z87wYXjzq9tZzQDv4Xg Diff:
Old | New | Differences | |
---|---|---|---|
488 | 488 | let lpPriceAssetShare = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [pricesList[2], MULT8], nil)) | |
489 | 489 | let poolWeight = getIntegerValue(factoryDapp, keyFactoryPoolWeight(toString(poolAddress))) | |
490 | 490 | let fee = getPoolFee(poolAddress) | |
491 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(accAmtAssetBalance), toString(accPriceAssetBalance), toString(poolLPBalance), toString(curPrice), toString(lpAmtAssetShare), toString(lpPriceAssetShare), toString(poolWeight), toString(fee)], SEP)) | |
491 | + | let poolOneTokenOperationsDisabled = { | |
492 | + | let @ = invoke(factoryDapp, "isPoolOneTokenOperationsDisabledREADONLY", [toString(poolAddress)], nil) | |
493 | + | if ($isInstanceOf(@, "Boolean")) | |
494 | + | then @ | |
495 | + | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
496 | + | } | |
497 | + | let poolOneTokenOperationsEnabled = !(poolOneTokenOperationsDisabled) | |
498 | + | $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(fee), toString(poolOneTokenOperationsEnabled)], SEP)) | |
492 | 499 | } | |
493 | 500 | ||
494 | 501 | ||
518 | 525 | let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, MULT18) | |
519 | 526 | let inPrAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inPrAssetAmtX18), priceAssetDcm], nil)) | |
520 | 527 | let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil) | |
521 | - | let $ | |
528 | + | let $t02234622699 = match res { | |
522 | 529 | case _ => | |
523 | 530 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
524 | 531 | then if ($isInstanceOf($match0._3, "Int")) | |
541 | 548 | } | |
542 | 549 | else throw("Couldn't cast types") | |
543 | 550 | } | |
544 | - | let calcLpAmt = $ | |
545 | - | let curPriceCalc = $ | |
546 | - | let amBalance = $ | |
547 | - | let prBalance = $ | |
548 | - | let lpEmission = $ | |
551 | + | let calcLpAmt = $t02234622699._1 | |
552 | + | let curPriceCalc = $t02234622699._2 | |
553 | + | let amBalance = $t02234622699._3 | |
554 | + | let prBalance = $t02234622699._4 | |
555 | + | let lpEmission = $t02234622699._5 | |
549 | 556 | $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)) | |
550 | 557 | } | |
551 | 558 | ||
576 | 583 | let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, MULT18, curPriceX18) | |
577 | 584 | let inAmAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inAmAssetAmtX18), amtAssetDcm], nil)) | |
578 | 585 | let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil) | |
579 | - | let $ | |
586 | + | let $t02527225625 = match res { | |
580 | 587 | case _ => | |
581 | 588 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
582 | 589 | then if ($isInstanceOf($match0._3, "Int")) | |
599 | 606 | } | |
600 | 607 | else throw("Couldn't cast types") | |
601 | 608 | } | |
602 | - | let calcLpAmt = $ | |
603 | - | let curPriceCalc = $ | |
604 | - | let amBalance = $ | |
605 | - | let prBalance = $ | |
606 | - | let lpEmission = $ | |
609 | + | let calcLpAmt = $t02527225625._1 | |
610 | + | let curPriceCalc = $t02527225625._2 | |
611 | + | let amBalance = $t02527225625._3 | |
612 | + | let prBalance = $t02527225625._4 | |
613 | + | let lpEmission = $t02527225625._5 | |
607 | 614 | $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)) | |
608 | 615 | } | |
609 | 616 | ||
613 | 620 | func poolEvaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = { | |
614 | 621 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(paymentLpAssetId))) | |
615 | 622 | let res = invoke(poolAddress, "estimateGetOperationWrapperREADONLY", ["", paymentLpAssetId, paymentLpAmt, toString(poolAddress)], nil) | |
616 | - | let $ | |
623 | + | let $t02632026737 = match res { | |
617 | 624 | case _ => | |
618 | 625 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
619 | 626 | then if ($isInstanceOf($match0._2, "Int")) | |
642 | 649 | } | |
643 | 650 | else throw("Couldn't cast types") | |
644 | 651 | } | |
645 | - | let outAmAmt = $ | |
646 | - | let outPrAmt = $ | |
647 | - | let amBalance = $ | |
648 | - | let prBalance = $ | |
649 | - | let lpEmission = $ | |
650 | - | let curPrice = $ | |
651 | - | let poolStatus = $ | |
652 | + | let outAmAmt = $t02632026737._1 | |
653 | + | let outPrAmt = $t02632026737._2 | |
654 | + | let amBalance = $t02632026737._3 | |
655 | + | let prBalance = $t02632026737._4 | |
656 | + | let lpEmission = $t02632026737._5 | |
657 | + | let curPrice = $t02632026737._6 | |
658 | + | let poolStatus = $t02632026737._7 | |
652 | 659 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(outAmAmt), toString(outPrAmt), toString(amBalance), toString(prBalance), toString(lpEmission), curPrice, poolStatus], SEP)) | |
653 | 660 | } | |
654 | 661 | ||
659 | 666 | let gwxUserInfoLIST = asAnyList(invoke(boostingDapp, "gwxUserInfoREADONLY", [userAddress], nil)) | |
660 | 667 | let gwxAmount = asInt(gwxUserInfoLIST[0]) | |
661 | 668 | $Tuple2(nil, makeString(["%d", toString(gwxAmount)], SEP)) | |
662 | - | } | |
663 | - | ||
664 | - | ||
665 | - | ||
666 | - | @Callable(i) | |
667 | - | func unstakeAndGetOneTknV2 (poolAddress,unstakeAmount,outAssetId,minOutAmount) = { | |
668 | - | let inv = invoke(addressFromStringValue(poolAddress), "unstakeAndGetOneTknV2", [unstakeAmount, outAssetId, minOutAmount], nil) | |
669 | - | if ((inv == inv)) | |
670 | - | then $Tuple2(nil, unit) | |
671 | - | else throw("Strict value is not equal to itself.") | |
672 | 669 | } | |
673 | 670 | ||
674 | 671 |
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 | func getPoolFee (poolAddress) = { | |
232 | 232 | let feeDefault = fraction(5, MULT8, 10000) | |
233 | 233 | let keyFee = "%s__fee" | |
234 | 234 | valueOrElse(getInteger(poolAddress, keyFee), feeDefault) | |
235 | 235 | } | |
236 | 236 | ||
237 | 237 | ||
238 | 238 | let factoryDapp = readFactoryAddressOrFail() | |
239 | 239 | ||
240 | 240 | let factoryCfg = readFactoryCfgOrFail(factoryDapp) | |
241 | 241 | ||
242 | 242 | let emissionDapp = getEmissionAddressOrFail(factoryCfg) | |
243 | 243 | ||
244 | 244 | let stakingDapp = getStakingAddressOrFail(factoryCfg) | |
245 | 245 | ||
246 | 246 | let gwxRewardDapp = getGwxRewardAddressOrFail(factoryCfg) | |
247 | 247 | ||
248 | 248 | let boostingDapp = getBoostingAddressOrFail(factoryCfg) | |
249 | 249 | ||
250 | 250 | func internalCurrentRewardRate (lpAssetId) = { | |
251 | 251 | let poolAddressStr = getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAssetId)) | |
252 | 252 | let poolWeightMult = MULT8 | |
253 | 253 | let poolWeight = getIntegerValue(factoryDapp, keyFactoryPoolWeight(poolAddressStr)) | |
254 | 254 | let wxEmissionPerBlock = getIntOrFail(emissionDapp, keyEmissionRatePerBlockCurrent()) | |
255 | 255 | let wxEmissionPerBlockMax = getIntOrFail(emissionDapp, keyEmissionRatePerBlockMaxCurrent()) | |
256 | 256 | let boostMaxCoeff = 3 | |
257 | 257 | let poolWxEmissionPerBlock = (fraction(wxEmissionPerBlock, poolWeight, poolWeightMult) / boostMaxCoeff) | |
258 | 258 | let poolWxEmissionPerBlockMax = fraction(wxEmissionPerBlockMax, poolWeight, poolWeightMult) | |
259 | 259 | let maxFactor = (boostMaxCoeff * MULT8) | |
260 | 260 | let totalLpStaked = getIntOrZero(stakingDapp, keyStakedTotal(lpAssetId)) | |
261 | 261 | [poolWxEmissionPerBlock, maxFactor, totalLpStaked] | |
262 | 262 | } | |
263 | 263 | ||
264 | 264 | ||
265 | 265 | func calcGwxAmountStartREADONLY (lockAmount,lockDuration,maxLockDuration) = { | |
266 | 266 | let coeffX8 = fraction(lockDuration, MULT8, maxLockDuration) | |
267 | 267 | let gWxAmountStart = fraction(lockAmount, coeffX8, MULT8) | |
268 | 268 | [gWxAmountStart] | |
269 | 269 | } | |
270 | 270 | ||
271 | 271 | ||
272 | 272 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
273 | 273 | case s: String => | |
274 | 274 | fromBase58String(s) | |
275 | 275 | case _: Unit => | |
276 | 276 | unit | |
277 | 277 | case _ => | |
278 | 278 | throw("Match error") | |
279 | 279 | } | |
280 | 280 | ||
281 | 281 | ||
282 | 282 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
283 | 283 | case s: String => | |
284 | 284 | fromBase58String(s) | |
285 | 285 | case _: Unit => | |
286 | 286 | unit | |
287 | 287 | case _ => | |
288 | 288 | throw("Match error") | |
289 | 289 | } | |
290 | 290 | ||
291 | 291 | ||
292 | 292 | func mustManager (i) = { | |
293 | 293 | let pd = throw("Permission denied") | |
294 | 294 | match managerPublicKeyOrUnit() { | |
295 | 295 | case pk: ByteVector => | |
296 | 296 | if ((i.callerPublicKey == pk)) | |
297 | 297 | then true | |
298 | 298 | else pd | |
299 | 299 | case _: Unit => | |
300 | 300 | if ((i.caller == this)) | |
301 | 301 | then true | |
302 | 302 | else pd | |
303 | 303 | case _ => | |
304 | 304 | throw("Match error") | |
305 | 305 | } | |
306 | 306 | } | |
307 | 307 | ||
308 | 308 | ||
309 | 309 | @Callable(i) | |
310 | 310 | func constructor (factoryAddress) = { | |
311 | 311 | let checkCaller = mustManager(i) | |
312 | 312 | if ((checkCaller == checkCaller)) | |
313 | 313 | then [StringEntry(keyFactoryAddress(), factoryAddress)] | |
314 | 314 | else throw("Strict value is not equal to itself.") | |
315 | 315 | } | |
316 | 316 | ||
317 | 317 | ||
318 | 318 | ||
319 | 319 | @Callable(i) | |
320 | 320 | func currentRewardRateREADONLY (lpAssetId) = { | |
321 | 321 | let rewardData = internalCurrentRewardRate(lpAssetId) | |
322 | 322 | let wxEmissionPerBlock = rewardData[0] | |
323 | 323 | let maxFactor = rewardData[1] | |
324 | 324 | let totalLpStaked = rewardData[2] | |
325 | 325 | $Tuple2(nil, makeString(["%d%d%d", toString(wxEmissionPerBlock), toString(maxFactor), toString(totalLpStaked)], SEP)) | |
326 | 326 | } | |
327 | 327 | ||
328 | 328 | ||
329 | 329 | ||
330 | 330 | @Callable(i) | |
331 | 331 | func currentUserRewardRateREADONLY (lpAssetId,userAddress) = { | |
332 | 332 | let rewardData = internalCurrentRewardRate(lpAssetId) | |
333 | 333 | let wxEmissionPerBlock = rewardData[0] | |
334 | 334 | let maxFactor = rewardData[1] | |
335 | 335 | let totalLpStaked = rewardData[2] | |
336 | 336 | let lpStakedByUser = getIntOrZero(stakingDapp, keyStakedByUser(userAddress, lpAssetId)) | |
337 | 337 | let userClaimInfo = split(asString(invoke(stakingDapp, "claimWxREADONLY", [lpAssetId, userAddress], nil)), SEP) | |
338 | 338 | let minRewardPart = valueOrErrorMessage(parseInt(userClaimInfo[5]), "couldn't parse minRewardPart") | |
339 | 339 | let boostRewardPart = valueOrErrorMessage(parseInt(userClaimInfo[6]), "couldn't parse boostRewardPart") | |
340 | 340 | let debug = userClaimInfo[7] | |
341 | 341 | let boostingPower = if ((boostRewardPart == 0)) | |
342 | 342 | then (1 * MULT8) | |
343 | 343 | else fraction((minRewardPart + boostRewardPart), MULT8, minRewardPart) | |
344 | 344 | $Tuple2(nil, makeString(["%d%d%d%d%d%s", toString(wxEmissionPerBlock), toString(maxFactor), toString(totalLpStaked), toString(lpStakedByUser), toString(boostingPower), debug], SEP)) | |
345 | 345 | } | |
346 | 346 | ||
347 | 347 | ||
348 | 348 | ||
349 | 349 | @Callable(i) | |
350 | 350 | func calcBoostBulkInternalREADONLY (currentIter,deltaWxAmountBulk,deltaLockPeriodInBlocksBulk,deltaLpAmountBulk,lpAssetIdOptBulk,userAddressOpt,resAcc) = if ((currentIter == size(deltaWxAmountBulk))) | |
351 | 351 | then $Tuple2(nil, resAcc) | |
352 | 352 | else { | |
353 | 353 | let deltaWxAmount = deltaWxAmountBulk[currentIter] | |
354 | 354 | let deltaLockPeriodInBlocks = deltaLockPeriodInBlocksBulk[currentIter] | |
355 | 355 | let deltaLpAmount = deltaLpAmountBulk[currentIter] | |
356 | 356 | let lpAssetIdOpt = lpAssetIdOptBulk[currentIter] | |
357 | 357 | let info = { | |
358 | 358 | let @ = invoke(this, "calcBoostREADONLY", [deltaWxAmount, deltaLockPeriodInBlocks, deltaLpAmount, lpAssetIdOpt, userAddressOpt], nil) | |
359 | 359 | if ($isInstanceOf(@, "String")) | |
360 | 360 | then @ | |
361 | 361 | else throw(($getType(@) + " couldn't be cast to String")) | |
362 | 362 | } | |
363 | 363 | let res = (resAcc :+ info) | |
364 | 364 | let inv = { | |
365 | 365 | let @ = invoke(this, "calcBoostBulkInternalREADONLY", [(currentIter + 1), deltaWxAmountBulk, deltaLockPeriodInBlocksBulk, deltaLpAmountBulk, lpAssetIdOptBulk, userAddressOpt, res], nil) | |
366 | 366 | if ($isInstanceOf(@, "List[Any]")) | |
367 | 367 | then @ | |
368 | 368 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
369 | 369 | } | |
370 | 370 | if ((inv == inv)) | |
371 | 371 | then $Tuple2(nil, inv) | |
372 | 372 | else throw("Strict value is not equal to itself.") | |
373 | 373 | } | |
374 | 374 | ||
375 | 375 | ||
376 | 376 | ||
377 | 377 | @Callable(i) | |
378 | 378 | func calcBoostBulkREADONLY (deltaWxAmount,deltaLockPeriodInBlocks,deltaLpAmount,lpAssetIdOpt,userAddressOpt) = { | |
379 | 379 | let res = invoke(this, "calcBoostBulkInternalREADONLY", [0, deltaWxAmount, deltaLockPeriodInBlocks, deltaLpAmount, lpAssetIdOpt, userAddressOpt, nil], nil) | |
380 | 380 | $Tuple2(nil, res) | |
381 | 381 | } | |
382 | 382 | ||
383 | 383 | ||
384 | 384 | ||
385 | 385 | @Callable(i) | |
386 | 386 | func calcBoostREADONLY (deltaWxAmount,deltaLockPeriodInBlocks,deltaLpAmount,lpAssetIdOpt,userAddressOpt) = { | |
387 | 387 | let mathDapp = gwxRewardDapp | |
388 | 388 | let EMPTYSTR = "empty" | |
389 | 389 | let maxLockDurationInBlocks = parseIntValue(split(getStringByAddressOrFail(boostingDapp, keyBoostCfg()), SEP)[4]) | |
390 | 390 | let lpAssetIdStr = if ((lpAssetIdOpt == "")) | |
391 | 391 | then EMPTYSTR | |
392 | 392 | else lpAssetIdOpt | |
393 | 393 | let userAddressStr = if ((userAddressOpt == "")) | |
394 | 394 | then EMPTYSTR | |
395 | 395 | else userAddressOpt | |
396 | 396 | let userNumStr = valueOrElse(getString(boostingDapp, keyUser2NumMapping(userAddressOpt)), EMPTYSTR) | |
397 | 397 | let userAmount = valueOrElse(getInteger(boostingDapp, keyLockParamUserAmount(userNumStr)), 0) | |
398 | 398 | let lockStart = valueOrElse(getInteger(boostingDapp, keyLockParamStartBlock(userNumStr)), height) | |
399 | 399 | let lockDuration = valueOrElse(getInteger(boostingDapp, keyLockParamDuration(userNumStr)), 0) | |
400 | 400 | let lockEnd = (lockStart + lockDuration) | |
401 | 401 | let remainingDuration = max([(lockEnd - height), 0]) | |
402 | 402 | let userAmountNew = (userAmount + deltaWxAmount) | |
403 | 403 | let lockDurationNew = min([(remainingDuration + deltaLockPeriodInBlocks), maxLockDurationInBlocks]) | |
404 | 404 | let userCurrgWxAmount = asInt(asAnyList(invoke(boostingDapp, "gwxUserInfoREADONLY", [userAddressStr], nil))[0]) | |
405 | 405 | let gWxAmountStartNew = calcGwxAmountStartREADONLY(userAmountNew, lockDurationNew, maxLockDurationInBlocks)[0] | |
406 | 406 | let gWxParamsResultList = asAnyList(invoke(mathDapp, "calcGwxParamsREADONLY", [gWxAmountStartNew, height, lockDurationNew], nil)) | |
407 | 407 | let gWxAmountDiff = (gWxAmountStartNew - userCurrgWxAmount) | |
408 | 408 | let k = asInt(gWxParamsResultList[0]) | |
409 | 409 | let b = asInt(gWxParamsResultList[1]) | |
410 | 410 | let period = toString(asInt(gWxParamsResultList[2])) | |
411 | 411 | let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL() | |
412 | 412 | let totalCachedGwxKEY = keyTotalCachedGwx() | |
413 | 413 | let userMaxBoostIntNew = ((gWxAmountStartNew * lockDurationNew) / 2) | |
414 | 414 | let totalMaxBoostInt = getIntOrZero(boostingDapp, totalMaxBoostIntegralKEY) | |
415 | 415 | let totalCachedGwx = valueOrElse(getInteger(boostingDapp, totalCachedGwxKEY), 0) | |
416 | 416 | let MULT3 = 1000 | |
417 | 417 | let wxEmissionPerBlockX3 = (getIntOrFail(emissionDapp, keyEmissionRatePerBlockCurrent()) * MULT3) | |
418 | 418 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
419 | 419 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
420 | 420 | let stakedByUser = readStaked(stakingDapp, stakedByUserKEY) | |
421 | 421 | let stakedTotal = readStaked(stakingDapp, stakedTotalKEY) | |
422 | 422 | let stakedByUserNew = (stakedByUser + deltaLpAmount) | |
423 | 423 | let stakedTotalNew = (stakedTotal + deltaLpAmount) | |
424 | 424 | let poolWeight = if ((lpAssetIdStr != EMPTYSTR)) | |
425 | 425 | then { | |
426 | 426 | let poolAddressStr = valueOrErrorMessage(getString(factoryDapp, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
427 | 427 | getIntegerValue(factoryDapp, keyFactoryPoolWeight(poolAddressStr)) | |
428 | 428 | } | |
429 | 429 | else 0 | |
430 | 430 | let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * 3)) | |
431 | 431 | let wxPerLpX3 = if ((stakedTotalNew != 0)) | |
432 | 432 | then fraction(poolWxEmissionPerBlockX3, MULT8, stakedTotalNew) | |
433 | 433 | else 0 | |
434 | 434 | let userWxPerBlockX3 = fraction(wxPerLpX3, stakedByUserNew, MULT8) | |
435 | 435 | let boostEmissionPerBlockX3 = (poolWxEmissionPerBlockX3 * 2) | |
436 | 436 | let tmpUserBoostPerBlockX3 = fraction(gWxAmountStartNew, boostEmissionPerBlockX3, (totalCachedGwx + gWxAmountDiff)) | |
437 | 437 | let userBoostPerBlockX3 = min([tmpUserBoostPerBlockX3, (userWxPerBlockX3 * 2)]) | |
438 | 438 | let boostCoeff = if ((userWxPerBlockX3 == 0)) | |
439 | 439 | then (1 * MULT8) | |
440 | 440 | else fraction((userBoostPerBlockX3 + userWxPerBlockX3), MULT8, userWxPerBlockX3) | |
441 | 441 | $Tuple2(nil, makeString(["%d%d%s", toString(gWxAmountStartNew), toString(boostCoeff), "d"], SEP)) | |
442 | 442 | } | |
443 | 443 | ||
444 | 444 | ||
445 | 445 | ||
446 | 446 | @Callable(i) | |
447 | 447 | func wxEmissionStatsREADONLY () = { | |
448 | 448 | let ONEMULT = toString(MULT8) | |
449 | 449 | let ONE = "1" | |
450 | 450 | let wxEmissionPerBlock = getIntOrFail(emissionDapp, keyEmissionRatePerBlockCurrent()) | |
451 | 451 | let emissionStartBlock = getIntOrFail(emissionDapp, keyEmissionStartBlock()) | |
452 | 452 | let passedBlocks = if ((emissionStartBlock > height)) | |
453 | 453 | then 0 | |
454 | 454 | else (height - emissionStartBlock) | |
455 | 455 | let teamEmDuration = (1440 * 365) | |
456 | 456 | let teamEmMax = (201000000 * MULT8) | |
457 | 457 | let teamEm = if ((passedBlocks > teamEmDuration)) | |
458 | 458 | then teamEmMax | |
459 | 459 | else fraction(teamEmMax, passedBlocks, teamEmDuration) | |
460 | 460 | let totalWxReleased = ((wxEmissionPerBlock * passedBlocks) + teamEm) | |
461 | 461 | let totalWxLocked = getIntOrZero(boostingDapp, keyBoostingLockParamTotalAmount()) | |
462 | 462 | let locksDurationSumInBlocks = getIntOrZero(boostingDapp, keyBoostingStatsLocksDurationSumInBlocks()) | |
463 | 463 | let locksCount = getIntOrZero(boostingDapp, keyBoostingStatsLocksCount()) | |
464 | 464 | $Tuple2(nil, makeString(["%d%d%d%d", toString(totalWxReleased), toString(totalWxLocked), toString(locksDurationSumInBlocks), toString(locksCount)], SEP)) | |
465 | 465 | } | |
466 | 466 | ||
467 | 467 | ||
468 | 468 | ||
469 | 469 | @Callable(i) | |
470 | 470 | func poolStatsREADONLY (lpAsset) = { | |
471 | 471 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAsset))) | |
472 | 472 | let cfg = asAnyList(invoke(poolAddress, "getPoolConfigWrapperREADONLY", nil, nil)) | |
473 | 473 | let lpAssetId = fromBase58String(asString(cfg[idxPoolLPAssetId])) | |
474 | 474 | let amtAssetId = asString(cfg[idxAmtAssetId]) | |
475 | 475 | let priceAssetId = asString(cfg[idxPriceAssetId]) | |
476 | 476 | let iAmtAssetId = asString(cfg[idxIAmtAssetId]) | |
477 | 477 | let iPriceAssetId = asString(cfg[idxIPriceAssetId]) | |
478 | 478 | let amtAssetDcm = parseIntValue(asString(cfg[idxAmtAssetDcm])) | |
479 | 479 | let priceAssetDcm = parseIntValue(asString(cfg[idxPriceAssetDcm])) | |
480 | 480 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
481 | 481 | let accAmtAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [amtAssetId], nil)) | |
482 | 482 | let accPriceAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [priceAssetId], nil)) | |
483 | 483 | let pricesList = if ((poolLPBalance == 0)) | |
484 | 484 | then [toString(zeroBigInt), toString(zeroBigInt), toString(zeroBigInt)] | |
485 | 485 | else asAnyList(invoke(poolAddress, "calcPricesWrapperREADONLY", [accAmtAssetBalance, accPriceAssetBalance, poolLPBalance], nil)) | |
486 | 486 | let curPrice = 0 | |
487 | 487 | let lpAmtAssetShare = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [pricesList[1], MULT8], nil)) | |
488 | 488 | let lpPriceAssetShare = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [pricesList[2], MULT8], nil)) | |
489 | 489 | let poolWeight = getIntegerValue(factoryDapp, keyFactoryPoolWeight(toString(poolAddress))) | |
490 | 490 | let fee = getPoolFee(poolAddress) | |
491 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(accAmtAssetBalance), toString(accPriceAssetBalance), toString(poolLPBalance), toString(curPrice), toString(lpAmtAssetShare), toString(lpPriceAssetShare), toString(poolWeight), toString(fee)], SEP)) | |
491 | + | let poolOneTokenOperationsDisabled = { | |
492 | + | let @ = invoke(factoryDapp, "isPoolOneTokenOperationsDisabledREADONLY", [toString(poolAddress)], nil) | |
493 | + | if ($isInstanceOf(@, "Boolean")) | |
494 | + | then @ | |
495 | + | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
496 | + | } | |
497 | + | let poolOneTokenOperationsEnabled = !(poolOneTokenOperationsDisabled) | |
498 | + | $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(fee), toString(poolOneTokenOperationsEnabled)], SEP)) | |
492 | 499 | } | |
493 | 500 | ||
494 | 501 | ||
495 | 502 | ||
496 | 503 | @Callable(i) | |
497 | 504 | func poolEvaluatePutByAmountAssetREADONLY (lpAsset,inAmAssetAmt) = { | |
498 | 505 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAsset))) | |
499 | 506 | let cfg = asAnyList(invoke(poolAddress, "getPoolConfigWrapperREADONLY", nil, nil)) | |
500 | 507 | let lpAssetId = fromBase58String(asString(cfg[idxPoolLPAssetId])) | |
501 | 508 | let amAssetIdStr = asString(cfg[idxAmtAssetId]) | |
502 | 509 | let amAssetId = fromBase58String(amAssetIdStr) | |
503 | 510 | let prAssetIdStr = asString(cfg[idxPriceAssetId]) | |
504 | 511 | let prAssetId = fromBase58String(prAssetIdStr) | |
505 | 512 | let amtAssetDcm = parseIntValue(asString(cfg[idxAmtAssetDcm])) | |
506 | 513 | let priceAssetDcm = parseIntValue(asString(cfg[idxPriceAssetDcm])) | |
507 | 514 | let poolStatus = asString(cfg[idxPoolStatus]) | |
508 | 515 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
509 | 516 | let accAmtAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [amAssetIdStr], nil)) | |
510 | 517 | let accPriceAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [prAssetIdStr], nil)) | |
511 | 518 | let amtAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [accAmtAssetBalance, amtAssetDcm], nil))) | |
512 | 519 | let priceAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [accPriceAssetBalance, priceAssetDcm], nil))) | |
513 | 520 | let curPriceX18 = if ((poolLPBalance == 0)) | |
514 | 521 | then zeroBigInt | |
515 | 522 | else parseBigIntValue(asString(invoke(poolAddress, "calcPriceBigIntWrapperREADONLY", [toString(priceAssetAmtX18), toString(amtAssetAmtX18)], nil))) | |
516 | 523 | let curPrice = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(curPriceX18), MULT8], nil)) | |
517 | 524 | let inAmAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [inAmAssetAmt, amtAssetDcm], nil))) | |
518 | 525 | let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, MULT18) | |
519 | 526 | let inPrAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inPrAssetAmtX18), priceAssetDcm], nil)) | |
520 | 527 | let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil) | |
521 | - | let $ | |
528 | + | let $t02234622699 = match res { | |
522 | 529 | case _ => | |
523 | 530 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
524 | 531 | then if ($isInstanceOf($match0._3, "Int")) | |
525 | 532 | then if ($isInstanceOf($match0._4, "Int")) | |
526 | 533 | then if ($isInstanceOf($match0._5, "Int")) | |
527 | 534 | then $isInstanceOf($match0._6, "Int") | |
528 | 535 | else false | |
529 | 536 | else false | |
530 | 537 | else false | |
531 | 538 | else false) | |
532 | 539 | then (size($match0) == 13) | |
533 | 540 | else false) | |
534 | 541 | then { | |
535 | 542 | let calcLpAmt = $match0._1 | |
536 | 543 | let curPriceCalc = $match0._3 | |
537 | 544 | let amBalance = $match0._4 | |
538 | 545 | let prBalance = $match0._5 | |
539 | 546 | let lpEmission = $match0._6 | |
540 | 547 | $Tuple5(calcLpAmt, curPriceCalc, amBalance, prBalance, lpEmission) | |
541 | 548 | } | |
542 | 549 | else throw("Couldn't cast types") | |
543 | 550 | } | |
544 | - | let calcLpAmt = $ | |
545 | - | let curPriceCalc = $ | |
546 | - | let amBalance = $ | |
547 | - | let prBalance = $ | |
548 | - | let lpEmission = $ | |
551 | + | let calcLpAmt = $t02234622699._1 | |
552 | + | let curPriceCalc = $t02234622699._2 | |
553 | + | let amBalance = $t02234622699._3 | |
554 | + | let prBalance = $t02234622699._4 | |
555 | + | let lpEmission = $t02234622699._5 | |
549 | 556 | $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)) | |
550 | 557 | } | |
551 | 558 | ||
552 | 559 | ||
553 | 560 | ||
554 | 561 | @Callable(i) | |
555 | 562 | func poolEvaluatePutByPriceAssetREADONLY (lpAsset,inPrAssetAmt) = { | |
556 | 563 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAsset))) | |
557 | 564 | let cfg = asAnyList(invoke(poolAddress, "getPoolConfigWrapperREADONLY", nil, nil)) | |
558 | 565 | let lpAssetId = fromBase58String(asString(cfg[idxPoolLPAssetId])) | |
559 | 566 | let amAssetIdStr = asString(cfg[idxAmtAssetId]) | |
560 | 567 | let amAssetId = fromBase58String(amAssetIdStr) | |
561 | 568 | let prAssetIdStr = asString(cfg[idxPriceAssetId]) | |
562 | 569 | let prAssetId = fromBase58String(prAssetIdStr) | |
563 | 570 | let amtAssetDcm = parseIntValue(asString(cfg[idxAmtAssetDcm])) | |
564 | 571 | let priceAssetDcm = parseIntValue(asString(cfg[idxPriceAssetDcm])) | |
565 | 572 | let poolStatus = asString(cfg[idxPoolStatus]) | |
566 | 573 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
567 | 574 | let amBalanceRaw = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [amAssetIdStr], nil)) | |
568 | 575 | let prBalanceRaw = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [prAssetIdStr], nil)) | |
569 | 576 | let amBalanceRawX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [amBalanceRaw, amtAssetDcm], nil))) | |
570 | 577 | let prBalanceRawX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [prBalanceRaw, priceAssetDcm], nil))) | |
571 | 578 | let curPriceX18 = if ((poolLPBalance == 0)) | |
572 | 579 | then zeroBigInt | |
573 | 580 | else parseBigIntValue(asString(invoke(poolAddress, "calcPriceBigIntWrapperREADONLY", [toString(prBalanceRawX18), toString(amBalanceRawX18)], nil))) | |
574 | 581 | let curPrice = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(curPriceX18), MULT8], nil)) | |
575 | 582 | let inPrAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [inPrAssetAmt, priceAssetDcm], nil))) | |
576 | 583 | let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, MULT18, curPriceX18) | |
577 | 584 | let inAmAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inAmAssetAmtX18), amtAssetDcm], nil)) | |
578 | 585 | let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil) | |
579 | - | let $ | |
586 | + | let $t02527225625 = match res { | |
580 | 587 | case _ => | |
581 | 588 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
582 | 589 | then if ($isInstanceOf($match0._3, "Int")) | |
583 | 590 | then if ($isInstanceOf($match0._4, "Int")) | |
584 | 591 | then if ($isInstanceOf($match0._5, "Int")) | |
585 | 592 | then $isInstanceOf($match0._6, "Int") | |
586 | 593 | else false | |
587 | 594 | else false | |
588 | 595 | else false | |
589 | 596 | else false) | |
590 | 597 | then (size($match0) == 13) | |
591 | 598 | else false) | |
592 | 599 | then { | |
593 | 600 | let calcLpAmt = $match0._1 | |
594 | 601 | let curPriceCalc = $match0._3 | |
595 | 602 | let amBalance = $match0._4 | |
596 | 603 | let prBalance = $match0._5 | |
597 | 604 | let lpEmission = $match0._6 | |
598 | 605 | $Tuple5(calcLpAmt, curPriceCalc, amBalance, prBalance, lpEmission) | |
599 | 606 | } | |
600 | 607 | else throw("Couldn't cast types") | |
601 | 608 | } | |
602 | - | let calcLpAmt = $ | |
603 | - | let curPriceCalc = $ | |
604 | - | let amBalance = $ | |
605 | - | let prBalance = $ | |
606 | - | let lpEmission = $ | |
609 | + | let calcLpAmt = $t02527225625._1 | |
610 | + | let curPriceCalc = $t02527225625._2 | |
611 | + | let amBalance = $t02527225625._3 | |
612 | + | let prBalance = $t02527225625._4 | |
613 | + | let lpEmission = $t02527225625._5 | |
607 | 614 | $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)) | |
608 | 615 | } | |
609 | 616 | ||
610 | 617 | ||
611 | 618 | ||
612 | 619 | @Callable(i) | |
613 | 620 | func poolEvaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = { | |
614 | 621 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(paymentLpAssetId))) | |
615 | 622 | let res = invoke(poolAddress, "estimateGetOperationWrapperREADONLY", ["", paymentLpAssetId, paymentLpAmt, toString(poolAddress)], nil) | |
616 | - | let $ | |
623 | + | let $t02632026737 = match res { | |
617 | 624 | case _ => | |
618 | 625 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
619 | 626 | then if ($isInstanceOf($match0._2, "Int")) | |
620 | 627 | then if ($isInstanceOf($match0._5, "Int")) | |
621 | 628 | then if ($isInstanceOf($match0._6, "Int")) | |
622 | 629 | then if ($isInstanceOf($match0._7, "Int")) | |
623 | 630 | then if ($isInstanceOf($match0._8, "String")) | |
624 | 631 | then $isInstanceOf($match0._9, "String") | |
625 | 632 | else false | |
626 | 633 | else false | |
627 | 634 | else false | |
628 | 635 | else false | |
629 | 636 | else false | |
630 | 637 | else false) | |
631 | 638 | then (size($match0) == 10) | |
632 | 639 | else false) | |
633 | 640 | then { | |
634 | 641 | let outAmAmt = $match0._1 | |
635 | 642 | let outPrAmt = $match0._2 | |
636 | 643 | let amBalance = $match0._5 | |
637 | 644 | let prBalance = $match0._6 | |
638 | 645 | let lpEmission = $match0._7 | |
639 | 646 | let curPrice = $match0._8 | |
640 | 647 | let poolStatus = $match0._9 | |
641 | 648 | $Tuple7(outAmAmt, outPrAmt, amBalance, prBalance, lpEmission, curPrice, poolStatus) | |
642 | 649 | } | |
643 | 650 | else throw("Couldn't cast types") | |
644 | 651 | } | |
645 | - | let outAmAmt = $ | |
646 | - | let outPrAmt = $ | |
647 | - | let amBalance = $ | |
648 | - | let prBalance = $ | |
649 | - | let lpEmission = $ | |
650 | - | let curPrice = $ | |
651 | - | let poolStatus = $ | |
652 | + | let outAmAmt = $t02632026737._1 | |
653 | + | let outPrAmt = $t02632026737._2 | |
654 | + | let amBalance = $t02632026737._3 | |
655 | + | let prBalance = $t02632026737._4 | |
656 | + | let lpEmission = $t02632026737._5 | |
657 | + | let curPrice = $t02632026737._6 | |
658 | + | let poolStatus = $t02632026737._7 | |
652 | 659 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(outAmAmt), toString(outPrAmt), toString(amBalance), toString(prBalance), toString(lpEmission), curPrice, poolStatus], SEP)) | |
653 | 660 | } | |
654 | 661 | ||
655 | 662 | ||
656 | 663 | ||
657 | 664 | @Callable(i) | |
658 | 665 | func gwxUserInfoREADONLY (userAddress) = { | |
659 | 666 | let gwxUserInfoLIST = asAnyList(invoke(boostingDapp, "gwxUserInfoREADONLY", [userAddress], nil)) | |
660 | 667 | let gwxAmount = asInt(gwxUserInfoLIST[0]) | |
661 | 668 | $Tuple2(nil, makeString(["%d", toString(gwxAmount)], SEP)) | |
662 | - | } | |
663 | - | ||
664 | - | ||
665 | - | ||
666 | - | @Callable(i) | |
667 | - | func unstakeAndGetOneTknV2 (poolAddress,unstakeAmount,outAssetId,minOutAmount) = { | |
668 | - | let inv = invoke(addressFromStringValue(poolAddress), "unstakeAndGetOneTknV2", [unstakeAmount, outAssetId, minOutAmount], nil) | |
669 | - | if ((inv == inv)) | |
670 | - | then $Tuple2(nil, unit) | |
671 | - | else throw("Strict value is not equal to itself.") | |
672 | 669 | } | |
673 | 670 | ||
674 | 671 | ||
675 | 672 | ||
676 | 673 | @Callable(i) | |
677 | 674 | func setManager (pendingManagerPublicKey) = { | |
678 | 675 | let checkCaller = mustManager(i) | |
679 | 676 | if ((checkCaller == checkCaller)) | |
680 | 677 | then { | |
681 | 678 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
682 | 679 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
683 | 680 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
684 | 681 | else throw("Strict value is not equal to itself.") | |
685 | 682 | } | |
686 | 683 | else throw("Strict value is not equal to itself.") | |
687 | 684 | } | |
688 | 685 | ||
689 | 686 | ||
690 | 687 | ||
691 | 688 | @Callable(i) | |
692 | 689 | func confirmManager () = { | |
693 | 690 | let pm = pendingManagerPublicKeyOrUnit() | |
694 | 691 | let hasPM = if (isDefined(pm)) | |
695 | 692 | then true | |
696 | 693 | else throw("No pending manager") | |
697 | 694 | if ((hasPM == hasPM)) | |
698 | 695 | then { | |
699 | 696 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
700 | 697 | then true | |
701 | 698 | else throw("You are not pending manager") | |
702 | 699 | if ((checkPM == checkPM)) | |
703 | 700 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
704 | 701 | else throw("Strict value is not equal to itself.") | |
705 | 702 | } | |
706 | 703 | else throw("Strict value is not equal to itself.") | |
707 | 704 | } | |
708 | 705 | ||
709 | 706 | ||
710 | 707 | @Verifier(tx) | |
711 | 708 | func verify () = { | |
712 | 709 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
713 | 710 | case pk: ByteVector => | |
714 | 711 | pk | |
715 | 712 | case _: Unit => | |
716 | 713 | tx.senderPublicKey | |
717 | 714 | case _ => | |
718 | 715 | throw("Match error") | |
719 | 716 | } | |
720 | 717 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
721 | 718 | } | |
722 | 719 |
github/deemru/w8io/026f985 365.96 ms ◑