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