tx · G3WvKRepNQWCrTj9z75Ry5GB51NgKYkvuumkb16VT4i5

3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr:  -0.01800000 Waves

2024.12.20 11:28 [3422614] smart account 3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr > SELF 0.00000000 Waves

{ "type": 13, "id": "G3WvKRepNQWCrTj9z75Ry5GB51NgKYkvuumkb16VT4i5", "fee": 1800000, "feeAssetId": null, "timestamp": 1734683378760, "version": 2, "chainId": 84, "sender": "3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr", "senderPublicKey": "jXCTQV8PjX2uC9UHBFveupYy9cjhY7stHbzE9cptymw", "proofs": [ "2ud4L6o5EkYkVdSUPqRVF1zHvF7pVzkhxVQdYFiZf3LgAUZcQjNMMmPmT2GdYGtK2c8faPrzPDUcaU1a1maMmq7j" ], "script": "base64:BwIxCAISAwoBCBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGDoACXNlcGFyYXRvcgICX18AC3dhdmVzU3RyaW5nAgVXQVZFUwAQY29udHJhY3RGaWxlbmFtZQIXbWVtZV9pbV9jYWxjdWxhdG9yLnJpZGUABW11bHQ4AIDC1y8BB3dyYXBFcnIBAXMJAKwCAgkArAICBRBjb250cmFjdEZpbGVuYW1lAgI6IAUBcwEIdGhyb3dFcnIBAXMJAAIBCQEHd3JhcEVycgEFAXMBD3ZhbGlkYXRlQWRkcmVzcwEHYWRkcmVzcwkBCWlzRGVmaW5lZAEJAKYIAQUHYWRkcmVzcwAMU1RBVFVTX0VNUFRZAAAADFNUQVRVU19SRUFEWQABABVTVEFUVVNfVEFSR0VUX1JFQUNIRUQAAgASU1RBVFVTX1RSQU5TRkVSUkVEAAMAC2RlZmF1bHRMb2dvAqYBPHN2ZyB3aWR0aD0nMzAnIGhlaWdodD0nMzAnIHhtbG5zPSdodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2Zyc+PGc+PGNpcmNsZSBjeD0nMTUn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bkFkZHJlc3NMaXN0AgACAl9fBAdieU93bmVyAwkAZwIJAJADAQUJYWRtaW5MaXN0AAMHCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5BAhieUFkbWlucwkAAAIIBQJ0eAJpZAkA2QQBCQELdmFsdWVPckVsc2UCCQCdCAIFDmZhY3RvcnlBZGRyZXNzBQ5rZXlBbGxvd2VkVHhJZAIAAwUIYnlBZG1pbnMGBQdieU93bmVy9pGv4w==", "height": 3422614, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6JGPkgQ9F49SFAb77UrMMtovRucmiKck9oaUXmBLzkDx Next: EFcQaMuruwefJfnzvu1QsyZfZJoANLwK5EGNdQ5Kjexn Diff:
OldNewDifferences
164164 func getPoolId (poolAddress) = valueOrErrorMessage(getInteger(factoryAddress, kPoolIndexFromAddress(poolAddress)), "pool doesn't exists")
165165
166166
167-func isPoolTargetReached (poolAddress) = (valueOrElse(getInteger(factoryAddress, kPoolStatus(getPoolId(poolAddress))), -1) == STATUS_TARGET_REACHED)
167+func isPoolTargetReached (poolAddress) = {
168+ let poolStatus = valueOrElse(getInteger(factoryAddress, kPoolStatus(getPoolId(poolAddress))), -1)
169+ containsElement([STATUS_TARGET_REACHED, STATUS_TRANSFERRED], poolStatus)
170+ }
168171
169172
170173 func getBalance (address,assetId) = match assetId {
370373 let poolTokensStringList = split(getStringValue(poolAddress, kPoolTokensList), ",")
371374 let asset1 = parseAssetId(poolTokensStringList[0])
372375 let asset2 = parseAssetId(poolTokensStringList[1])
373- let $t01197612068 = if ((asset1 == unit))
376+ let $t01204712139 = if ((asset1 == unit))
374377 then $Tuple2(asset2, asset1)
375378 else $Tuple2(asset1, asset2)
376- let poolAsset = $t01197612068._1
377- let wavesAsset = $t01197612068._2
379+ let poolAsset = $t01204712139._1
380+ let wavesAsset = $t01204712139._2
378381 let poolAssetBalanceBefore = getBalance(factoryAddress, poolAsset)
379382 if ((poolAssetBalanceBefore == poolAssetBalanceBefore))
380383 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
167-func isPoolTargetReached (poolAddress) = (valueOrElse(getInteger(factoryAddress, kPoolStatus(getPoolId(poolAddress))), -1) == STATUS_TARGET_REACHED)
167+func isPoolTargetReached (poolAddress) = {
168+ let poolStatus = valueOrElse(getInteger(factoryAddress, kPoolStatus(getPoolId(poolAddress))), -1)
169+ containsElement([STATUS_TARGET_REACHED, STATUS_TRANSFERRED], poolStatus)
170+ }
168171
169172
170173 func getBalance (address,assetId) = match assetId {
171174 case id: ByteVector =>
172175 assetBalance(address, id)
173176 case _ =>
174177 wavesBalance(address).available
175178 }
176179
177180
178181 func isWxSwapActive (amountAssetString,priceAssetString) = {
179182 let statusKey = makeString(["%s%s%s", "status", amountAssetString, priceAssetString], separator)
180183 let statusKeyReverse = makeString(["%s%s%s", "status", priceAssetString, amountAssetString], separator)
181184 let pairStatus = valueOrElse(getString(userPoolsAddress, statusKey), "")
182185 let reversePairStatus = valueOrElse(getString(userPoolsAddress, statusKeyReverse), "")
183186 if ((pairStatus == "active"))
184187 then true
185188 else (reversePairStatus == "active")
186189 }
187190
188191
189192 @Callable(i)
190193 func init (factoryAddressStr) = {
191194 let checkCaller = mustThis(i.caller)
192195 if ((checkCaller == checkCaller))
193196 then [StringEntry(kFactoryAddress, factoryAddressStr)]
194197 else throw("Strict value is not equal to itself.")
195198 }
196199
197200
198201
199202 @Callable(i)
200203 func addEmptyPool (callerPublicKey,args) = {
201204 let newPoolAddress = addressFromPublicKey(callerPublicKey)
202205 let newPoolIndex = (lastEmptyIndex + 1)
203206 let checks = [if (!(shutdown))
204207 then true
205208 else throwErr("not allowed (shutdown)"), if (checkContractScript(newPoolAddress))
206209 then true
207210 else throwErr("pool script is not allowed"), if (!(isPoolExists(newPoolAddress)))
208211 then true
209212 else throwErr("pool address is already registered")]
210213 if ((checks == checks))
211214 then {
212215 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)]
213216 $Tuple2(nil, factoryActions)
214217 }
215218 else throw("Strict value is not equal to itself.")
216219 }
217220
218221
219222
220223 @Callable(i)
221224 func createPool (callerPublicKey,args) = {
222225 let minPayment = (listingVolume + creationFee)
223226 let checks = [if (!(shutdown))
224227 then true
225228 else throwErr("Temporary shutdown"), mustFactory(i.caller), if (((lastEmptyIndex - firstEmptyIndex) > 0))
226229 then true
227230 else throwErr("No empty pool available"), if ((i.payments[0].assetId == unit))
228231 then true
229232 else throwErr("Payment should be in WAVES"), if ((i.payments[0].amount >= minPayment))
230233 then true
231234 else throwErr((("Payment should be greater or equal " + toString(minPayment)) + " WAVELET")), if (isDefined(args[0]))
232235 then true
233236 else throwErr("Token name is not provided"), if (isDefined(args[1]))
234237 then true
235238 else throwErr("Token description is not provided"), if (isDefined(args[2]))
236239 then true
237240 else throwErr("Token quantity is not provided"), if ((parseInt(args[2]) != unit))
238241 then true
239242 else throwErr("Token quantity should be a number")]
240243 if ((checks == checks))
241244 then {
242245 let poolIndex = (firstEmptyIndex + 1)
243246 let poolAddressString = getStringValue(factoryAddress, kPoolAddressFromIndex(poolIndex))
244247 let poolAddress = addressFromStringValue(poolAddressString)
245248 let callerAddress = addressFromPublicKey(callerPublicKey)
246249 let poolDomain = take(poolAddressString, 8)
247250 let poolOwner = toString(callerAddress)
248251 let tokenName = args[0]
249252 let tokenDesc = args[1]
250253 let tokenQuantity = args[2]
251254 let initPoolInvoke = invoke(factoryAddress, "initPoolInvoke", [poolAddressString, [poolDomain, poolOwner, tokenName, tokenDesc, tokenQuantity]], [AttachedPayment(i.payments[0].assetId, i.payments[0].amount)])
252255 if ((initPoolInvoke == initPoolInvoke))
253256 then {
254257 let factoryActions = [invoke(factoryAddress, "integerEntry", [kFirstEmptyPoolIndex, poolIndex], nil), invoke(factoryAddress, "integerEntry", [kPoolStatus(poolIndex), STATUS_READY], nil)]
255258 $Tuple2(nil, factoryActions)
256259 }
257260 else throw("Strict value is not equal to itself.")
258261 }
259262 else throw("Strict value is not equal to itself.")
260263 }
261264
262265
263266
264267 @Callable(i)
265268 func notifyStatusUpdate (callerPublicKey,args) = {
266269 let poolAddress = addressFromPublicKey(callerPublicKey)
267270 let checks = [if (isPoolExists(poolAddress))
268271 then true
269272 else throwErr("pool not found"), mustFactory(i.caller)]
270273 if ((checks == checks))
271274 then {
272275 let poolIndex = getIntegerValue(factoryAddress, kPoolIndexFromAddress(poolAddress))
273276 let newStatus = parseIntValue(args[0])
274277 let factoryActions = [invoke(factoryAddress, "integerEntry", [kPoolStatus(poolIndex), newStatus], nil)]
275278 $Tuple2(nil, factoryActions)
276279 }
277280 else throw("Strict value is not equal to itself.")
278281 }
279282
280283
281284
282285 @Callable(i)
283286 func isWxSwapActiveREADONLY (callerPublicKey,args) = {
284287 let amountAssetIdString = args[0]
285288 let priceAssetIdString = args[1]
286289 let checks = [mustFactory(i.caller)]
287290 if ((checks == checks))
288291 then $Tuple2(nil, isWxSwapActive(amountAssetIdString, priceAssetIdString))
289292 else throw("Strict value is not equal to itself.")
290293 }
291294
292295
293296
294297 @Callable(i)
295298 func swapREADONLY (callerPublicKey,args) = {
296299 let poolAddress = addressFromStringValue(args[0])
297300 let amountAssetIdString = args[1]
298301 let priceAssetIdString = args[2]
299302 let amount = parseIntValue(args[3])
300303 let checks = [if (!(shutdown))
301304 then true
302305 else throwErr("Temporary shutdown"), mustFactory(i.caller)]
303306 if ((checks == checks))
304307 then if (isPoolTargetReached(poolAddress))
305308 then {
306309 let wxSwapResult = {
307310 let @ = invoke(wxSwapAddress, "swapCalculateREADONLY", [amount, amountAssetIdString, priceAssetIdString], nil)
308311 if ($isInstanceOf(@, "Int"))
309312 then @
310313 else throw(($getType(@) + " couldn't be cast to Int"))
311314 }
312315 $Tuple2(nil, $Tuple2(wxSwapResult, "WxSwap"))
313316 }
314317 else {
315318 let poolSwapResult = {
316319 let @ = invoke(poolAddress, "swapReadOnly", [amountAssetIdString, priceAssetIdString, amount], nil)
317320 if ($isInstanceOf(@, "Int"))
318321 then @
319322 else throw(($getType(@) + " couldn't be cast to Int"))
320323 }
321324 $Tuple2(nil, $Tuple2(poolSwapResult, "iMemePool"))
322325 }
323326 else throw("Strict value is not equal to itself.")
324327 }
325328
326329
327330
328331 @Callable(i)
329332 func swap (callerPublicKey,args) = {
330333 let callerAddress = addressFromPublicKey(callerPublicKey)
331334 let poolAddress = addressFromStringValue(args[0])
332335 let priceAssetIdString = args[1]
333336 let priceAssetId = parseAssetId(priceAssetIdString)
334337 let minimumAmount = parseIntValue(args[2])
335338 let assetInAmount = i.payments[0].amount
336339 let assetInAssetId = i.payments[0].assetId
337340 let checks = [if (!(shutdown))
338341 then true
339342 else throwErr("Temporary shutdown"), mustFactory(i.caller), if ((size(i.payments) == 1))
340343 then true
341344 else throwErr("exactly one payment is expected")]
342345 if ((checks == checks))
343346 then {
344347 let outAssetBalanceBefore = getBalance(this, priceAssetId)
345348 if ((outAssetBalanceBefore == outAssetBalanceBefore))
346349 then {
347350 let swapAction = if (isPoolTargetReached(poolAddress))
348351 then invoke(wxSwapAddress, "swap", [minimumAmount, priceAssetIdString, toString(this)], i.payments)
349352 else invoke(poolAddress, "swap", [priceAssetIdString, minimumAmount], i.payments)
350353 if ((swapAction == swapAction))
351354 then {
352355 let outAssetBalanceAfter = getBalance(this, priceAssetId)
353356 if ((outAssetBalanceAfter == outAssetBalanceAfter))
354357 then [ScriptTransfer(callerAddress, (outAssetBalanceAfter - outAssetBalanceBefore), priceAssetId)]
355358 else throw("Strict value is not equal to itself.")
356359 }
357360 else throw("Strict value is not equal to itself.")
358361 }
359362 else throw("Strict value is not equal to itself.")
360363 }
361364 else throw("Strict value is not equal to itself.")
362365 }
363366
364367
365368
366369 @Callable(i)
367370 func transferPool (callerPublicKey,args) = {
368371 let callerAddress = addressFromPublicKey(callerPublicKey)
369372 let poolAddress = addressFromStringValue(args[0])
370373 let poolTokensStringList = split(getStringValue(poolAddress, kPoolTokensList), ",")
371374 let asset1 = parseAssetId(poolTokensStringList[0])
372375 let asset2 = parseAssetId(poolTokensStringList[1])
373- let $t01197612068 = if ((asset1 == unit))
376+ let $t01204712139 = if ((asset1 == unit))
374377 then $Tuple2(asset2, asset1)
375378 else $Tuple2(asset1, asset2)
376- let poolAsset = $t01197612068._1
377- let wavesAsset = $t01197612068._2
379+ let poolAsset = $t01204712139._1
380+ let wavesAsset = $t01204712139._2
378381 let poolAssetBalanceBefore = getBalance(factoryAddress, poolAsset)
379382 if ((poolAssetBalanceBefore == poolAssetBalanceBefore))
380383 then {
381384 let wavesAssetBalanceBefore = getBalance(factoryAddress, wavesAsset)
382385 if ((wavesAssetBalanceBefore == wavesAssetBalanceBefore))
383386 then {
384387 let withdrawInvoke = invoke(factoryAddress, "withdrawLiquidityFromPool", [poolAddress.bytes], nil)
385388 if ((withdrawInvoke == withdrawInvoke))
386389 then {
387390 let poolAssetBalanceAfter = getBalance(factoryAddress, poolAsset)
388391 if ((poolAssetBalanceAfter == poolAssetBalanceAfter))
389392 then {
390393 let wavesAssetBalanceAfter = getBalance(factoryAddress, wavesAsset)
391394 if ((wavesAssetBalanceAfter == wavesAssetBalanceAfter))
392395 then {
393396 let poolAssetAmount = (poolAssetBalanceAfter - poolAssetBalanceBefore)
394397 let wavesAmount = (wavesAssetBalanceAfter - wavesAssetBalanceBefore)
395398 if (if ((poolAssetAmount > 0))
396399 then (wavesAmount > 0)
397400 else false)
398401 then {
399402 let burnAmount = fraction(poolAssetAmount, 20, 100)
400403 let burnAction = invoke(factoryAddress, "burn", [poolAsset, burnAmount], nil)
401404 if ((burnAction == burnAction))
402405 then {
403406 let feeWavesAmount = fraction(wavesAmount, 20, 100)
404407 let feeAction = invoke(factoryAddress, "transferWaves", [feeCollectorAddress.bytes, feeWavesAmount], nil)
405408 if ((feeAction == feeAction))
406409 then {
407410 let registerAssetAction = invoke(factoryAddress, "registerAsset", [assetStoreAddress.bytes, assetIdToString(poolAsset), defaultLogo, true], nil)
408411 if ((registerAssetAction == registerAssetAction))
409412 then {
410413 let createWxPoolAction = invoke(factoryAddress, "createWxPool", [userPoolsAddress.bytes, assetIdToString(poolAsset), (poolAssetAmount - burnAmount), assetIdToString(wavesAsset), (wavesAmount - feeWavesAmount)], nil)
411414 if ((createWxPoolAction == createWxPoolAction))
412415 then {
413416 let changeStatus = invoke(factoryAddress, "integerEntry", [kPoolStatus(getPoolId(poolAddress)), STATUS_TRANSFERRED], nil)
414417 if ((changeStatus == changeStatus))
415418 then nil
416419 else throw("Strict value is not equal to itself.")
417420 }
418421 else throw("Strict value is not equal to itself.")
419422 }
420423 else throw("Strict value is not equal to itself.")
421424 }
422425 else throw("Strict value is not equal to itself.")
423426 }
424427 else throw("Strict value is not equal to itself.")
425428 }
426429 else throwErr("withdrawn amount from pool is too low")
427430 }
428431 else throw("Strict value is not equal to itself.")
429432 }
430433 else throw("Strict value is not equal to itself.")
431434 }
432435 else throw("Strict value is not equal to itself.")
433436 }
434437 else throw("Strict value is not equal to itself.")
435438 }
436439 else throw("Strict value is not equal to itself.")
437440 }
438441
439442
440443 @Verifier(tx)
441444 func verify () = {
442445 let keyAdminAddressList = "%s__adminAddressList"
443446 let keyAllowedTxId = "%s__txId"
444447 let adminList = split(valueOrElse(getString(factoryAddress, keyAdminAddressList), ""), "__")
445448 let byOwner = if ((size(adminList) >= 3))
446449 then false
447450 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
448451 let byAdmins = (tx.id == fromBase58String(valueOrElse(getString(factoryAddress, keyAllowedTxId), "")))
449452 if (byAdmins)
450453 then true
451454 else byOwner
452455 }
453456

github/deemru/w8io/169f3d6 
53.93 ms