tx · SW4DYDiJS8mTQTHcVvMZCrSmvYkzqn2JJSJTDyCgyVQ

3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr:  -0.01700000 Waves

2024.12.20 11:19 [3422603] smart account 3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr > SELF 0.00000000 Waves

{ "type": 13, "id": "SW4DYDiJS8mTQTHcVvMZCrSmvYkzqn2JJSJTDyCgyVQ", "fee": 1700000, "feeAssetId": null, "timestamp": 1734682740129, "version": 2, "chainId": 84, "sender": "3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr", "senderPublicKey": "jXCTQV8PjX2uC9UHBFveupYy9cjhY7stHbzE9cptymw", "proofs": [ "4f5KnLPemK7U1Pk7D4YoGVqW4Zbuk1rK3MoG7oycFVp5v3PonmohVtUG2bynkx1ERoBF9HiwJGKXG6JYGWH9XMnK" ], "script": "base64:BwIxCAISAwoBCBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGDoACXNlcGFyYXRvcgICX18AC3dhdmVzU3RyaW5nAgVXQVZFUwAQY29udHJhY3RGaWxlbmFtZQIXbWVtZV9pbV9jYWxjdWxhdG9yLnJpZGUABW11bHQ4AIDC1y8BB3dyYXBFcnIBAXMJAKwCAgkArAICBRBjb250cmFjdEZpbGVuYW1lAgI6IAUBcwEIdGhyb3dFcnIBAXMJAAIBCQEHd3JhcEVycgEFAXMBD3ZhbGlkYXRlQWRkcmVzcwEHYWRkcmVzcwkBCWlzRGVmaW5lZAEJAKYIAQUHYWRkcmVzcwAMU1RBVFVTX0VNUFRZAAAADFNUQVRVU19SRUFEWQABABVTVEFUVVNfVEFSR0VUX1JFQUNIRUQAAgASU1RBVFVTX1RSQU5TRkVSUkVEAAMAC2RlZmF1bHRMb2dvAqYBPHN2ZyB3aWR0aD0nMzAnIGhlaWdodD0nMzAnIHhtbG5zPSdodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2Zyc+PGc+PGNpcmNsZSBje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LHtJN Next: FZEFZsaSqaXyKCvpy8vzwP5SLByaLqgMypait27tGBq1 Diff:
OldNewDifferences
175175 }
176176
177177
178-func isWxSwapActive (amountAsset,priceAsset) = {
179- let amountAssetString = assetIdToString(amountAsset)
180- let priceAssetString = assetIdToString(priceAsset)
178+func isWxSwapActive (amountAssetString,priceAssetString) = {
181179 let statusKey = makeString(["%s%s%s", "status", amountAssetString, priceAssetString], separator)
182180 let status = valueOrElse(getString(userPoolsAddress, statusKey), "")
183181 (status == "active")
278276
279277
280278 @Callable(i)
279+func isWxSwapActiveREADONLY (callerPublicKey,args) = {
280+ let amountAssetIdString = args[1]
281+ let priceAssetIdString = args[2]
282+ let checks = [mustFactory(i.caller)]
283+ if ((checks == checks))
284+ then $Tuple2(nil, isWxSwapActive(amountAssetIdString, priceAssetIdString))
285+ else throw("Strict value is not equal to itself.")
286+ }
287+
288+
289+
290+@Callable(i)
281291 func swapREADONLY (callerPublicKey,args) = {
282292 let poolAddress = addressFromStringValue(args[0])
283293 let amountAssetIdString = args[1]
356366 let poolTokensStringList = split(getStringValue(poolAddress, kPoolTokensList), ",")
357367 let asset1 = parseAssetId(poolTokensStringList[0])
358368 let asset2 = parseAssetId(poolTokensStringList[1])
359- let $t01149211584 = if ((asset1 == unit))
369+ let $t01172511817 = if ((asset1 == unit))
360370 then $Tuple2(asset2, asset1)
361371 else $Tuple2(asset1, asset2)
362- let poolAsset = $t01149211584._1
363- let wavesAsset = $t01149211584._2
372+ let poolAsset = $t01172511817._1
373+ let wavesAsset = $t01172511817._2
364374 let poolAssetBalanceBefore = getBalance(factoryAddress, poolAsset)
365375 if ((poolAssetBalanceBefore == poolAssetBalanceBefore))
366376 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
2929 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
178-func isWxSwapActive (amountAsset,priceAsset) = {
179- let amountAssetString = assetIdToString(amountAsset)
180- let priceAssetString = assetIdToString(priceAsset)
178+func isWxSwapActive (amountAssetString,priceAssetString) = {
181179 let statusKey = makeString(["%s%s%s", "status", amountAssetString, priceAssetString], separator)
182180 let status = valueOrElse(getString(userPoolsAddress, statusKey), "")
183181 (status == "active")
184182 }
185183
186184
187185 @Callable(i)
188186 func init (factoryAddressStr) = {
189187 let checkCaller = mustThis(i.caller)
190188 if ((checkCaller == checkCaller))
191189 then [StringEntry(kFactoryAddress, factoryAddressStr)]
192190 else throw("Strict value is not equal to itself.")
193191 }
194192
195193
196194
197195 @Callable(i)
198196 func addEmptyPool (callerPublicKey,args) = {
199197 let newPoolAddress = addressFromPublicKey(callerPublicKey)
200198 let newPoolIndex = (lastEmptyIndex + 1)
201199 let checks = [if (!(shutdown))
202200 then true
203201 else throwErr("not allowed (shutdown)"), if (checkContractScript(newPoolAddress))
204202 then true
205203 else throwErr("pool script is not allowed"), if (!(isPoolExists(newPoolAddress)))
206204 then true
207205 else throwErr("pool address is already registered")]
208206 if ((checks == checks))
209207 then {
210208 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)]
211209 $Tuple2(nil, factoryActions)
212210 }
213211 else throw("Strict value is not equal to itself.")
214212 }
215213
216214
217215
218216 @Callable(i)
219217 func createPool (callerPublicKey,args) = {
220218 let minPayment = (listingVolume + creationFee)
221219 let checks = [if (!(shutdown))
222220 then true
223221 else throwErr("Temporary shutdown"), mustFactory(i.caller), if (((lastEmptyIndex - firstEmptyIndex) > 0))
224222 then true
225223 else throwErr("No empty pool available"), if ((i.payments[0].assetId == unit))
226224 then true
227225 else throwErr("Payment should be in WAVES"), if ((i.payments[0].amount >= minPayment))
228226 then true
229227 else throwErr((("Payment should be greater or equal " + toString(minPayment)) + " WAVELET")), if (isDefined(args[0]))
230228 then true
231229 else throwErr("Token name is not provided"), if (isDefined(args[1]))
232230 then true
233231 else throwErr("Token description is not provided"), if (isDefined(args[2]))
234232 then true
235233 else throwErr("Token quantity is not provided"), if ((parseInt(args[2]) != unit))
236234 then true
237235 else throwErr("Token quantity should be a number")]
238236 if ((checks == checks))
239237 then {
240238 let poolIndex = (firstEmptyIndex + 1)
241239 let poolAddressString = getStringValue(factoryAddress, kPoolAddressFromIndex(poolIndex))
242240 let poolAddress = addressFromStringValue(poolAddressString)
243241 let callerAddress = addressFromPublicKey(callerPublicKey)
244242 let poolDomain = take(poolAddressString, 8)
245243 let poolOwner = toString(callerAddress)
246244 let tokenName = args[0]
247245 let tokenDesc = args[1]
248246 let tokenQuantity = args[2]
249247 let initPoolInvoke = invoke(factoryAddress, "initPoolInvoke", [poolAddressString, [poolDomain, poolOwner, tokenName, tokenDesc, tokenQuantity]], [AttachedPayment(i.payments[0].assetId, i.payments[0].amount)])
250248 if ((initPoolInvoke == initPoolInvoke))
251249 then {
252250 let factoryActions = [invoke(factoryAddress, "integerEntry", [kFirstEmptyPoolIndex, poolIndex], nil), invoke(factoryAddress, "integerEntry", [kPoolStatus(poolIndex), STATUS_READY], nil)]
253251 $Tuple2(nil, factoryActions)
254252 }
255253 else throw("Strict value is not equal to itself.")
256254 }
257255 else throw("Strict value is not equal to itself.")
258256 }
259257
260258
261259
262260 @Callable(i)
263261 func notifyStatusUpdate (callerPublicKey,args) = {
264262 let poolAddress = addressFromPublicKey(callerPublicKey)
265263 let checks = [if (isPoolExists(poolAddress))
266264 then true
267265 else throwErr("pool not found"), mustFactory(i.caller)]
268266 if ((checks == checks))
269267 then {
270268 let poolIndex = getIntegerValue(factoryAddress, kPoolIndexFromAddress(poolAddress))
271269 let newStatus = parseIntValue(args[0])
272270 let factoryActions = [invoke(factoryAddress, "integerEntry", [kPoolStatus(poolIndex), newStatus], nil)]
273271 $Tuple2(nil, factoryActions)
274272 }
275273 else throw("Strict value is not equal to itself.")
276274 }
277275
278276
279277
280278 @Callable(i)
279+func isWxSwapActiveREADONLY (callerPublicKey,args) = {
280+ let amountAssetIdString = args[1]
281+ let priceAssetIdString = args[2]
282+ let checks = [mustFactory(i.caller)]
283+ if ((checks == checks))
284+ then $Tuple2(nil, isWxSwapActive(amountAssetIdString, priceAssetIdString))
285+ else throw("Strict value is not equal to itself.")
286+ }
287+
288+
289+
290+@Callable(i)
281291 func swapREADONLY (callerPublicKey,args) = {
282292 let poolAddress = addressFromStringValue(args[0])
283293 let amountAssetIdString = args[1]
284294 let priceAssetIdString = args[2]
285295 let amount = parseIntValue(args[3])
286296 let checks = [if (!(shutdown))
287297 then true
288298 else throwErr("Temporary shutdown"), mustFactory(i.caller)]
289299 if ((checks == checks))
290300 then if (isPoolTargetReached(poolAddress))
291301 then {
292302 let wxSwapResult = {
293303 let @ = invoke(wxSwapAddress, "swapCalculateREADONLY", [amount, amountAssetIdString, priceAssetIdString], nil)
294304 if ($isInstanceOf(@, "Int"))
295305 then @
296306 else throw(($getType(@) + " couldn't be cast to Int"))
297307 }
298308 $Tuple2(nil, $Tuple2(wxSwapResult, "WxSwap"))
299309 }
300310 else {
301311 let poolSwapResult = {
302312 let @ = invoke(poolAddress, "swapReadOnly", [amountAssetIdString, priceAssetIdString, amount], nil)
303313 if ($isInstanceOf(@, "Int"))
304314 then @
305315 else throw(($getType(@) + " couldn't be cast to Int"))
306316 }
307317 $Tuple2(nil, $Tuple2(poolSwapResult, "iMemePool"))
308318 }
309319 else throw("Strict value is not equal to itself.")
310320 }
311321
312322
313323
314324 @Callable(i)
315325 func swap (callerPublicKey,args) = {
316326 let callerAddress = addressFromPublicKey(callerPublicKey)
317327 let poolAddress = addressFromStringValue(args[0])
318328 let priceAssetIdString = args[1]
319329 let priceAssetId = parseAssetId(priceAssetIdString)
320330 let minimumAmount = parseIntValue(args[2])
321331 let assetInAmount = i.payments[0].amount
322332 let assetInAssetId = i.payments[0].assetId
323333 let checks = [if (!(shutdown))
324334 then true
325335 else throwErr("Temporary shutdown"), mustFactory(i.caller), if ((size(i.payments) == 1))
326336 then true
327337 else throwErr("exactly one payment is expected")]
328338 if ((checks == checks))
329339 then {
330340 let outAssetBalanceBefore = getBalance(this, priceAssetId)
331341 if ((outAssetBalanceBefore == outAssetBalanceBefore))
332342 then {
333343 let swapAction = if (isPoolTargetReached(poolAddress))
334344 then invoke(wxSwapAddress, "swap", [minimumAmount, priceAssetIdString, toString(this)], i.payments)
335345 else invoke(poolAddress, "swap", [priceAssetIdString, minimumAmount], i.payments)
336346 if ((swapAction == swapAction))
337347 then {
338348 let outAssetBalanceAfter = getBalance(this, priceAssetId)
339349 if ((outAssetBalanceAfter == outAssetBalanceAfter))
340350 then [ScriptTransfer(callerAddress, (outAssetBalanceAfter - outAssetBalanceBefore), priceAssetId)]
341351 else throw("Strict value is not equal to itself.")
342352 }
343353 else throw("Strict value is not equal to itself.")
344354 }
345355 else throw("Strict value is not equal to itself.")
346356 }
347357 else throw("Strict value is not equal to itself.")
348358 }
349359
350360
351361
352362 @Callable(i)
353363 func transferPool (callerPublicKey,args) = {
354364 let callerAddress = addressFromPublicKey(callerPublicKey)
355365 let poolAddress = addressFromStringValue(args[0])
356366 let poolTokensStringList = split(getStringValue(poolAddress, kPoolTokensList), ",")
357367 let asset1 = parseAssetId(poolTokensStringList[0])
358368 let asset2 = parseAssetId(poolTokensStringList[1])
359- let $t01149211584 = if ((asset1 == unit))
369+ let $t01172511817 = if ((asset1 == unit))
360370 then $Tuple2(asset2, asset1)
361371 else $Tuple2(asset1, asset2)
362- let poolAsset = $t01149211584._1
363- let wavesAsset = $t01149211584._2
372+ let poolAsset = $t01172511817._1
373+ let wavesAsset = $t01172511817._2
364374 let poolAssetBalanceBefore = getBalance(factoryAddress, poolAsset)
365375 if ((poolAssetBalanceBefore == poolAssetBalanceBefore))
366376 then {
367377 let wavesAssetBalanceBefore = getBalance(factoryAddress, wavesAsset)
368378 if ((wavesAssetBalanceBefore == wavesAssetBalanceBefore))
369379 then {
370380 let withdrawInvoke = invoke(factoryAddress, "withdrawLiquidityFromPool", [poolAddress.bytes], nil)
371381 if ((withdrawInvoke == withdrawInvoke))
372382 then {
373383 let poolAssetBalanceAfter = getBalance(factoryAddress, poolAsset)
374384 if ((poolAssetBalanceAfter == poolAssetBalanceAfter))
375385 then {
376386 let wavesAssetBalanceAfter = getBalance(factoryAddress, wavesAsset)
377387 if ((wavesAssetBalanceAfter == wavesAssetBalanceAfter))
378388 then {
379389 let poolAssetAmount = (poolAssetBalanceAfter - poolAssetBalanceBefore)
380390 let wavesAmount = (wavesAssetBalanceAfter - wavesAssetBalanceBefore)
381391 if (if ((poolAssetAmount > 0))
382392 then (wavesAmount > 0)
383393 else false)
384394 then {
385395 let burnAmount = fraction(poolAssetAmount, 20, 100)
386396 let burnAction = invoke(factoryAddress, "burn", [poolAsset, burnAmount], nil)
387397 if ((burnAction == burnAction))
388398 then {
389399 let feeWavesAmount = fraction(wavesAmount, 20, 100)
390400 let feeAction = invoke(factoryAddress, "transferWaves", [feeCollectorAddress.bytes, feeWavesAmount], nil)
391401 if ((feeAction == feeAction))
392402 then {
393403 let registerAssetAction = invoke(factoryAddress, "registerAsset", [assetStoreAddress.bytes, assetIdToString(poolAsset), defaultLogo, true], nil)
394404 if ((registerAssetAction == registerAssetAction))
395405 then {
396406 let createWxPoolAction = invoke(factoryAddress, "createWxPool", [userPoolsAddress.bytes, assetIdToString(poolAsset), (poolAssetAmount - burnAmount), assetIdToString(wavesAsset), (wavesAmount - feeWavesAmount)], nil)
397407 if ((createWxPoolAction == createWxPoolAction))
398408 then {
399409 let changeStatus = invoke(factoryAddress, "integerEntry", [kPoolStatus(getPoolId(poolAddress)), STATUS_TRANSFERRED], nil)
400410 if ((changeStatus == changeStatus))
401411 then nil
402412 else throw("Strict value is not equal to itself.")
403413 }
404414 else throw("Strict value is not equal to itself.")
405415 }
406416 else throw("Strict value is not equal to itself.")
407417 }
408418 else throw("Strict value is not equal to itself.")
409419 }
410420 else throw("Strict value is not equal to itself.")
411421 }
412422 else throwErr("withdrawn amount from pool is too low")
413423 }
414424 else throw("Strict value is not equal to itself.")
415425 }
416426 else throw("Strict value is not equal to itself.")
417427 }
418428 else throw("Strict value is not equal to itself.")
419429 }
420430 else throw("Strict value is not equal to itself.")
421431 }
422432 else throw("Strict value is not equal to itself.")
423433 }
424434
425435
426436 @Verifier(tx)
427437 func verify () = {
428438 let keyAdminAddressList = "%s__adminAddressList"
429439 let keyAllowedTxId = "%s__txId"
430440 let adminList = split(valueOrElse(getString(factoryAddress, keyAdminAddressList), ""), "__")
431441 let byOwner = if ((size(adminList) >= 3))
432442 then false
433443 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
434444 let byAdmins = (tx.id == fromBase58String(valueOrElse(getString(factoryAddress, keyAllowedTxId), "")))
435445 if (byAdmins)
436446 then true
437447 else byOwner
438448 }
439449

github/deemru/w8io/169f3d6 
45.30 ms