tx · LyGaKAz7PEJmzSxEi8J5xcT9qoKCnTJwdSQrDmufB25

3N5nmMvMH8o3RPEyCKCaoWahBTYTexnZy62:  -0.02000000 Waves

2020.07.14 16:44 [1087073] smart account 3N5nmMvMH8o3RPEyCKCaoWahBTYTexnZy62 > SELF 0.00000000 Waves

{ "type": 13, "id": "LyGaKAz7PEJmzSxEi8J5xcT9qoKCnTJwdSQrDmufB25", "fee": 2000000, "feeAssetId": null, "timestamp": 1594734266712, "version": 1, "sender": "3N5nmMvMH8o3RPEyCKCaoWahBTYTexnZy62", "senderPublicKey": "6PBV8fVJwLaUQbCyG7iqoKR3x1nqFRZFNeuN9qodoiTu", "proofs": [ "63XEweLuqCg7HxC1fw2mCNanaUJnUiYig9MtFrTqnQSRQds54HcXLGqZRL2c2FvYAuS5ZbHFhNsLux98M1dzRtca", "s3bCczur5UGauY12xkSfngFtVXe2uF8FjeSoNBRDktgiA2Z1BADCAfYCUQQtTmGg7ufxPK6nJTLVbMu2Cq7dTU4", "67CMXBJUSdBseLyvMKrkjP3EkmFW9sqKpbAAs5aZs1MgYHrCz4Vh8UXYjGB5aFJmPUEbDuHy428zmYpRtEzVAdDx" ], "script": "base64:AAIDAAAAAAAAABMIARIECgIBCBIAEgMKAQgSABIAAAAAOQEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQIAAAAAAQAAABZnZXRCb29sQnlBZGRyZXNzQW5kS2V5AAAAAgAAAAdhZG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M1pNaHJNN25pTHNlREgydVJvSzZ3ZUJxMkpRM0EJAARMAAAAAgIAAAAsNVdSWEZTandjVGJOZktjSnM4WnFYbVNTV1lzU1ZKVXRNdk1xWmo1aEg0TmMFAAAAA25pbAQAAAAFY291bnQJAABkAAAAAgkAAGQAAAACCQAAZAAAAAIDCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAkAAlkAAAABCQABkQAAAAIFAAAAEHB1YktleUFkbWluc0xpc3QAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAADCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAQkAAlkAAAABCQABkQAAAAIFAAAAEHB1YktleUFkbWluc0xpc3QAAAAAAAAAAAEAAAAAAAAAAAEAAAAAAAAAAAADCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAgkAAlkAAAABCQABkQAAAAIFAAAAEHB1YktleUFkbWluc0xpc3QAAAAAAAAAAAIAAAAAAAAAAAEAAAAAAAAAAAADCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAwkAAlkAAAABCQABkQAAAAIFAAAAEHB1YktleUFkbWluc0xpc3QAAAAAAAAAAAMAAAAAAAAAAAIAAAAAAAAAAAAJAABnAAAAAgUAAAAFY291bnQAAAAAAAAAAAMVuEv/", "chainId": 84, "height": 1087073, "spentComplexity": 0 } View: original | compacted Prev: 8Ndd4zfTQuici7f1MWLryUR5eCjkK7mcTURfVajovXVa Next: BEbxrNz7J4F1dE5LjzhQQ6oDh2h6Vwo16zsoTRa4GsKF Diff:
OldNewDifferences
4444 let WAVELET = 100000000
4545
4646 let PAULI = 1000000
47+
48+let PRICELET = 1000000
4749
4850 let CANCELED = "canceled"
4951
9597 func getNextOrderKey (orderId) = ("order_next_" + orderId)
9698
9799
98-func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, 100, price), WAVELET, PAULI)
100+func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, PRICELET, price), WAVELET, PAULI)
99101
100102
101-func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, 100), PAULI, WAVELET)
103+func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, PRICELET), PAULI, WAVELET)
102104
103105
104106 func convertWavesToBond (amount,price) = convertWavesToNeutrino(amount, price)
291293 else {
292294 let nextOrder = getNextOrder(firstOrder)
293295 let filledTotal = getOrderFilledTotal(firstOrder)
294- let orderPrice = getOrderPrice(firstOrder)
296+ let nsbt2UsdnPrice = getOrderPrice(firstOrder)
295297 let remainedTotal = (getOrderTotal(firstOrder) - filledTotal)
296- let totalUSDNRequiredToFillOrder = fraction(remainedTotal, orderPrice, 100)
298+ let totalUSDNRequiredToFillOrder = fraction(remainedTotal, nsbt2UsdnPrice, 100)
297299 let isOrderFullyFilable = (usdnAmount >= totalUSDNRequiredToFillOrder)
298300 let fillableOrderAmount = if (isOrderFullyFilable)
299301 then totalUSDNRequiredToFillOrder
300302 else usdnAmount
301- let finalNBTFillable = fraction(fillableOrderAmount, 100, orderPrice)
302- let nbTokensLiquidateCondition = (fraction((surplus + neutrinoSupply), 100, neutrinoSupply) >= orderPrice)
303+ let finalNBTFillable = fraction(fillableOrderAmount, 100, nsbt2UsdnPrice)
304+ let nbTokensLiquidateCondition = (fraction((surplus + neutrinoSupply), 100, neutrinoSupply) >= nsbt2UsdnPrice)
303305 if (!(nbTokensLiquidateCondition))
304306 then throw(("innapropriate surplus: " + toString(surplus)))
305307 else {
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func getNumberByKey (key) = match getInteger(this, key) {
55 case a: Int =>
66 a
77 case _ =>
88 0
99 }
1010
1111
1212 func getStringByKey (key) = match getString(this, key) {
1313 case a: String =>
1414 a
1515 case _ =>
1616 ""
1717 }
1818
1919
2020 func getBoolByAddressAndKey (address,key) = match getBoolean(address, key) {
2121 case a: Boolean =>
2222 a
2323 case _ =>
2424 false
2525 }
2626
2727
2828 func getStringByAddressAndKey (address,key) = match getString(address, key) {
2929 case a: String =>
3030 a
3131 case _ =>
3232 ""
3333 }
3434
3535
3636 func getNumberByAddressAndKey (address,key) = match getInteger(address, key) {
3737 case a: Int =>
3838 a
3939 case _ =>
4040 0
4141 }
4242
4343
4444 let WAVELET = 100000000
4545
4646 let PAULI = 1000000
47+
48+let PRICELET = 1000000
4749
4850 let CANCELED = "canceled"
4951
5052 let NEW = "new"
5153
5254 let FILLED = "filled"
5355
5456 let NeutrinoContractKey = "neutrino_contract"
5557
5658 let PriceKey = "price"
5759
5860 let BondAssetIdKey = "bond_asset_id"
5961
6062 let NeutrinoAssetIdKey = "neutrino_asset_id"
6163
6264 let ControlContractKey = "control_contract"
6365
6466 let BalanceLockedkKey = "balance_lock_"
6567
6668 let WavesLockedBalanceKey = (BalanceLockedkKey + "waves")
6769
6870 let NeutrinoLockedBalanceKey = (BalanceLockedkKey + "neutrino")
6971
7072 let FirstOrderKey = "order_first"
7173
7274 let CurrentDefaultOrderKey = "order_default"
7375
7476 func getOrderPriceKey (orderId) = ("order_price_" + orderId)
7577
7678
7779 func getOrderTotalKey (orderId) = ("order_total_" + orderId)
7880
7981
8082 func getOrderOwnerKey (orderId) = ("order_owner_" + orderId)
8183
8284
8385 func getOrderHeightKey (orderId) = ("order_height_" + orderId)
8486
8587
8688 func getOrderStatusKey (orderId) = ("order_status_" + orderId)
8789
8890
8991 func getOrderFilledTotalKey (orderId) = ("order_filled_total_" + orderId)
9092
9193
9294 func getPrevOrderKey (orderId) = ("order_prev_" + orderId)
9395
9496
9597 func getNextOrderKey (orderId) = ("order_next_" + orderId)
9698
9799
98-func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, 100, price), WAVELET, PAULI)
100+func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, PRICELET, price), WAVELET, PAULI)
99101
100102
101-func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, 100), PAULI, WAVELET)
103+func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, PRICELET), PAULI, WAVELET)
102104
103105
104106 func convertWavesToBond (amount,price) = convertWavesToNeutrino(amount, price)
105107
106108
107109 let neutrinoContract = addressFromStringValue(getStringByKey(NeutrinoContractKey))
108110
109111 let controlContract = addressFromStringValue(getStringByAddressAndKey(neutrinoContract, ControlContractKey))
110112
111113 let liquidationContract = this
112114
113115 let neutrinoAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, NeutrinoAssetIdKey))
114116
115117 let bondAssetId = fromBase58String("BGhPYquXSK6UYjnPLEn94gFhetp4Jvf7toekEY4x1VDH")
116118
117119 let firstOrder = getStringByKey(FirstOrderKey)
118120
119121 let isBlocked = getBoolByAddressAndKey(controlContract, "is_blocked")
120122
121123 let currentPrice = getNumberByAddressAndKey(controlContract, PriceKey)
122124
123125 let neutrinoLockedBalance = getNumberByAddressAndKey(neutrinoContract, NeutrinoLockedBalanceKey)
124126
125127 let wavesLockedBalance = getNumberByAddressAndKey(neutrinoContract, WavesLockedBalanceKey)
126128
127129 let reserve = (wavesBalance(neutrinoContract) - wavesLockedBalance)
128130
129131 let neutrinoSupply = (((neutrinoLockedBalance + extract(assetInfo(neutrinoAssetId)).quantity) - assetBalance(neutrinoContract, neutrinoAssetId)) - assetBalance(liquidationContract, neutrinoAssetId))
130132
131133 let surplus = (convertWavesToNeutrino(reserve, currentPrice) - neutrinoSupply)
132134
133135 func getOrderPrice (id) = getNumberByKey(getOrderPriceKey(id))
134136
135137
136138 func getOrderTotal (id) = getNumberByKey(getOrderTotalKey(id))
137139
138140
139141 func getOrderOwner (id) = getStringByKey(getOrderOwnerKey(id))
140142
141143
142144 func getOrderStatus (id) = getStringByKey(getOrderStatusKey(id))
143145
144146
145147 func getOrderFilledTotal (id) = getNumberByKey(getOrderFilledTotalKey(id))
146148
147149
148150 func getOrderHeight (id) = getNumberByKey(getOrderHeightKey(id))
149151
150152
151153 func getPrevOrder (id) = getStringByKey(getPrevOrderKey(id))
152154
153155
154156 func getNextOrder (id) = getStringByKey(getNextOrderKey(id))
155157
156158
157159 let currentDefaultOrder = getStringByKey(CurrentDefaultOrderKey)
158160
159161 func generateDataEntryToAddOrder (price,newOrderId,i,prevOrder,nextOrder,firstOrder) = {
160162 let amount = extract(i.payment).amount
161163 let isOneForOneOrder = (price == 100)
162164 let isFirstOrderEmty = (firstOrder == "")
163165 let isNewOrderPriceLowerThanCurrentFirstOrder = (getOrderPrice(firstOrder) > price)
164166 let newFirstOrder = if (isFirstOrderEmty)
165167 then newOrderId
166168 else if (isNewOrderPriceLowerThanCurrentFirstOrder)
167169 then newOrderId
168170 else firstOrder
169171 [DataEntry(getPrevOrderKey(newOrderId), prevOrder), DataEntry(getNextOrderKey(newOrderId), nextOrder), DataEntry(getNextOrderKey(prevOrder), if ((prevOrder == ""))
170172 then prevOrder
171173 else newOrderId), DataEntry(getPrevOrderKey(nextOrder), if ((nextOrder == ""))
172174 then nextOrder
173175 else newOrderId), DataEntry(FirstOrderKey, newFirstOrder), DataEntry(getOrderPriceKey(newOrderId), price), DataEntry(getOrderTotalKey(newOrderId), amount), DataEntry(getOrderOwnerKey(newOrderId), toString(i.caller)), DataEntry(getOrderHeightKey(newOrderId), height), DataEntry(getOrderStatusKey(newOrderId), NEW), DataEntry(CurrentDefaultOrderKey, if (isOneForOneOrder)
174176 then newOrderId
175177 else currentDefaultOrder)]
176178 }
177179
178180
179181 func internalAddLiquidationOrder (i,price,prevOrder) = {
180182 let pmt = extract(i.payment)
181183 let newOrderId = toBase58String(keccak256((((toBytes(pmt.amount) + i.caller.bytes) + toBytes(height)) + i.transactionId)))
182184 let owner = toString(i.caller)
183185 let isEmptyPrevOrder = (prevOrder == "")
184186 let isEmptyFirstOrder = (firstOrder == "")
185187 if (isBlocked)
186188 then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles")
187189 else if ((PAULI > pmt.amount))
188190 then throw("order amount should be higher than 1 NSBT")
189191 else if ((100 > price))
190192 then throw(("price should be equal or higher than 1 nsbt for 1 usdn. i.e. >= 100; price: " + toString(price)))
191193 else if ((pmt.assetId != bondAssetId))
192194 then throw("can use appropriate neutrino base tokens (nsbt) only")
193195 else if ((getOrderOwner(newOrderId) != ""))
194196 then throw("the order already exists")
195197 else if (if (!(isEmptyPrevOrder))
196198 then (getOrderStatus(prevOrder) != NEW)
197199 else false)
198200 then throw("prev order status is not new")
199201 else if (if (isEmptyFirstOrder)
200202 then !(isEmptyPrevOrder)
201203 else false)
202204 then throw("wrong prev order parameter")
203205 else {
204206 let nextOrder = if (isEmptyPrevOrder)
205207 then firstOrder
206208 else getNextOrder(prevOrder)
207209 let isEmptyNextOrder = (nextOrder == "")
208210 if (isEmptyFirstOrder)
209211 then WriteSet(generateDataEntryToAddOrder(price, newOrderId, i, prevOrder, nextOrder, firstOrder))
210212 else {
211213 let nextOrderPrice = getNumberByKey(getOrderPriceKey(nextOrder))
212214 let prevOrderPrice = getNumberByKey(getOrderPriceKey(prevOrder))
213215 let isNextOrderError = if (!(isEmptyNextOrder))
214216 then (price >= nextOrderPrice)
215217 else false
216218 let isPrevOrderError = if (!(isEmptyPrevOrder))
217219 then (prevOrderPrice > price)
218220 else false
219221 if (if (isNextOrderError)
220222 then true
221223 else isPrevOrderError)
222224 then throw(((("invalid order isPrevOrderError:" + toString(isPrevOrderError)) + " isNextOrderError:") + toString(isNextOrderError)))
223225 else WriteSet(generateDataEntryToAddOrder(price, newOrderId, i, prevOrder, nextOrder, firstOrder))
224226 }
225227 }
226228 }
227229
228230
229231 func computeCurrentDefaultOrder (id) = if ((id != currentDefaultOrder))
230232 then currentDefaultOrder
231233 else ""
232234
233235
234236 @Callable(i)
235237 func addLiquidationOrderWithPrice (price,prevOrder) = internalAddLiquidationOrder(i, price, prevOrder)
236238
237239
238240
239241 @Callable(i)
240242 func addLiquidationOrder () = internalAddLiquidationOrder(i, 100, currentDefaultOrder)
241243
242244
243245
244246 @Callable(i)
245247 func cancelOrder (orderId) = {
246248 let owner = getOrderOwner(orderId)
247249 let amount = (getOrderTotal(orderId) - getOrderFilledTotal(orderId))
248250 let caller = toString(i.caller)
249251 let nextOrder = getNextOrder(orderId)
250252 let prevOrder = getPrevOrder(orderId)
251253 let isDefaultOrder = (orderId == currentDefaultOrder)
252254 let isPrevCanBecomeDefault = (getOrderStatus(prevOrder) == NEW)
253255 let newDefaultOrder = if (isDefaultOrder)
254256 then if (isPrevCanBecomeDefault)
255257 then prevOrder
256258 else ""
257259 else currentDefaultOrder
258260 if (isBlocked)
259261 then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles")
260262 else if ((owner != caller))
261263 then throw("permission denied")
262264 else if ((getOrderStatus(orderId) != NEW))
263265 then throw("invalid order status")
264266 else ScriptResult(WriteSet([DataEntry(CurrentDefaultOrderKey, newDefaultOrder), DataEntry(FirstOrderKey, if ((firstOrder == orderId))
265267 then nextOrder
266268 else firstOrder), DataEntry(getNextOrderKey(prevOrder), nextOrder), DataEntry(getPrevOrderKey(nextOrder), prevOrder), DataEntry(getOrderStatusKey(orderId), CANCELED)]), TransferSet([ScriptTransfer(i.caller, amount, bondAssetId)]))
267269 }
268270
269271
270272
271273 @Callable(i)
272274 func liquidateBond () = {
273275 let liquidationBalance = assetBalance(this, neutrinoAssetId)
274276 let surplusPositive = if ((0 >= surplus))
275277 then 0
276278 else surplus
277279 let usdnAmount = if ((surplusPositive >= liquidationBalance))
278280 then liquidationBalance
279281 else surplusPositive
280282 let returnAmount = if ((surplusPositive >= liquidationBalance))
281283 then 0
282284 else (liquidationBalance - surplusPositive)
283285 if (isBlocked)
284286 then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles")
285287 else if ((liquidationBalance == 0))
286288 then throw("without base tokens to liquidate")
287289 else if ((returnAmount > 0))
288290 then TransferSet([ScriptTransfer(neutrinoContract, returnAmount, neutrinoAssetId)])
289291 else if ((firstOrder == ""))
290292 then throw("empty orderbook")
291293 else {
292294 let nextOrder = getNextOrder(firstOrder)
293295 let filledTotal = getOrderFilledTotal(firstOrder)
294- let orderPrice = getOrderPrice(firstOrder)
296+ let nsbt2UsdnPrice = getOrderPrice(firstOrder)
295297 let remainedTotal = (getOrderTotal(firstOrder) - filledTotal)
296- let totalUSDNRequiredToFillOrder = fraction(remainedTotal, orderPrice, 100)
298+ let totalUSDNRequiredToFillOrder = fraction(remainedTotal, nsbt2UsdnPrice, 100)
297299 let isOrderFullyFilable = (usdnAmount >= totalUSDNRequiredToFillOrder)
298300 let fillableOrderAmount = if (isOrderFullyFilable)
299301 then totalUSDNRequiredToFillOrder
300302 else usdnAmount
301- let finalNBTFillable = fraction(fillableOrderAmount, 100, orderPrice)
302- let nbTokensLiquidateCondition = (fraction((surplus + neutrinoSupply), 100, neutrinoSupply) >= orderPrice)
303+ let finalNBTFillable = fraction(fillableOrderAmount, 100, nsbt2UsdnPrice)
304+ let nbTokensLiquidateCondition = (fraction((surplus + neutrinoSupply), 100, neutrinoSupply) >= nsbt2UsdnPrice)
303305 if (!(nbTokensLiquidateCondition))
304306 then throw(("innapropriate surplus: " + toString(surplus)))
305307 else {
306308 let isNothingToFillNow = (remainedTotal == 0)
307309 let isNothingToFillAtAll = ((filledTotal + finalNBTFillable) == getOrderTotal(firstOrder))
308310 let newStatus = if (if (isOrderFullyFilable)
309311 then if (isNothingToFillNow)
310312 then true
311313 else isNothingToFillAtAll
312314 else false)
313315 then FILLED
314316 else NEW
315317 ScriptResult(WriteSet([DataEntry(getPrevOrderKey(nextOrder), if ((newStatus == FILLED))
316318 then ""
317319 else firstOrder), DataEntry(FirstOrderKey, if ((newStatus == FILLED))
318320 then nextOrder
319321 else firstOrder), DataEntry(getOrderFilledTotalKey(firstOrder), (filledTotal + finalNBTFillable)), DataEntry(getOrderStatusKey(firstOrder), newStatus), DataEntry(CurrentDefaultOrderKey, computeCurrentDefaultOrder(firstOrder))]), TransferSet([ScriptTransfer(addressFromStringValue(getOrderOwner(firstOrder)), fillableOrderAmount, neutrinoAssetId), ScriptTransfer(neutrinoContract, finalNBTFillable, bondAssetId)]))
320322 }
321323 }
322324 }
323325
324326
325327
326328 @Callable(i)
327329 func updateReservesAndNeutrinoSupply () = {
328330 func getNumberByKeyInternal (key) = match getInteger(this, key) {
329331 case a: Int =>
330332 a
331333 case _ =>
332334 0
333335 }
334336
335337 let idx = getNumberByKeyInternal("updateReservesAndNeutrinoSupplyIdx")
336338 let newIdx = (idx + 1)
337339 WriteSet([DataEntry("updateReservesAndNeutrinoSupplyIdx", newIdx), DataEntry("reserve", reserve), DataEntry("neutrinoSupply", neutrinoSupply), DataEntry("surplus", surplus)])
338340 }
339341
340342
341343 @Verifier(tx)
342344 func verify () = {
343345 let pubKeyAdminsList = ["GXxmZaCigPgJsT6d1cLr8nUXA65nGX8V7FuAzzrY8wQE", "3xumx4hrPpeeoo79HLGbZCgfz95L39ZFdxxwWeSUC2Pu", "D4CqtK5fBsnzRo33ZMhrM7niLseDH2uRoK6weBq2JQ3A", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"]
344346 let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0])))
345347 then 1
346348 else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1])))
347349 then 1
348350 else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2])))
349351 then 1
350352 else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3])))
351353 then 2
352354 else 0))
353355 (count >= 3)
354356 }
355357

github/deemru/w8io/026f985 
50.56 ms