tx · J5xwGBvQVTeMK2r5PCA6FjjETuBQavKiuMkpZLwwUexm

3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr:  -0.01600000 Waves

2024.12.19 10:45 [3421136] smart account 3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr > SELF 0.00000000 Waves

{ "type": 13, "id": "J5xwGBvQVTeMK2r5PCA6FjjETuBQavKiuMkpZLwwUexm", "fee": 1600000, "feeAssetId": null, "timestamp": 1734594349914, "version": 2, "chainId": 84, "sender": "3N1ytAUyhtig9X6F2hHHs1jbzYxr47Yp8Fr", "senderPublicKey": "jXCTQV8PjX2uC9UHBFveupYy9cjhY7stHbzE9cptymw", "proofs": [ "48HcBtNXE6GsdsVU5Sh2bjj5hY12DZhybCZEjvzueJHMc31Y7ER2eobsqseZV3jjy335NYUrY7UeZzMYrbFhBP1U" ], "script": "base64:BwIrCAISAwoBCBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGBIECgICGDUACXNlcGFyYXRvcgICX18AC3dhdmVzU3RyaW5nAgVXQVZFUwAQY29udHJhY3RGaWxlbmFtZQIXbWVtZV9pbV9jYWxjdWxhdG9yLnJpZGUABW11bHQ4AIDC1y8BB3dyYXBFcnIBAXMJAKwCAgkArAICBRBjb250cmFjdEZpbGVuYW1lAgI6IAUBcwEIdGhyb3dFcnIBAXMJAAIBCQEHd3JhcEVycgEFAXMBD3ZhbGlkYXRlQWRkcmVzcwEHYWRkcmVzcwkBCWlzRGVmaW5lZAEJAKYIAQUHYWRkcmVzcwAMU1RBVFVTX0VNUFRZAAAADFNUQVRVU19SRUFEWQABABVTVEFUVVNfVEFSR0VUX1JFQUNIRUQAAgASU1RBVFVTX1RSQU5TRkVSUkVEAAMACWtTaHV0ZG93bgIOc2h1dGRvd25fX2ZsYWcAC2tQcmljZUFzc2V0AgxwcmljZV9fYXNzZXQADmtMaXN0aW5nVm9sdW1lAg9saXN0aW5nX192b2x1bWUADGtDcmVhdGlvbkZlZQISc2V0dXBfX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2V5QWxsb3dlZFR4SWQCAAMFCGJ5QWRtaW5zBgUHYnlPd25lcpZWQtE=", "height": 3421136, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HG5LGg2bxYLNvihRSyQYjQ4cLPNLC1tJVxvDWyriRVPa Next: AWxxyUq7pUj4mnKd4kcbfxbchATDWQyUX2v4sLVLxhSJ Diff:
OldNewDifferences
2424
2525 let STATUS_TARGET_REACHED = 2
2626
27+let STATUS_TRANSFERRED = 3
28+
2729 let kShutdown = "shutdown__flag"
2830
2931 let kPriceAsset = "price__asset"
3537 let kCurveTarget = "setup__curveTarget"
3638
3739 let kVirtualLiquidity = "setup__virtualLiquidity"
40+
41+let kPoolTokensList = "static_tokenIds"
3842
3943 let kPoolContractHash = "pool__contract__hash"
4044
7276 let wxSwapAddressOption = match getString(factoryAddress, kWxSwapAddress) {
7377 case s: String =>
7478 addressFromString(s)
75- case _: Unit =>
79+ case _ =>
7680 unit
77- case _ =>
78- throw("Match error")
7981 }
8082
8183 let wxSwapAddress = valueOrErrorMessage(wxSwapAddressOption, wrapErr("invalid wx swap address"))
84+
85+let kFeeCollectorAddress = "wxfee_address"
86+
87+let feeCollectorAddressOption = match getString(factoryAddress, kFeeCollectorAddress) {
88+ case s: String =>
89+ addressFromString(s)
90+ case _ =>
91+ unit
92+}
93+
94+let feeCollectorAddress = valueOrErrorMessage(feeCollectorAddressOption, wrapErr("invalid fee collector address"))
95+
96+let kUserPoolsAddress = "userpools_address"
97+
98+let userPoolsAddressOption = match getString(factoryAddress, kUserPoolsAddress) {
99+ case s: String =>
100+ addressFromString(s)
101+ case _ =>
102+ unit
103+}
104+
105+let userPoolsAddress = valueOrErrorMessage(userPoolsAddressOption, wrapErr("invalid user_pools dapp address"))
82106
83107 let shutdown = valueOrElse(getBoolean(factoryAddress, kShutdown), false)
84108
302326 }
303327
304328
329+
330+@Callable(i)
331+func transferPool (callerPublicKey,args) = {
332+ let callerAddress = addressFromPublicKey(callerPublicKey)
333+ let poolAddress = addressFromStringValue(args[0])
334+ let poolTokensStringList = split(getStringValue(poolAddress, kPoolTokensList), ",")
335+ let asset1 = parseAssetId(poolTokensStringList[0])
336+ let asset2 = parseAssetId(poolTokensStringList[1])
337+ let $t01059110683 = if ((asset1 == unit))
338+ then $Tuple2(asset2, asset1)
339+ else $Tuple2(asset1, asset2)
340+ let poolAsset = $t01059110683._1
341+ let wavesAsset = $t01059110683._2
342+ let poolAssetBalanceBefore = getBalance(factoryAddress, poolAsset)
343+ if ((poolAssetBalanceBefore == poolAssetBalanceBefore))
344+ then {
345+ let wavesAssetBalanceBefore = getBalance(factoryAddress, wavesAsset)
346+ if ((wavesAssetBalanceBefore == wavesAssetBalanceBefore))
347+ then {
348+ let withdrawInvoke = invoke(factoryAddress, "withdrawLiquidityFromPool", nil, nil)
349+ if ((withdrawInvoke == withdrawInvoke))
350+ then {
351+ let poolAssetBalanceAfter = getBalance(factoryAddress, poolAsset)
352+ if ((poolAssetBalanceAfter == poolAssetBalanceAfter))
353+ then {
354+ let wavesAssetBalanceAfter = getBalance(factoryAddress, wavesAsset)
355+ if ((wavesAssetBalanceAfter == wavesAssetBalanceAfter))
356+ then {
357+ let poolAssetAmount = (poolAssetBalanceAfter - poolAssetBalanceBefore)
358+ let wavesAmount = (wavesAssetBalanceAfter - wavesAssetBalanceBefore)
359+ if (if ((poolAssetAmount > 0))
360+ then (wavesAmount > 0)
361+ else false)
362+ then {
363+ let burnAmount = fraction(poolAssetAmount, 20, 100)
364+ let burnAction = invoke(factoryAddress, "burn", [poolAsset, burnAmount], nil)
365+ if ((burnAction == burnAction))
366+ then {
367+ let feeWavesAmount = fraction(wavesAmount, 20, 100)
368+ let feeAction = invoke(factoryAddress, "transferWaves", [feeCollectorAddress, feeWavesAmount], nil)
369+ if ((feeAction == feeAction))
370+ then {
371+ let createWxPoolAction = invoke(factoryAddress, "createWxPool", [userPoolsAddress, assetIdToString(poolAsset), (poolAssetAmount - burnAmount), assetIdToString(wavesAsset), (wavesAmount - feeWavesAmount)], nil)
372+ if ((createWxPoolAction == createWxPoolAction))
373+ then nil
374+ else throw("Strict value is not equal to itself.")
375+ }
376+ else throw("Strict value is not equal to itself.")
377+ }
378+ else throw("Strict value is not equal to itself.")
379+ }
380+ else throwErr("withdrawn amount from pool is too low")
381+ }
382+ else throw("Strict value is not equal to itself.")
383+ }
384+ else throw("Strict value is not equal to itself.")
385+ }
386+ else throw("Strict value is not equal to itself.")
387+ }
388+ else throw("Strict value is not equal to itself.")
389+ }
390+ else throw("Strict value is not equal to itself.")
391+ }
392+
393+
305394 @Verifier(tx)
306395 func verify () = {
307396 let keyAdminAddressList = "%s__adminAddressList"
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
27+let STATUS_TRANSFERRED = 3
28+
2729 let kShutdown = "shutdown__flag"
2830
2931 let kPriceAsset = "price__asset"
3032
3133 let kListingVolume = "listing__volume"
3234
3335 let kCreationFee = "setup__creationFee"
3436
3537 let kCurveTarget = "setup__curveTarget"
3638
3739 let kVirtualLiquidity = "setup__virtualLiquidity"
40+
41+let kPoolTokensList = "static_tokenIds"
3842
3943 let kPoolContractHash = "pool__contract__hash"
4044
4145 let kLastEmptyPoolIndex = "last__empty_pool__index"
4246
4347 let kFirstEmptyPoolIndex = "first__empty__pool__index"
4448
4549 func kPoolAddressFromIndex (index) = makeString(["pool", toString(index)], separator)
4650
4751
4852 func kPoolIndexFromAddress (address) = makeString(["pool", toString(address)], separator)
4953
5054
5155 func kPoolAsset (address) = makeString(["asset", toString(address)], separator)
5256
5357
5458 func kPoolStatus (index) = makeString(["pool", "status", toString(index)], separator)
5559
5660
5761 let kFactoryAddress = "factory__address"
5862
5963 let factoryAddressOption = match getString(this, kFactoryAddress) {
6064 case s: String =>
6165 addressFromString(s)
6266 case _: Unit =>
6367 unit
6468 case _ =>
6569 throw("Match error")
6670 }
6771
6872 let factoryAddress = valueOrErrorMessage(factoryAddressOption, wrapErr("invalid factory address"))
6973
7074 let kWxSwapAddress = "wxswap__address"
7175
7276 let wxSwapAddressOption = match getString(factoryAddress, kWxSwapAddress) {
7377 case s: String =>
7478 addressFromString(s)
75- case _: Unit =>
79+ case _ =>
7680 unit
77- case _ =>
78- throw("Match error")
7981 }
8082
8183 let wxSwapAddress = valueOrErrorMessage(wxSwapAddressOption, wrapErr("invalid wx swap address"))
84+
85+let kFeeCollectorAddress = "wxfee_address"
86+
87+let feeCollectorAddressOption = match getString(factoryAddress, kFeeCollectorAddress) {
88+ case s: String =>
89+ addressFromString(s)
90+ case _ =>
91+ unit
92+}
93+
94+let feeCollectorAddress = valueOrErrorMessage(feeCollectorAddressOption, wrapErr("invalid fee collector address"))
95+
96+let kUserPoolsAddress = "userpools_address"
97+
98+let userPoolsAddressOption = match getString(factoryAddress, kUserPoolsAddress) {
99+ case s: String =>
100+ addressFromString(s)
101+ case _ =>
102+ unit
103+}
104+
105+let userPoolsAddress = valueOrErrorMessage(userPoolsAddressOption, wrapErr("invalid user_pools dapp address"))
82106
83107 let shutdown = valueOrElse(getBoolean(factoryAddress, kShutdown), false)
84108
85109 let lastEmptyIndex = valueOrElse(getInteger(factoryAddress, kLastEmptyPoolIndex), 0)
86110
87111 let firstEmptyIndex = valueOrElse(getInteger(factoryAddress, kFirstEmptyPoolIndex), 0)
88112
89113 let listingVolume = valueOrElse(getInteger(factoryAddress, kListingVolume), 0)
90114
91115 let creationFee = valueOrElse(getInteger(factoryAddress, kCreationFee), 0)
92116
93117 let poolContractHash = getBinary(factoryAddress, kPoolContractHash)
94118
95119 func parseAssetId (input) = if ((input == wavesString))
96120 then unit
97121 else fromBase58String(input)
98122
99123
100124 func assetIdToString (input) = if ((input == unit))
101125 then wavesString
102126 else toBase58String(value(input))
103127
104128
105129 func mustAddress (caller,address) = if ((caller == address))
106130 then true
107131 else throwErr("permission denied")
108132
109133
110134 func mustThis (caller) = mustAddress(caller, this)
111135
112136
113137 func mustFactory (caller) = mustAddress(caller, factoryAddress)
114138
115139
116140 func checkContractScript (address) = match poolContractHash {
117141 case hash: ByteVector =>
118142 (scriptHash(address) == hash)
119143 case _ =>
120144 true
121145 }
122146
123147
124148 func isPoolExists (poolAddress) = isDefined(getInteger(factoryAddress, kPoolIndexFromAddress(poolAddress)))
125149
126150
127151 func getPoolId (poolAddress) = valueOrErrorMessage(getInteger(factoryAddress, kPoolIndexFromAddress(poolAddress)), "pool doesn't exists")
128152
129153
130154 func isPoolTargetReached (poolAddress) = (valueOrElse(getInteger(factoryAddress, kPoolStatus(getPoolId(poolAddress))), -1) == STATUS_TARGET_REACHED)
131155
132156
133157 func getBalance (address,assetId) = match assetId {
134158 case id: ByteVector =>
135159 assetBalance(address, id)
136160 case _ =>
137161 wavesBalance(address).available
138162 }
139163
140164
141165 @Callable(i)
142166 func init (factoryAddressStr) = {
143167 let checkCaller = mustThis(i.caller)
144168 if ((checkCaller == checkCaller))
145169 then [StringEntry(kFactoryAddress, factoryAddressStr)]
146170 else throw("Strict value is not equal to itself.")
147171 }
148172
149173
150174
151175 @Callable(i)
152176 func addEmptyPool (callerPublicKey,args) = {
153177 let newPoolAddress = addressFromPublicKey(callerPublicKey)
154178 let newPoolIndex = (lastEmptyIndex + 1)
155179 let checks = [if (!(shutdown))
156180 then true
157181 else throwErr("not allowed (shutdown)"), if (checkContractScript(newPoolAddress))
158182 then true
159183 else throwErr("pool script is not allowed"), if (!(isPoolExists(newPoolAddress)))
160184 then true
161185 else throwErr("pool address is already registered")]
162186 if ((checks == checks))
163187 then {
164188 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)]
165189 $Tuple2(nil, factoryActions)
166190 }
167191 else throw("Strict value is not equal to itself.")
168192 }
169193
170194
171195
172196 @Callable(i)
173197 func createPool (callerPublicKey,args) = {
174198 let minPayment = (listingVolume + creationFee)
175199 let checks = [if (!(shutdown))
176200 then true
177201 else throwErr("Temporary shutdown"), mustFactory(i.caller), if (((lastEmptyIndex - firstEmptyIndex) > 0))
178202 then true
179203 else throwErr("No empty pool available"), if ((i.payments[0].assetId == unit))
180204 then true
181205 else throwErr("Payment should be in WAVES"), if ((i.payments[0].amount >= minPayment))
182206 then true
183207 else throwErr((("Payment should be greater or equal " + toString(minPayment)) + " WAVELET")), if (isDefined(args[0]))
184208 then true
185209 else throwErr("Token name is not provided"), if (isDefined(args[1]))
186210 then true
187211 else throwErr("Token description is not provided"), if (isDefined(args[2]))
188212 then true
189213 else throwErr("Token quantity is not provided"), if ((parseInt(args[2]) != unit))
190214 then true
191215 else throwErr("Token quantity should be a number")]
192216 if ((checks == checks))
193217 then {
194218 let poolIndex = (firstEmptyIndex + 1)
195219 let poolAddressString = getStringValue(factoryAddress, kPoolAddressFromIndex(poolIndex))
196220 let poolAddress = addressFromStringValue(poolAddressString)
197221 let callerAddress = addressFromPublicKey(callerPublicKey)
198222 let poolDomain = take(poolAddressString, 8)
199223 let poolOwner = toString(callerAddress)
200224 let tokenName = args[0]
201225 let tokenDesc = args[1]
202226 let tokenQuantity = args[2]
203227 let initPoolInvoke = invoke(factoryAddress, "initPoolInvoke", [poolAddressString, [poolDomain, poolOwner, tokenName, tokenDesc, tokenQuantity]], [AttachedPayment(i.payments[0].assetId, i.payments[0].amount)])
204228 if ((initPoolInvoke == initPoolInvoke))
205229 then {
206230 let factoryActions = [invoke(factoryAddress, "integerEntry", [kFirstEmptyPoolIndex, poolIndex], nil), invoke(factoryAddress, "integerEntry", [kPoolStatus(poolIndex), STATUS_READY], nil)]
207231 $Tuple2(nil, factoryActions)
208232 }
209233 else throw("Strict value is not equal to itself.")
210234 }
211235 else throw("Strict value is not equal to itself.")
212236 }
213237
214238
215239
216240 @Callable(i)
217241 func notifyStatusUpdate (callerPublicKey,args) = {
218242 let poolAddress = addressFromPublicKey(callerPublicKey)
219243 let checks = [if (isPoolExists(poolAddress))
220244 then true
221245 else throwErr("pool not found"), mustFactory(i.caller)]
222246 if ((checks == checks))
223247 then {
224248 let poolIndex = getIntegerValue(factoryAddress, kPoolIndexFromAddress(poolAddress))
225249 let newStatus = parseIntValue(args[0])
226250 let factoryActions = [invoke(factoryAddress, "integerEntry", [kPoolStatus(poolIndex), newStatus], nil)]
227251 $Tuple2(nil, factoryActions)
228252 }
229253 else throw("Strict value is not equal to itself.")
230254 }
231255
232256
233257
234258 @Callable(i)
235259 func swapREADONLY (callerPublicKey,args) = {
236260 let poolAddress = addressFromStringValue(args[0])
237261 let amountAssetIdString = args[1]
238262 let priceAssetIdString = args[2]
239263 let amount = parseIntValue(args[3])
240264 let checks = [if (!(shutdown))
241265 then true
242266 else throwErr("Temporary shutdown"), mustFactory(i.caller)]
243267 if ((checks == checks))
244268 then if (isPoolTargetReached(poolAddress))
245269 then {
246270 let wxSwapResult = {
247271 let @ = invoke(wxSwapAddress, "swapCalculateREADONLY", [amount, amountAssetIdString, priceAssetIdString], nil)
248272 if ($isInstanceOf(@, "Int"))
249273 then @
250274 else throw(($getType(@) + " couldn't be cast to Int"))
251275 }
252276 $Tuple2(nil, $Tuple2(wxSwapResult, "WxSwap"))
253277 }
254278 else {
255279 let poolSwapResult = {
256280 let @ = invoke(poolAddress, "swapReadOnly", [amountAssetIdString, priceAssetIdString, amount], nil)
257281 if ($isInstanceOf(@, "Int"))
258282 then @
259283 else throw(($getType(@) + " couldn't be cast to Int"))
260284 }
261285 $Tuple2(nil, $Tuple2(poolSwapResult, "iMemePool"))
262286 }
263287 else throw("Strict value is not equal to itself.")
264288 }
265289
266290
267291
268292 @Callable(i)
269293 func swap (callerPublicKey,args) = {
270294 let callerAddress = addressFromPublicKey(callerPublicKey)
271295 let poolAddress = addressFromStringValue(args[0])
272296 let priceAssetIdString = args[1]
273297 let priceAssetId = parseAssetId(priceAssetIdString)
274298 let minimumAmount = parseIntValue(args[2])
275299 let assetInAmount = i.payments[0].amount
276300 let assetInAssetId = i.payments[0].assetId
277301 let checks = [if (!(shutdown))
278302 then true
279303 else throwErr("Temporary shutdown"), mustFactory(i.caller), if ((size(i.payments) == 1))
280304 then true
281305 else throwErr("exactly one payment is expected")]
282306 if ((checks == checks))
283307 then {
284308 let outAssetBalanceBefore = getBalance(this, priceAssetId)
285309 if ((outAssetBalanceBefore == outAssetBalanceBefore))
286310 then {
287311 let swapAction = if (isPoolTargetReached(poolAddress))
288312 then invoke(wxSwapAddress, "swap", [minimumAmount, priceAssetIdString, toString(this)], i.payments)
289313 else invoke(poolAddress, "swap", [priceAssetIdString, minimumAmount], i.payments)
290314 if ((swapAction == swapAction))
291315 then {
292316 let outAssetBalanceAfter = getBalance(this, priceAssetId)
293317 if ((outAssetBalanceAfter == outAssetBalanceAfter))
294318 then [ScriptTransfer(callerAddress, (outAssetBalanceAfter - outAssetBalanceBefore), priceAssetId)]
295319 else throw("Strict value is not equal to itself.")
296320 }
297321 else throw("Strict value is not equal to itself.")
298322 }
299323 else throw("Strict value is not equal to itself.")
300324 }
301325 else throw("Strict value is not equal to itself.")
302326 }
303327
304328
329+
330+@Callable(i)
331+func transferPool (callerPublicKey,args) = {
332+ let callerAddress = addressFromPublicKey(callerPublicKey)
333+ let poolAddress = addressFromStringValue(args[0])
334+ let poolTokensStringList = split(getStringValue(poolAddress, kPoolTokensList), ",")
335+ let asset1 = parseAssetId(poolTokensStringList[0])
336+ let asset2 = parseAssetId(poolTokensStringList[1])
337+ let $t01059110683 = if ((asset1 == unit))
338+ then $Tuple2(asset2, asset1)
339+ else $Tuple2(asset1, asset2)
340+ let poolAsset = $t01059110683._1
341+ let wavesAsset = $t01059110683._2
342+ let poolAssetBalanceBefore = getBalance(factoryAddress, poolAsset)
343+ if ((poolAssetBalanceBefore == poolAssetBalanceBefore))
344+ then {
345+ let wavesAssetBalanceBefore = getBalance(factoryAddress, wavesAsset)
346+ if ((wavesAssetBalanceBefore == wavesAssetBalanceBefore))
347+ then {
348+ let withdrawInvoke = invoke(factoryAddress, "withdrawLiquidityFromPool", nil, nil)
349+ if ((withdrawInvoke == withdrawInvoke))
350+ then {
351+ let poolAssetBalanceAfter = getBalance(factoryAddress, poolAsset)
352+ if ((poolAssetBalanceAfter == poolAssetBalanceAfter))
353+ then {
354+ let wavesAssetBalanceAfter = getBalance(factoryAddress, wavesAsset)
355+ if ((wavesAssetBalanceAfter == wavesAssetBalanceAfter))
356+ then {
357+ let poolAssetAmount = (poolAssetBalanceAfter - poolAssetBalanceBefore)
358+ let wavesAmount = (wavesAssetBalanceAfter - wavesAssetBalanceBefore)
359+ if (if ((poolAssetAmount > 0))
360+ then (wavesAmount > 0)
361+ else false)
362+ then {
363+ let burnAmount = fraction(poolAssetAmount, 20, 100)
364+ let burnAction = invoke(factoryAddress, "burn", [poolAsset, burnAmount], nil)
365+ if ((burnAction == burnAction))
366+ then {
367+ let feeWavesAmount = fraction(wavesAmount, 20, 100)
368+ let feeAction = invoke(factoryAddress, "transferWaves", [feeCollectorAddress, feeWavesAmount], nil)
369+ if ((feeAction == feeAction))
370+ then {
371+ let createWxPoolAction = invoke(factoryAddress, "createWxPool", [userPoolsAddress, assetIdToString(poolAsset), (poolAssetAmount - burnAmount), assetIdToString(wavesAsset), (wavesAmount - feeWavesAmount)], nil)
372+ if ((createWxPoolAction == createWxPoolAction))
373+ then nil
374+ else throw("Strict value is not equal to itself.")
375+ }
376+ else throw("Strict value is not equal to itself.")
377+ }
378+ else throw("Strict value is not equal to itself.")
379+ }
380+ else throwErr("withdrawn amount from pool is too low")
381+ }
382+ else throw("Strict value is not equal to itself.")
383+ }
384+ else throw("Strict value is not equal to itself.")
385+ }
386+ else throw("Strict value is not equal to itself.")
387+ }
388+ else throw("Strict value is not equal to itself.")
389+ }
390+ else throw("Strict value is not equal to itself.")
391+ }
392+
393+
305394 @Verifier(tx)
306395 func verify () = {
307396 let keyAdminAddressList = "%s__adminAddressList"
308397 let keyAllowedTxId = "%s__txId"
309398 let adminList = split(valueOrElse(getString(factoryAddress, keyAdminAddressList), ""), "__")
310399 let byOwner = if ((size(adminList) >= 3))
311400 then false
312401 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
313402 let byAdmins = (tx.id == fromBase58String(valueOrElse(getString(factoryAddress, keyAllowedTxId), "")))
314403 if (byAdmins)
315404 then true
316405 else byOwner
317406 }
318407

github/deemru/w8io/169f3d6 
49.77 ms