tx · 7FDLNAFmhXK1evijReWLFjM3urn7XrBU49LPDr3CiMss 3MsQwxepm5q2BG1PYUMwqoD2JLgKrACa3P2: -0.01400000 Waves 2020.04.11 09:18 [949341] smart account 3MsQwxepm5q2BG1PYUMwqoD2JLgKrACa3P2 > SELF 0.00000000 Waves
{ "type": 13, "id": "7FDLNAFmhXK1evijReWLFjM3urn7XrBU49LPDr3CiMss", "fee": 1400000, "feeAssetId": null, "timestamp": 1586585890894, "version": 1, "sender": "3MsQwxepm5q2BG1PYUMwqoD2JLgKrACa3P2", "senderPublicKey": "GQpgNnxYTNNWmyiXVfx9rpMV1hgft2HPhJ3CkWeLuxAt", "proofs": [ "2zdH3GDAkGMLG2GMCLFmukEAc9vEbv2cFH62fAG68E7H32pvQLZbdGcYeMxTuiTsrVCHqPqJty65KdTYAcnrY8bC" ], "script": "base64:AAIDAAAAAAAAACkIARIECgIICBIHCgUICAgBARIICgYICAgBAQgSBgoECAgIARIECgIIAQAAADgAAAAAB2JCaXRDTzIBAAAAICS5vPeQFg1II100BnJ39DNnWlTh001ZMTGPiOi4CeDRAAAAAAhzdGFydFF0eQAAAAAAAExLQAAAAAAIbm9tUHJpY2UAAAAAAAAAAAEAAAAAA3d2cwAAAAAABfXhAAAAAAAQc3VwcGxpZXJEaXNjb3VudAAAAAAAAAAADAAAAAAETk9ORQIAAAAEbm9uZQAAAAALT3duZXJQdWJLZXkBAAAAIOT5kr0qxAUdVllbsg32nwnU0gQ806lA/C0Ix5M0fVkpAAAAAAZpc3N1ZXIJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVQmXeqpNBOU0gXTRoLnFygaPj7BjtrRIP0AAAAABGVBZGQJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVTK9zs+5y/RVeIPrfhFsyze+43QDUVrfW8AAAAABHBBZGQJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVTUPeuO2Y1p2TpK+OH14WsDuVCV2jcMFFQAAAAAA2lndgAAAAAAAAAAEgAAAAADY1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AAAQgICAUAAAACdHgAAAAJc2VsbE9yZGVyAAAACWFzc2V0UGFpcgAAAApwcmljZUFzc2V0BgkBAAAAASEAAAABCQEAAAAJaXNEZWZpbmVkAAAAAQgICAUAAAACdHgAAAAJc2VsbE9yZGVyAAAACWFzc2V0UGFpcgAAAAthbW91bnRBc3NldAUAAAAJd2l0aFdhdmVzB+J783s=", "chainId": 84, "height": 949341, "spentComplexity": 0 } View: original | compacted Prev: 7CeJes8NNz9WXBmNeFb55nBSATErXTfz3yDkHXCiet8T Next: CRs8xuRcmriQqGC4vgmAevFjvppnEGTLGq4m7fovuMTV Diff:
Old | New | Differences | |
---|---|---|---|
192 | 192 | ||
193 | 193 | ||
194 | 194 | @Callable(i) | |
195 | + | func purchase (item,userName,userCountry,userDiscount,orderQty) = { | |
196 | + | let pmt = extract(i.payment) | |
197 | + | if (isDefined(pmt.assetId)) | |
198 | + | then throw("you can adquire cBitCO2 only by Waves tokens") | |
199 | + | else { | |
200 | + | let supplier = match getString(this, getKeyItemSupplier(item)) { | |
201 | + | case a: String => | |
202 | + | a | |
203 | + | case _ => | |
204 | + | NONE | |
205 | + | } | |
206 | + | let preIcoQty = match getInteger(this, getKeyBalanceQtySupplier(item)) { | |
207 | + | case a: Int => | |
208 | + | a | |
209 | + | case _ => | |
210 | + | startQty | |
211 | + | } | |
212 | + | let balanceSupplier = match getInteger(this, getKeyBalanceSupplier(supplier)) { | |
213 | + | case a: Int => | |
214 | + | a | |
215 | + | case _ => | |
216 | + | 0 | |
217 | + | } | |
218 | + | let userAddress = toBase58String(i.caller.bytes) | |
219 | + | let currentTokenPrice = ((((100 - userDiscount) * nomPrice) * wvs) / 100) | |
220 | + | let totalAmount = (orderQty * currentTokenPrice) | |
221 | + | if ((totalAmount > pmt.amount)) | |
222 | + | then throw("Payment Amount can't be less than item Purchase Order") | |
223 | + | else if ((pmt.amount > totalAmount)) | |
224 | + | then throw("Payment Amount can't be higher than item Purchase Order") | |
225 | + | else ScriptResult(WriteSet([DataEntry(getKeyUserItemCounter(userAddress, item), (getValueUserItemCounter(userAddress, item) + 1)), DataEntry(getKeyBalanceQtySupplier(item), (preIcoQty - orderQty)), DataEntry(getKeyItemUser(item), userName), DataEntry(getKeyItemUserData(item), userCountry), DataEntry(getKeyItemDiscountUser(item), userDiscount), DataEntry(getKeyItemUserOrderQty(item), orderQty), DataEntry("tokenPrice/Supplier, wvs", (nomPrice * wvs)), DataEntry("tokenPrice/User, wvs", currentTokenPrice), DataEntry("investedAmount/User, wvs", totalAmount), DataEntry("purchaseOrder/Status:", "confirmed"), DataEntry(getKeyBalanceSupplier(supplier), (balanceSupplier + pmt.amount))]), TransferSet([ScriptTransfer(addressFromStringValue(userAddress), orderQty, bBitCO2)])) | |
226 | + | } | |
227 | + | } | |
228 | + | ||
229 | + | ||
230 | + | ||
231 | + | @Callable(i) | |
195 | 232 | func AddSupplierToken (title,name,country,preIcoQty,supplierDiscount,supplierData) = { | |
196 | 233 | let supplier = toBase58String(i.caller.bytes) | |
197 | 234 | let item = getKeyItem(supplier, title) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let bBitCO2 = base58'3UMwob2PDKVYmDMZZdT9ijK7EdRJZKFoBLCAXnwKtNN4' | |
5 | 5 | ||
6 | 6 | let startQty = 5000000 | |
7 | 7 | ||
8 | 8 | let nomPrice = 1 | |
9 | 9 | ||
10 | 10 | let wvs = 100000000 | |
11 | 11 | ||
12 | 12 | let supplierDiscount = 12 | |
13 | 13 | ||
14 | 14 | let NONE = "none" | |
15 | 15 | ||
16 | 16 | let OwnerPubKey = base58'GQpgNnxYTNNWmyiXVfx9rpMV1hgft2HPhJ3CkWeLuxAt' | |
17 | 17 | ||
18 | 18 | let issuer = Address(base58'3MsQwxepm5q2BG1PYUMwqoD2JLgKrACa3P2') | |
19 | 19 | ||
20 | 20 | let eAdd = Address(base58'3N8RGScPyKYySaXd5Z3VcpnttH2uBeMpSy4') | |
21 | 21 | ||
22 | 22 | let pAdd = Address(base58'3N9GKCsktAL7oPFmaKsgPBoDfu3ijk23Vmm') | |
23 | 23 | ||
24 | 24 | let igv = 18 | |
25 | 25 | ||
26 | 26 | let cPB = 88 | |
27 | 27 | ||
28 | 28 | let uIP = 5 | |
29 | 29 | ||
30 | 30 | let pIP = 10 | |
31 | 31 | ||
32 | 32 | let sIP = 1 | |
33 | 33 | ||
34 | 34 | let eIP = 1 | |
35 | 35 | ||
36 | 36 | func getNumberByKey (key) = { | |
37 | 37 | let num = match getInteger(this, key) { | |
38 | 38 | case a: Int => | |
39 | 39 | a | |
40 | 40 | case _ => | |
41 | 41 | 0 | |
42 | 42 | } | |
43 | 43 | num | |
44 | 44 | } | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | func getStrByKey (key) = { | |
48 | 48 | let str = match getString(this, key) { | |
49 | 49 | case a: String => | |
50 | 50 | a | |
51 | 51 | case _ => | |
52 | 52 | NONE | |
53 | 53 | } | |
54 | 54 | str | |
55 | 55 | } | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func getKeyItem (supplier,title) = ("A y G:" + toBase58String(sha256(toBytes((supplier + title))))) | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func getKeyItemSupplier (item) = (item + "_P SAC") | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func getValueItemSupplier (item) = getStrByKey(getKeyItemSupplier(item)) | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func getKeySupplier (supplier) = (supplier + "_P SAC") | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func getValueSupplier (supplier) = getStrByKey(getKeySupplier(supplier)) | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func getKeyProject (pA) = (pA + "_A-PreICO") | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func getValueProject (pA) = getStrByKey(getKeyProject(pA)) | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func getKeyUserItemCounter (user,item) = "Order_№:" | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func getValueUserItemCounter (user,item) = getNumberByKey(getKeyUserItemCounter(user, item)) | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func getKeyItemUser (item) = "UserName:" | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func getValueItemUser (item) = getStrByKey(getKeyItemUser(item)) | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func getKeyUserCountry (item) = "UserPais:" | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func getValueUserCountry (item) = getStrByKey(getKeyUserCountry(item)) | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func getKeyItemUD (item) = "UD:" | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func getKeyBalanceSupplier (supplier) = "Seller_Balance,_aBitCO2" | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | func getValueBalanceSupplier (supplier) = getNumberByKey(getKeyBalanceSupplier(supplier)) | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | func getKeyUI (item) = "UI,_wvs:" | |
107 | 107 | ||
108 | 108 | ||
109 | 109 | func getValueUI (item) = getNumberByKey(getKeyUI(item)) | |
110 | 110 | ||
111 | 111 | ||
112 | 112 | func getKeyUBI (item) = "UBI,_BitCO2:" | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | func getValueUBI (item) = getNumberByKey(getKeyUBI(item)) | |
116 | 116 | ||
117 | 117 | ||
118 | 118 | func getKeyPI (item) = "PI,_%:" | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | func getValuePI (item) = getNumberByKey(getKeyPI(item)) | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | func getKeySI (item) = "SI,_%:" | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | func getValueSI (item) = getNumberByKey(getKeySI(item)) | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | func getKeyEI (eA) = "EI,_%:" | |
131 | 131 | ||
132 | 132 | ||
133 | 133 | func getValueEI (eA) = getNumberByKey(getKeyEI(eA)) | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | func getKeyItemUserData (item) = "UserCountry:" | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | func getKeyItemDiscountUser (item) = "UserDiscount, %:" | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func getValueItemDiscountUser (item) = getNumberByKey(getKeyItemDiscountUser(item)) | |
143 | 143 | ||
144 | 144 | ||
145 | 145 | func getKeyItemUserOrderQty (item) = "Order_qty,_tokens:" | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | func getValueItemUserOrderQty (item) = getNumberByKey(getKeyItemUserOrderQty(item)) | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func getKeyBalanceQtySupplier (item) = "Balance/Saldo, tokens:" | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func getValueBalanceQtySupplier (item) = getNumberByKey(getKeyBalanceQtySupplier(item)) | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | func getKeyItemPriceSupplier (item) = "_waves" | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | func getValueItemPriceSupplier (item) = getNumberByKey(getKeyItemPriceSupplier(item)) | |
161 | 161 | ||
162 | 162 | ||
163 | 163 | func getKeyItemDiscountSupplier (item) = "SupplierDiscount, max_%:" | |
164 | 164 | ||
165 | 165 | ||
166 | 166 | func getValueItemDiscountSupplier (item) = getNumberByKey(getKeyItemDiscountSupplier(item)) | |
167 | 167 | ||
168 | 168 | ||
169 | 169 | func getKeyItemData (item) = "description: " | |
170 | 170 | ||
171 | 171 | ||
172 | 172 | @Callable(i) | |
173 | 173 | func deposit (title,supplierData) = { | |
174 | 174 | let pmt = extract(i.payment) | |
175 | 175 | if ((pmt.assetId != bBitCO2)) | |
176 | 176 | then throw("Use bBitCO2 tokens only for the wallet deposit") | |
177 | 177 | else { | |
178 | 178 | let supplier = toBase58String(i.caller.bytes) | |
179 | 179 | let currentAmount = match getInteger(this, supplier) { | |
180 | 180 | case a: Int => | |
181 | 181 | a | |
182 | 182 | case _ => | |
183 | 183 | startQty | |
184 | 184 | } | |
185 | 185 | let newAmount = (currentAmount + pmt.amount) | |
186 | 186 | if ((0 >= newAmount)) | |
187 | 187 | then throw("No hay BitCO2 in your balance") | |
188 | 188 | else WriteSet([DataEntry(supplier, newAmount)]) | |
189 | 189 | } | |
190 | 190 | } | |
191 | 191 | ||
192 | 192 | ||
193 | 193 | ||
194 | 194 | @Callable(i) | |
195 | + | func purchase (item,userName,userCountry,userDiscount,orderQty) = { | |
196 | + | let pmt = extract(i.payment) | |
197 | + | if (isDefined(pmt.assetId)) | |
198 | + | then throw("you can adquire cBitCO2 only by Waves tokens") | |
199 | + | else { | |
200 | + | let supplier = match getString(this, getKeyItemSupplier(item)) { | |
201 | + | case a: String => | |
202 | + | a | |
203 | + | case _ => | |
204 | + | NONE | |
205 | + | } | |
206 | + | let preIcoQty = match getInteger(this, getKeyBalanceQtySupplier(item)) { | |
207 | + | case a: Int => | |
208 | + | a | |
209 | + | case _ => | |
210 | + | startQty | |
211 | + | } | |
212 | + | let balanceSupplier = match getInteger(this, getKeyBalanceSupplier(supplier)) { | |
213 | + | case a: Int => | |
214 | + | a | |
215 | + | case _ => | |
216 | + | 0 | |
217 | + | } | |
218 | + | let userAddress = toBase58String(i.caller.bytes) | |
219 | + | let currentTokenPrice = ((((100 - userDiscount) * nomPrice) * wvs) / 100) | |
220 | + | let totalAmount = (orderQty * currentTokenPrice) | |
221 | + | if ((totalAmount > pmt.amount)) | |
222 | + | then throw("Payment Amount can't be less than item Purchase Order") | |
223 | + | else if ((pmt.amount > totalAmount)) | |
224 | + | then throw("Payment Amount can't be higher than item Purchase Order") | |
225 | + | else ScriptResult(WriteSet([DataEntry(getKeyUserItemCounter(userAddress, item), (getValueUserItemCounter(userAddress, item) + 1)), DataEntry(getKeyBalanceQtySupplier(item), (preIcoQty - orderQty)), DataEntry(getKeyItemUser(item), userName), DataEntry(getKeyItemUserData(item), userCountry), DataEntry(getKeyItemDiscountUser(item), userDiscount), DataEntry(getKeyItemUserOrderQty(item), orderQty), DataEntry("tokenPrice/Supplier, wvs", (nomPrice * wvs)), DataEntry("tokenPrice/User, wvs", currentTokenPrice), DataEntry("investedAmount/User, wvs", totalAmount), DataEntry("purchaseOrder/Status:", "confirmed"), DataEntry(getKeyBalanceSupplier(supplier), (balanceSupplier + pmt.amount))]), TransferSet([ScriptTransfer(addressFromStringValue(userAddress), orderQty, bBitCO2)])) | |
226 | + | } | |
227 | + | } | |
228 | + | ||
229 | + | ||
230 | + | ||
231 | + | @Callable(i) | |
195 | 232 | func AddSupplierToken (title,name,country,preIcoQty,supplierDiscount,supplierData) = { | |
196 | 233 | let supplier = toBase58String(i.caller.bytes) | |
197 | 234 | let item = getKeyItem(supplier, title) | |
198 | 235 | if ((0 >= preIcoQty)) | |
199 | 236 | then throw("Sorry, insufficient token offer") | |
200 | 237 | else WriteSet([DataEntry(("Supplier:_" + getKeySupplier(item)), supplier), DataEntry(("Title:_" + supplier), title), DataEntry(("ProjectName:_" + supplier), name), DataEntry(("Country:_" + supplier), country), DataEntry(getKeyBalanceQtySupplier(item), preIcoQty), DataEntry(("NomTokenPrice:_" + getKeyItemPriceSupplier(item)), (nomPrice * wvs)), DataEntry(("Max_Descuento_ofrecido:" + getKeyItemDiscountSupplier(item)), supplierDiscount), DataEntry(("Development:_" + getKeyItemData(item)), supplierData)]) | |
201 | 238 | } | |
202 | 239 | ||
203 | 240 | ||
204 | 241 | ||
205 | 242 | @Callable(i) | |
206 | 243 | func purchaseGTS (item,userName,userDocument,totalAmount) = { | |
207 | 244 | let pmt = extract(i.payment) | |
208 | 245 | if (isDefined(pmt.assetId)) | |
209 | 246 | then throw("you can adquire Products only by Waves tokens") | |
210 | 247 | else { | |
211 | 248 | let supplier = match getString(this, getKeyItemSupplier(item)) { | |
212 | 249 | case a: String => | |
213 | 250 | a | |
214 | 251 | case _ => | |
215 | 252 | NONE | |
216 | 253 | } | |
217 | 254 | let preIcoQty = match getInteger(this, getKeyBalanceQtySupplier(item)) { | |
218 | 255 | case a: Int => | |
219 | 256 | a | |
220 | 257 | case _ => | |
221 | 258 | startQty | |
222 | 259 | } | |
223 | 260 | let balanceSupplier = match getInteger(this, getKeyBalanceSupplier(supplier)) { | |
224 | 261 | case a: Int => | |
225 | 262 | a | |
226 | 263 | case _ => | |
227 | 264 | 0 | |
228 | 265 | } | |
229 | 266 | let userAddress = toBase58String(i.caller.bytes) | |
230 | 267 | let subTotal = (totalAmount - ((igv * totalAmount) / 100)) | |
231 | 268 | let uI = ((subTotal * uIP) / 100) | |
232 | 269 | let uBI = (uI / cPB) | |
233 | 270 | let pI = ((subTotal * pIP) / 100) | |
234 | 271 | let eI = ((subTotal * eIP) / 100) | |
235 | 272 | let eBI = ((subTotal * eIP) / (cPB * 100)) | |
236 | 273 | let sI = ((totalAmount - pI) - eI) | |
237 | 274 | let sBI = ((subTotal * sIP) / (cPB * 100)) | |
238 | 275 | if ((totalAmount > pmt.amount)) | |
239 | 276 | then throw("Payment Amount can't be less than item Purchase Order") | |
240 | 277 | else if ((pmt.amount > totalAmount)) | |
241 | 278 | then throw("Payment Amount can't be higher than item Purchase Order") | |
242 | 279 | else ScriptResult(WriteSet([DataEntry(getKeyUserItemCounter(userAddress, item), (getValueUserItemCounter(userAddress, item) + 1)), DataEntry(getKeyItemUser(item), userName), DataEntry(getKeyItemUD(item), userDocument), DataEntry("Payment_amount,_wvs", totalAmount), DataEntry("Imp, %", igv), DataEntry("STtl, wvs", subTotal), DataEntry("CP 1 B, wvs", (cPB * 1000000)), DataEntry(getKeyUI(item), uI), DataEntry("UBI", uBI), DataEntry(getKeyPI(item), pI), DataEntry("EcSys", eBI), DataEntry(("Order_Status:_" + userAddress), "confirmed"), DataEntry(getKeySI(item), sI), DataEntry("SBI: b", sBI), DataEntry(getKeyBalanceSupplier(supplier), (balanceSupplier + pmt.amount))]), TransferSet([ScriptTransfer(i.caller, uBI, bBitCO2), ScriptTransfer(pAdd, pI, unit), ScriptTransfer(issuer, sI, unit), ScriptTransfer(issuer, sBI, bBitCO2), ScriptTransfer(eAdd, eI, unit), ScriptTransfer(eAdd, eBI, bBitCO2)])) | |
243 | 280 | } | |
244 | 281 | } | |
245 | 282 | ||
246 | 283 | ||
247 | 284 | ||
248 | 285 | @Callable(i) | |
249 | 286 | func withdraw (item,amount) = { | |
250 | 287 | let userAddress = toBase58String(i.caller.bytes) | |
251 | 288 | let supplier = match getString(this, getKeyItemSupplier(item)) { | |
252 | 289 | case a: String => | |
253 | 290 | a | |
254 | 291 | case _ => | |
255 | 292 | NONE | |
256 | 293 | } | |
257 | 294 | let preIcoQty = match getInteger(this, getKeyBalanceQtySupplier(item)) { | |
258 | 295 | case a: Int => | |
259 | 296 | a | |
260 | 297 | case _ => | |
261 | 298 | startQty | |
262 | 299 | } | |
263 | 300 | let newAmount = (preIcoQty - amount) | |
264 | 301 | if ((0 > amount)) | |
265 | 302 | then throw("Can't withdraw negative amount") | |
266 | 303 | else if ((0 >= newAmount)) | |
267 | 304 | then throw("Not enought /insuficiente balance") | |
268 | 305 | else ScriptResult(WriteSet([DataEntry(item, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, bBitCO2)])) | |
269 | 306 | } | |
270 | 307 | ||
271 | 308 | ||
272 | 309 | @Verifier(tx) | |
273 | 310 | func verify () = match tx { | |
274 | 311 | case t: SetScriptTransaction => | |
275 | 312 | sigVerify(tx.bodyBytes, tx.proofs[0], OwnerPubKey) | |
276 | 313 | case d: ReissueTransaction|DataTransaction => | |
277 | 314 | true | |
278 | 315 | case tx: TransferTransaction => | |
279 | 316 | true | |
280 | 317 | case tx: ExchangeTransaction => | |
281 | 318 | let withWaves = if (!(isDefined(tx.sellOrder.assetPair.priceAsset))) | |
282 | 319 | then true | |
283 | 320 | else !(isDefined(tx.sellOrder.assetPair.amountAsset)) | |
284 | 321 | withWaves | |
285 | 322 | case _ => | |
286 | 323 | false | |
287 | 324 | } | |
288 | 325 |
github/deemru/w8io/169f3d6 70.21 ms ◑