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