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