tx · AWxxyUq7pUj4mnKd4kcbfxbchATDWQyUX2v4sLVLxhSJ

3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr:  -0.01600000 Waves

2024.12.19 10:48 [3421139] smart account 3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr > SELF 0.00000000 Waves

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

github/deemru/w8io/169f3d6 
44.13 ms