tx · 8jDFViNr6ArUXefKy8oSEgqWYjkojSUYFhPuLD5cHtCy 3MsMP2pb2p8MDd6Rxb7XEXqqwEhE8ATfyai: -0.02600000 Waves 2023.04.06 17:35 [2522831] smart account 3MsMP2pb2p8MDd6Rxb7XEXqqwEhE8ATfyai > SELF 0.00000000 Waves
{ "type": 13, "id": "8jDFViNr6ArUXefKy8oSEgqWYjkojSUYFhPuLD5cHtCy", "fee": 2600000, "feeAssetId": null, "timestamp": 1680791810445, "version": 2, "chainId": 84, "sender": "3MsMP2pb2p8MDd6Rxb7XEXqqwEhE8ATfyai", "senderPublicKey": "2JEaBjtjvMoNGKZmL9QxYefa1VkMJM3vMW8rNvTs9R2H", "proofs": [ "3Q93WvqcpZ19f1zxgR4TK8ALnx8wJxfKckCfsueguhimsMGLiVeEDB9vnvd8DjHRKqJEJdXZmNWiiajcPYv6PLWh" ], "script": "base64:BgKqKwgCEgASBAoCCAgSBAoCCAgSAwoBCBIKCggICAgICAgIARIDCgEIEgYKBAgICAgSBAoCCBgSAwoBCBIECgIIGBIDCgEIEgASAwoBGBIKCggICAgICAEICBIECgIIARIDCgEBEgMKAQESBAoCCAESBgoECAgICBIECgIICBIECgIICBIECgIICBIDCgEIEgMKAQgSAwoBCBIDCgEIEgQKAggIEgMKAQgSAwoBCBIDCgEIEgQKAggIEgMKAQgSAwoBCCIGU0NBTEU4IgVNVUxUOCIGTVVMVDEyIgdTQ0FMRTE4IgZNVUxUMTgiDlBPT0xXRUlHSFRNVUxUIg5HV1h2aXJ0dWFsUE9PTCIMbGFiZWxQb29sc0xwIg1kZWZhdWx0U3ByZWFkIgt3YXZlc1N0cmluZyIRZGVjaW1hbHNNdWx0UHJpY2UiA1NFUCIFRU1QVFkiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIhJpZHhJbnRlcm5hbEFzc2V0SWQiD2lkeFJlc3V0QWN0aW9ucyIgaWR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uyX9LCCj4Uw2dXuXNWSNshHbB61oiFrNHKm4MQgizD Next: 4AZezJTV9ZsKRAXtEB1C7cZRqsSfodsrDBLczBUP6zLf Diff:
Old | New | Differences | |
---|---|---|---|
4 | 4 | let SCALE8 = 8 | |
5 | 5 | ||
6 | 6 | let MULT8 = 100000000 | |
7 | + | ||
8 | + | let MULT12 = 1000000000000 | |
7 | 9 | ||
8 | 10 | let SCALE18 = 18 | |
9 | 11 | ||
138 | 140 | ||
139 | 141 | ||
140 | 142 | func keyPoolOneTokenOperationsDisabled (assetsInternal) = { | |
141 | - | let $ | |
142 | - | let amountAssetInternal = $ | |
143 | - | let priceAssetInternal = $ | |
143 | + | let $t037543816 = assetsInternal | |
144 | + | let amountAssetInternal = $t037543816._1 | |
145 | + | let priceAssetInternal = $t037543816._2 | |
144 | 146 | makeString(["%d%d%s", toString(amountAssetInternal), toString(priceAssetInternal), "oneTokenOperationsDisabled"], SEP) | |
145 | 147 | } | |
146 | 148 | ||
194 | 196 | ||
195 | 197 | ||
196 | 198 | func keyChangeAmpTarget (poolAddress) = ("%s%s__changeAmpTarget__" + poolAddress) | |
199 | + | ||
200 | + | ||
201 | + | func keySWavesProxyAddress () = "%s__sWavesProxyAddress" | |
202 | + | ||
203 | + | ||
204 | + | func keySWavesAssetId () = "%s__sWavesAssetId" | |
205 | + | ||
206 | + | ||
207 | + | func keyStakingProfitAddress () = "%s__stakingProfitAddress" | |
208 | + | ||
209 | + | ||
210 | + | func keyLeasedRatio (poolAddress,assetId) = makeString(["%s%s%s", "leasedRatio", poolAddress, assetId], SEP) | |
211 | + | ||
212 | + | ||
213 | + | func keyLeasedRatioDefault (assetId) = makeString(["%s%s", "leasedRatioDefault", assetId], SEP) | |
214 | + | ||
215 | + | ||
216 | + | func keyLeasedRatioTolerance (poolAddress,assetId) = makeString(["%s%s%s", "leasedRatioTolerance", poolAddress, assetId], SEP) | |
217 | + | ||
218 | + | ||
219 | + | func keyMinBalance (poolAddress,assetId) = makeString(["%s%s%s", "minBalance", poolAddress, assetId], SEP) | |
220 | + | ||
221 | + | ||
222 | + | func keyMinBalanceDefault (assetId) = makeString(["%s%s", "minBalanceDefault", assetId], SEP) | |
197 | 223 | ||
198 | 224 | ||
199 | 225 | func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), ("No data for this.key=" + key)) | |
366 | 392 | ||
367 | 393 | @Callable(i) | |
368 | 394 | func getSwapContractREADONLY () = $Tuple2(nil, getStringOrFail(swapContract())) | |
395 | + | ||
396 | + | ||
397 | + | ||
398 | + | @Callable(i) | |
399 | + | func getPoolLeaseConfigREADONLY (poolAddress,assetId) = { | |
400 | + | let $t01430514609 = match getInteger(this, keyLeasedRatio(poolAddress, assetId)) { | |
401 | + | case r: Int => | |
402 | + | $Tuple2(true, min([100, max([0, r])])) | |
403 | + | case _ => | |
404 | + | match getInteger(this, keyLeasedRatioDefault(assetId)) { | |
405 | + | case rd: Int => | |
406 | + | $Tuple2(true, min([100, max([0, rd])])) | |
407 | + | case _ => | |
408 | + | $Tuple2(false, 0) | |
409 | + | } | |
410 | + | } | |
411 | + | let isLeasable = $t01430514609._1 | |
412 | + | let leasedRatio = $t01430514609._2 | |
413 | + | let minBalance = match getInteger(this, keyMinBalance(poolAddress, assetId)) { | |
414 | + | case b: Int => | |
415 | + | max([0, b]) | |
416 | + | case _ => | |
417 | + | match getInteger(this, keyMinBalanceDefault(assetId)) { | |
418 | + | case bd: Int => | |
419 | + | max([0, bd]) | |
420 | + | case _ => | |
421 | + | 0 | |
422 | + | } | |
423 | + | } | |
424 | + | let $t01487515099 = if ((assetId == "WAVES")) | |
425 | + | then $Tuple3(valueOrElse(getString(this, keySWavesProxyAddress()), ""), getString(this, valueOrElse(keySWavesAssetId(), "")), MULT12) | |
426 | + | else $Tuple3("", "", 0) | |
427 | + | let proxyAddress = $t01487515099._1 | |
428 | + | let proxyAssetId = $t01487515099._2 | |
429 | + | let proxyRateMul = $t01487515099._3 | |
430 | + | let stakingProfitAddress = valueOrElse(getString(this, keyStakingProfitAddress()), "") | |
431 | + | $Tuple2(nil, $Tuple7(isLeasable, leasedRatio, minBalance, proxyAddress, proxyAssetId, proxyRateMul, stakingProfitAddress)) | |
432 | + | } | |
369 | 433 | ||
370 | 434 | ||
371 | 435 |
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 | + | ||
8 | + | let MULT12 = 1000000000000 | |
7 | 9 | ||
8 | 10 | let SCALE18 = 18 | |
9 | 11 | ||
10 | 12 | let MULT18 = toBigInt(1000000000000000000) | |
11 | 13 | ||
12 | 14 | let POOLWEIGHTMULT = MULT8 | |
13 | 15 | ||
14 | 16 | let GWXvirtualPOOL = "GWXvirtualPOOL" | |
15 | 17 | ||
16 | 18 | let labelPoolsLp = "POOLS_LP" | |
17 | 19 | ||
18 | 20 | let defaultSpread = 2000000 | |
19 | 21 | ||
20 | 22 | let wavesString = "WAVES" | |
21 | 23 | ||
22 | 24 | let decimalsMultPrice = ((100 * 1000) * 1000) | |
23 | 25 | ||
24 | 26 | let SEP = "__" | |
25 | 27 | ||
26 | 28 | let EMPTY = "" | |
27 | 29 | ||
28 | 30 | let PoolActive = 1 | |
29 | 31 | ||
30 | 32 | let PoolPutDisabled = 2 | |
31 | 33 | ||
32 | 34 | let PoolMatcherDisabled = 3 | |
33 | 35 | ||
34 | 36 | let PoolShutdown = 4 | |
35 | 37 | ||
36 | 38 | let idxInternalAssetId = 1 | |
37 | 39 | ||
38 | 40 | let idxResutActions = 2 | |
39 | 41 | ||
40 | 42 | let idxIfAssetIdCalculationPerformed = 3 | |
41 | 43 | ||
42 | 44 | let idxPoolAddress = 1 | |
43 | 45 | ||
44 | 46 | let idxPoolStatus = 2 | |
45 | 47 | ||
46 | 48 | let idxPoolLPAssetId = 3 | |
47 | 49 | ||
48 | 50 | let idxAmtAssetId = 4 | |
49 | 51 | ||
50 | 52 | let idxPriceAssetId = 5 | |
51 | 53 | ||
52 | 54 | let idxAmtAssetDcm = 6 | |
53 | 55 | ||
54 | 56 | let idxPriceAssetDcm = 7 | |
55 | 57 | ||
56 | 58 | let idxIAmtAssetId = 8 | |
57 | 59 | ||
58 | 60 | let idxIPriceAssetId = 9 | |
59 | 61 | ||
60 | 62 | let idxLPAssetDcm = 10 | |
61 | 63 | ||
62 | 64 | let idxPoolType = 11 | |
63 | 65 | ||
64 | 66 | let poolLabelWxEmission = "WX_EMISSION" | |
65 | 67 | ||
66 | 68 | let validPoolLabels = [poolLabelWxEmission] | |
67 | 69 | ||
68 | 70 | func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash" | |
69 | 71 | ||
70 | 72 | ||
71 | 73 | func keyAllowedLpStableScriptHash () = "%s__allowedLpStableScriptHash" | |
72 | 74 | ||
73 | 75 | ||
74 | 76 | func keyAllowedLpStableAddonScriptHash () = "%s__allowedLpStableAddonScriptHash" | |
75 | 77 | ||
76 | 78 | ||
77 | 79 | func swapContract () = "%s__swapContract" | |
78 | 80 | ||
79 | 81 | ||
80 | 82 | func keyFactoryConfig () = "%s__factoryConfig" | |
81 | 83 | ||
82 | 84 | ||
83 | 85 | func keyLpTokensList () = "%s__lpTokensList" | |
84 | 86 | ||
85 | 87 | ||
86 | 88 | func keyPoolScriptHash () = "%s%s__pool__scriptHash" | |
87 | 89 | ||
88 | 90 | ||
89 | 91 | func keyMatcherPub () = "%s%s__matcher__publicKey" | |
90 | 92 | ||
91 | 93 | ||
92 | 94 | func keyLegacyFactoryContract () = "%s__legacyFactoryContract" | |
93 | 95 | ||
94 | 96 | ||
95 | 97 | func keyLegacyPools () = "%s__legacyPools" | |
96 | 98 | ||
97 | 99 | ||
98 | 100 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
99 | 101 | ||
100 | 102 | ||
101 | 103 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
102 | 104 | ||
103 | 105 | ||
104 | 106 | func keyAdminPubKeys () = "%s__adminPubKeys" | |
105 | 107 | ||
106 | 108 | ||
107 | 109 | func keyAssetsStoreContract () = "%s__assetsStoreContract" | |
108 | 110 | ||
109 | 111 | ||
110 | 112 | func keyVotingEmissionContract () = "%s__votingEmissionContract" | |
111 | 113 | ||
112 | 114 | ||
113 | 115 | func keyPriceAssets () = makeString(["%s", "priceAssets"], SEP) | |
114 | 116 | ||
115 | 117 | ||
116 | 118 | func keyPriceDecimals () = "%s__priceDecimals" | |
117 | 119 | ||
118 | 120 | ||
119 | 121 | func keyAllPoolsShutdown () = "%s__shutdown" | |
120 | 122 | ||
121 | 123 | ||
122 | 124 | func keyNextInternalAssetId () = "%s__nextInternalAssetId" | |
123 | 125 | ||
124 | 126 | ||
125 | 127 | func keyPoolToWeight (poolAddress) = ("%s%s__poolWeight__" + poolAddress) | |
126 | 128 | ||
127 | 129 | ||
128 | 130 | func keyPoolToWeightHistory (poolAddress,num) = ((("%s%s__poolWeight__" + poolAddress) + "__") + toString(num)) | |
129 | 131 | ||
130 | 132 | ||
131 | 133 | func keyMappingsInternal2baseAssetId (internalBaseAsset) = ("%s%s%d__mappings__internal2baseAssetId__" + toString(internalBaseAsset)) | |
132 | 134 | ||
133 | 135 | ||
134 | 136 | func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr) | |
135 | 137 | ||
136 | 138 | ||
137 | 139 | func keyPoolConfig (amountAssetInternal,priceAssetInternal) = (((("%d%d%s__" + amountAssetInternal) + "__") + priceAssetInternal) + "__config") | |
138 | 140 | ||
139 | 141 | ||
140 | 142 | func keyPoolOneTokenOperationsDisabled (assetsInternal) = { | |
141 | - | let $ | |
142 | - | let amountAssetInternal = $ | |
143 | - | let priceAssetInternal = $ | |
143 | + | let $t037543816 = assetsInternal | |
144 | + | let amountAssetInternal = $t037543816._1 | |
145 | + | let priceAssetInternal = $t037543816._2 | |
144 | 146 | makeString(["%d%d%s", toString(amountAssetInternal), toString(priceAssetInternal), "oneTokenOperationsDisabled"], SEP) | |
145 | 147 | } | |
146 | 148 | ||
147 | 149 | ||
148 | 150 | func keyAllPoolsOneTokenOperationsDisabled () = makeString(["%s", "oneTokenOperationsDisabled"], SEP) | |
149 | 151 | ||
150 | 152 | ||
151 | 153 | func keyMappingLpAssetToPoolAssets (lpAssetStr) = (("%s%s%s__" + lpAssetStr) + "__mappings__lpAsset2Pool") | |
152 | 154 | ||
153 | 155 | ||
154 | 156 | func keyMappingPoolAssetsToLpasset (internalAmountAssetIdStr,internalPriceAssetIdStr) = (((("%d%d%s%s__" + internalAmountAssetIdStr) + "__") + internalPriceAssetIdStr) + "__mappings__PoolAssets2LpAsset") | |
155 | 157 | ||
156 | 158 | ||
157 | 159 | func keyPoolSpread (poolAddress) = ("%s%s__spread__" + poolAddress) | |
158 | 160 | ||
159 | 161 | ||
160 | 162 | func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2PoolAssets") | |
161 | 163 | ||
162 | 164 | ||
163 | 165 | func keyMappingPoolAssetsToPoolContractAddress (internalAmountAssetIdStr,internalPriceAssetIdStr) = (((("%d%d%s%s__" + toString(internalAmountAssetIdStr)) + "__") + toString(internalPriceAssetIdStr)) + "__mappings__poolAssets2PoolContract") | |
164 | 166 | ||
165 | 167 | ||
166 | 168 | func keyMappingPoolContractToLPAsset (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset") | |
167 | 169 | ||
168 | 170 | ||
169 | 171 | func keyMappingPoolLPAssetToPoolContractAddress (lpAssetStr) = (("%s%s%s__" + lpAssetStr) + "__mappings__lpAsset2PoolContract") | |
170 | 172 | ||
171 | 173 | ||
172 | 174 | func keyWxEmission (amountAssetId,priceAssetId) = ((("%s%s%s__wxEmission__" + amountAssetId) + "__") + priceAssetId) | |
173 | 175 | ||
174 | 176 | ||
175 | 177 | func keyInFee (poolAddress) = ("%s%s__inFee__" + poolAddress) | |
176 | 178 | ||
177 | 179 | ||
178 | 180 | func keyInFeeDefault () = "%s__inFeeDefault" | |
179 | 181 | ||
180 | 182 | ||
181 | 183 | func keyOutFee (poolAddress) = ("%s%s__outFee__" + poolAddress) | |
182 | 184 | ||
183 | 185 | ||
184 | 186 | func keyOutFeeDefault () = "%s__outFeeDefault" | |
185 | 187 | ||
186 | 188 | ||
187 | 189 | func keySkipOrderValidation (poolAddress) = ("%s%s__skipOrderValidation__" + poolAddress) | |
188 | 190 | ||
189 | 191 | ||
190 | 192 | func keyChangeAmpDelay (poolAddress) = ("%s%s__changeAmpDelay__" + poolAddress) | |
191 | 193 | ||
192 | 194 | ||
193 | 195 | func keyChangeAmpDelta (poolAddress) = ("%s%s__changeAmpDelta__" + poolAddress) | |
194 | 196 | ||
195 | 197 | ||
196 | 198 | func keyChangeAmpTarget (poolAddress) = ("%s%s__changeAmpTarget__" + poolAddress) | |
199 | + | ||
200 | + | ||
201 | + | func keySWavesProxyAddress () = "%s__sWavesProxyAddress" | |
202 | + | ||
203 | + | ||
204 | + | func keySWavesAssetId () = "%s__sWavesAssetId" | |
205 | + | ||
206 | + | ||
207 | + | func keyStakingProfitAddress () = "%s__stakingProfitAddress" | |
208 | + | ||
209 | + | ||
210 | + | func keyLeasedRatio (poolAddress,assetId) = makeString(["%s%s%s", "leasedRatio", poolAddress, assetId], SEP) | |
211 | + | ||
212 | + | ||
213 | + | func keyLeasedRatioDefault (assetId) = makeString(["%s%s", "leasedRatioDefault", assetId], SEP) | |
214 | + | ||
215 | + | ||
216 | + | func keyLeasedRatioTolerance (poolAddress,assetId) = makeString(["%s%s%s", "leasedRatioTolerance", poolAddress, assetId], SEP) | |
217 | + | ||
218 | + | ||
219 | + | func keyMinBalance (poolAddress,assetId) = makeString(["%s%s%s", "minBalance", poolAddress, assetId], SEP) | |
220 | + | ||
221 | + | ||
222 | + | func keyMinBalanceDefault (assetId) = makeString(["%s%s", "minBalanceDefault", assetId], SEP) | |
197 | 223 | ||
198 | 224 | ||
199 | 225 | func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), ("No data for this.key=" + key)) | |
200 | 226 | ||
201 | 227 | ||
202 | 228 | func getBooleanOrFail (key) = valueOrErrorMessage(getBoolean(this, key), ("No data for this.key=" + key)) | |
203 | 229 | ||
204 | 230 | ||
205 | 231 | func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), ("No data for this.key=" + key)) | |
206 | 232 | ||
207 | 233 | ||
208 | 234 | func parseAssetId (input) = if ((input == wavesString)) | |
209 | 235 | then unit | |
210 | 236 | else fromBase58String(input) | |
211 | 237 | ||
212 | 238 | ||
213 | 239 | let IdxFactoryCfgStakingDapp = 1 | |
214 | 240 | ||
215 | 241 | let IdxFactoryCfgBoostingDapp = 2 | |
216 | 242 | ||
217 | 243 | let IdxFactoryCfgIdoDapp = 3 | |
218 | 244 | ||
219 | 245 | let IdxFactoryCfgTeamDapp = 4 | |
220 | 246 | ||
221 | 247 | let IdxFactoryCfgEmissionDapp = 5 | |
222 | 248 | ||
223 | 249 | let IdxFactoryCfgRestDapp = 6 | |
224 | 250 | ||
225 | 251 | let IdxFactoryCfgSlippageDapp = 7 | |
226 | 252 | ||
227 | 253 | let IdxFactoryCfgDaoDapp = 8 | |
228 | 254 | ||
229 | 255 | let IdxFactoryCfgMarketingDapp = 9 | |
230 | 256 | ||
231 | 257 | let IdxFactoryCfgGwxRewardDapp = 10 | |
232 | 258 | ||
233 | 259 | let IdxFactoryCfgBirdsDapp = 11 | |
234 | 260 | ||
235 | 261 | func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp]) | |
236 | 262 | ||
237 | 263 | ||
238 | 264 | func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp]) | |
239 | 265 | ||
240 | 266 | ||
241 | 267 | func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp]) | |
242 | 268 | ||
243 | 269 | ||
244 | 270 | func getGwxRewardAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgGwxRewardDapp]) | |
245 | 271 | ||
246 | 272 | ||
247 | 273 | func getPriceAssets () = match getString(keyPriceAssets()) { | |
248 | 274 | case s: String => | |
249 | 275 | if ((size(s) == 0)) | |
250 | 276 | then nil | |
251 | 277 | else split(s, SEP) | |
252 | 278 | case _ => | |
253 | 279 | nil | |
254 | 280 | } | |
255 | 281 | ||
256 | 282 | ||
257 | 283 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
258 | 284 | case s: String => | |
259 | 285 | fromBase58String(s) | |
260 | 286 | case _: Unit => | |
261 | 287 | unit | |
262 | 288 | case _ => | |
263 | 289 | throw("Match error") | |
264 | 290 | } | |
265 | 291 | ||
266 | 292 | ||
267 | 293 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
268 | 294 | case s: String => | |
269 | 295 | fromBase58String(s) | |
270 | 296 | case _: Unit => | |
271 | 297 | unit | |
272 | 298 | case _ => | |
273 | 299 | throw("Match error") | |
274 | 300 | } | |
275 | 301 | ||
276 | 302 | ||
277 | 303 | let permissionDeniedError = throw("Permission denied") | |
278 | 304 | ||
279 | 305 | let testError = throw("Test error here") | |
280 | 306 | ||
281 | 307 | func mustThis (i) = if ((i.caller == this)) | |
282 | 308 | then true | |
283 | 309 | else permissionDeniedError | |
284 | 310 | ||
285 | 311 | ||
286 | 312 | func mustManager (i) = match managerPublicKeyOrUnit() { | |
287 | 313 | case pk: ByteVector => | |
288 | 314 | if ((i.callerPublicKey == pk)) | |
289 | 315 | then true | |
290 | 316 | else permissionDeniedError | |
291 | 317 | case _: Unit => | |
292 | 318 | mustThis(i) | |
293 | 319 | case _ => | |
294 | 320 | throw("Match error") | |
295 | 321 | } | |
296 | 322 | ||
297 | 323 | ||
298 | 324 | func dataFactoryCfgV3 (stakingAddress,boostingAddress,idoContract,teamContract,emissionContract,restContract,slippageContract,daoContract,marketingContract,gwxRewardsContract,birdsContract) = makeString(["%s%s%s%s%s%s%s%s%s%s%s", stakingAddress, boostingAddress, idoContract, teamContract, emissionContract, restContract, slippageContract, daoContract, marketingContract, gwxRewardsContract, birdsContract], SEP) | |
299 | 325 | ||
300 | 326 | ||
301 | 327 | func dataFactoryCfg (stakingAddress,boostingAddress,idoContract,teamContract,emissionContract,restContract,slippageContract) = makeString(["%s%s%s%s%s%s", stakingAddress, boostingAddress, idoContract, teamContract, emissionContract, restContract, slippageContract], SEP) | |
302 | 328 | ||
303 | 329 | ||
304 | 330 | func dataPoolCfg (poolAddress,poolStatus,lpAssetId,amountAssetStr,priceAssetStr,amountAssetDecimals,priceAssetDecimals,amountAssetInternalId,priceAssetInternalId,lpAssetDecimals,poolType) = makeString(["%s%d%s%s%s%d%d%d%d%d%s", poolAddress, poolStatus, lpAssetId, amountAssetStr, priceAssetStr, toString(amountAssetDecimals), toString(priceAssetDecimals), toString(amountAssetInternalId), toString(priceAssetInternalId), toString(lpAssetDecimals), poolType], SEP) | |
305 | 331 | ||
306 | 332 | ||
307 | 333 | func dataMappingPoolAssets (internalAmountAssetStr,internalPriceAssetStr) = makeString(["%d%d", toString(internalAmountAssetStr), toString(internalPriceAssetStr)], SEP) | |
308 | 334 | ||
309 | 335 | ||
310 | 336 | func getPoolConfig (poolAddress) = { | |
311 | 337 | let poolAssets = split(getStringOrFail(keyMappingPoolContractAddressToPoolAssets(poolAddress)), SEP) | |
312 | 338 | let amountAssetInternal = poolAssets[1] | |
313 | 339 | let priceAssetInternal = poolAssets[2] | |
314 | 340 | split(getStringOrFail(keyPoolConfig(amountAssetInternal, priceAssetInternal)), SEP) | |
315 | 341 | } | |
316 | 342 | ||
317 | 343 | ||
318 | 344 | func getInternalAssetIdOrCreate (assetIdStr,incrementor) = { | |
319 | 345 | let internalAssetId = valueOrElse(getInteger(this, keyMappingsBaseAsset2internalId(assetIdStr)), 0) | |
320 | 346 | let currentIndexOfInternalId = valueOrElse(getInteger(this, keyNextInternalAssetId()), 0) | |
321 | 347 | let result = if ((internalAssetId == 0)) | |
322 | 348 | then { | |
323 | 349 | let newInternalAssetId = (currentIndexOfInternalId + incrementor) | |
324 | 350 | $Tuple3(newInternalAssetId, [IntegerEntry(keyNextInternalAssetId(), newInternalAssetId), IntegerEntry(keyMappingsBaseAsset2internalId(assetIdStr), newInternalAssetId), StringEntry(keyMappingsInternal2baseAssetId(newInternalAssetId), assetIdStr)], true) | |
325 | 351 | } | |
326 | 352 | else $Tuple3(internalAssetId, nil, false) | |
327 | 353 | result | |
328 | 354 | } | |
329 | 355 | ||
330 | 356 | ||
331 | 357 | func mustAdmin (i) = { | |
332 | 358 | let adminPKs = split(valueOrElse(getString(keyAdminPubKeys()), EMPTY), SEP) | |
333 | 359 | if (containsElement(adminPKs, toBase58String(i.callerPublicKey))) | |
334 | 360 | then true | |
335 | 361 | else { | |
336 | 362 | let isManager = mustManager(i) | |
337 | 363 | if ((isManager == isManager)) | |
338 | 364 | then true | |
339 | 365 | else throw("Strict value is not equal to itself.") | |
340 | 366 | } | |
341 | 367 | } | |
342 | 368 | ||
343 | 369 | ||
344 | 370 | func intOrDefaultOrFallback (key,keyDefault,valueFallback) = valueOrElse(getInteger(this, key), valueOrElse(getInteger(this, keyDefault), valueFallback)) | |
345 | 371 | ||
346 | 372 | ||
347 | 373 | func poolExistsInternal (amountAssetId,priceAssetId) = { | |
348 | 374 | let amountAssetInternal = getInteger(keyMappingsBaseAsset2internalId(amountAssetId)) | |
349 | 375 | let priceAssetInternal = getInteger(keyMappingsBaseAsset2internalId(priceAssetId)) | |
350 | 376 | if (if ((amountAssetInternal == unit)) | |
351 | 377 | then true | |
352 | 378 | else (priceAssetInternal == unit)) | |
353 | 379 | then false | |
354 | 380 | else { | |
355 | 381 | let amAs = toString(value(amountAssetInternal)) | |
356 | 382 | let prAs = toString(value(priceAssetInternal)) | |
357 | 383 | let cfg = getString(keyPoolConfig(amAs, prAs)) | |
358 | 384 | let cfgReverse = getString(keyPoolConfig(prAs, amAs)) | |
359 | 385 | let exists = if ((cfg != unit)) | |
360 | 386 | then true | |
361 | 387 | else (cfgReverse != unit) | |
362 | 388 | exists | |
363 | 389 | } | |
364 | 390 | } | |
365 | 391 | ||
366 | 392 | ||
367 | 393 | @Callable(i) | |
368 | 394 | func getSwapContractREADONLY () = $Tuple2(nil, getStringOrFail(swapContract())) | |
395 | + | ||
396 | + | ||
397 | + | ||
398 | + | @Callable(i) | |
399 | + | func getPoolLeaseConfigREADONLY (poolAddress,assetId) = { | |
400 | + | let $t01430514609 = match getInteger(this, keyLeasedRatio(poolAddress, assetId)) { | |
401 | + | case r: Int => | |
402 | + | $Tuple2(true, min([100, max([0, r])])) | |
403 | + | case _ => | |
404 | + | match getInteger(this, keyLeasedRatioDefault(assetId)) { | |
405 | + | case rd: Int => | |
406 | + | $Tuple2(true, min([100, max([0, rd])])) | |
407 | + | case _ => | |
408 | + | $Tuple2(false, 0) | |
409 | + | } | |
410 | + | } | |
411 | + | let isLeasable = $t01430514609._1 | |
412 | + | let leasedRatio = $t01430514609._2 | |
413 | + | let minBalance = match getInteger(this, keyMinBalance(poolAddress, assetId)) { | |
414 | + | case b: Int => | |
415 | + | max([0, b]) | |
416 | + | case _ => | |
417 | + | match getInteger(this, keyMinBalanceDefault(assetId)) { | |
418 | + | case bd: Int => | |
419 | + | max([0, bd]) | |
420 | + | case _ => | |
421 | + | 0 | |
422 | + | } | |
423 | + | } | |
424 | + | let $t01487515099 = if ((assetId == "WAVES")) | |
425 | + | then $Tuple3(valueOrElse(getString(this, keySWavesProxyAddress()), ""), getString(this, valueOrElse(keySWavesAssetId(), "")), MULT12) | |
426 | + | else $Tuple3("", "", 0) | |
427 | + | let proxyAddress = $t01487515099._1 | |
428 | + | let proxyAssetId = $t01487515099._2 | |
429 | + | let proxyRateMul = $t01487515099._3 | |
430 | + | let stakingProfitAddress = valueOrElse(getString(this, keyStakingProfitAddress()), "") | |
431 | + | $Tuple2(nil, $Tuple7(isLeasable, leasedRatio, minBalance, proxyAddress, proxyAssetId, proxyRateMul, stakingProfitAddress)) | |
432 | + | } | |
369 | 433 | ||
370 | 434 | ||
371 | 435 | ||
372 | 436 | @Callable(i) | |
373 | 437 | func getLpAssetFromPoolAssetsREADONLY (asset1,asset2) = if (if ((asset1 == "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS")) | |
374 | 438 | then (asset2 == "WAVES") | |
375 | 439 | else false) | |
376 | 440 | then $Tuple2(nil, unit) | |
377 | 441 | else { | |
378 | 442 | let assetNum1 = value(getInteger(this, keyMappingsBaseAsset2internalId(asset1))) | |
379 | 443 | let assetNum2 = value(getInteger(this, keyMappingsBaseAsset2internalId(asset2))) | |
380 | 444 | let ee = getString(this, keyMappingPoolAssetsToLpasset(toString(assetNum1), toString(assetNum2))) | |
381 | 445 | let res = if ((ee == unit)) | |
382 | 446 | then unit | |
383 | 447 | else drop(value(ee), 4) | |
384 | 448 | $Tuple2(nil, res) | |
385 | 449 | } | |
386 | 450 | ||
387 | 451 | ||
388 | 452 | ||
389 | 453 | @Callable(i) | |
390 | 454 | func getPoolAddressFromLpAssetREADONLY (lp) = $Tuple2(nil, valueOrElse(getString(this, keyMappingPoolLPAssetToPoolContractAddress(lp)), "")) | |
391 | 455 | ||
392 | 456 | ||
393 | 457 | ||
394 | 458 | @Callable(i) | |
395 | 459 | func constructor (stakingContract,boostingContract,idoContract,teamContract,emissionContract,restContract,slpipageContract,priceDecimals) = { | |
396 | 460 | let checkCaller = mustManager(i) | |
397 | 461 | if ((checkCaller == checkCaller)) | |
398 | 462 | then [StringEntry(keyFactoryConfig(), dataFactoryCfg(stakingContract, boostingContract, idoContract, teamContract, emissionContract, restContract, slpipageContract)), IntegerEntry(keyPriceDecimals(), priceDecimals)] | |
399 | 463 | else throw("Strict value is not equal to itself.") | |
400 | 464 | } | |
401 | 465 | ||
402 | 466 | ||
403 | 467 | ||
404 | 468 | @Callable(i) | |
405 | 469 | func constructorV2 (mathcherPub58Str) = { | |
406 | 470 | let checkCaller = mustManager(i) | |
407 | 471 | if ((checkCaller == checkCaller)) | |
408 | 472 | then { | |
409 | 473 | let mathcerPub = addressFromPublicKey(fromBase58String(mathcherPub58Str)) | |
410 | 474 | if ((mathcerPub == mathcerPub)) | |
411 | 475 | then [StringEntry(keyMatcherPub(), mathcherPub58Str)] | |
412 | 476 | else throw("Strict value is not equal to itself.") | |
413 | 477 | } | |
414 | 478 | else throw("Strict value is not equal to itself.") | |
415 | 479 | } | |
416 | 480 | ||
417 | 481 | ||
418 | 482 | ||
419 | 483 | @Callable(i) | |
420 | 484 | func constructorV3 (daoContract,marketingContract,gwxRewardsContract,birdsContract) = { | |
421 | 485 | let checkCaller = mustManager(i) | |
422 | 486 | if ((checkCaller == checkCaller)) | |
423 | 487 | then { | |
424 | 488 | let factoryCfg = split(getStringOrFail(keyFactoryConfig()), SEP) | |
425 | 489 | [StringEntry(keyFactoryConfig(), dataFactoryCfgV3(factoryCfg[1], factoryCfg[2], factoryCfg[3], factoryCfg[4], factoryCfg[5], factoryCfg[6], factoryCfg[7], daoContract, marketingContract, gwxRewardsContract, birdsContract))] | |
426 | 490 | } | |
427 | 491 | else throw("Strict value is not equal to itself.") | |
428 | 492 | } | |
429 | 493 | ||
430 | 494 | ||
431 | 495 | ||
432 | 496 | @Callable(i) | |
433 | 497 | func constructorV4 (legacyFactoryContract,legacyPools) = { | |
434 | 498 | let checkCaller = mustManager(i) | |
435 | 499 | if ((checkCaller == checkCaller)) | |
436 | 500 | then [StringEntry(keyLegacyFactoryContract(), legacyFactoryContract), StringEntry(keyLegacyPools(), makeString(legacyPools, SEP))] | |
437 | 501 | else throw("Strict value is not equal to itself.") | |
438 | 502 | } | |
439 | 503 | ||
440 | 504 | ||
441 | 505 | ||
442 | 506 | @Callable(i) | |
443 | 507 | func constructorV5 (assetsStoreContract) = { | |
444 | 508 | let checkCaller = mustManager(i) | |
445 | 509 | if ((checkCaller == checkCaller)) | |
446 | 510 | then [StringEntry(keyAssetsStoreContract(), assetsStoreContract)] | |
447 | 511 | else throw("Strict value is not equal to itself.") | |
448 | 512 | } | |
449 | 513 | ||
450 | 514 | ||
451 | 515 | ||
452 | 516 | @Callable(i) | |
453 | 517 | func constructorV6 (votingEmissionContract,priceAssets) = { | |
454 | 518 | let cheks = [mustManager(i), if ((addressFromString(votingEmissionContract) != unit)) | |
455 | 519 | then true | |
456 | 520 | else "invalid voting emission contract address"] | |
457 | 521 | if ((cheks == cheks)) | |
458 | 522 | then [StringEntry(keyVotingEmissionContract(), votingEmissionContract), StringEntry(keyPriceAssets(), makeString(priceAssets, SEP))] | |
459 | 523 | else throw("Strict value is not equal to itself.") | |
460 | 524 | } | |
461 | 525 | ||
462 | 526 | ||
463 | 527 | ||
464 | 528 | @Callable(i) | |
465 | 529 | func setManager (pendingManagerPublicKey) = { | |
466 | 530 | let checkCaller = mustManager(i) | |
467 | 531 | if ((checkCaller == checkCaller)) | |
468 | 532 | then { | |
469 | 533 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
470 | 534 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
471 | 535 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
472 | 536 | else throw("Strict value is not equal to itself.") | |
473 | 537 | } | |
474 | 538 | else throw("Strict value is not equal to itself.") | |
475 | 539 | } | |
476 | 540 | ||
477 | 541 | ||
478 | 542 | ||
479 | 543 | @Callable(i) | |
480 | 544 | func confirmManager () = { | |
481 | 545 | let pm = pendingManagerPublicKeyOrUnit() | |
482 | 546 | let hasPM = if (isDefined(pm)) | |
483 | 547 | then true | |
484 | 548 | else throw("No pending manager") | |
485 | 549 | if ((hasPM == hasPM)) | |
486 | 550 | then { | |
487 | 551 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
488 | 552 | then true | |
489 | 553 | else throw("You are not pending manager") | |
490 | 554 | if ((checkPM == checkPM)) | |
491 | 555 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
492 | 556 | else throw("Strict value is not equal to itself.") | |
493 | 557 | } | |
494 | 558 | else throw("Strict value is not equal to itself.") | |
495 | 559 | } | |
496 | 560 | ||
497 | 561 | ||
498 | 562 | ||
499 | 563 | @Callable(i) | |
500 | 564 | func setAdmins (adminPubKeys) = { | |
501 | 565 | let checkCaller = mustManager(i) | |
502 | 566 | if ((checkCaller == checkCaller)) | |
503 | 567 | then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))] | |
504 | 568 | else throw("Strict value is not equal to itself.") | |
505 | 569 | } | |
506 | 570 | ||
507 | 571 | ||
508 | 572 | ||
509 | 573 | @Callable(i) | |
510 | 574 | func activateNewPool (poolAddress,amountAssetStr,priceAssetStr,lpAssetName,lpAssetDescr,poolWeight,poolType,logo) = { | |
511 | 575 | let checkCaller = mustAdmin(i) | |
512 | 576 | if ((checkCaller == checkCaller)) | |
513 | 577 | then if (isDefined(getString(keyMappingPoolContractAddressToPoolAssets(poolAddress)))) | |
514 | 578 | then throw((("Pool address " + poolAddress) + " already registered.")) | |
515 | 579 | else { | |
516 | 580 | let internalAmountAssetData = getInternalAssetIdOrCreate(amountAssetStr, 1) | |
517 | 581 | let internalAmountAssetId = internalAmountAssetData._1 | |
518 | 582 | let internalPriceAssetData = getInternalAssetIdOrCreate(priceAssetStr, if (internalAmountAssetData._3) | |
519 | 583 | then 2 | |
520 | 584 | else 1) | |
521 | 585 | let internalPriceAssetId = internalPriceAssetData._1 | |
522 | 586 | let poolAccountScriptHash = valueOrErrorMessage(scriptHash(addressFromStringValue(poolAddress)), ("No script has been found on pool account " + poolAddress)) | |
523 | 587 | let ethalonPoolAccountScriptHash = getBinaryValue(keyPoolScriptHash()) | |
524 | 588 | let poolExists = poolExistsInternal(amountAssetStr, priceAssetStr) | |
525 | 589 | if (poolExists) | |
526 | 590 | then throw((((("Pool " + amountAssetStr) + "/") + priceAssetStr) + " has already been activated.")) | |
527 | 591 | else { | |
528 | 592 | let poolConfigValue = value(getString(this, keyPoolConfig(toString(internalAmountAssetId), toString(internalPriceAssetId)))) | |
529 | 593 | let amountAssetsDecimals = if ((amountAssetStr == "WAVES")) | |
530 | 594 | then decimalsMultPrice | |
531 | 595 | else pow(10, 0, value(assetInfo(fromBase58String(amountAssetStr))).decimals, 0, 0, DOWN) | |
532 | 596 | let priceAssetsDecimals = if ((priceAssetStr == "WAVES")) | |
533 | 597 | then decimalsMultPrice | |
534 | 598 | else pow(10, 0, value(assetInfo(fromBase58String(priceAssetStr))).decimals, 0, 0, DOWN) | |
535 | 599 | let lpAssetIssueAction = Issue(lpAssetName, lpAssetDescr, 1, 8, true) | |
536 | 600 | let lpAssetId = calculateAssetId(lpAssetIssueAction) | |
537 | 601 | let lpAssetIdStr = toBase58String(lpAssetId) | |
538 | 602 | let poolActivateInvokeResult = invoke(addressFromStringValue(poolAddress), "activate", [amountAssetStr, priceAssetStr], nil) | |
539 | 603 | if ((poolActivateInvokeResult == poolActivateInvokeResult)) | |
540 | 604 | then if ((poolActivateInvokeResult != "success")) | |
541 | 605 | then throw("Pool initialisation error happened.") | |
542 | 606 | else { | |
543 | 607 | let assetsStoreContract = addressFromStringValue(getStringOrFail(keyAssetsStoreContract())) | |
544 | 608 | let createOrUpdateLpAssetInv = invoke(assetsStoreContract, "createOrUpdate", [lpAssetIdStr, lpAssetName, false], nil) | |
545 | 609 | if ((createOrUpdateLpAssetInv == createOrUpdateLpAssetInv)) | |
546 | 610 | then { | |
547 | 611 | let addPoolsLpLabelInv = invoke(assetsStoreContract, "addLabel", [lpAssetIdStr, labelPoolsLp], nil) | |
548 | 612 | if ((addPoolsLpLabelInv == addPoolsLpLabelInv)) | |
549 | 613 | then { | |
550 | 614 | let setLogoInv = invoke(assetsStoreContract, "setLogo", [lpAssetIdStr, logo], nil) | |
551 | 615 | if ((setLogoInv == setLogoInv)) | |
552 | 616 | then { | |
553 | 617 | let addAssetsLinkInv = invoke(assetsStoreContract, "addAssetsLink", [amountAssetStr, priceAssetStr, lpAssetIdStr], nil) | |
554 | 618 | if ((addAssetsLinkInv == addAssetsLinkInv)) | |
555 | 619 | then { | |
556 | 620 | let increaseAssetPoolsNumberInv = invoke(assetsStoreContract, "increaseAssetPoolsNumber", [amountAssetStr], nil) | |
557 | 621 | if ((increaseAssetPoolsNumberInv == increaseAssetPoolsNumberInv)) | |
558 | 622 | then $Tuple2(((internalAmountAssetData._2 ++ internalPriceAssetData._2) ++ [lpAssetIssueAction, Burn(lpAssetId, 1), StringEntry(keyPoolConfig(toString(internalAmountAssetId), toString(internalPriceAssetId)), dataPoolCfg(poolAddress, toString(PoolActive), lpAssetIdStr, amountAssetStr, priceAssetStr, amountAssetsDecimals, priceAssetsDecimals, internalAmountAssetId, internalPriceAssetId, decimalsMultPrice, poolType)), StringEntry(keyMappingLpAssetToPoolAssets(lpAssetIdStr), dataMappingPoolAssets(internalAmountAssetId, internalPriceAssetId)), StringEntry(keyMappingPoolAssetsToLpasset(toString(internalAmountAssetId), toString(internalPriceAssetId)), ("%s__" + lpAssetIdStr)), StringEntry(keyMappingPoolContractAddressToPoolAssets(poolAddress), dataMappingPoolAssets(internalAmountAssetId, internalPriceAssetId)), StringEntry(keyMappingPoolAssetsToPoolContractAddress(internalAmountAssetId, internalPriceAssetId), poolAddress), StringEntry(keyMappingPoolLPAssetToPoolContractAddress(lpAssetIdStr), poolAddress), StringEntry(keyMappingPoolContractToLPAsset(poolAddress), lpAssetIdStr), IntegerEntry(keyPoolToWeight(poolAddress), poolWeight), IntegerEntry(keyPoolSpread(poolAddress), defaultSpread)]), lpAssetIdStr) | |
559 | 623 | else throw("Strict value is not equal to itself.") | |
560 | 624 | } | |
561 | 625 | else throw("Strict value is not equal to itself.") | |
562 | 626 | } | |
563 | 627 | else throw("Strict value is not equal to itself.") | |
564 | 628 | } | |
565 | 629 | else throw("Strict value is not equal to itself.") | |
566 | 630 | } | |
567 | 631 | else throw("Strict value is not equal to itself.") | |
568 | 632 | } | |
569 | 633 | else throw("Strict value is not equal to itself.") | |
570 | 634 | } | |
571 | 635 | } | |
572 | 636 | else throw("Strict value is not equal to itself.") | |
573 | 637 | } | |
574 | 638 | ||
575 | 639 | ||
576 | 640 | ||
577 | 641 | @Callable(i) | |
578 | 642 | func managePool (poolAddress,newStatus) = { | |
579 | 643 | let checkCaller = mustManager(i) | |
580 | 644 | if ((checkCaller == checkCaller)) | |
581 | 645 | then { | |
582 | 646 | let poolConfig = getPoolConfig(poolAddress) | |
583 | 647 | let poolStatus = poolConfig[idxPoolStatus] | |
584 | 648 | let lpAssetIdStr = poolConfig[idxPoolLPAssetId] | |
585 | 649 | let amountAssetStr = poolConfig[idxAmtAssetId] | |
586 | 650 | let priceAssetStr = poolConfig[idxPriceAssetId] | |
587 | 651 | let amountAssetsDecimals = parseIntValue(poolConfig[idxAmtAssetDcm]) | |
588 | 652 | let priceAssetsDecimals = parseIntValue(poolConfig[idxPriceAssetDcm]) | |
589 | 653 | let internalAmountAssetId = parseIntValue(poolConfig[idxIAmtAssetId]) | |
590 | 654 | let internalPriceAssetId = parseIntValue(poolConfig[idxIPriceAssetId]) | |
591 | 655 | let lpAssetDcm = parseIntValue(poolConfig[idxLPAssetDcm]) | |
592 | 656 | let poolType = poolConfig[idxPoolType] | |
593 | 657 | [StringEntry(keyPoolConfig(toString(internalAmountAssetId), toString(internalPriceAssetId)), dataPoolCfg(poolAddress, toString(newStatus), lpAssetIdStr, amountAssetStr, priceAssetStr, amountAssetsDecimals, priceAssetsDecimals, internalAmountAssetId, internalPriceAssetId, lpAssetDcm, poolType))] | |
594 | 658 | } | |
595 | 659 | else throw("Strict value is not equal to itself.") | |
596 | 660 | } | |
597 | 661 | ||
598 | 662 | ||
599 | 663 | ||
600 | 664 | @Callable(i) | |
601 | 665 | func emit (amountToEmit) = { | |
602 | 666 | let caller = i.caller | |
603 | 667 | let originCaller = i.originCaller | |
604 | 668 | let lpAssetRequested = valueOrErrorMessage(getString(keyMappingPoolContractToLPAsset(toString(caller))), "Invalid LP address called me.") | |
605 | 669 | let lpAsset = fromBase58String(lpAssetRequested) | |
606 | 670 | let legacyPools = split(valueOrElse(getString(keyLegacyPools()), EMPTY), SEP) | |
607 | 671 | let legacyFactoryContract = addressFromStringValue(valueOrErrorMessage(getString(keyLegacyFactoryContract()), "Legacy factory contract does not exists.")) | |
608 | 672 | if ((0 >= amountToEmit)) | |
609 | 673 | then nil | |
610 | 674 | else if (containsElement(legacyPools, toString(caller))) | |
611 | 675 | then $Tuple2(nil, legacyFactoryContract) | |
612 | 676 | else $Tuple2([Reissue(lpAsset, amountToEmit, true), ScriptTransfer(i.caller, amountToEmit, lpAsset)], "success") | |
613 | 677 | } | |
614 | 678 | ||
615 | 679 | ||
616 | 680 | ||
617 | 681 | @Callable(i) | |
618 | 682 | func burn (amountToBurn) = { | |
619 | 683 | let caller = i.caller | |
620 | 684 | let originCaller = i.originCaller | |
621 | 685 | let payment = value(i.payments[0]) | |
622 | 686 | let paymentAmount = value(payment.amount) | |
623 | 687 | let inAmountAssetId = toBase58String(value(payment.assetId)) | |
624 | 688 | let lpAssetRequestedForBurning = valueOrErrorMessage(getString(keyMappingPoolContractToLPAsset(toString(caller))), "Invalid LP address called me.") | |
625 | 689 | if ((inAmountAssetId != lpAssetRequestedForBurning)) | |
626 | 690 | then throw("Invalid asset passed.") | |
627 | 691 | else if ((amountToBurn != paymentAmount)) | |
628 | 692 | then throw("Invalid amount passed.") | |
629 | 693 | else { | |
630 | 694 | let lpAsset = fromBase58String(lpAssetRequestedForBurning) | |
631 | 695 | $Tuple2([Burn(lpAsset, amountToBurn)], "success") | |
632 | 696 | } | |
633 | 697 | } | |
634 | 698 | ||
635 | 699 | ||
636 | 700 | ||
637 | 701 | @Callable(i) | |
638 | 702 | func modifyWeight (lpAssetId,share) = { | |
639 | 703 | let checkCaller = if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyVotingEmissionContract()), ""))) | |
640 | 704 | then true | |
641 | 705 | else mustManager(i) | |
642 | 706 | if ((checkCaller == checkCaller)) | |
643 | 707 | then { | |
644 | 708 | let poolContractAddress = getStringOrFail(keyMappingPoolLPAssetToPoolContractAddress(lpAssetId)) | |
645 | 709 | let poolWeightKey = keyPoolToWeight(poolContractAddress) | |
646 | 710 | let gwxWeightKey = keyPoolToWeight(GWXvirtualPOOL) | |
647 | 711 | let gwxWeight = valueOrElse(getInteger(gwxWeightKey), 0) | |
648 | 712 | let poolWeight = valueOrElse(getInteger(poolWeightKey), 0) | |
649 | 713 | let poolWeightNew = share | |
650 | 714 | let factoryCfg = split(getStringOrFail(keyFactoryConfig()), SEP) | |
651 | 715 | let stakingContract = getStakingAddressOrFail(factoryCfg) | |
652 | 716 | let onModifyWeightInv = invoke(stakingContract, "onModifyWeight", [lpAssetId, poolContractAddress], nil) | |
653 | 717 | if ((onModifyWeightInv == onModifyWeightInv)) | |
654 | 718 | then { | |
655 | 719 | let gwxVirtualPoolActions = if ((gwxWeight == 0)) | |
656 | 720 | then nil | |
657 | 721 | else [IntegerEntry(gwxWeightKey, 0)] | |
658 | 722 | let poolWeightHistoryKey = keyPoolToWeightHistory(poolContractAddress, 0) | |
659 | 723 | let poolWeightHistoryOrUnit = getInteger(poolWeightHistoryKey) | |
660 | 724 | let poolWeightHistoryActions = if ((poolWeightHistoryOrUnit == unit)) | |
661 | 725 | then nil | |
662 | 726 | else [DeleteEntry(poolWeightHistoryKey)] | |
663 | 727 | (([IntegerEntry(poolWeightKey, poolWeightNew)] ++ gwxVirtualPoolActions) ++ poolWeightHistoryActions) | |
664 | 728 | } | |
665 | 729 | else throw("Strict value is not equal to itself.") | |
666 | 730 | } | |
667 | 731 | else throw("Strict value is not equal to itself.") | |
668 | 732 | } | |
669 | 733 | ||
670 | 734 | ||
671 | 735 | ||
672 | 736 | @Callable(i) | |
673 | 737 | func modifyWeights (btcPoolAddress,ethPoolAddress,ethBtcPoolAddress,usdcUsdtPoolAddress) = { | |
674 | 738 | let checkCaller = mustManager(i) | |
675 | 739 | if ((checkCaller == checkCaller)) | |
676 | 740 | then { | |
677 | 741 | let ethBtcWeightNew = ((5 * POOLWEIGHTMULT) / 100) | |
678 | 742 | let usdcUsdtWeightNew = ((5 * POOLWEIGHTMULT) / 100) | |
679 | 743 | let weightDecrement = ((5 * POOLWEIGHTMULT) / 100) | |
680 | 744 | let factoryCfg = split(getStringOrFail(keyFactoryConfig()), SEP) | |
681 | 745 | let stakingDapp = getStakingAddressOrFail(factoryCfg) | |
682 | 746 | let gwxRewardDapp = getGwxRewardAddressOrFail(factoryCfg) | |
683 | 747 | let btcWeightKEY = keyPoolToWeight(btcPoolAddress) | |
684 | 748 | let ethWeightKEY = keyPoolToWeight(ethPoolAddress) | |
685 | 749 | let ethBtcWeightKEY = keyPoolToWeight(ethBtcPoolAddress) | |
686 | 750 | let usdcUsdtWeightKEY = keyPoolToWeight(usdcUsdtPoolAddress) | |
687 | 751 | let btcWeight = getIntOrFail(btcWeightKEY) | |
688 | 752 | let ethWeight = getIntOrFail(ethWeightKEY) | |
689 | 753 | let btcWeightNew = (btcWeight - weightDecrement) | |
690 | 754 | let ethWeightNew = (ethWeight - weightDecrement) | |
691 | 755 | if ((0 >= btcWeightNew)) | |
692 | 756 | then throw(("invalid btcWeightNew: " + toString(btcWeightNew))) | |
693 | 757 | else if ((0 >= ethWeightNew)) | |
694 | 758 | then throw(("invalid ethWeightNew: " + toString(ethWeightNew))) | |
695 | 759 | else { | |
696 | 760 | let btcLpAssetIdStr = getStringOrFail(keyMappingPoolContractToLPAsset(btcPoolAddress)) | |
697 | 761 | let ethLpAssetIdStr = getStringOrFail(keyMappingPoolContractToLPAsset(ethPoolAddress)) | |
698 | 762 | let ethBtcLpAssetIdStr = getStringOrFail(keyMappingPoolContractToLPAsset(ethBtcPoolAddress)) | |
699 | 763 | let usdcUsdtLpAssetIdStr = getStringOrFail(keyMappingPoolContractToLPAsset(usdcUsdtPoolAddress)) | |
700 | 764 | let onModifyWeightBtc = invoke(stakingDapp, "onModifyWeight", [btcLpAssetIdStr, btcPoolAddress], nil) | |
701 | 765 | if ((onModifyWeightBtc == onModifyWeightBtc)) | |
702 | 766 | then { | |
703 | 767 | let onModifyWeightEth = invoke(stakingDapp, "onModifyWeight", [ethLpAssetIdStr, ethPoolAddress], nil) | |
704 | 768 | if ((onModifyWeightEth == onModifyWeightEth)) | |
705 | 769 | then { | |
706 | 770 | let onModifyWeightEthBtc = invoke(stakingDapp, "onModifyWeight", [ethBtcLpAssetIdStr, ethBtcPoolAddress], nil) | |
707 | 771 | if ((onModifyWeightEthBtc == onModifyWeightEthBtc)) | |
708 | 772 | then { | |
709 | 773 | let onModifyWeightUsdcUsdt = invoke(stakingDapp, "onModifyWeight", [usdcUsdtLpAssetIdStr, usdcUsdtPoolAddress], nil) | |
710 | 774 | if ((onModifyWeightUsdcUsdt == onModifyWeightUsdcUsdt)) | |
711 | 775 | then [IntegerEntry(btcWeightKEY, btcWeightNew), IntegerEntry(ethWeightKEY, ethWeightNew), IntegerEntry(ethBtcWeightKEY, ethBtcWeightNew), IntegerEntry(usdcUsdtWeightKEY, usdcUsdtWeightNew), IntegerEntry(keyPoolToWeightHistory(btcPoolAddress, 0), btcWeight), IntegerEntry(keyPoolToWeightHistory(ethPoolAddress, 0), ethWeight), IntegerEntry(keyPoolToWeightHistory(ethBtcPoolAddress, 0), ethBtcWeightNew), IntegerEntry(keyPoolToWeightHistory(usdcUsdtPoolAddress, 0), usdcUsdtWeightNew)] | |
712 | 776 | else throw("Strict value is not equal to itself.") | |
713 | 777 | } | |
714 | 778 | else throw("Strict value is not equal to itself.") | |
715 | 779 | } | |
716 | 780 | else throw("Strict value is not equal to itself.") | |
717 | 781 | } | |
718 | 782 | else throw("Strict value is not equal to itself.") | |
719 | 783 | } | |
720 | 784 | } | |
721 | 785 | else throw("Strict value is not equal to itself.") | |
722 | 786 | } | |
723 | 787 | ||
724 | 788 | ||
725 | 789 | ||
726 | 790 | @Callable(i) | |
727 | 791 | func checkWxEmissionPoolLabel (amountAssetId,priceAssetId) = { | |
728 | 792 | let haveLabel = match getBoolean(keyWxEmission(amountAssetId, priceAssetId)) { | |
729 | 793 | case b: Boolean => | |
730 | 794 | b | |
731 | 795 | case _ => | |
732 | 796 | false | |
733 | 797 | } | |
734 | 798 | $Tuple2(nil, haveLabel) | |
735 | 799 | } | |
736 | 800 | ||
737 | 801 | ||
738 | 802 | ||
739 | 803 | @Callable(i) | |
740 | 804 | func setWxEmissionPoolLabel (amountAssetId,priceAssetId) = { | |
741 | 805 | let checkCaller = mustAdmin(i) | |
742 | 806 | if ((checkCaller == checkCaller)) | |
743 | 807 | then $Tuple2([BooleanEntry(keyWxEmission(amountAssetId, priceAssetId), true)], unit) | |
744 | 808 | else throw("Strict value is not equal to itself.") | |
745 | 809 | } | |
746 | 810 | ||
747 | 811 | ||
748 | 812 | ||
749 | 813 | @Callable(i) | |
750 | 814 | func deleteWxEmissionPoolLabel (amountAssetId,priceAssetId) = { | |
751 | 815 | let checkCaller = if (mustThis(i)) | |
752 | 816 | then true | |
753 | 817 | else mustAdmin(i) | |
754 | 818 | if ((checkCaller == checkCaller)) | |
755 | 819 | then $Tuple2([DeleteEntry(keyWxEmission(amountAssetId, priceAssetId))], unit) | |
756 | 820 | else throw("Strict value is not equal to itself.") | |
757 | 821 | } | |
758 | 822 | ||
759 | 823 | ||
760 | 824 | ||
761 | 825 | @Callable(i) | |
762 | 826 | func onVerificationLoss (assetId) = { | |
763 | 827 | let checkCaller = if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyAssetsStoreContract()), ""))) | |
764 | 828 | then true | |
765 | 829 | else mustManager(i) | |
766 | 830 | if ((checkCaller == checkCaller)) | |
767 | 831 | then { | |
768 | 832 | let priceAssets = getPriceAssets() | |
769 | 833 | let checkPriceAssetsSize = if ((size(priceAssets) > 0)) | |
770 | 834 | then true | |
771 | 835 | else throw("invalid price assets") | |
772 | 836 | if ((checkPriceAssetsSize == checkPriceAssetsSize)) | |
773 | 837 | then { | |
774 | 838 | func cb (acc,priceAsset) = { | |
775 | 839 | let r = invoke(this, "deleteWxEmissionPoolLabel", [assetId, priceAsset], nil) | |
776 | 840 | if ((r == r)) | |
777 | 841 | then unit | |
778 | 842 | else throw("Strict value is not equal to itself.") | |
779 | 843 | } | |
780 | 844 | ||
781 | 845 | let actions = { | |
782 | 846 | let $l = priceAssets | |
783 | 847 | let $s = size($l) | |
784 | 848 | let $acc0 = unit | |
785 | 849 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
786 | 850 | then $a | |
787 | 851 | else cb($a, $l[$i]) | |
788 | 852 | ||
789 | 853 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
790 | 854 | then $a | |
791 | 855 | else throw("List size exceeds 2") | |
792 | 856 | ||
793 | 857 | $f0_2($f0_1($f0_1($acc0, 0), 1), 2) | |
794 | 858 | } | |
795 | 859 | if ((actions == actions)) | |
796 | 860 | then $Tuple2(nil, unit) | |
797 | 861 | else throw("Strict value is not equal to itself.") | |
798 | 862 | } | |
799 | 863 | else throw("Strict value is not equal to itself.") | |
800 | 864 | } | |
801 | 865 | else throw("Strict value is not equal to itself.") | |
802 | 866 | } | |
803 | 867 | ||
804 | 868 | ||
805 | 869 | ||
806 | 870 | @Callable(i) | |
807 | 871 | func isPoolOneTokenOperationsDisabledREADONLY (poolAddress) = { | |
808 | 872 | let poolConfig = getPoolConfig(poolAddress) | |
809 | 873 | let assetsInternal = $Tuple2(parseIntValue(poolConfig[idxIAmtAssetId]), parseIntValue(poolConfig[idxIPriceAssetId])) | |
810 | 874 | let poolOneTokenOperationsDisabled = valueOrElse(getBoolean(keyPoolOneTokenOperationsDisabled(assetsInternal)), false) | |
811 | 875 | let allPoolsOneTokenOperationsDisabled = valueOrElse(getBoolean(keyAllPoolsOneTokenOperationsDisabled()), false) | |
812 | 876 | $Tuple2(nil, if (allPoolsOneTokenOperationsDisabled) | |
813 | 877 | then true | |
814 | 878 | else poolOneTokenOperationsDisabled) | |
815 | 879 | } | |
816 | 880 | ||
817 | 881 | ||
818 | 882 | ||
819 | 883 | @Callable(i) | |
820 | 884 | func getInFeeREADONLY (poolAddress) = { | |
821 | 885 | let fee = intOrDefaultOrFallback(keyInFee(poolAddress), keyInFeeDefault(), 0) | |
822 | 886 | $Tuple2(nil, fee) | |
823 | 887 | } | |
824 | 888 | ||
825 | 889 | ||
826 | 890 | ||
827 | 891 | @Callable(i) | |
828 | 892 | func getOutFeeREADONLY (poolAddress) = { | |
829 | 893 | let fee = intOrDefaultOrFallback(keyOutFee(poolAddress), keyOutFeeDefault(), fraction(10, MULT8, 10000)) | |
830 | 894 | $Tuple2(nil, fee) | |
831 | 895 | } | |
832 | 896 | ||
833 | 897 | ||
834 | 898 | ||
835 | 899 | @Callable(i) | |
836 | 900 | func poolInfoREADONLY (amountAssetIdStr,priceAssetIdStr) = { | |
837 | 901 | let amountAssetInternalIdOption = getInteger(this, keyMappingsBaseAsset2internalId(amountAssetIdStr)) | |
838 | 902 | let priceAssetInternalIdOption = getInteger(this, keyMappingsBaseAsset2internalId(priceAssetIdStr)) | |
839 | 903 | let poolContractAddressOption = getString(this, keyMappingPoolAssetsToPoolContractAddress(value(amountAssetInternalIdOption), value(priceAssetInternalIdOption))) | |
840 | 904 | let lpAssetIdOption = getString(this, keyMappingPoolContractToLPAsset(value(poolContractAddressOption))) | |
841 | 905 | let poolExists = if (if (isDefined(amountAssetInternalIdOption)) | |
842 | 906 | then isDefined(priceAssetInternalIdOption) | |
843 | 907 | else false) | |
844 | 908 | then isDefined(poolContractAddressOption) | |
845 | 909 | else false | |
846 | 910 | let poolInfo = if (poolExists) | |
847 | 911 | then $Tuple2(addressFromStringValue(value(poolContractAddressOption)), parseAssetId(value(lpAssetIdOption))) | |
848 | 912 | else unit | |
849 | 913 | $Tuple2(nil, poolInfo) | |
850 | 914 | } | |
851 | 915 | ||
852 | 916 | ||
853 | 917 | ||
854 | 918 | @Callable(i) | |
855 | 919 | func getPoolStatusREADONLY (poolAddress) = { | |
856 | 920 | let poolAssets = split(getStringOrFail(keyMappingPoolContractAddressToPoolAssets(poolAddress)), SEP) | |
857 | 921 | let amountAssetInternal = poolAssets[1] | |
858 | 922 | let priceAssetInternal = poolAssets[2] | |
859 | 923 | let cfg = split(getStringOrFail(keyPoolConfig(amountAssetInternal, priceAssetInternal)), SEP) | |
860 | 924 | $Tuple2(nil, parseIntValue(cfg[idxPoolStatus])) | |
861 | 925 | } | |
862 | 926 | ||
863 | 927 | ||
864 | 928 | ||
865 | 929 | @Callable(i) | |
866 | 930 | func getPoolConfigREADONLY (poolAddress) = { | |
867 | 931 | let poolAssets = split(getStringOrFail(keyMappingPoolContractAddressToPoolAssets(poolAddress)), SEP) | |
868 | 932 | let amountAssetInternal = poolAssets[1] | |
869 | 933 | let priceAssetInternal = poolAssets[2] | |
870 | 934 | let cfg = split(getStringOrFail(keyPoolConfig(amountAssetInternal, priceAssetInternal)), SEP) | |
871 | 935 | $Tuple2(nil, cfg) | |
872 | 936 | } | |
873 | 937 | ||
874 | 938 | ||
875 | 939 | ||
876 | 940 | @Callable(i) | |
877 | 941 | func getPoolConfigByLpAssetIdREADONLY (lpAssetIdStr) = { | |
878 | 942 | let poolAssets = split(getStringOrFail(keyMappingLpAssetToPoolAssets(lpAssetIdStr)), SEP) | |
879 | 943 | let amountAssetInternal = poolAssets[1] | |
880 | 944 | let priceAssetInternal = poolAssets[2] | |
881 | 945 | let cfg = split(getStringOrFail(keyPoolConfig(amountAssetInternal, priceAssetInternal)), SEP) | |
882 | 946 | $Tuple2(nil, cfg) | |
883 | 947 | } | |
884 | 948 | ||
885 | 949 | ||
886 | 950 | ||
887 | 951 | @Callable(i) | |
888 | 952 | func poolExistsREADONLY (amountAssetId,priceAssetId) = $Tuple2(nil, poolExistsInternal(amountAssetId, priceAssetId)) | |
889 | 953 | ||
890 | 954 | ||
891 | 955 | ||
892 | 956 | @Callable(i) | |
893 | 957 | func skipOrderValidationREADONLY (poolAddress) = $Tuple2(nil, valueOrElse(getBoolean(keySkipOrderValidation(poolAddress)), false)) | |
894 | 958 | ||
895 | 959 | ||
896 | 960 | ||
897 | 961 | @Callable(i) | |
898 | 962 | func getChangeAmpConfigREADONLY (poolAddress) = { | |
899 | 963 | let delay = getIntegerValue(keyChangeAmpDelay(poolAddress)) | |
900 | 964 | let delta = getIntegerValue(keyChangeAmpDelta(poolAddress)) | |
901 | 965 | let target = getIntegerValue(keyChangeAmpTarget(poolAddress)) | |
902 | 966 | $Tuple2(nil, [delay, delta, target]) | |
903 | 967 | } | |
904 | 968 | ||
905 | 969 | ||
906 | 970 | @Verifier(tx) | |
907 | 971 | func verify () = { | |
908 | 972 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
909 | 973 | case pk: ByteVector => | |
910 | 974 | pk | |
911 | 975 | case _: Unit => | |
912 | 976 | tx.senderPublicKey | |
913 | 977 | case _ => | |
914 | 978 | throw("Match error") | |
915 | 979 | } | |
916 | 980 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
917 | 981 | } | |
918 | 982 |
github/deemru/w8io/169f3d6 138.60 ms ◑