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+PGNpcmNsZSBjeD0nMTUnIG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RtaW5MaXN0AAMHCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5BAhieUFkbWlucwkAAAIIBQJ0eAJpZAkA2QQBCQELdmFsdWVPckVsc2UCCQCdCAIFDmZhY3RvcnlBZGRyZXNzBQ5rZXlBbGxvd2VkVHhJZAIAAwUIYnlBZG1pbnMGBQdieU93bmVyuLABUg==", "height": 3422585, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: H4cjs3n8JTZLZRkYi6Fen5WkDn8g1cQvqXCCtmSZc2PD Next: EeYZr3JEPQMVjbjCrts3MtHWWu44bxJ2MN6wstdLHtJN Diff:
OldNewDifferences
2626
2727 let STATUS_TRANSFERRED = 3
2828
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 stroke='#0' x='6' y='20'>iM</text></g></svg>"
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>"
3030
3131 let kShutdown = "shutdown__flag"
3232
347347 let poolTokensStringList = split(getStringValue(poolAddress, kPoolTokensList), ",")
348348 let asset1 = parseAssetId(poolTokensStringList[0])
349349 let asset2 = parseAssetId(poolTokensStringList[1])
350- let $t01108811180 = if ((asset1 == unit))
350+ let $t01109411186 = if ((asset1 == unit))
351351 then $Tuple2(asset2, asset1)
352352 else $Tuple2(asset1, asset2)
353- let poolAsset = $t01108811180._1
354- let wavesAsset = $t01108811180._2
353+ let poolAsset = $t01109411186._1
354+ let wavesAsset = $t01109411186._2
355355 let poolAssetBalanceBefore = getBalance(factoryAddress, poolAsset)
356356 if ((poolAssetBalanceBefore == poolAssetBalanceBefore))
357357 then {
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 7 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let separator = "__"
55
66 let wavesString = "WAVES"
77
88 let contractFilename = "meme_im_calculator.ride"
99
1010 let mult8 = 100000000
1111
1212 func wrapErr (s) = ((contractFilename + ": ") + s)
1313
1414
1515 func throwErr (s) = throw(wrapErr(s))
1616
1717
1818 func validateAddress (address) = isDefined(addressFromString(address))
1919
2020
2121 let STATUS_EMPTY = 0
2222
2323 let STATUS_READY = 1
2424
2525 let STATUS_TARGET_REACHED = 2
2626
2727 let STATUS_TRANSFERRED = 3
2828
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 stroke='#0' x='6' y='20'>iM</text></g></svg>"
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>"
3030
3131 let kShutdown = "shutdown__flag"
3232
3333 let kPriceAsset = "price__asset"
3434
3535 let kListingVolume = "listing__volume"
3636
3737 let kCreationFee = "setup__creationFee"
3838
3939 let kCurveTarget = "setup__curveTarget"
4040
4141 let kVirtualLiquidity = "setup__virtualLiquidity"
4242
4343 let kPoolTokensList = "static_tokenIds"
4444
4545 let kPoolContractHash = "pool__contract__hash"
4646
4747 let kLastEmptyPoolIndex = "last__empty_pool__index"
4848
4949 let kFirstEmptyPoolIndex = "first__empty__pool__index"
5050
5151 func kPoolAddressFromIndex (index) = makeString(["pool", toString(index)], separator)
5252
5353
5454 func kPoolIndexFromAddress (address) = makeString(["pool", toString(address)], separator)
5555
5656
5757 func kPoolAsset (address) = makeString(["asset", toString(address)], separator)
5858
5959
6060 func kPoolStatus (index) = makeString(["pool", "status", toString(index)], separator)
6161
6262
6363 let kFactoryAddress = "factory__address"
6464
6565 let factoryAddressOption = match getString(this, kFactoryAddress) {
6666 case s: String =>
6767 addressFromString(s)
6868 case _: Unit =>
6969 unit
7070 case _ =>
7171 throw("Match error")
7272 }
7373
7474 let factoryAddress = valueOrErrorMessage(factoryAddressOption, wrapErr("invalid factory address"))
7575
7676 let kWxSwapAddress = "wxswap__address"
7777
7878 let wxSwapAddressOption = match getString(factoryAddress, kWxSwapAddress) {
7979 case s: String =>
8080 addressFromString(s)
8181 case _ =>
8282 unit
8383 }
8484
8585 let wxSwapAddress = valueOrErrorMessage(wxSwapAddressOption, wrapErr("invalid wx swap address"))
8686
8787 let kFeeCollectorAddress = "wxfee_address"
8888
8989 let feeCollectorAddressOption = match getString(factoryAddress, kFeeCollectorAddress) {
9090 case s: String =>
9191 addressFromString(s)
9292 case _ =>
9393 unit
9494 }
9595
9696 let feeCollectorAddress = valueOrErrorMessage(feeCollectorAddressOption, wrapErr("invalid fee collector address"))
9797
9898 let kUserPoolsAddress = "userpools_address"
9999
100100 let userPoolsAddressOption = match getString(factoryAddress, kUserPoolsAddress) {
101101 case s: String =>
102102 addressFromString(s)
103103 case _ =>
104104 unit
105105 }
106106
107107 let userPoolsAddress = valueOrErrorMessage(userPoolsAddressOption, wrapErr("invalid user_pools dapp address"))
108108
109109 let kAssetStoreAddress = "assetstore_address"
110110
111111 let assetStoreAddressOption = match getString(factoryAddress, kAssetStoreAddress) {
112112 case s: String =>
113113 addressFromString(s)
114114 case _ =>
115115 unit
116116 }
117117
118118 let assetStoreAddress = valueOrErrorMessage(assetStoreAddressOption, wrapErr("invalid asset_store dapp address"))
119119
120120 let shutdown = valueOrElse(getBoolean(factoryAddress, kShutdown), false)
121121
122122 let lastEmptyIndex = valueOrElse(getInteger(factoryAddress, kLastEmptyPoolIndex), 0)
123123
124124 let firstEmptyIndex = valueOrElse(getInteger(factoryAddress, kFirstEmptyPoolIndex), 0)
125125
126126 let listingVolume = valueOrElse(getInteger(factoryAddress, kListingVolume), 0)
127127
128128 let creationFee = valueOrElse(getInteger(factoryAddress, kCreationFee), 0)
129129
130130 let poolContractHash = getBinary(factoryAddress, kPoolContractHash)
131131
132132 func parseAssetId (input) = if ((input == wavesString))
133133 then unit
134134 else fromBase58String(input)
135135
136136
137137 func assetIdToString (input) = if ((input == unit))
138138 then wavesString
139139 else toBase58String(value(input))
140140
141141
142142 func mustAddress (caller,address) = if ((caller == address))
143143 then true
144144 else throwErr("permission denied")
145145
146146
147147 func mustThis (caller) = mustAddress(caller, this)
148148
149149
150150 func mustFactory (caller) = mustAddress(caller, factoryAddress)
151151
152152
153153 func checkContractScript (address) = match poolContractHash {
154154 case hash: ByteVector =>
155155 (scriptHash(address) == hash)
156156 case _ =>
157157 true
158158 }
159159
160160
161161 func isPoolExists (poolAddress) = isDefined(getInteger(factoryAddress, kPoolIndexFromAddress(poolAddress)))
162162
163163
164164 func getPoolId (poolAddress) = valueOrErrorMessage(getInteger(factoryAddress, kPoolIndexFromAddress(poolAddress)), "pool doesn't exists")
165165
166166
167167 func isPoolTargetReached (poolAddress) = (valueOrElse(getInteger(factoryAddress, kPoolStatus(getPoolId(poolAddress))), -1) == STATUS_TARGET_REACHED)
168168
169169
170170 func getBalance (address,assetId) = match assetId {
171171 case id: ByteVector =>
172172 assetBalance(address, id)
173173 case _ =>
174174 wavesBalance(address).available
175175 }
176176
177177
178178 @Callable(i)
179179 func init (factoryAddressStr) = {
180180 let checkCaller = mustThis(i.caller)
181181 if ((checkCaller == checkCaller))
182182 then [StringEntry(kFactoryAddress, factoryAddressStr)]
183183 else throw("Strict value is not equal to itself.")
184184 }
185185
186186
187187
188188 @Callable(i)
189189 func addEmptyPool (callerPublicKey,args) = {
190190 let newPoolAddress = addressFromPublicKey(callerPublicKey)
191191 let newPoolIndex = (lastEmptyIndex + 1)
192192 let checks = [if (!(shutdown))
193193 then true
194194 else throwErr("not allowed (shutdown)"), if (checkContractScript(newPoolAddress))
195195 then true
196196 else throwErr("pool script is not allowed"), if (!(isPoolExists(newPoolAddress)))
197197 then true
198198 else throwErr("pool address is already registered")]
199199 if ((checks == checks))
200200 then {
201201 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)]
202202 $Tuple2(nil, factoryActions)
203203 }
204204 else throw("Strict value is not equal to itself.")
205205 }
206206
207207
208208
209209 @Callable(i)
210210 func createPool (callerPublicKey,args) = {
211211 let minPayment = (listingVolume + creationFee)
212212 let checks = [if (!(shutdown))
213213 then true
214214 else throwErr("Temporary shutdown"), mustFactory(i.caller), if (((lastEmptyIndex - firstEmptyIndex) > 0))
215215 then true
216216 else throwErr("No empty pool available"), if ((i.payments[0].assetId == unit))
217217 then true
218218 else throwErr("Payment should be in WAVES"), if ((i.payments[0].amount >= minPayment))
219219 then true
220220 else throwErr((("Payment should be greater or equal " + toString(minPayment)) + " WAVELET")), if (isDefined(args[0]))
221221 then true
222222 else throwErr("Token name is not provided"), if (isDefined(args[1]))
223223 then true
224224 else throwErr("Token description is not provided"), if (isDefined(args[2]))
225225 then true
226226 else throwErr("Token quantity is not provided"), if ((parseInt(args[2]) != unit))
227227 then true
228228 else throwErr("Token quantity should be a number")]
229229 if ((checks == checks))
230230 then {
231231 let poolIndex = (firstEmptyIndex + 1)
232232 let poolAddressString = getStringValue(factoryAddress, kPoolAddressFromIndex(poolIndex))
233233 let poolAddress = addressFromStringValue(poolAddressString)
234234 let callerAddress = addressFromPublicKey(callerPublicKey)
235235 let poolDomain = take(poolAddressString, 8)
236236 let poolOwner = toString(callerAddress)
237237 let tokenName = args[0]
238238 let tokenDesc = args[1]
239239 let tokenQuantity = args[2]
240240 let initPoolInvoke = invoke(factoryAddress, "initPoolInvoke", [poolAddressString, [poolDomain, poolOwner, tokenName, tokenDesc, tokenQuantity]], [AttachedPayment(i.payments[0].assetId, i.payments[0].amount)])
241241 if ((initPoolInvoke == initPoolInvoke))
242242 then {
243243 let factoryActions = [invoke(factoryAddress, "integerEntry", [kFirstEmptyPoolIndex, poolIndex], nil), invoke(factoryAddress, "integerEntry", [kPoolStatus(poolIndex), STATUS_READY], nil)]
244244 $Tuple2(nil, factoryActions)
245245 }
246246 else throw("Strict value is not equal to itself.")
247247 }
248248 else throw("Strict value is not equal to itself.")
249249 }
250250
251251
252252
253253 @Callable(i)
254254 func notifyStatusUpdate (callerPublicKey,args) = {
255255 let poolAddress = addressFromPublicKey(callerPublicKey)
256256 let checks = [if (isPoolExists(poolAddress))
257257 then true
258258 else throwErr("pool not found"), mustFactory(i.caller)]
259259 if ((checks == checks))
260260 then {
261261 let poolIndex = getIntegerValue(factoryAddress, kPoolIndexFromAddress(poolAddress))
262262 let newStatus = parseIntValue(args[0])
263263 let factoryActions = [invoke(factoryAddress, "integerEntry", [kPoolStatus(poolIndex), newStatus], nil)]
264264 $Tuple2(nil, factoryActions)
265265 }
266266 else throw("Strict value is not equal to itself.")
267267 }
268268
269269
270270
271271 @Callable(i)
272272 func swapREADONLY (callerPublicKey,args) = {
273273 let poolAddress = addressFromStringValue(args[0])
274274 let amountAssetIdString = args[1]
275275 let priceAssetIdString = args[2]
276276 let amount = parseIntValue(args[3])
277277 let checks = [if (!(shutdown))
278278 then true
279279 else throwErr("Temporary shutdown"), mustFactory(i.caller)]
280280 if ((checks == checks))
281281 then if (isPoolTargetReached(poolAddress))
282282 then {
283283 let wxSwapResult = {
284284 let @ = invoke(wxSwapAddress, "swapCalculateREADONLY", [amount, amountAssetIdString, priceAssetIdString], nil)
285285 if ($isInstanceOf(@, "Int"))
286286 then @
287287 else throw(($getType(@) + " couldn't be cast to Int"))
288288 }
289289 $Tuple2(nil, $Tuple2(wxSwapResult, "WxSwap"))
290290 }
291291 else {
292292 let poolSwapResult = {
293293 let @ = invoke(poolAddress, "swapReadOnly", [amountAssetIdString, priceAssetIdString, amount], nil)
294294 if ($isInstanceOf(@, "Int"))
295295 then @
296296 else throw(($getType(@) + " couldn't be cast to Int"))
297297 }
298298 $Tuple2(nil, $Tuple2(poolSwapResult, "iMemePool"))
299299 }
300300 else throw("Strict value is not equal to itself.")
301301 }
302302
303303
304304
305305 @Callable(i)
306306 func swap (callerPublicKey,args) = {
307307 let callerAddress = addressFromPublicKey(callerPublicKey)
308308 let poolAddress = addressFromStringValue(args[0])
309309 let priceAssetIdString = args[1]
310310 let priceAssetId = parseAssetId(priceAssetIdString)
311311 let minimumAmount = parseIntValue(args[2])
312312 let assetInAmount = i.payments[0].amount
313313 let assetInAssetId = i.payments[0].assetId
314314 let checks = [if (!(shutdown))
315315 then true
316316 else throwErr("Temporary shutdown"), mustFactory(i.caller), if ((size(i.payments) == 1))
317317 then true
318318 else throwErr("exactly one payment is expected")]
319319 if ((checks == checks))
320320 then {
321321 let outAssetBalanceBefore = getBalance(this, priceAssetId)
322322 if ((outAssetBalanceBefore == outAssetBalanceBefore))
323323 then {
324324 let swapAction = if (isPoolTargetReached(poolAddress))
325325 then invoke(wxSwapAddress, "swap", [minimumAmount, priceAssetIdString, toString(this)], i.payments)
326326 else invoke(poolAddress, "swap", [priceAssetIdString, minimumAmount], i.payments)
327327 if ((swapAction == swapAction))
328328 then {
329329 let outAssetBalanceAfter = getBalance(this, priceAssetId)
330330 if ((outAssetBalanceAfter == outAssetBalanceAfter))
331331 then [ScriptTransfer(callerAddress, (outAssetBalanceAfter - outAssetBalanceBefore), priceAssetId)]
332332 else throw("Strict value is not equal to itself.")
333333 }
334334 else throw("Strict value is not equal to itself.")
335335 }
336336 else throw("Strict value is not equal to itself.")
337337 }
338338 else throw("Strict value is not equal to itself.")
339339 }
340340
341341
342342
343343 @Callable(i)
344344 func transferPool (callerPublicKey,args) = {
345345 let callerAddress = addressFromPublicKey(callerPublicKey)
346346 let poolAddress = addressFromStringValue(args[0])
347347 let poolTokensStringList = split(getStringValue(poolAddress, kPoolTokensList), ",")
348348 let asset1 = parseAssetId(poolTokensStringList[0])
349349 let asset2 = parseAssetId(poolTokensStringList[1])
350- let $t01108811180 = if ((asset1 == unit))
350+ let $t01109411186 = if ((asset1 == unit))
351351 then $Tuple2(asset2, asset1)
352352 else $Tuple2(asset1, asset2)
353- let poolAsset = $t01108811180._1
354- let wavesAsset = $t01108811180._2
353+ let poolAsset = $t01109411186._1
354+ let wavesAsset = $t01109411186._2
355355 let poolAssetBalanceBefore = getBalance(factoryAddress, poolAsset)
356356 if ((poolAssetBalanceBefore == poolAssetBalanceBefore))
357357 then {
358358 let wavesAssetBalanceBefore = getBalance(factoryAddress, wavesAsset)
359359 if ((wavesAssetBalanceBefore == wavesAssetBalanceBefore))
360360 then {
361361 let withdrawInvoke = invoke(factoryAddress, "withdrawLiquidityFromPool", [poolAddress.bytes], nil)
362362 if ((withdrawInvoke == withdrawInvoke))
363363 then {
364364 let poolAssetBalanceAfter = getBalance(factoryAddress, poolAsset)
365365 if ((poolAssetBalanceAfter == poolAssetBalanceAfter))
366366 then {
367367 let wavesAssetBalanceAfter = getBalance(factoryAddress, wavesAsset)
368368 if ((wavesAssetBalanceAfter == wavesAssetBalanceAfter))
369369 then {
370370 let poolAssetAmount = (poolAssetBalanceAfter - poolAssetBalanceBefore)
371371 let wavesAmount = (wavesAssetBalanceAfter - wavesAssetBalanceBefore)
372372 if (if ((poolAssetAmount > 0))
373373 then (wavesAmount > 0)
374374 else false)
375375 then {
376376 let burnAmount = fraction(poolAssetAmount, 20, 100)
377377 let burnAction = invoke(factoryAddress, "burn", [poolAsset, burnAmount], nil)
378378 if ((burnAction == burnAction))
379379 then {
380380 let feeWavesAmount = fraction(wavesAmount, 20, 100)
381381 let feeAction = invoke(factoryAddress, "transferWaves", [feeCollectorAddress.bytes, feeWavesAmount], nil)
382382 if ((feeAction == feeAction))
383383 then {
384384 let registerAssetAction = invoke(factoryAddress, "registerAsset", [assetStoreAddress.bytes, assetIdToString(poolAsset), defaultLogo, true], nil)
385385 if ((registerAssetAction == registerAssetAction))
386386 then {
387387 let createWxPoolAction = invoke(factoryAddress, "createWxPool", [userPoolsAddress.bytes, assetIdToString(poolAsset), (poolAssetAmount - burnAmount), assetIdToString(wavesAsset), (wavesAmount - feeWavesAmount)], nil)
388388 if ((createWxPoolAction == createWxPoolAction))
389389 then {
390390 let changeStatus = invoke(factoryAddress, "integerEntry", [kPoolStatus(getPoolId(poolAddress)), STATUS_TRANSFERRED], nil)
391391 if ((changeStatus == changeStatus))
392392 then nil
393393 else throw("Strict value is not equal to itself.")
394394 }
395395 else throw("Strict value is not equal to itself.")
396396 }
397397 else throw("Strict value is not equal to itself.")
398398 }
399399 else throw("Strict value is not equal to itself.")
400400 }
401401 else throw("Strict value is not equal to itself.")
402402 }
403403 else throwErr("withdrawn amount from pool is too low")
404404 }
405405 else throw("Strict value is not equal to itself.")
406406 }
407407 else throw("Strict value is not equal to itself.")
408408 }
409409 else throw("Strict value is not equal to itself.")
410410 }
411411 else throw("Strict value is not equal to itself.")
412412 }
413413 else throw("Strict value is not equal to itself.")
414414 }
415415
416416
417417 @Verifier(tx)
418418 func verify () = {
419419 let keyAdminAddressList = "%s__adminAddressList"
420420 let keyAllowedTxId = "%s__txId"
421421 let adminList = split(valueOrElse(getString(factoryAddress, keyAdminAddressList), ""), "__")
422422 let byOwner = if ((size(adminList) >= 3))
423423 then false
424424 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
425425 let byAdmins = (tx.id == fromBase58String(valueOrElse(getString(factoryAddress, keyAllowedTxId), "")))
426426 if (byAdmins)
427427 then true
428428 else byOwner
429429 }
430430

github/deemru/w8io/169f3d6 
44.61 ms