tx · 6JGPkgQ9F49SFAb77UrMMtovRucmiKck9oaUXmBLzkDx 3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr: -0.01700000 Waves 2024.12.20 11:20 [3422606] smart account 3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr > SELF 0.00000000 Waves
{ "type": 13, "id": "6JGPkgQ9F49SFAb77UrMMtovRucmiKck9oaUXmBLzkDx", "fee": 1700000, "feeAssetId": null, "timestamp": 1734682942172, "version": 2, "chainId": 84, "sender": "3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr", "senderPublicKey": "jXCTQV8PjX2uC9UHBFveupYy9cjhY7stHbzE9cptymw", "proofs": [ "mag4NsMK9AezQBzMDpVQEXgfwno5FMsZVkLaV5sKNVimBXGtPQiNjg8ofW8gCHRTpnmrBeEp4xQe6uqFKdsFXa6" ], "script": "base64:BwIxCAISAwoBCBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGDoACXNlcGFyYXRvcgICX18AC3dhdmVzU3RyaW5nAgVXQVZFUwAQY29udHJhY3RGaWxlbmFtZQIXbWVtZV9pbV9jYWxjdWxhdG9yLnJpZGUABW11bHQ4AIDC1y8BB3dyYXBFcnIBAXMJAKwCAgkArAICBRBjb250cmFjdEZpbGVuYW1lAgI6IAUBcwEIdGhyb3dFcnIBAXMJAAIBCQEHd3JhcEVycgEFAXMBD3ZhbGlkYXRlQWRkcmVzcwEHYWRkcmVzcwkBCWlzRGVmaW5lZAEJAKYIAQUHYWRkcmVzcwAMU1RBVFVTX0VNUFRZAAAADFNUQVRVU19SRUFEWQABABVTVEFUVVNfVEFSR0VUX1JFQUNIRUQAAgASU1RBVFVTX1RSQU5TRkVSUkVEAAMAC2RlZmF1bHRMb2dvAqYBPHN2ZyB3aWR0aD0nMzAnIGhlaWdodD0nMzAnIHhtbG5zPSdodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2Zyc+PGc+PGNpcmNsZSBjeD0nMTUnIGN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zdAADBwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleQQIYnlBZG1pbnMJAAACCAUCdHgCaWQJANkEAQkBC3ZhbHVlT3JFbHNlAgkAnQgCBQ5mYWN0b3J5QWRkcmVzcwUOa2V5QWxsb3dlZFR4SWQCAAMFCGJ5QWRtaW5zBgUHYnlPd25lcnXfpUI=", "height": 3422606, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FZEFZsaSqaXyKCvpy8vzwP5SLByaLqgMypait27tGBq1 Next: G3WvKRepNQWCrTj9z75Ry5GB51NgKYkvuumkb16VT4i5 Diff:
Old | New | Differences | |
---|---|---|---|
177 | 177 | ||
178 | 178 | func isWxSwapActive (amountAssetString,priceAssetString) = { | |
179 | 179 | let statusKey = makeString(["%s%s%s", "status", amountAssetString, priceAssetString], separator) | |
180 | - | let status = valueOrElse(getString(userPoolsAddress, statusKey), "") | |
181 | - | (status == "active") | |
180 | + | let statusKeyReverse = makeString(["%s%s%s", "status", priceAssetString, amountAssetString], separator) | |
181 | + | let pairStatus = valueOrElse(getString(userPoolsAddress, statusKey), "") | |
182 | + | let reversePairStatus = valueOrElse(getString(userPoolsAddress, statusKeyReverse), "") | |
183 | + | if ((pairStatus == "active")) | |
184 | + | then true | |
185 | + | else (reversePairStatus == "active") | |
182 | 186 | } | |
183 | 187 | ||
184 | 188 | ||
366 | 370 | let poolTokensStringList = split(getStringValue(poolAddress, kPoolTokensList), ",") | |
367 | 371 | let asset1 = parseAssetId(poolTokensStringList[0]) | |
368 | 372 | let asset2 = parseAssetId(poolTokensStringList[1]) | |
369 | - | let $ | |
373 | + | let $t01197612068 = if ((asset1 == unit)) | |
370 | 374 | then $Tuple2(asset2, asset1) | |
371 | 375 | else $Tuple2(asset1, asset2) | |
372 | - | let poolAsset = $ | |
373 | - | let wavesAsset = $ | |
376 | + | let poolAsset = $t01197612068._1 | |
377 | + | let wavesAsset = $t01197612068._2 | |
374 | 378 | let poolAssetBalanceBefore = getBalance(factoryAddress, poolAsset) | |
375 | 379 | if ((poolAssetBalanceBefore == poolAssetBalanceBefore)) | |
376 | 380 | then { |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 7 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separator = "__" | |
5 | 5 | ||
6 | 6 | let wavesString = "WAVES" | |
7 | 7 | ||
8 | 8 | let contractFilename = "meme_im_calculator.ride" | |
9 | 9 | ||
10 | 10 | let mult8 = 100000000 | |
11 | 11 | ||
12 | 12 | func wrapErr (s) = ((contractFilename + ": ") + s) | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | func throwErr (s) = throw(wrapErr(s)) | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | func validateAddress (address) = isDefined(addressFromString(address)) | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | let STATUS_EMPTY = 0 | |
22 | 22 | ||
23 | 23 | let STATUS_READY = 1 | |
24 | 24 | ||
25 | 25 | let STATUS_TARGET_REACHED = 2 | |
26 | 26 | ||
27 | 27 | let STATUS_TRANSFERRED = 3 | |
28 | 28 | ||
29 | 29 | let defaultLogo = "<svg width='30' height='30' xmlns='http://www.w3.org/2000/svg'><g><circle cx='15' cy='15' fill='#ccc' r='15'/><text x='1' y='18' font-size='10'>iMeme</text></g></svg>" | |
30 | 30 | ||
31 | 31 | let kShutdown = "shutdown__flag" | |
32 | 32 | ||
33 | 33 | let kPriceAsset = "price__asset" | |
34 | 34 | ||
35 | 35 | let kListingVolume = "listing__volume" | |
36 | 36 | ||
37 | 37 | let kCreationFee = "setup__creationFee" | |
38 | 38 | ||
39 | 39 | let kCurveTarget = "setup__curveTarget" | |
40 | 40 | ||
41 | 41 | let kVirtualLiquidity = "setup__virtualLiquidity" | |
42 | 42 | ||
43 | 43 | let kPoolTokensList = "static_tokenIds" | |
44 | 44 | ||
45 | 45 | let kPoolContractHash = "pool__contract__hash" | |
46 | 46 | ||
47 | 47 | let kLastEmptyPoolIndex = "last__empty_pool__index" | |
48 | 48 | ||
49 | 49 | let kFirstEmptyPoolIndex = "first__empty__pool__index" | |
50 | 50 | ||
51 | 51 | func kPoolAddressFromIndex (index) = makeString(["pool", toString(index)], separator) | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func kPoolIndexFromAddress (address) = makeString(["pool", toString(address)], separator) | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func kPoolAsset (address) = makeString(["asset", toString(address)], separator) | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func kPoolStatus (index) = makeString(["pool", "status", toString(index)], separator) | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | let kFactoryAddress = "factory__address" | |
64 | 64 | ||
65 | 65 | let factoryAddressOption = match getString(this, kFactoryAddress) { | |
66 | 66 | case s: String => | |
67 | 67 | addressFromString(s) | |
68 | 68 | case _: Unit => | |
69 | 69 | unit | |
70 | 70 | case _ => | |
71 | 71 | throw("Match error") | |
72 | 72 | } | |
73 | 73 | ||
74 | 74 | let factoryAddress = valueOrErrorMessage(factoryAddressOption, wrapErr("invalid factory address")) | |
75 | 75 | ||
76 | 76 | let kWxSwapAddress = "wxswap__address" | |
77 | 77 | ||
78 | 78 | let wxSwapAddressOption = match getString(factoryAddress, kWxSwapAddress) { | |
79 | 79 | case s: String => | |
80 | 80 | addressFromString(s) | |
81 | 81 | case _ => | |
82 | 82 | unit | |
83 | 83 | } | |
84 | 84 | ||
85 | 85 | let wxSwapAddress = valueOrErrorMessage(wxSwapAddressOption, wrapErr("invalid wx swap address")) | |
86 | 86 | ||
87 | 87 | let kFeeCollectorAddress = "wxfee_address" | |
88 | 88 | ||
89 | 89 | let feeCollectorAddressOption = match getString(factoryAddress, kFeeCollectorAddress) { | |
90 | 90 | case s: String => | |
91 | 91 | addressFromString(s) | |
92 | 92 | case _ => | |
93 | 93 | unit | |
94 | 94 | } | |
95 | 95 | ||
96 | 96 | let feeCollectorAddress = valueOrErrorMessage(feeCollectorAddressOption, wrapErr("invalid fee collector address")) | |
97 | 97 | ||
98 | 98 | let kUserPoolsAddress = "userpools_address" | |
99 | 99 | ||
100 | 100 | let userPoolsAddressOption = match getString(factoryAddress, kUserPoolsAddress) { | |
101 | 101 | case s: String => | |
102 | 102 | addressFromString(s) | |
103 | 103 | case _ => | |
104 | 104 | unit | |
105 | 105 | } | |
106 | 106 | ||
107 | 107 | let userPoolsAddress = valueOrErrorMessage(userPoolsAddressOption, wrapErr("invalid user_pools dapp address")) | |
108 | 108 | ||
109 | 109 | let kAssetStoreAddress = "assetstore_address" | |
110 | 110 | ||
111 | 111 | let assetStoreAddressOption = match getString(factoryAddress, kAssetStoreAddress) { | |
112 | 112 | case s: String => | |
113 | 113 | addressFromString(s) | |
114 | 114 | case _ => | |
115 | 115 | unit | |
116 | 116 | } | |
117 | 117 | ||
118 | 118 | let assetStoreAddress = valueOrErrorMessage(assetStoreAddressOption, wrapErr("invalid asset_store dapp address")) | |
119 | 119 | ||
120 | 120 | let shutdown = valueOrElse(getBoolean(factoryAddress, kShutdown), false) | |
121 | 121 | ||
122 | 122 | let lastEmptyIndex = valueOrElse(getInteger(factoryAddress, kLastEmptyPoolIndex), 0) | |
123 | 123 | ||
124 | 124 | let firstEmptyIndex = valueOrElse(getInteger(factoryAddress, kFirstEmptyPoolIndex), 0) | |
125 | 125 | ||
126 | 126 | let listingVolume = valueOrElse(getInteger(factoryAddress, kListingVolume), 0) | |
127 | 127 | ||
128 | 128 | let creationFee = valueOrElse(getInteger(factoryAddress, kCreationFee), 0) | |
129 | 129 | ||
130 | 130 | let poolContractHash = getBinary(factoryAddress, kPoolContractHash) | |
131 | 131 | ||
132 | 132 | func parseAssetId (input) = if ((input == wavesString)) | |
133 | 133 | then unit | |
134 | 134 | else fromBase58String(input) | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | func assetIdToString (input) = if ((input == unit)) | |
138 | 138 | then wavesString | |
139 | 139 | else toBase58String(value(input)) | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func mustAddress (caller,address) = if ((caller == address)) | |
143 | 143 | then true | |
144 | 144 | else throwErr("permission denied") | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | func mustThis (caller) = mustAddress(caller, this) | |
148 | 148 | ||
149 | 149 | ||
150 | 150 | func mustFactory (caller) = mustAddress(caller, factoryAddress) | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | func checkContractScript (address) = match poolContractHash { | |
154 | 154 | case hash: ByteVector => | |
155 | 155 | (scriptHash(address) == hash) | |
156 | 156 | case _ => | |
157 | 157 | true | |
158 | 158 | } | |
159 | 159 | ||
160 | 160 | ||
161 | 161 | func isPoolExists (poolAddress) = isDefined(getInteger(factoryAddress, kPoolIndexFromAddress(poolAddress))) | |
162 | 162 | ||
163 | 163 | ||
164 | 164 | func getPoolId (poolAddress) = valueOrErrorMessage(getInteger(factoryAddress, kPoolIndexFromAddress(poolAddress)), "pool doesn't exists") | |
165 | 165 | ||
166 | 166 | ||
167 | 167 | func isPoolTargetReached (poolAddress) = (valueOrElse(getInteger(factoryAddress, kPoolStatus(getPoolId(poolAddress))), -1) == STATUS_TARGET_REACHED) | |
168 | 168 | ||
169 | 169 | ||
170 | 170 | func getBalance (address,assetId) = match assetId { | |
171 | 171 | case id: ByteVector => | |
172 | 172 | assetBalance(address, id) | |
173 | 173 | case _ => | |
174 | 174 | wavesBalance(address).available | |
175 | 175 | } | |
176 | 176 | ||
177 | 177 | ||
178 | 178 | func isWxSwapActive (amountAssetString,priceAssetString) = { | |
179 | 179 | let statusKey = makeString(["%s%s%s", "status", amountAssetString, priceAssetString], separator) | |
180 | - | let status = valueOrElse(getString(userPoolsAddress, statusKey), "") | |
181 | - | (status == "active") | |
180 | + | let statusKeyReverse = makeString(["%s%s%s", "status", priceAssetString, amountAssetString], separator) | |
181 | + | let pairStatus = valueOrElse(getString(userPoolsAddress, statusKey), "") | |
182 | + | let reversePairStatus = valueOrElse(getString(userPoolsAddress, statusKeyReverse), "") | |
183 | + | if ((pairStatus == "active")) | |
184 | + | then true | |
185 | + | else (reversePairStatus == "active") | |
182 | 186 | } | |
183 | 187 | ||
184 | 188 | ||
185 | 189 | @Callable(i) | |
186 | 190 | func init (factoryAddressStr) = { | |
187 | 191 | let checkCaller = mustThis(i.caller) | |
188 | 192 | if ((checkCaller == checkCaller)) | |
189 | 193 | then [StringEntry(kFactoryAddress, factoryAddressStr)] | |
190 | 194 | else throw("Strict value is not equal to itself.") | |
191 | 195 | } | |
192 | 196 | ||
193 | 197 | ||
194 | 198 | ||
195 | 199 | @Callable(i) | |
196 | 200 | func addEmptyPool (callerPublicKey,args) = { | |
197 | 201 | let newPoolAddress = addressFromPublicKey(callerPublicKey) | |
198 | 202 | let newPoolIndex = (lastEmptyIndex + 1) | |
199 | 203 | let checks = [if (!(shutdown)) | |
200 | 204 | then true | |
201 | 205 | else throwErr("not allowed (shutdown)"), if (checkContractScript(newPoolAddress)) | |
202 | 206 | then true | |
203 | 207 | else throwErr("pool script is not allowed"), if (!(isPoolExists(newPoolAddress))) | |
204 | 208 | then true | |
205 | 209 | else throwErr("pool address is already registered")] | |
206 | 210 | if ((checks == checks)) | |
207 | 211 | then { | |
208 | 212 | let factoryActions = [invoke(factoryAddress, "integerEntry", [kLastEmptyPoolIndex, newPoolIndex], nil), invoke(factoryAddress, "stringEntry", [kPoolAddressFromIndex(newPoolIndex), toString(newPoolAddress)], nil), invoke(factoryAddress, "integerEntry", [kPoolIndexFromAddress(newPoolAddress), newPoolIndex], nil), invoke(factoryAddress, "integerEntry", [kPoolStatus(newPoolIndex), STATUS_EMPTY], nil)] | |
209 | 213 | $Tuple2(nil, factoryActions) | |
210 | 214 | } | |
211 | 215 | else throw("Strict value is not equal to itself.") | |
212 | 216 | } | |
213 | 217 | ||
214 | 218 | ||
215 | 219 | ||
216 | 220 | @Callable(i) | |
217 | 221 | func createPool (callerPublicKey,args) = { | |
218 | 222 | let minPayment = (listingVolume + creationFee) | |
219 | 223 | let checks = [if (!(shutdown)) | |
220 | 224 | then true | |
221 | 225 | else throwErr("Temporary shutdown"), mustFactory(i.caller), if (((lastEmptyIndex - firstEmptyIndex) > 0)) | |
222 | 226 | then true | |
223 | 227 | else throwErr("No empty pool available"), if ((i.payments[0].assetId == unit)) | |
224 | 228 | then true | |
225 | 229 | else throwErr("Payment should be in WAVES"), if ((i.payments[0].amount >= minPayment)) | |
226 | 230 | then true | |
227 | 231 | else throwErr((("Payment should be greater or equal " + toString(minPayment)) + " WAVELET")), if (isDefined(args[0])) | |
228 | 232 | then true | |
229 | 233 | else throwErr("Token name is not provided"), if (isDefined(args[1])) | |
230 | 234 | then true | |
231 | 235 | else throwErr("Token description is not provided"), if (isDefined(args[2])) | |
232 | 236 | then true | |
233 | 237 | else throwErr("Token quantity is not provided"), if ((parseInt(args[2]) != unit)) | |
234 | 238 | then true | |
235 | 239 | else throwErr("Token quantity should be a number")] | |
236 | 240 | if ((checks == checks)) | |
237 | 241 | then { | |
238 | 242 | let poolIndex = (firstEmptyIndex + 1) | |
239 | 243 | let poolAddressString = getStringValue(factoryAddress, kPoolAddressFromIndex(poolIndex)) | |
240 | 244 | let poolAddress = addressFromStringValue(poolAddressString) | |
241 | 245 | let callerAddress = addressFromPublicKey(callerPublicKey) | |
242 | 246 | let poolDomain = take(poolAddressString, 8) | |
243 | 247 | let poolOwner = toString(callerAddress) | |
244 | 248 | let tokenName = args[0] | |
245 | 249 | let tokenDesc = args[1] | |
246 | 250 | let tokenQuantity = args[2] | |
247 | 251 | let initPoolInvoke = invoke(factoryAddress, "initPoolInvoke", [poolAddressString, [poolDomain, poolOwner, tokenName, tokenDesc, tokenQuantity]], [AttachedPayment(i.payments[0].assetId, i.payments[0].amount)]) | |
248 | 252 | if ((initPoolInvoke == initPoolInvoke)) | |
249 | 253 | then { | |
250 | 254 | let factoryActions = [invoke(factoryAddress, "integerEntry", [kFirstEmptyPoolIndex, poolIndex], nil), invoke(factoryAddress, "integerEntry", [kPoolStatus(poolIndex), STATUS_READY], nil)] | |
251 | 255 | $Tuple2(nil, factoryActions) | |
252 | 256 | } | |
253 | 257 | else throw("Strict value is not equal to itself.") | |
254 | 258 | } | |
255 | 259 | else throw("Strict value is not equal to itself.") | |
256 | 260 | } | |
257 | 261 | ||
258 | 262 | ||
259 | 263 | ||
260 | 264 | @Callable(i) | |
261 | 265 | func notifyStatusUpdate (callerPublicKey,args) = { | |
262 | 266 | let poolAddress = addressFromPublicKey(callerPublicKey) | |
263 | 267 | let checks = [if (isPoolExists(poolAddress)) | |
264 | 268 | then true | |
265 | 269 | else throwErr("pool not found"), mustFactory(i.caller)] | |
266 | 270 | if ((checks == checks)) | |
267 | 271 | then { | |
268 | 272 | let poolIndex = getIntegerValue(factoryAddress, kPoolIndexFromAddress(poolAddress)) | |
269 | 273 | let newStatus = parseIntValue(args[0]) | |
270 | 274 | let factoryActions = [invoke(factoryAddress, "integerEntry", [kPoolStatus(poolIndex), newStatus], nil)] | |
271 | 275 | $Tuple2(nil, factoryActions) | |
272 | 276 | } | |
273 | 277 | else throw("Strict value is not equal to itself.") | |
274 | 278 | } | |
275 | 279 | ||
276 | 280 | ||
277 | 281 | ||
278 | 282 | @Callable(i) | |
279 | 283 | func isWxSwapActiveREADONLY (callerPublicKey,args) = { | |
280 | 284 | let amountAssetIdString = args[0] | |
281 | 285 | let priceAssetIdString = args[1] | |
282 | 286 | let checks = [mustFactory(i.caller)] | |
283 | 287 | if ((checks == checks)) | |
284 | 288 | then $Tuple2(nil, isWxSwapActive(amountAssetIdString, priceAssetIdString)) | |
285 | 289 | else throw("Strict value is not equal to itself.") | |
286 | 290 | } | |
287 | 291 | ||
288 | 292 | ||
289 | 293 | ||
290 | 294 | @Callable(i) | |
291 | 295 | func swapREADONLY (callerPublicKey,args) = { | |
292 | 296 | let poolAddress = addressFromStringValue(args[0]) | |
293 | 297 | let amountAssetIdString = args[1] | |
294 | 298 | let priceAssetIdString = args[2] | |
295 | 299 | let amount = parseIntValue(args[3]) | |
296 | 300 | let checks = [if (!(shutdown)) | |
297 | 301 | then true | |
298 | 302 | else throwErr("Temporary shutdown"), mustFactory(i.caller)] | |
299 | 303 | if ((checks == checks)) | |
300 | 304 | then if (isPoolTargetReached(poolAddress)) | |
301 | 305 | then { | |
302 | 306 | let wxSwapResult = { | |
303 | 307 | let @ = invoke(wxSwapAddress, "swapCalculateREADONLY", [amount, amountAssetIdString, priceAssetIdString], nil) | |
304 | 308 | if ($isInstanceOf(@, "Int")) | |
305 | 309 | then @ | |
306 | 310 | else throw(($getType(@) + " couldn't be cast to Int")) | |
307 | 311 | } | |
308 | 312 | $Tuple2(nil, $Tuple2(wxSwapResult, "WxSwap")) | |
309 | 313 | } | |
310 | 314 | else { | |
311 | 315 | let poolSwapResult = { | |
312 | 316 | let @ = invoke(poolAddress, "swapReadOnly", [amountAssetIdString, priceAssetIdString, amount], nil) | |
313 | 317 | if ($isInstanceOf(@, "Int")) | |
314 | 318 | then @ | |
315 | 319 | else throw(($getType(@) + " couldn't be cast to Int")) | |
316 | 320 | } | |
317 | 321 | $Tuple2(nil, $Tuple2(poolSwapResult, "iMemePool")) | |
318 | 322 | } | |
319 | 323 | else throw("Strict value is not equal to itself.") | |
320 | 324 | } | |
321 | 325 | ||
322 | 326 | ||
323 | 327 | ||
324 | 328 | @Callable(i) | |
325 | 329 | func swap (callerPublicKey,args) = { | |
326 | 330 | let callerAddress = addressFromPublicKey(callerPublicKey) | |
327 | 331 | let poolAddress = addressFromStringValue(args[0]) | |
328 | 332 | let priceAssetIdString = args[1] | |
329 | 333 | let priceAssetId = parseAssetId(priceAssetIdString) | |
330 | 334 | let minimumAmount = parseIntValue(args[2]) | |
331 | 335 | let assetInAmount = i.payments[0].amount | |
332 | 336 | let assetInAssetId = i.payments[0].assetId | |
333 | 337 | let checks = [if (!(shutdown)) | |
334 | 338 | then true | |
335 | 339 | else throwErr("Temporary shutdown"), mustFactory(i.caller), if ((size(i.payments) == 1)) | |
336 | 340 | then true | |
337 | 341 | else throwErr("exactly one payment is expected")] | |
338 | 342 | if ((checks == checks)) | |
339 | 343 | then { | |
340 | 344 | let outAssetBalanceBefore = getBalance(this, priceAssetId) | |
341 | 345 | if ((outAssetBalanceBefore == outAssetBalanceBefore)) | |
342 | 346 | then { | |
343 | 347 | let swapAction = if (isPoolTargetReached(poolAddress)) | |
344 | 348 | then invoke(wxSwapAddress, "swap", [minimumAmount, priceAssetIdString, toString(this)], i.payments) | |
345 | 349 | else invoke(poolAddress, "swap", [priceAssetIdString, minimumAmount], i.payments) | |
346 | 350 | if ((swapAction == swapAction)) | |
347 | 351 | then { | |
348 | 352 | let outAssetBalanceAfter = getBalance(this, priceAssetId) | |
349 | 353 | if ((outAssetBalanceAfter == outAssetBalanceAfter)) | |
350 | 354 | then [ScriptTransfer(callerAddress, (outAssetBalanceAfter - outAssetBalanceBefore), priceAssetId)] | |
351 | 355 | else throw("Strict value is not equal to itself.") | |
352 | 356 | } | |
353 | 357 | else throw("Strict value is not equal to itself.") | |
354 | 358 | } | |
355 | 359 | else throw("Strict value is not equal to itself.") | |
356 | 360 | } | |
357 | 361 | else throw("Strict value is not equal to itself.") | |
358 | 362 | } | |
359 | 363 | ||
360 | 364 | ||
361 | 365 | ||
362 | 366 | @Callable(i) | |
363 | 367 | func transferPool (callerPublicKey,args) = { | |
364 | 368 | let callerAddress = addressFromPublicKey(callerPublicKey) | |
365 | 369 | let poolAddress = addressFromStringValue(args[0]) | |
366 | 370 | let poolTokensStringList = split(getStringValue(poolAddress, kPoolTokensList), ",") | |
367 | 371 | let asset1 = parseAssetId(poolTokensStringList[0]) | |
368 | 372 | let asset2 = parseAssetId(poolTokensStringList[1]) | |
369 | - | let $ | |
373 | + | let $t01197612068 = if ((asset1 == unit)) | |
370 | 374 | then $Tuple2(asset2, asset1) | |
371 | 375 | else $Tuple2(asset1, asset2) | |
372 | - | let poolAsset = $ | |
373 | - | let wavesAsset = $ | |
376 | + | let poolAsset = $t01197612068._1 | |
377 | + | let wavesAsset = $t01197612068._2 | |
374 | 378 | let poolAssetBalanceBefore = getBalance(factoryAddress, poolAsset) | |
375 | 379 | if ((poolAssetBalanceBefore == poolAssetBalanceBefore)) | |
376 | 380 | then { | |
377 | 381 | let wavesAssetBalanceBefore = getBalance(factoryAddress, wavesAsset) | |
378 | 382 | if ((wavesAssetBalanceBefore == wavesAssetBalanceBefore)) | |
379 | 383 | then { | |
380 | 384 | let withdrawInvoke = invoke(factoryAddress, "withdrawLiquidityFromPool", [poolAddress.bytes], nil) | |
381 | 385 | if ((withdrawInvoke == withdrawInvoke)) | |
382 | 386 | then { | |
383 | 387 | let poolAssetBalanceAfter = getBalance(factoryAddress, poolAsset) | |
384 | 388 | if ((poolAssetBalanceAfter == poolAssetBalanceAfter)) | |
385 | 389 | then { | |
386 | 390 | let wavesAssetBalanceAfter = getBalance(factoryAddress, wavesAsset) | |
387 | 391 | if ((wavesAssetBalanceAfter == wavesAssetBalanceAfter)) | |
388 | 392 | then { | |
389 | 393 | let poolAssetAmount = (poolAssetBalanceAfter - poolAssetBalanceBefore) | |
390 | 394 | let wavesAmount = (wavesAssetBalanceAfter - wavesAssetBalanceBefore) | |
391 | 395 | if (if ((poolAssetAmount > 0)) | |
392 | 396 | then (wavesAmount > 0) | |
393 | 397 | else false) | |
394 | 398 | then { | |
395 | 399 | let burnAmount = fraction(poolAssetAmount, 20, 100) | |
396 | 400 | let burnAction = invoke(factoryAddress, "burn", [poolAsset, burnAmount], nil) | |
397 | 401 | if ((burnAction == burnAction)) | |
398 | 402 | then { | |
399 | 403 | let feeWavesAmount = fraction(wavesAmount, 20, 100) | |
400 | 404 | let feeAction = invoke(factoryAddress, "transferWaves", [feeCollectorAddress.bytes, feeWavesAmount], nil) | |
401 | 405 | if ((feeAction == feeAction)) | |
402 | 406 | then { | |
403 | 407 | let registerAssetAction = invoke(factoryAddress, "registerAsset", [assetStoreAddress.bytes, assetIdToString(poolAsset), defaultLogo, true], nil) | |
404 | 408 | if ((registerAssetAction == registerAssetAction)) | |
405 | 409 | then { | |
406 | 410 | let createWxPoolAction = invoke(factoryAddress, "createWxPool", [userPoolsAddress.bytes, assetIdToString(poolAsset), (poolAssetAmount - burnAmount), assetIdToString(wavesAsset), (wavesAmount - feeWavesAmount)], nil) | |
407 | 411 | if ((createWxPoolAction == createWxPoolAction)) | |
408 | 412 | then { | |
409 | 413 | let changeStatus = invoke(factoryAddress, "integerEntry", [kPoolStatus(getPoolId(poolAddress)), STATUS_TRANSFERRED], nil) | |
410 | 414 | if ((changeStatus == changeStatus)) | |
411 | 415 | then nil | |
412 | 416 | else throw("Strict value is not equal to itself.") | |
413 | 417 | } | |
414 | 418 | else throw("Strict value is not equal to itself.") | |
415 | 419 | } | |
416 | 420 | else throw("Strict value is not equal to itself.") | |
417 | 421 | } | |
418 | 422 | else throw("Strict value is not equal to itself.") | |
419 | 423 | } | |
420 | 424 | else throw("Strict value is not equal to itself.") | |
421 | 425 | } | |
422 | 426 | else throwErr("withdrawn amount from pool is too low") | |
423 | 427 | } | |
424 | 428 | else throw("Strict value is not equal to itself.") | |
425 | 429 | } | |
426 | 430 | else throw("Strict value is not equal to itself.") | |
427 | 431 | } | |
428 | 432 | else throw("Strict value is not equal to itself.") | |
429 | 433 | } | |
430 | 434 | else throw("Strict value is not equal to itself.") | |
431 | 435 | } | |
432 | 436 | else throw("Strict value is not equal to itself.") | |
433 | 437 | } | |
434 | 438 | ||
435 | 439 | ||
436 | 440 | @Verifier(tx) | |
437 | 441 | func verify () = { | |
438 | 442 | let keyAdminAddressList = "%s__adminAddressList" | |
439 | 443 | let keyAllowedTxId = "%s__txId" | |
440 | 444 | let adminList = split(valueOrElse(getString(factoryAddress, keyAdminAddressList), ""), "__") | |
441 | 445 | let byOwner = if ((size(adminList) >= 3)) | |
442 | 446 | then false | |
443 | 447 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
444 | 448 | let byAdmins = (tx.id == fromBase58String(valueOrElse(getString(factoryAddress, keyAllowedTxId), ""))) | |
445 | 449 | if (byAdmins) | |
446 | 450 | then true | |
447 | 451 | else byOwner | |
448 | 452 | } | |
449 | 453 |
github/deemru/w8io/169f3d6 61.60 ms ◑