tx · 36eQMJnqu2CeK2W9DQP5LGNxFxz69LQqPuB5SauwJwiD

3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr:  -0.01800000 Waves

2024.12.20 18:22 [3423027] smart account 3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr > SELF 0.00000000 Waves

{ "type": 13, "id": "36eQMJnqu2CeK2W9DQP5LGNxFxz69LQqPuB5SauwJwiD", "fee": 1800000, "feeAssetId": null, "timestamp": 1734708147815, "version": 2, "chainId": 84, "sender": "3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr", "senderPublicKey": "jXCTQV8PjX2uC9UHBFveupYy9cjhY7stHbzE9cptymw", "proofs": [ "4Ft6DjvnxV6E5oexLGsQsdMBp2UoxSKZboJVPn3mX4DvBRLQ3ErZii4Gujq1B1RRRneLME3Bqu7fvXuVqjQnXLc8" ], "script": "base64:BwIxCAISAwoBCBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGDoACXNlcGFyYXRvcgICX18AC3dhdmVzU3RyaW5nAgVXQVZFUwAQY29udHJhY3RGaWxlbmFtZQIXbWVtZV9pbV9jYWxjdWxhdG9yLnJpZGUABW11bHQ4AIDC1y8BB3dyYXBFcnIBAXMJAKwCAgkArAICBRBjb250cmFjdEZpbGVuYW1lAgI6IAUBcwEIdGhyb3dFcnIBAXMJAAIBCQEHd3JhcEVycgEFAXMBD3ZhbGlkYXRlQWRkcmVzcwEHYWRkcmVzcwkBCWlzRGVmaW5lZAEJAKYIAQUHYWRkcmVzcwAMU1RBVFVTX0VNUFRZAAAADFNUQVRVU19SRUFEWQABABVTVEFUVVNfVEFSR0VUX1JFQUNIRUQAAgASU1RBVFVTX1RSQU5TRkVSUkVEAAMACWtTaHV0ZG93bgIOc2h1dGRvd25fX2ZsYWcAC2tQcmljZUFzc2V0AgxwcmljZV9fYXNzZXQADmtMaXN0aW5nVm9sdW1lAg9saXN0aW5nX192b2x1bWUADGtDcmVhdGlvbkZl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BhbW91bnQgZnJvbSBwb29sIGlzIHRvbyBsb3cJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAnR4AQZ2ZXJpZnkABBNrZXlBZG1pbkFkZHJlc3NMaXN0AhQlc19fYWRtaW5BZGRyZXNzTGlzdAQOa2V5QWxsb3dlZFR4SWQCCCVzX190eElkBAlhZG1pbkxpc3QJALUJAgkBC3ZhbHVlT3JFbHNlAgkAnQgCBQ5mYWN0b3J5QWRkcmVzcwUTa2V5QWRtaW5BZGRyZXNzTGlzdAIAAgJfXwQHYnlPd25lcgMJAGcCCQCQAwEFCWFkbWluTGlzdAADBwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleQQIYnlBZG1pbnMJAAACCAUCdHgCaWQJANkEAQkBC3ZhbHVlT3JFbHNlAgkAnQgCBQ5mYWN0b3J5QWRkcmVzcwUOa2V5QWxsb3dlZFR4SWQCAAMFCGJ5QWRtaW5zBgUHYnlPd25lcp4nr+4=", "height": 3423027, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Akrmc7XheVDVkVvt7ueiN7h3VSTEcTw8qUcqqGvvJ1Hc Next: Aih1LhYGq68JX9RdPJKvVgKfELsrNEUXsDNyR1HsT9zb Diff:
OldNewDifferences
402402 let wavesAssetBalanceBefore = getBalance(factoryAddress, wavesAsset)
403403 if ((wavesAssetBalanceBefore == wavesAssetBalanceBefore))
404404 then {
405- let withdrawInvoke = invoke(factoryAddress, "withdrawLiquidityFromPool", [poolAddress.bytes], nil)
405+ let withdrawInvoke = reentrantInvoke(factoryAddress, "withdrawLiquidityFromPool", [poolAddress.bytes], nil)
406406 if ((withdrawInvoke == withdrawInvoke))
407407 then {
408408 let poolAssetBalanceAfter = getBalance(factoryAddress, poolAsset)
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 kAssetStoreAddress = "assetstore_address"
108108
109109 let assetStoreAddressOption = match getString(factoryAddress, kAssetStoreAddress) {
110110 case s: String =>
111111 addressFromString(s)
112112 case _ =>
113113 unit
114114 }
115115
116116 let assetStoreAddress = valueOrErrorMessage(assetStoreAddressOption, wrapErr("invalid asset_store dapp address"))
117117
118118 let shutdown = valueOrElse(getBoolean(factoryAddress, kShutdown), false)
119119
120120 let lastEmptyIndex = valueOrElse(getInteger(factoryAddress, kLastEmptyPoolIndex), 0)
121121
122122 let firstEmptyIndex = valueOrElse(getInteger(factoryAddress, kFirstEmptyPoolIndex), 0)
123123
124124 let listingVolume = valueOrElse(getInteger(factoryAddress, kListingVolume), 0)
125125
126126 let creationFee = valueOrElse(getInteger(factoryAddress, kCreationFee), 0)
127127
128128 let poolContractHash = getBinary(factoryAddress, kPoolContractHash)
129129
130130 func parseAssetId (input) = if ((input == wavesString))
131131 then unit
132132 else fromBase58String(input)
133133
134134
135135 func assetIdToString (input) = if ((input == unit))
136136 then wavesString
137137 else toBase58String(value(input))
138138
139139
140140 func mustAddress (caller,address) = if ((caller == address))
141141 then true
142142 else throwErr("permission denied")
143143
144144
145145 func mustThis (caller) = mustAddress(caller, this)
146146
147147
148148 func mustFactory (caller) = mustAddress(caller, factoryAddress)
149149
150150
151151 func checkContractScript (address) = match poolContractHash {
152152 case hash: ByteVector =>
153153 (scriptHash(address) == hash)
154154 case _ =>
155155 true
156156 }
157157
158158
159159 func isPoolExists (poolAddress) = isDefined(getInteger(factoryAddress, kPoolIndexFromAddress(poolAddress)))
160160
161161
162162 func getPoolId (poolAddress) = valueOrErrorMessage(getInteger(factoryAddress, kPoolIndexFromAddress(poolAddress)), "pool doesn't exists")
163163
164164
165165 func isPoolTargetReached (poolAddress) = {
166166 let poolStatus = valueOrElse(getInteger(factoryAddress, kPoolStatus(getPoolId(poolAddress))), -1)
167167 containsElement([STATUS_TARGET_REACHED, STATUS_TRANSFERRED], poolStatus)
168168 }
169169
170170
171171 func getBalance (address,assetId) = match assetId {
172172 case id: ByteVector =>
173173 assetBalance(address, id)
174174 case _ =>
175175 wavesBalance(address).available
176176 }
177177
178178
179179 func isWxSwapActive (amountAssetString,priceAssetString) = {
180180 let statusKey = makeString(["%s%s%s", "status", amountAssetString, priceAssetString], separator)
181181 let statusKeyReverse = makeString(["%s%s%s", "status", priceAssetString, amountAssetString], separator)
182182 let pairStatus = valueOrElse(getString(userPoolsAddress, statusKey), "")
183183 let reversePairStatus = valueOrElse(getString(userPoolsAddress, statusKeyReverse), "")
184184 if ((pairStatus == "active"))
185185 then true
186186 else (reversePairStatus == "active")
187187 }
188188
189189
190190 func genLogo (assetId) = {
191191 let $t054295712 = match assetId {
192192 case b: ByteVector =>
193193 let name = match assetInfo(b) {
194194 case a: Asset =>
195195 a.name
196196 case _ =>
197197 "%"
198198 }
199199 $Tuple2(toString((toInt(b) % 360)), name)
200200 case _ =>
201201 $Tuple2("200", "WAVES")
202202 }
203203 let color = $t054295712._1
204204 let assetName = $t054295712._2
205205 let logo = (((("<svg width='30' height='30' xmlns='http://www.w3.org/2000/svg'><circle cx='15' cy='15' fill='hsl(" + color) + ", 70%, 70%)' r='15'/><text x='50%' y='50%' text-anchor='middle' dominant-baseline='middle' font-size='18'>") + take(assetName, 1)) + "</text></svg>")
206206 logo
207207 }
208208
209209
210210 @Callable(i)
211211 func init (factoryAddressStr) = {
212212 let checkCaller = mustThis(i.caller)
213213 if ((checkCaller == checkCaller))
214214 then [StringEntry(kFactoryAddress, factoryAddressStr)]
215215 else throw("Strict value is not equal to itself.")
216216 }
217217
218218
219219
220220 @Callable(i)
221221 func addEmptyPool (callerPublicKey,args) = {
222222 let newPoolAddress = addressFromPublicKey(callerPublicKey)
223223 let newPoolIndex = (lastEmptyIndex + 1)
224224 let checks = [if (!(shutdown))
225225 then true
226226 else throwErr("not allowed (shutdown)"), if (checkContractScript(newPoolAddress))
227227 then true
228228 else throwErr("pool script is not allowed"), if (!(isPoolExists(newPoolAddress)))
229229 then true
230230 else throwErr("pool address is already registered")]
231231 if ((checks == checks))
232232 then {
233233 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)]
234234 $Tuple2(nil, factoryActions)
235235 }
236236 else throw("Strict value is not equal to itself.")
237237 }
238238
239239
240240
241241 @Callable(i)
242242 func createPool (callerPublicKey,args) = {
243243 let minPayment = (listingVolume + creationFee)
244244 let checks = [if (!(shutdown))
245245 then true
246246 else throwErr("Temporary shutdown"), mustFactory(i.caller), if (((lastEmptyIndex - firstEmptyIndex) > 0))
247247 then true
248248 else throwErr("No empty pool available"), if ((i.payments[0].assetId == unit))
249249 then true
250250 else throwErr("Payment should be in WAVES"), if ((i.payments[0].amount >= minPayment))
251251 then true
252252 else throwErr((("Payment should be greater or equal " + toString(minPayment)) + " WAVELET")), if (isDefined(args[0]))
253253 then true
254254 else throwErr("Token name is not provided"), if (isDefined(args[1]))
255255 then true
256256 else throwErr("Token description is not provided"), if (isDefined(args[2]))
257257 then true
258258 else throwErr("Token quantity is not provided"), if ((parseInt(args[2]) != unit))
259259 then true
260260 else throwErr("Token quantity should be a number")]
261261 if ((checks == checks))
262262 then {
263263 let poolIndex = (firstEmptyIndex + 1)
264264 let poolAddressString = getStringValue(factoryAddress, kPoolAddressFromIndex(poolIndex))
265265 let poolAddress = addressFromStringValue(poolAddressString)
266266 let callerAddress = addressFromPublicKey(callerPublicKey)
267267 let poolDomain = take(poolAddressString, 8)
268268 let poolOwner = toString(callerAddress)
269269 let tokenName = args[0]
270270 let tokenDesc = args[1]
271271 let tokenQuantity = args[2]
272272 let initPoolInvoke = invoke(factoryAddress, "initPoolInvoke", [poolAddressString, [poolDomain, poolOwner, tokenName, tokenDesc, tokenQuantity]], [AttachedPayment(i.payments[0].assetId, i.payments[0].amount)])
273273 if ((initPoolInvoke == initPoolInvoke))
274274 then {
275275 let factoryActions = [invoke(factoryAddress, "integerEntry", [kFirstEmptyPoolIndex, poolIndex], nil), invoke(factoryAddress, "integerEntry", [kPoolStatus(poolIndex), STATUS_READY], nil)]
276276 $Tuple2(nil, factoryActions)
277277 }
278278 else throw("Strict value is not equal to itself.")
279279 }
280280 else throw("Strict value is not equal to itself.")
281281 }
282282
283283
284284
285285 @Callable(i)
286286 func notifyStatusUpdate (callerPublicKey,args) = {
287287 let poolAddress = addressFromPublicKey(callerPublicKey)
288288 let checks = [if (isPoolExists(poolAddress))
289289 then true
290290 else throwErr("pool not found"), mustFactory(i.caller)]
291291 if ((checks == checks))
292292 then {
293293 let poolIndex = getIntegerValue(factoryAddress, kPoolIndexFromAddress(poolAddress))
294294 let newStatus = parseIntValue(args[0])
295295 let factoryActions = [invoke(factoryAddress, "integerEntry", [kPoolStatus(poolIndex), newStatus], nil)]
296296 $Tuple2(nil, factoryActions)
297297 }
298298 else throw("Strict value is not equal to itself.")
299299 }
300300
301301
302302
303303 @Callable(i)
304304 func isWxSwapActiveREADONLY (callerPublicKey,args) = {
305305 let amountAssetIdString = args[0]
306306 let priceAssetIdString = args[1]
307307 let checks = [mustFactory(i.caller)]
308308 if ((checks == checks))
309309 then $Tuple2(nil, isWxSwapActive(amountAssetIdString, priceAssetIdString))
310310 else throw("Strict value is not equal to itself.")
311311 }
312312
313313
314314
315315 @Callable(i)
316316 func swapREADONLY (callerPublicKey,args) = {
317317 let poolAddress = addressFromStringValue(args[0])
318318 let amountAssetIdString = args[1]
319319 let priceAssetIdString = args[2]
320320 let amount = parseIntValue(args[3])
321321 let checks = [if (!(shutdown))
322322 then true
323323 else throwErr("Temporary shutdown"), mustFactory(i.caller)]
324324 if ((checks == checks))
325325 then if (isPoolTargetReached(poolAddress))
326326 then {
327327 let wxSwapResult = {
328328 let @ = invoke(wxSwapAddress, "swapCalculateREADONLY", [amount, amountAssetIdString, priceAssetIdString], nil)
329329 if ($isInstanceOf(@, "Int"))
330330 then @
331331 else throw(($getType(@) + " couldn't be cast to Int"))
332332 }
333333 $Tuple2(nil, $Tuple2(wxSwapResult, "WxSwap"))
334334 }
335335 else {
336336 let poolSwapResult = {
337337 let @ = invoke(poolAddress, "swapReadOnly", [amountAssetIdString, priceAssetIdString, amount], nil)
338338 if ($isInstanceOf(@, "Int"))
339339 then @
340340 else throw(($getType(@) + " couldn't be cast to Int"))
341341 }
342342 $Tuple2(nil, $Tuple2(poolSwapResult, "iMemePool"))
343343 }
344344 else throw("Strict value is not equal to itself.")
345345 }
346346
347347
348348
349349 @Callable(i)
350350 func swap (callerPublicKey,args) = {
351351 let callerAddress = addressFromPublicKey(callerPublicKey)
352352 let poolAddress = addressFromStringValue(args[0])
353353 let priceAssetIdString = args[1]
354354 let priceAssetId = parseAssetId(priceAssetIdString)
355355 let minimumAmount = parseIntValue(args[2])
356356 let assetInAmount = i.payments[0].amount
357357 let assetInAssetId = i.payments[0].assetId
358358 let checks = [if (!(shutdown))
359359 then true
360360 else throwErr("Temporary shutdown"), mustFactory(i.caller), if ((size(i.payments) == 1))
361361 then true
362362 else throwErr("exactly one payment is expected")]
363363 if ((checks == checks))
364364 then {
365365 let outAssetBalanceBefore = getBalance(this, priceAssetId)
366366 if ((outAssetBalanceBefore == outAssetBalanceBefore))
367367 then {
368368 let swapAction = if (isPoolTargetReached(poolAddress))
369369 then invoke(wxSwapAddress, "swap", [minimumAmount, priceAssetIdString, toString(this)], i.payments)
370370 else invoke(poolAddress, "swap", [priceAssetIdString, minimumAmount], i.payments)
371371 if ((swapAction == swapAction))
372372 then {
373373 let outAssetBalanceAfter = getBalance(this, priceAssetId)
374374 if ((outAssetBalanceAfter == outAssetBalanceAfter))
375375 then [ScriptTransfer(callerAddress, (outAssetBalanceAfter - outAssetBalanceBefore), priceAssetId)]
376376 else throw("Strict value is not equal to itself.")
377377 }
378378 else throw("Strict value is not equal to itself.")
379379 }
380380 else throw("Strict value is not equal to itself.")
381381 }
382382 else throw("Strict value is not equal to itself.")
383383 }
384384
385385
386386
387387 @Callable(i)
388388 func transferPool (callerPublicKey,args) = {
389389 let callerAddress = addressFromPublicKey(callerPublicKey)
390390 let poolAddress = addressFromStringValue(args[0])
391391 let poolTokensStringList = split(getStringValue(poolAddress, kPoolTokensList), ",")
392392 let asset1 = parseAssetId(poolTokensStringList[0])
393393 let asset2 = parseAssetId(poolTokensStringList[1])
394394 let $t01247612568 = if ((asset1 == unit))
395395 then $Tuple2(asset2, asset1)
396396 else $Tuple2(asset1, asset2)
397397 let poolAsset = $t01247612568._1
398398 let wavesAsset = $t01247612568._2
399399 let poolAssetBalanceBefore = getBalance(factoryAddress, poolAsset)
400400 if ((poolAssetBalanceBefore == poolAssetBalanceBefore))
401401 then {
402402 let wavesAssetBalanceBefore = getBalance(factoryAddress, wavesAsset)
403403 if ((wavesAssetBalanceBefore == wavesAssetBalanceBefore))
404404 then {
405- let withdrawInvoke = invoke(factoryAddress, "withdrawLiquidityFromPool", [poolAddress.bytes], nil)
405+ let withdrawInvoke = reentrantInvoke(factoryAddress, "withdrawLiquidityFromPool", [poolAddress.bytes], nil)
406406 if ((withdrawInvoke == withdrawInvoke))
407407 then {
408408 let poolAssetBalanceAfter = getBalance(factoryAddress, poolAsset)
409409 if ((poolAssetBalanceAfter == poolAssetBalanceAfter))
410410 then {
411411 let wavesAssetBalanceAfter = getBalance(factoryAddress, wavesAsset)
412412 if ((wavesAssetBalanceAfter == wavesAssetBalanceAfter))
413413 then {
414414 let poolAssetAmount = (poolAssetBalanceAfter - poolAssetBalanceBefore)
415415 let wavesAmount = (wavesAssetBalanceAfter - wavesAssetBalanceBefore)
416416 let logo = genLogo(poolAsset)
417417 if (if ((poolAssetAmount > 0))
418418 then (wavesAmount > 0)
419419 else false)
420420 then {
421421 let burnAmount = fraction(poolAssetAmount, 20, 100)
422422 let burnAction = invoke(factoryAddress, "burn", [poolAsset, burnAmount], nil)
423423 if ((burnAction == burnAction))
424424 then {
425425 let feeWavesAmount = fraction(wavesAmount, 20, 100)
426426 let feeAction = invoke(factoryAddress, "transferWaves", [feeCollectorAddress.bytes, feeWavesAmount], nil)
427427 if ((feeAction == feeAction))
428428 then {
429429 let registerAssetAction = invoke(factoryAddress, "registerAsset", [assetStoreAddress.bytes, assetIdToString(poolAsset), logo, true], nil)
430430 if ((registerAssetAction == registerAssetAction))
431431 then {
432432 let createWxPoolAction = invoke(factoryAddress, "createWxPool", [userPoolsAddress.bytes, assetIdToString(poolAsset), (poolAssetAmount - burnAmount), assetIdToString(wavesAsset), (wavesAmount - feeWavesAmount)], nil)
433433 if ((createWxPoolAction == createWxPoolAction))
434434 then {
435435 let changeStatus = invoke(factoryAddress, "integerEntry", [kPoolStatus(getPoolId(poolAddress)), STATUS_TRANSFERRED], nil)
436436 if ((changeStatus == changeStatus))
437437 then nil
438438 else throw("Strict value is not equal to itself.")
439439 }
440440 else throw("Strict value is not equal to itself.")
441441 }
442442 else throw("Strict value is not equal to itself.")
443443 }
444444 else throw("Strict value is not equal to itself.")
445445 }
446446 else throw("Strict value is not equal to itself.")
447447 }
448448 else throwErr("withdrawn amount from pool is too low")
449449 }
450450 else throw("Strict value is not equal to itself.")
451451 }
452452 else throw("Strict value is not equal to itself.")
453453 }
454454 else throw("Strict value is not equal to itself.")
455455 }
456456 else throw("Strict value is not equal to itself.")
457457 }
458458 else throw("Strict value is not equal to itself.")
459459 }
460460
461461
462462 @Verifier(tx)
463463 func verify () = {
464464 let keyAdminAddressList = "%s__adminAddressList"
465465 let keyAllowedTxId = "%s__txId"
466466 let adminList = split(valueOrElse(getString(factoryAddress, keyAdminAddressList), ""), "__")
467467 let byOwner = if ((size(adminList) >= 3))
468468 then false
469469 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
470470 let byAdmins = (tx.id == fromBase58String(valueOrElse(getString(factoryAddress, keyAllowedTxId), "")))
471471 if (byAdmins)
472472 then true
473473 else byOwner
474474 }
475475

github/deemru/w8io/169f3d6 
51.33 ms