tx · G3WvKRepNQWCrTj9z75Ry5GB51NgKYkvuumkb16VT4i5 3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr: -0.01800000 Waves 2024.12.20 11:28 [3422614] smart account 3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr > SELF 0.00000000 Waves
{ "type": 13, "id": "G3WvKRepNQWCrTj9z75Ry5GB51NgKYkvuumkb16VT4i5", "fee": 1800000, "feeAssetId": null, "timestamp": 1734683378760, "version": 2, "chainId": 84, "sender": "3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr", "senderPublicKey": "jXCTQV8PjX2uC9UHBFveupYy9cjhY7stHbzE9cptymw", "proofs": [ "2ud4L6o5EkYkVdSUPqRVF1zHvF7pVzkhxVQdYFiZf3LgAUZcQjNMMmPmT2GdYGtK2c8faPrzPDUcaU1a1maMmq7j" ], "script": "base64:BwIxCAISAwoBCBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGDoACXNlcGFyYXRvcgICX18AC3dhdmVzU3RyaW5nAgVXQVZFUwAQY29udHJhY3RGaWxlbmFtZQIXbWVtZV9pbV9jYWxjdWxhdG9yLnJpZGUABW11bHQ4AIDC1y8BB3dyYXBFcnIBAXMJAKwCAgkArAICBRBjb250cmFjdEZpbGVuYW1lAgI6IAUBcwEIdGhyb3dFcnIBAXMJAAIBCQEHd3JhcEVycgEFAXMBD3ZhbGlkYXRlQWRkcmVzcwEHYWRkcmVzcwkBCWlzRGVmaW5lZAEJAKYIAQUHYWRkcmVzcwAMU1RBVFVTX0VNUFRZAAAADFNUQVRVU19SRUFEWQABABVTVEFUVVNfVEFSR0VUX1JFQUNIRUQAAgASU1RBVFVTX1RSQU5TRkVSUkVEAAMAC2RlZmF1bHRMb2dvAqYBPHN2ZyB3aWR0aD0nMzAnIGhlaWdodD0nMzAnIHhtbG5zPSdodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2Zyc+PGc+PGNpcmNsZSBjeD0nMTUnI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kFkZHJlc3NMaXN0AgACAl9fBAdieU93bmVyAwkAZwIJAJADAQUJYWRtaW5MaXN0AAMHCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5BAhieUFkbWlucwkAAAIIBQJ0eAJpZAkA2QQBCQELdmFsdWVPckVsc2UCCQCdCAIFDmZhY3RvcnlBZGRyZXNzBQ5rZXlBbGxvd2VkVHhJZAIAAwUIYnlBZG1pbnMGBQdieU93bmVy9pGv4w==", "height": 3422614, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6JGPkgQ9F49SFAb77UrMMtovRucmiKck9oaUXmBLzkDx Next: EFcQaMuruwefJfnzvu1QsyZfZJoANLwK5EGNdQ5Kjexn Diff:
Old | New | Differences | |
---|---|---|---|
164 | 164 | func getPoolId (poolAddress) = valueOrErrorMessage(getInteger(factoryAddress, kPoolIndexFromAddress(poolAddress)), "pool doesn't exists") | |
165 | 165 | ||
166 | 166 | ||
167 | - | func isPoolTargetReached (poolAddress) = (valueOrElse(getInteger(factoryAddress, kPoolStatus(getPoolId(poolAddress))), -1) == STATUS_TARGET_REACHED) | |
167 | + | func isPoolTargetReached (poolAddress) = { | |
168 | + | let poolStatus = valueOrElse(getInteger(factoryAddress, kPoolStatus(getPoolId(poolAddress))), -1) | |
169 | + | containsElement([STATUS_TARGET_REACHED, STATUS_TRANSFERRED], poolStatus) | |
170 | + | } | |
168 | 171 | ||
169 | 172 | ||
170 | 173 | func getBalance (address,assetId) = match assetId { | |
370 | 373 | let poolTokensStringList = split(getStringValue(poolAddress, kPoolTokensList), ",") | |
371 | 374 | let asset1 = parseAssetId(poolTokensStringList[0]) | |
372 | 375 | let asset2 = parseAssetId(poolTokensStringList[1]) | |
373 | - | let $ | |
376 | + | let $t01204712139 = if ((asset1 == unit)) | |
374 | 377 | then $Tuple2(asset2, asset1) | |
375 | 378 | else $Tuple2(asset1, asset2) | |
376 | - | let poolAsset = $ | |
377 | - | let wavesAsset = $ | |
379 | + | let poolAsset = $t01204712139._1 | |
380 | + | let wavesAsset = $t01204712139._2 | |
378 | 381 | let poolAssetBalanceBefore = getBalance(factoryAddress, poolAsset) | |
379 | 382 | if ((poolAssetBalanceBefore == poolAssetBalanceBefore)) | |
380 | 383 | 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 | - | func isPoolTargetReached (poolAddress) = (valueOrElse(getInteger(factoryAddress, kPoolStatus(getPoolId(poolAddress))), -1) == STATUS_TARGET_REACHED) | |
167 | + | func isPoolTargetReached (poolAddress) = { | |
168 | + | let poolStatus = valueOrElse(getInteger(factoryAddress, kPoolStatus(getPoolId(poolAddress))), -1) | |
169 | + | containsElement([STATUS_TARGET_REACHED, STATUS_TRANSFERRED], poolStatus) | |
170 | + | } | |
168 | 171 | ||
169 | 172 | ||
170 | 173 | func getBalance (address,assetId) = match assetId { | |
171 | 174 | case id: ByteVector => | |
172 | 175 | assetBalance(address, id) | |
173 | 176 | case _ => | |
174 | 177 | wavesBalance(address).available | |
175 | 178 | } | |
176 | 179 | ||
177 | 180 | ||
178 | 181 | func isWxSwapActive (amountAssetString,priceAssetString) = { | |
179 | 182 | let statusKey = makeString(["%s%s%s", "status", amountAssetString, priceAssetString], separator) | |
180 | 183 | let statusKeyReverse = makeString(["%s%s%s", "status", priceAssetString, amountAssetString], separator) | |
181 | 184 | let pairStatus = valueOrElse(getString(userPoolsAddress, statusKey), "") | |
182 | 185 | let reversePairStatus = valueOrElse(getString(userPoolsAddress, statusKeyReverse), "") | |
183 | 186 | if ((pairStatus == "active")) | |
184 | 187 | then true | |
185 | 188 | else (reversePairStatus == "active") | |
186 | 189 | } | |
187 | 190 | ||
188 | 191 | ||
189 | 192 | @Callable(i) | |
190 | 193 | func init (factoryAddressStr) = { | |
191 | 194 | let checkCaller = mustThis(i.caller) | |
192 | 195 | if ((checkCaller == checkCaller)) | |
193 | 196 | then [StringEntry(kFactoryAddress, factoryAddressStr)] | |
194 | 197 | else throw("Strict value is not equal to itself.") | |
195 | 198 | } | |
196 | 199 | ||
197 | 200 | ||
198 | 201 | ||
199 | 202 | @Callable(i) | |
200 | 203 | func addEmptyPool (callerPublicKey,args) = { | |
201 | 204 | let newPoolAddress = addressFromPublicKey(callerPublicKey) | |
202 | 205 | let newPoolIndex = (lastEmptyIndex + 1) | |
203 | 206 | let checks = [if (!(shutdown)) | |
204 | 207 | then true | |
205 | 208 | else throwErr("not allowed (shutdown)"), if (checkContractScript(newPoolAddress)) | |
206 | 209 | then true | |
207 | 210 | else throwErr("pool script is not allowed"), if (!(isPoolExists(newPoolAddress))) | |
208 | 211 | then true | |
209 | 212 | else throwErr("pool address is already registered")] | |
210 | 213 | if ((checks == checks)) | |
211 | 214 | then { | |
212 | 215 | 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)] | |
213 | 216 | $Tuple2(nil, factoryActions) | |
214 | 217 | } | |
215 | 218 | else throw("Strict value is not equal to itself.") | |
216 | 219 | } | |
217 | 220 | ||
218 | 221 | ||
219 | 222 | ||
220 | 223 | @Callable(i) | |
221 | 224 | func createPool (callerPublicKey,args) = { | |
222 | 225 | let minPayment = (listingVolume + creationFee) | |
223 | 226 | let checks = [if (!(shutdown)) | |
224 | 227 | then true | |
225 | 228 | else throwErr("Temporary shutdown"), mustFactory(i.caller), if (((lastEmptyIndex - firstEmptyIndex) > 0)) | |
226 | 229 | then true | |
227 | 230 | else throwErr("No empty pool available"), if ((i.payments[0].assetId == unit)) | |
228 | 231 | then true | |
229 | 232 | else throwErr("Payment should be in WAVES"), if ((i.payments[0].amount >= minPayment)) | |
230 | 233 | then true | |
231 | 234 | else throwErr((("Payment should be greater or equal " + toString(minPayment)) + " WAVELET")), if (isDefined(args[0])) | |
232 | 235 | then true | |
233 | 236 | else throwErr("Token name is not provided"), if (isDefined(args[1])) | |
234 | 237 | then true | |
235 | 238 | else throwErr("Token description is not provided"), if (isDefined(args[2])) | |
236 | 239 | then true | |
237 | 240 | else throwErr("Token quantity is not provided"), if ((parseInt(args[2]) != unit)) | |
238 | 241 | then true | |
239 | 242 | else throwErr("Token quantity should be a number")] | |
240 | 243 | if ((checks == checks)) | |
241 | 244 | then { | |
242 | 245 | let poolIndex = (firstEmptyIndex + 1) | |
243 | 246 | let poolAddressString = getStringValue(factoryAddress, kPoolAddressFromIndex(poolIndex)) | |
244 | 247 | let poolAddress = addressFromStringValue(poolAddressString) | |
245 | 248 | let callerAddress = addressFromPublicKey(callerPublicKey) | |
246 | 249 | let poolDomain = take(poolAddressString, 8) | |
247 | 250 | let poolOwner = toString(callerAddress) | |
248 | 251 | let tokenName = args[0] | |
249 | 252 | let tokenDesc = args[1] | |
250 | 253 | let tokenQuantity = args[2] | |
251 | 254 | let initPoolInvoke = invoke(factoryAddress, "initPoolInvoke", [poolAddressString, [poolDomain, poolOwner, tokenName, tokenDesc, tokenQuantity]], [AttachedPayment(i.payments[0].assetId, i.payments[0].amount)]) | |
252 | 255 | if ((initPoolInvoke == initPoolInvoke)) | |
253 | 256 | then { | |
254 | 257 | let factoryActions = [invoke(factoryAddress, "integerEntry", [kFirstEmptyPoolIndex, poolIndex], nil), invoke(factoryAddress, "integerEntry", [kPoolStatus(poolIndex), STATUS_READY], nil)] | |
255 | 258 | $Tuple2(nil, factoryActions) | |
256 | 259 | } | |
257 | 260 | else throw("Strict value is not equal to itself.") | |
258 | 261 | } | |
259 | 262 | else throw("Strict value is not equal to itself.") | |
260 | 263 | } | |
261 | 264 | ||
262 | 265 | ||
263 | 266 | ||
264 | 267 | @Callable(i) | |
265 | 268 | func notifyStatusUpdate (callerPublicKey,args) = { | |
266 | 269 | let poolAddress = addressFromPublicKey(callerPublicKey) | |
267 | 270 | let checks = [if (isPoolExists(poolAddress)) | |
268 | 271 | then true | |
269 | 272 | else throwErr("pool not found"), mustFactory(i.caller)] | |
270 | 273 | if ((checks == checks)) | |
271 | 274 | then { | |
272 | 275 | let poolIndex = getIntegerValue(factoryAddress, kPoolIndexFromAddress(poolAddress)) | |
273 | 276 | let newStatus = parseIntValue(args[0]) | |
274 | 277 | let factoryActions = [invoke(factoryAddress, "integerEntry", [kPoolStatus(poolIndex), newStatus], nil)] | |
275 | 278 | $Tuple2(nil, factoryActions) | |
276 | 279 | } | |
277 | 280 | else throw("Strict value is not equal to itself.") | |
278 | 281 | } | |
279 | 282 | ||
280 | 283 | ||
281 | 284 | ||
282 | 285 | @Callable(i) | |
283 | 286 | func isWxSwapActiveREADONLY (callerPublicKey,args) = { | |
284 | 287 | let amountAssetIdString = args[0] | |
285 | 288 | let priceAssetIdString = args[1] | |
286 | 289 | let checks = [mustFactory(i.caller)] | |
287 | 290 | if ((checks == checks)) | |
288 | 291 | then $Tuple2(nil, isWxSwapActive(amountAssetIdString, priceAssetIdString)) | |
289 | 292 | else throw("Strict value is not equal to itself.") | |
290 | 293 | } | |
291 | 294 | ||
292 | 295 | ||
293 | 296 | ||
294 | 297 | @Callable(i) | |
295 | 298 | func swapREADONLY (callerPublicKey,args) = { | |
296 | 299 | let poolAddress = addressFromStringValue(args[0]) | |
297 | 300 | let amountAssetIdString = args[1] | |
298 | 301 | let priceAssetIdString = args[2] | |
299 | 302 | let amount = parseIntValue(args[3]) | |
300 | 303 | let checks = [if (!(shutdown)) | |
301 | 304 | then true | |
302 | 305 | else throwErr("Temporary shutdown"), mustFactory(i.caller)] | |
303 | 306 | if ((checks == checks)) | |
304 | 307 | then if (isPoolTargetReached(poolAddress)) | |
305 | 308 | then { | |
306 | 309 | let wxSwapResult = { | |
307 | 310 | let @ = invoke(wxSwapAddress, "swapCalculateREADONLY", [amount, amountAssetIdString, priceAssetIdString], nil) | |
308 | 311 | if ($isInstanceOf(@, "Int")) | |
309 | 312 | then @ | |
310 | 313 | else throw(($getType(@) + " couldn't be cast to Int")) | |
311 | 314 | } | |
312 | 315 | $Tuple2(nil, $Tuple2(wxSwapResult, "WxSwap")) | |
313 | 316 | } | |
314 | 317 | else { | |
315 | 318 | let poolSwapResult = { | |
316 | 319 | let @ = invoke(poolAddress, "swapReadOnly", [amountAssetIdString, priceAssetIdString, amount], nil) | |
317 | 320 | if ($isInstanceOf(@, "Int")) | |
318 | 321 | then @ | |
319 | 322 | else throw(($getType(@) + " couldn't be cast to Int")) | |
320 | 323 | } | |
321 | 324 | $Tuple2(nil, $Tuple2(poolSwapResult, "iMemePool")) | |
322 | 325 | } | |
323 | 326 | else throw("Strict value is not equal to itself.") | |
324 | 327 | } | |
325 | 328 | ||
326 | 329 | ||
327 | 330 | ||
328 | 331 | @Callable(i) | |
329 | 332 | func swap (callerPublicKey,args) = { | |
330 | 333 | let callerAddress = addressFromPublicKey(callerPublicKey) | |
331 | 334 | let poolAddress = addressFromStringValue(args[0]) | |
332 | 335 | let priceAssetIdString = args[1] | |
333 | 336 | let priceAssetId = parseAssetId(priceAssetIdString) | |
334 | 337 | let minimumAmount = parseIntValue(args[2]) | |
335 | 338 | let assetInAmount = i.payments[0].amount | |
336 | 339 | let assetInAssetId = i.payments[0].assetId | |
337 | 340 | let checks = [if (!(shutdown)) | |
338 | 341 | then true | |
339 | 342 | else throwErr("Temporary shutdown"), mustFactory(i.caller), if ((size(i.payments) == 1)) | |
340 | 343 | then true | |
341 | 344 | else throwErr("exactly one payment is expected")] | |
342 | 345 | if ((checks == checks)) | |
343 | 346 | then { | |
344 | 347 | let outAssetBalanceBefore = getBalance(this, priceAssetId) | |
345 | 348 | if ((outAssetBalanceBefore == outAssetBalanceBefore)) | |
346 | 349 | then { | |
347 | 350 | let swapAction = if (isPoolTargetReached(poolAddress)) | |
348 | 351 | then invoke(wxSwapAddress, "swap", [minimumAmount, priceAssetIdString, toString(this)], i.payments) | |
349 | 352 | else invoke(poolAddress, "swap", [priceAssetIdString, minimumAmount], i.payments) | |
350 | 353 | if ((swapAction == swapAction)) | |
351 | 354 | then { | |
352 | 355 | let outAssetBalanceAfter = getBalance(this, priceAssetId) | |
353 | 356 | if ((outAssetBalanceAfter == outAssetBalanceAfter)) | |
354 | 357 | then [ScriptTransfer(callerAddress, (outAssetBalanceAfter - outAssetBalanceBefore), priceAssetId)] | |
355 | 358 | else throw("Strict value is not equal to itself.") | |
356 | 359 | } | |
357 | 360 | else throw("Strict value is not equal to itself.") | |
358 | 361 | } | |
359 | 362 | else throw("Strict value is not equal to itself.") | |
360 | 363 | } | |
361 | 364 | else throw("Strict value is not equal to itself.") | |
362 | 365 | } | |
363 | 366 | ||
364 | 367 | ||
365 | 368 | ||
366 | 369 | @Callable(i) | |
367 | 370 | func transferPool (callerPublicKey,args) = { | |
368 | 371 | let callerAddress = addressFromPublicKey(callerPublicKey) | |
369 | 372 | let poolAddress = addressFromStringValue(args[0]) | |
370 | 373 | let poolTokensStringList = split(getStringValue(poolAddress, kPoolTokensList), ",") | |
371 | 374 | let asset1 = parseAssetId(poolTokensStringList[0]) | |
372 | 375 | let asset2 = parseAssetId(poolTokensStringList[1]) | |
373 | - | let $ | |
376 | + | let $t01204712139 = if ((asset1 == unit)) | |
374 | 377 | then $Tuple2(asset2, asset1) | |
375 | 378 | else $Tuple2(asset1, asset2) | |
376 | - | let poolAsset = $ | |
377 | - | let wavesAsset = $ | |
379 | + | let poolAsset = $t01204712139._1 | |
380 | + | let wavesAsset = $t01204712139._2 | |
378 | 381 | let poolAssetBalanceBefore = getBalance(factoryAddress, poolAsset) | |
379 | 382 | if ((poolAssetBalanceBefore == poolAssetBalanceBefore)) | |
380 | 383 | then { | |
381 | 384 | let wavesAssetBalanceBefore = getBalance(factoryAddress, wavesAsset) | |
382 | 385 | if ((wavesAssetBalanceBefore == wavesAssetBalanceBefore)) | |
383 | 386 | then { | |
384 | 387 | let withdrawInvoke = invoke(factoryAddress, "withdrawLiquidityFromPool", [poolAddress.bytes], nil) | |
385 | 388 | if ((withdrawInvoke == withdrawInvoke)) | |
386 | 389 | then { | |
387 | 390 | let poolAssetBalanceAfter = getBalance(factoryAddress, poolAsset) | |
388 | 391 | if ((poolAssetBalanceAfter == poolAssetBalanceAfter)) | |
389 | 392 | then { | |
390 | 393 | let wavesAssetBalanceAfter = getBalance(factoryAddress, wavesAsset) | |
391 | 394 | if ((wavesAssetBalanceAfter == wavesAssetBalanceAfter)) | |
392 | 395 | then { | |
393 | 396 | let poolAssetAmount = (poolAssetBalanceAfter - poolAssetBalanceBefore) | |
394 | 397 | let wavesAmount = (wavesAssetBalanceAfter - wavesAssetBalanceBefore) | |
395 | 398 | if (if ((poolAssetAmount > 0)) | |
396 | 399 | then (wavesAmount > 0) | |
397 | 400 | else false) | |
398 | 401 | then { | |
399 | 402 | let burnAmount = fraction(poolAssetAmount, 20, 100) | |
400 | 403 | let burnAction = invoke(factoryAddress, "burn", [poolAsset, burnAmount], nil) | |
401 | 404 | if ((burnAction == burnAction)) | |
402 | 405 | then { | |
403 | 406 | let feeWavesAmount = fraction(wavesAmount, 20, 100) | |
404 | 407 | let feeAction = invoke(factoryAddress, "transferWaves", [feeCollectorAddress.bytes, feeWavesAmount], nil) | |
405 | 408 | if ((feeAction == feeAction)) | |
406 | 409 | then { | |
407 | 410 | let registerAssetAction = invoke(factoryAddress, "registerAsset", [assetStoreAddress.bytes, assetIdToString(poolAsset), defaultLogo, true], nil) | |
408 | 411 | if ((registerAssetAction == registerAssetAction)) | |
409 | 412 | then { | |
410 | 413 | let createWxPoolAction = invoke(factoryAddress, "createWxPool", [userPoolsAddress.bytes, assetIdToString(poolAsset), (poolAssetAmount - burnAmount), assetIdToString(wavesAsset), (wavesAmount - feeWavesAmount)], nil) | |
411 | 414 | if ((createWxPoolAction == createWxPoolAction)) | |
412 | 415 | then { | |
413 | 416 | let changeStatus = invoke(factoryAddress, "integerEntry", [kPoolStatus(getPoolId(poolAddress)), STATUS_TRANSFERRED], nil) | |
414 | 417 | if ((changeStatus == changeStatus)) | |
415 | 418 | then nil | |
416 | 419 | else throw("Strict value is not equal to itself.") | |
417 | 420 | } | |
418 | 421 | else throw("Strict value is not equal to itself.") | |
419 | 422 | } | |
420 | 423 | else throw("Strict value is not equal to itself.") | |
421 | 424 | } | |
422 | 425 | else throw("Strict value is not equal to itself.") | |
423 | 426 | } | |
424 | 427 | else throw("Strict value is not equal to itself.") | |
425 | 428 | } | |
426 | 429 | else throwErr("withdrawn amount from pool is too low") | |
427 | 430 | } | |
428 | 431 | else throw("Strict value is not equal to itself.") | |
429 | 432 | } | |
430 | 433 | else throw("Strict value is not equal to itself.") | |
431 | 434 | } | |
432 | 435 | else throw("Strict value is not equal to itself.") | |
433 | 436 | } | |
434 | 437 | else throw("Strict value is not equal to itself.") | |
435 | 438 | } | |
436 | 439 | else throw("Strict value is not equal to itself.") | |
437 | 440 | } | |
438 | 441 | ||
439 | 442 | ||
440 | 443 | @Verifier(tx) | |
441 | 444 | func verify () = { | |
442 | 445 | let keyAdminAddressList = "%s__adminAddressList" | |
443 | 446 | let keyAllowedTxId = "%s__txId" | |
444 | 447 | let adminList = split(valueOrElse(getString(factoryAddress, keyAdminAddressList), ""), "__") | |
445 | 448 | let byOwner = if ((size(adminList) >= 3)) | |
446 | 449 | then false | |
447 | 450 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
448 | 451 | let byAdmins = (tx.id == fromBase58String(valueOrElse(getString(factoryAddress, keyAllowedTxId), ""))) | |
449 | 452 | if (byAdmins) | |
450 | 453 | then true | |
451 | 454 | else byOwner | |
452 | 455 | } | |
453 | 456 |
github/deemru/w8io/169f3d6 53.93 ms ◑