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