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