tx · 6JGPkgQ9F49SFAb77UrMMtovRucmiKck9oaUXmBLzkDx

3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr:  -0.01700000 Waves

2024.12.20 11:20 [3422606] smart account 3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr > SELF 0.00000000 Waves

{ "type": 13, "id": "6JGPkgQ9F49SFAb77UrMMtovRucmiKck9oaUXmBLzkDx", "fee": 1700000, "feeAssetId": null, "timestamp": 1734682942172, "version": 2, "chainId": 84, "sender": "3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr", "senderPublicKey": "jXCTQV8PjX2uC9UHBFveupYy9cjhY7stHbzE9cptymw", "proofs": [ "mag4NsMK9AezQBzMDpVQEXgfwno5FMsZVkLaV5sKNVimBXGtPQiNjg8ofW8gCHRTpnmrBeEp4xQe6uqFKdsFXa6" ], "script": "base64:BwIxCAISAwoBCBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGDoACXNlcGFyYXRvcgICX18AC3dhdmVzU3RyaW5nAgVXQVZFUwAQY29udHJhY3RGaWxlbmFtZQIXbWVtZV9pbV9jYWxjdWxhdG9yLnJpZGUABW11bHQ4AIDC1y8BB3dyYXBFcnIBAXMJAKwCAgkArAICBRBjb250cmFjdEZpbGVuYW1lAgI6IAUBcwEIdGhyb3dFcnIBAXMJAAIBCQEHd3JhcEVycgEFAXMBD3ZhbGlkYXRlQWRkcmVzcwEHYWRkcmVzcwkBCWlzRGVmaW5lZAEJAKYIAQUHYWRkcmVzcwAMU1RBVFVTX0VNUFRZAAAADFNUQVRVU19SRUFEWQABABVTVEFUVVNfVEFSR0VUX1JFQUNIRUQAAgASU1RBVFVTX1RSQU5TRkVSUkVEAAMAC2RlZmF1bHRMb2dvAqYBPHN2ZyB3aWR0aD0nMzAnIGhlaWdodD0nMzAnIHhtbG5zPSdodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2Zyc+PGc+PGNpcmNsZSBjeD0nMTUnIG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lzdAADBwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleQQIYnlBZG1pbnMJAAACCAUCdHgCaWQJANkEAQkBC3ZhbHVlT3JFbHNlAgkAnQgCBQ5mYWN0b3J5QWRkcmVzcwUOa2V5QWxsb3dlZFR4SWQCAAMFCGJ5QWRtaW5zBgUHYnlPd25lcnXfpUI=", "height": 3422606, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FZEFZsaSqaXyKCvpy8vzwP5SLByaLqgMypait27tGBq1 Next: G3WvKRepNQWCrTj9z75Ry5GB51NgKYkvuumkb16VT4i5 Diff:
OldNewDifferences
177177
178178 func isWxSwapActive (amountAssetString,priceAssetString) = {
179179 let statusKey = makeString(["%s%s%s", "status", amountAssetString, priceAssetString], separator)
180- let status = valueOrElse(getString(userPoolsAddress, statusKey), "")
181- (status == "active")
180+ let statusKeyReverse = makeString(["%s%s%s", "status", priceAssetString, amountAssetString], separator)
181+ let pairStatus = valueOrElse(getString(userPoolsAddress, statusKey), "")
182+ let reversePairStatus = valueOrElse(getString(userPoolsAddress, statusKeyReverse), "")
183+ if ((pairStatus == "active"))
184+ then true
185+ else (reversePairStatus == "active")
182186 }
183187
184188
366370 let poolTokensStringList = split(getStringValue(poolAddress, kPoolTokensList), ",")
367371 let asset1 = parseAssetId(poolTokensStringList[0])
368372 let asset2 = parseAssetId(poolTokensStringList[1])
369- let $t01172511817 = if ((asset1 == unit))
373+ let $t01197612068 = if ((asset1 == unit))
370374 then $Tuple2(asset2, asset1)
371375 else $Tuple2(asset1, asset2)
372- let poolAsset = $t01172511817._1
373- let wavesAsset = $t01172511817._2
376+ let poolAsset = $t01197612068._1
377+ let wavesAsset = $t01197612068._2
374378 let poolAssetBalanceBefore = getBalance(factoryAddress, poolAsset)
375379 if ((poolAssetBalanceBefore == poolAssetBalanceBefore))
376380 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
178178 func isWxSwapActive (amountAssetString,priceAssetString) = {
179179 let statusKey = makeString(["%s%s%s", "status", amountAssetString, priceAssetString], separator)
180- let status = valueOrElse(getString(userPoolsAddress, statusKey), "")
181- (status == "active")
180+ let statusKeyReverse = makeString(["%s%s%s", "status", priceAssetString, amountAssetString], separator)
181+ let pairStatus = valueOrElse(getString(userPoolsAddress, statusKey), "")
182+ let reversePairStatus = valueOrElse(getString(userPoolsAddress, statusKeyReverse), "")
183+ if ((pairStatus == "active"))
184+ then true
185+ else (reversePairStatus == "active")
182186 }
183187
184188
185189 @Callable(i)
186190 func init (factoryAddressStr) = {
187191 let checkCaller = mustThis(i.caller)
188192 if ((checkCaller == checkCaller))
189193 then [StringEntry(kFactoryAddress, factoryAddressStr)]
190194 else throw("Strict value is not equal to itself.")
191195 }
192196
193197
194198
195199 @Callable(i)
196200 func addEmptyPool (callerPublicKey,args) = {
197201 let newPoolAddress = addressFromPublicKey(callerPublicKey)
198202 let newPoolIndex = (lastEmptyIndex + 1)
199203 let checks = [if (!(shutdown))
200204 then true
201205 else throwErr("not allowed (shutdown)"), if (checkContractScript(newPoolAddress))
202206 then true
203207 else throwErr("pool script is not allowed"), if (!(isPoolExists(newPoolAddress)))
204208 then true
205209 else throwErr("pool address is already registered")]
206210 if ((checks == checks))
207211 then {
208212 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)]
209213 $Tuple2(nil, factoryActions)
210214 }
211215 else throw("Strict value is not equal to itself.")
212216 }
213217
214218
215219
216220 @Callable(i)
217221 func createPool (callerPublicKey,args) = {
218222 let minPayment = (listingVolume + creationFee)
219223 let checks = [if (!(shutdown))
220224 then true
221225 else throwErr("Temporary shutdown"), mustFactory(i.caller), if (((lastEmptyIndex - firstEmptyIndex) > 0))
222226 then true
223227 else throwErr("No empty pool available"), if ((i.payments[0].assetId == unit))
224228 then true
225229 else throwErr("Payment should be in WAVES"), if ((i.payments[0].amount >= minPayment))
226230 then true
227231 else throwErr((("Payment should be greater or equal " + toString(minPayment)) + " WAVELET")), if (isDefined(args[0]))
228232 then true
229233 else throwErr("Token name is not provided"), if (isDefined(args[1]))
230234 then true
231235 else throwErr("Token description is not provided"), if (isDefined(args[2]))
232236 then true
233237 else throwErr("Token quantity is not provided"), if ((parseInt(args[2]) != unit))
234238 then true
235239 else throwErr("Token quantity should be a number")]
236240 if ((checks == checks))
237241 then {
238242 let poolIndex = (firstEmptyIndex + 1)
239243 let poolAddressString = getStringValue(factoryAddress, kPoolAddressFromIndex(poolIndex))
240244 let poolAddress = addressFromStringValue(poolAddressString)
241245 let callerAddress = addressFromPublicKey(callerPublicKey)
242246 let poolDomain = take(poolAddressString, 8)
243247 let poolOwner = toString(callerAddress)
244248 let tokenName = args[0]
245249 let tokenDesc = args[1]
246250 let tokenQuantity = args[2]
247251 let initPoolInvoke = invoke(factoryAddress, "initPoolInvoke", [poolAddressString, [poolDomain, poolOwner, tokenName, tokenDesc, tokenQuantity]], [AttachedPayment(i.payments[0].assetId, i.payments[0].amount)])
248252 if ((initPoolInvoke == initPoolInvoke))
249253 then {
250254 let factoryActions = [invoke(factoryAddress, "integerEntry", [kFirstEmptyPoolIndex, poolIndex], nil), invoke(factoryAddress, "integerEntry", [kPoolStatus(poolIndex), STATUS_READY], nil)]
251255 $Tuple2(nil, factoryActions)
252256 }
253257 else throw("Strict value is not equal to itself.")
254258 }
255259 else throw("Strict value is not equal to itself.")
256260 }
257261
258262
259263
260264 @Callable(i)
261265 func notifyStatusUpdate (callerPublicKey,args) = {
262266 let poolAddress = addressFromPublicKey(callerPublicKey)
263267 let checks = [if (isPoolExists(poolAddress))
264268 then true
265269 else throwErr("pool not found"), mustFactory(i.caller)]
266270 if ((checks == checks))
267271 then {
268272 let poolIndex = getIntegerValue(factoryAddress, kPoolIndexFromAddress(poolAddress))
269273 let newStatus = parseIntValue(args[0])
270274 let factoryActions = [invoke(factoryAddress, "integerEntry", [kPoolStatus(poolIndex), newStatus], nil)]
271275 $Tuple2(nil, factoryActions)
272276 }
273277 else throw("Strict value is not equal to itself.")
274278 }
275279
276280
277281
278282 @Callable(i)
279283 func isWxSwapActiveREADONLY (callerPublicKey,args) = {
280284 let amountAssetIdString = args[0]
281285 let priceAssetIdString = args[1]
282286 let checks = [mustFactory(i.caller)]
283287 if ((checks == checks))
284288 then $Tuple2(nil, isWxSwapActive(amountAssetIdString, priceAssetIdString))
285289 else throw("Strict value is not equal to itself.")
286290 }
287291
288292
289293
290294 @Callable(i)
291295 func swapREADONLY (callerPublicKey,args) = {
292296 let poolAddress = addressFromStringValue(args[0])
293297 let amountAssetIdString = args[1]
294298 let priceAssetIdString = args[2]
295299 let amount = parseIntValue(args[3])
296300 let checks = [if (!(shutdown))
297301 then true
298302 else throwErr("Temporary shutdown"), mustFactory(i.caller)]
299303 if ((checks == checks))
300304 then if (isPoolTargetReached(poolAddress))
301305 then {
302306 let wxSwapResult = {
303307 let @ = invoke(wxSwapAddress, "swapCalculateREADONLY", [amount, amountAssetIdString, priceAssetIdString], nil)
304308 if ($isInstanceOf(@, "Int"))
305309 then @
306310 else throw(($getType(@) + " couldn't be cast to Int"))
307311 }
308312 $Tuple2(nil, $Tuple2(wxSwapResult, "WxSwap"))
309313 }
310314 else {
311315 let poolSwapResult = {
312316 let @ = invoke(poolAddress, "swapReadOnly", [amountAssetIdString, priceAssetIdString, amount], nil)
313317 if ($isInstanceOf(@, "Int"))
314318 then @
315319 else throw(($getType(@) + " couldn't be cast to Int"))
316320 }
317321 $Tuple2(nil, $Tuple2(poolSwapResult, "iMemePool"))
318322 }
319323 else throw("Strict value is not equal to itself.")
320324 }
321325
322326
323327
324328 @Callable(i)
325329 func swap (callerPublicKey,args) = {
326330 let callerAddress = addressFromPublicKey(callerPublicKey)
327331 let poolAddress = addressFromStringValue(args[0])
328332 let priceAssetIdString = args[1]
329333 let priceAssetId = parseAssetId(priceAssetIdString)
330334 let minimumAmount = parseIntValue(args[2])
331335 let assetInAmount = i.payments[0].amount
332336 let assetInAssetId = i.payments[0].assetId
333337 let checks = [if (!(shutdown))
334338 then true
335339 else throwErr("Temporary shutdown"), mustFactory(i.caller), if ((size(i.payments) == 1))
336340 then true
337341 else throwErr("exactly one payment is expected")]
338342 if ((checks == checks))
339343 then {
340344 let outAssetBalanceBefore = getBalance(this, priceAssetId)
341345 if ((outAssetBalanceBefore == outAssetBalanceBefore))
342346 then {
343347 let swapAction = if (isPoolTargetReached(poolAddress))
344348 then invoke(wxSwapAddress, "swap", [minimumAmount, priceAssetIdString, toString(this)], i.payments)
345349 else invoke(poolAddress, "swap", [priceAssetIdString, minimumAmount], i.payments)
346350 if ((swapAction == swapAction))
347351 then {
348352 let outAssetBalanceAfter = getBalance(this, priceAssetId)
349353 if ((outAssetBalanceAfter == outAssetBalanceAfter))
350354 then [ScriptTransfer(callerAddress, (outAssetBalanceAfter - outAssetBalanceBefore), priceAssetId)]
351355 else throw("Strict value is not equal to itself.")
352356 }
353357 else throw("Strict value is not equal to itself.")
354358 }
355359 else throw("Strict value is not equal to itself.")
356360 }
357361 else throw("Strict value is not equal to itself.")
358362 }
359363
360364
361365
362366 @Callable(i)
363367 func transferPool (callerPublicKey,args) = {
364368 let callerAddress = addressFromPublicKey(callerPublicKey)
365369 let poolAddress = addressFromStringValue(args[0])
366370 let poolTokensStringList = split(getStringValue(poolAddress, kPoolTokensList), ",")
367371 let asset1 = parseAssetId(poolTokensStringList[0])
368372 let asset2 = parseAssetId(poolTokensStringList[1])
369- let $t01172511817 = if ((asset1 == unit))
373+ let $t01197612068 = if ((asset1 == unit))
370374 then $Tuple2(asset2, asset1)
371375 else $Tuple2(asset1, asset2)
372- let poolAsset = $t01172511817._1
373- let wavesAsset = $t01172511817._2
376+ let poolAsset = $t01197612068._1
377+ let wavesAsset = $t01197612068._2
374378 let poolAssetBalanceBefore = getBalance(factoryAddress, poolAsset)
375379 if ((poolAssetBalanceBefore == poolAssetBalanceBefore))
376380 then {
377381 let wavesAssetBalanceBefore = getBalance(factoryAddress, wavesAsset)
378382 if ((wavesAssetBalanceBefore == wavesAssetBalanceBefore))
379383 then {
380384 let withdrawInvoke = invoke(factoryAddress, "withdrawLiquidityFromPool", [poolAddress.bytes], nil)
381385 if ((withdrawInvoke == withdrawInvoke))
382386 then {
383387 let poolAssetBalanceAfter = getBalance(factoryAddress, poolAsset)
384388 if ((poolAssetBalanceAfter == poolAssetBalanceAfter))
385389 then {
386390 let wavesAssetBalanceAfter = getBalance(factoryAddress, wavesAsset)
387391 if ((wavesAssetBalanceAfter == wavesAssetBalanceAfter))
388392 then {
389393 let poolAssetAmount = (poolAssetBalanceAfter - poolAssetBalanceBefore)
390394 let wavesAmount = (wavesAssetBalanceAfter - wavesAssetBalanceBefore)
391395 if (if ((poolAssetAmount > 0))
392396 then (wavesAmount > 0)
393397 else false)
394398 then {
395399 let burnAmount = fraction(poolAssetAmount, 20, 100)
396400 let burnAction = invoke(factoryAddress, "burn", [poolAsset, burnAmount], nil)
397401 if ((burnAction == burnAction))
398402 then {
399403 let feeWavesAmount = fraction(wavesAmount, 20, 100)
400404 let feeAction = invoke(factoryAddress, "transferWaves", [feeCollectorAddress.bytes, feeWavesAmount], nil)
401405 if ((feeAction == feeAction))
402406 then {
403407 let registerAssetAction = invoke(factoryAddress, "registerAsset", [assetStoreAddress.bytes, assetIdToString(poolAsset), defaultLogo, true], nil)
404408 if ((registerAssetAction == registerAssetAction))
405409 then {
406410 let createWxPoolAction = invoke(factoryAddress, "createWxPool", [userPoolsAddress.bytes, assetIdToString(poolAsset), (poolAssetAmount - burnAmount), assetIdToString(wavesAsset), (wavesAmount - feeWavesAmount)], nil)
407411 if ((createWxPoolAction == createWxPoolAction))
408412 then {
409413 let changeStatus = invoke(factoryAddress, "integerEntry", [kPoolStatus(getPoolId(poolAddress)), STATUS_TRANSFERRED], nil)
410414 if ((changeStatus == changeStatus))
411415 then nil
412416 else throw("Strict value is not equal to itself.")
413417 }
414418 else throw("Strict value is not equal to itself.")
415419 }
416420 else throw("Strict value is not equal to itself.")
417421 }
418422 else throw("Strict value is not equal to itself.")
419423 }
420424 else throw("Strict value is not equal to itself.")
421425 }
422426 else throwErr("withdrawn amount from pool is too low")
423427 }
424428 else throw("Strict value is not equal to itself.")
425429 }
426430 else throw("Strict value is not equal to itself.")
427431 }
428432 else throw("Strict value is not equal to itself.")
429433 }
430434 else throw("Strict value is not equal to itself.")
431435 }
432436 else throw("Strict value is not equal to itself.")
433437 }
434438
435439
436440 @Verifier(tx)
437441 func verify () = {
438442 let keyAdminAddressList = "%s__adminAddressList"
439443 let keyAllowedTxId = "%s__txId"
440444 let adminList = split(valueOrElse(getString(factoryAddress, keyAdminAddressList), ""), "__")
441445 let byOwner = if ((size(adminList) >= 3))
442446 then false
443447 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
444448 let byAdmins = (tx.id == fromBase58String(valueOrElse(getString(factoryAddress, keyAllowedTxId), "")))
445449 if (byAdmins)
446450 then true
447451 else byOwner
448452 }
449453

github/deemru/w8io/169f3d6 
61.60 ms