tx · 9WQMk5SDnGzAz3TYrkeD7UvSEeprmTe6x16St6EDLXtQ

3MovmZoJtqutkf49oGXHzABSMUQ7HU5Dcg7:  -0.01400000 Waves

2021.08.03 17:29 [1642285] smart account 3MovmZoJtqutkf49oGXHzABSMUQ7HU5Dcg7 > SELF 0.00000000 Waves

{ "type": 13, "id": "9WQMk5SDnGzAz3TYrkeD7UvSEeprmTe6x16St6EDLXtQ", "fee": 1400000, "feeAssetId": null, "timestamp": 1628001028500, "version": 2, "chainId": 84, "sender": "3MovmZoJtqutkf49oGXHzABSMUQ7HU5Dcg7", "senderPublicKey": "3tp5fNYyPi4jMnkf6s1k4kBqvJ7nm57SxzvLyi8RkxT2", "proofs": [ "5umiZqbEbQJoYEj9pfQ7h8qtYkNT8GuyFY4B2LVZoTDunSxzZCt8yjRA7mFrxTX8Xoo6VWzsBpTR66qCzAjjFdMT" ], "script": "base64:AAIEAAAAAAAAAD4IAhIDCgEIEgYKBAgBCAESBwoFCAgBCAESAwoBCBIDCgEIEgMKAQgSBAoCCAgSABIAEgQKAggIEgUKAwgICAAAAD4AAAAABE5PTkUCAAAABE5PTkUAAAAABlZPVEVSUwAAAAAAAAAAAwAAAAAGUVVPUlVNAAAAAAAAAAACAAAAAAhGRUFUVVJFRAIAAAAIZmVhdHVyZWQAAAAACERFTElTVEVEAgAAAAhkZWxpc3RlZAAAAAAGVk9USU5HAgAAAAZ2b3RpbmcAAAAABlJFVkVBTAIAAAAGcmV2ZWFsAAAAAAhBUFBST1ZBTAIAAAAIYXBwcm92YWwAAAAACFJFSkVDVEVEAgAAAAhyZWplY3RlZAAAAAAIQUNDRVBURUQCAAAACGFjY2VwdGVkAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhBQAAAAROT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gAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABBJc3N1ZVRyYW5zYWN0aW9uBAAAAAF0BQAAAAckbWF0Y2gwCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAABdAUAAAAHJG1hdGNoMAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkHKkOB0Q==", "height": 1642285, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 93aipbv2S6caXcT95GMeXibdLBgEh91evNLsd7RuCybA Next: 8feNKHbNMUGHt7nPTBYdYaggJpNyAW1HTMiJoHYc2DyY Diff:
OldNewDifferences
257257 then throw(("You don't owned item " + item))
258258 else {
259259 let soldCounter = getValueItemSoldCounter(item)
260- if ((soldCounter > 0))
260+ if ((soldCounter == 0))
261261 then [DeleteEntry(getKeyItemSupplier(item)), DeleteEntry(getKeyItemTitle(item)), DeleteEntry(getKeyItemPrice(item)), DeleteEntry(getKeyItemData(item)), DeleteEntry(getKeyItemExpireDate(item))]
262262 else [BooleanEntry(getKeyItemRemoved(item), true)]
263263 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let NONE = "NONE"
55
66 let VOTERS = 3
77
88 let QUORUM = 2
99
1010 let FEATURED = "featured"
1111
1212 let DELISTED = "delisted"
1313
1414 let VOTING = "voting"
1515
1616 let REVEAL = "reveal"
1717
1818 let APPROVAL = "approval"
1919
2020 let REJECTED = "rejected"
2121
2222 let ACCEPTED = "accepted"
2323
2424 func getStringByKey (key) = match getString(this, key) {
2525 case a: String =>
2626 a
2727 case _ =>
2828 NONE
2929 }
3030
3131
3232 func getIntegerByKey (key) = match getInteger(this, key) {
3333 case a: Int =>
3434 a
3535 case _ =>
3636 0
3737 }
3838
3939
4040 func getKeySupplierAccount (account) = (account + "_account")
4141
4242
4343 func getSupplierAccount (account) = getStringByKey(getKeySupplierAccount(account))
4444
4545
4646 func getKeyItem (supplier,title) = {
4747 let supplierTitle = (supplier + title)
4848 ("item_" + toBase58String(sha256(toBytes(supplierTitle))))
4949 }
5050
5151
5252 func getKeyItemSupplier (item) = (item + "_owner")
5353
5454
5555 func getKeyItemTitle (item) = (item + "_title")
5656
5757
5858 func getKeyItemPrice (item) = (item + "_price")
5959
6060
6161 func getKeyItemData (item) = (item + "_data")
6262
6363
6464 func getKeyItemExpireDate (item) = (item + "_expiredate")
6565
6666
6767 func getKeyItemSoldCounter (item) = (item + "_sold")
6868
6969
7070 func getKeyItemRemoved (item) = (item + "_removed")
7171
7272
7373 func getKeyCommit (item,user) = (((item + "_") + user) + "_commit")
7474
7575
7676 func getKeyCommitsCount (item) = (item + "_cmtcnt")
7777
7878
7979 func getKeyReveal (item,user) = (((item + "_") + user) + "_reveal")
8080
8181
8282 func getKeyItemStatus (item) = (item + "_status")
8383
8484
8585 func getKeyVotesCount (item,vote) = ((item + "_res:") + vote)
8686
8787
8888 func getKeySupplierBalance (supplier) = (supplier + "_balance")
8989
9090
9191 func getKeySupplierAvailableBalance (supplier) = (supplier + "_available")
9292
9393
9494 func getKeyUserItemCounter (user,item) = (((user + "_") + item) + "_counter")
9595
9696
9797 func genPurchaseKey (supplier,item,user,counter) = ("purchase_" + toBase58String(sha256(toBytes(((((((supplier + "_") + item) + "_") + user) + "_") + toString(counter))))))
9898
9999
100100 func getKeyPurchaseStatus (purchase) = (purchase + "_status")
101101
102102
103103 func getKeyPurchaseItem (purchase) = (purchase + "_item")
104104
105105
106106 func getKeyPurchaseSupplier (purchase) = (purchase + "_supplier")
107107
108108
109109 func getKeyPurchaseUser (purchase) = (purchase + "_user")
110110
111111
112112 func getKeyPurchaseAmount (purchase) = (purchase + "_amount")
113113
114114
115115 func getKeyPurchaseTimestamp (purchase) = (purchase + "_timestamp")
116116
117117
118118 func getKeyPurchaseAssetId (purchase) = (purchase + "_assetId")
119119
120120
121121 func getKeyCouponPurchase (assetId) = (("coupon_" + assetId) + "_purchase")
122122
123123
124124 func getKeyCouponItem (assetId) = (("coupon_" + assetId) + "_item")
125125
126126
127127 func getValueSupplierBalance (supplier) = getIntegerByKey(getKeySupplierBalance(supplier))
128128
129129
130130 func getValueSupplierAvailableBalance (supplier) = getIntegerByKey(getKeySupplierAvailableBalance(supplier))
131131
132132
133133 func getValueUserItemCounter (user,item) = getIntegerByKey(getKeyUserItemCounter(user, item))
134134
135135
136136 func getValuePurchaseStatus (purchase) = getStringByKey(getKeyPurchaseStatus(purchase))
137137
138138
139139 func getValuePurchaseItem (purchase) = getStringValue(this, getKeyPurchaseItem(purchase))
140140
141141
142142 func getValuePurchaseSupplier (purchase) = getStringValue(this, getKeyPurchaseSupplier(purchase))
143143
144144
145145 func getValuePurchaseUser (purchase) = getStringValue(this, getKeyPurchaseUser(purchase))
146146
147147
148148 func getValuePurchaseAmount (purchase) = getIntegerValue(this, getKeyPurchaseAmount(purchase))
149149
150150
151151 func getValuePurchaseTimestamp (purchase) = getIntegerByKey(getKeyPurchaseTimestamp(purchase))
152152
153153
154154 func getValuePurchaseAssetId (purchase) = getStringByKey(getKeyPurchaseAssetId(purchase))
155155
156156
157157 func getValueItemPrice (item) = getIntegerValue(this, getKeyItemPrice(item))
158158
159159
160160 func getValueItemSupplier (item) = getStringByKey(getKeyItemSupplier(item))
161161
162162
163163 func getValueItemExpireTime (item) = getIntegerByKey(getKeyItemExpireDate(item))
164164
165165
166166 func getValueItemTitle (item) = getStringByKey(getKeyItemTitle(item))
167167
168168
169169 func getValueItemSoldCounter (item) = getIntegerByKey(getKeyItemSoldCounter(item))
170170
171171
172172 func getValueItemRemoved (item) = match getBoolean(this, getKeyItemRemoved(item)) {
173173 case b: Boolean =>
174174 b
175175 case _ =>
176176 false
177177 }
178178
179179
180180 func getValueCouponPurchase (assetId) = getStringByKey(getKeyCouponPurchase(assetId))
181181
182182
183183 func getValueCommit (item,user) = getStringByKey(getKeyCommit(item, user))
184184
185185
186186 func getValueCommitsCount (item) = getIntegerByKey(getKeyCommitsCount(item))
187187
188188
189189 func getValueReveal (item,user) = getStringByKey(getKeyReveal(item, user))
190190
191191
192192 func getValueItemStatus (item) = getStringByKey(getKeyItemStatus(item))
193193
194194
195195 func getValueVotesCount (item,vote) = getIntegerByKey(getKeyVotesCount(item, vote))
196196
197197
198198 @Callable(i)
199199 func registerSupplier (data) = {
200200 let supplier = toBase58String(i.caller.bytes)
201201 let account = getSupplierAccount(supplier)
202202 if ((account != NONE))
203203 then throw("This address has already registred as supplier")
204204 else [StringEntry(getKeySupplierAccount(supplier), data)]
205205 }
206206
207207
208208
209209 @Callable(i)
210210 func addItem (title,price,data,expire) = {
211211 let supplier = toBase58String(i.caller.bytes)
212212 let account = getSupplierAccount(supplier)
213213 let item = getKeyItem(supplier, title)
214214 if ((account == NONE))
215215 then throw("You should register as supplier to add an item")
216216 else if ((0 >= price))
217217 then throw("Purchase amount cannot be less than item price")
218218 else if ((getValueItemSupplier(item) != NONE))
219219 then throw("An item already exists")
220220 else [StringEntry(getKeyItemSupplier(item), supplier), StringEntry(getKeyItemTitle(item), title), IntegerEntry(getKeyItemPrice(item), price), StringEntry(getKeyItemData(item), data), IntegerEntry(getKeyItemExpireDate(item), expire)]
221221 }
222222
223223
224224
225225 @Callable(i)
226226 func updateItem (item,title,price,data,expire) = {
227227 let supplier = toBase58String(i.caller.bytes)
228228 let account = getSupplierAccount(supplier)
229229 let itemSupplier = getValueItemSupplier(item)
230230 let notFound = if ((getValueItemTitle(item) == NONE))
231231 then true
232232 else (getValueItemRemoved(item) == true)
233233 if ((account == NONE))
234234 then throw("You should register as supplier to remove an item")
235235 else if (notFound)
236236 then throw(("Item does not exists or has been removed " + item))
237237 else if ((supplier != itemSupplier))
238238 then throw(("You don't owned item " + item))
239239 else [StringEntry(getKeyItemTitle(item), title), IntegerEntry(getKeyItemPrice(item), price), StringEntry(getKeyItemData(item), data), IntegerEntry(getKeyItemExpireDate(item), expire)]
240240 }
241241
242242
243243
244244 @Callable(i)
245245 func removeItem (item) = {
246246 let supplier = toBase58String(i.caller.bytes)
247247 let account = getSupplierAccount(supplier)
248248 let itemSupplier = getValueItemSupplier(item)
249249 let notFound = if ((getValueItemTitle(item) == NONE))
250250 then true
251251 else (getValueItemRemoved(item) == true)
252252 if ((account == NONE))
253253 then throw("You should register as supplier to remove an item")
254254 else if (notFound)
255255 then throw(("Item does not exists or has been removed " + item))
256256 else if ((supplier != itemSupplier))
257257 then throw(("You don't owned item " + item))
258258 else {
259259 let soldCounter = getValueItemSoldCounter(item)
260- if ((soldCounter > 0))
260+ if ((soldCounter == 0))
261261 then [DeleteEntry(getKeyItemSupplier(item)), DeleteEntry(getKeyItemTitle(item)), DeleteEntry(getKeyItemPrice(item)), DeleteEntry(getKeyItemData(item)), DeleteEntry(getKeyItemExpireDate(item))]
262262 else [BooleanEntry(getKeyItemRemoved(item), true)]
263263 }
264264 }
265265
266266
267267
268268 @Callable(i)
269269 func purchase (item) = {
270270 let pmt = i.payments[0]
271271 let notFound = if ((getValueItemTitle(item) == NONE))
272272 then true
273273 else (getValueItemRemoved(item) == true)
274274 if (notFound)
275275 then throw(("Item does not exists or has been removed " + item))
276276 else if (isDefined(pmt.assetId))
277277 then throw("You can buy tokens only with Waves tokens")
278278 else {
279279 let user = toBase58String(i.caller.bytes)
280280 let price = getValueItemPrice(item)
281281 let supplier = getValueItemSupplier(item)
282282 let expire = getValueItemExpireTime(item)
283283 if (if ((expire > 0))
284284 then (lastBlock.timestamp >= expire)
285285 else false)
286286 then throw("Coupon expired")
287287 else if ((price > pmt.amount))
288288 then throw("Purchase amount cannot be less than item price")
289289 else if ((pmt.amount > price))
290290 then throw("Purchase amount cannot be higher than item price")
291291 else if ((supplier == NONE))
292292 then throw("Supplier does not exists")
293293 else {
294294 let keyUserItemCounter = getKeyUserItemCounter(user, item)
295295 let userItemCounter = (getValueUserItemCounter(user, item) + 1)
296296 let purchase = genPurchaseKey(supplier, item, user, userItemCounter)
297297 let keyPurchaseStatus = getKeyPurchaseStatus(purchase)
298298 let keyPurchaseItem = getKeyPurchaseItem(purchase)
299299 let keyPurchaseSupplier = getKeyPurchaseSupplier(purchase)
300300 let keyPurchaseUser = getKeyPurchaseUser(purchase)
301301 let keyPurchaseAmount = getKeyPurchaseAmount(purchase)
302302 let keyPurchaseTimestamp = getKeyPurchaseTimestamp(purchase)
303303 [IntegerEntry(keyUserItemCounter, userItemCounter), StringEntry(keyPurchaseStatus, APPROVAL), StringEntry(keyPurchaseItem, item), StringEntry(keyPurchaseSupplier, supplier), StringEntry(keyPurchaseUser, user), IntegerEntry(keyPurchaseAmount, pmt.amount), IntegerEntry(keyPurchaseTimestamp, lastBlock.timestamp)]
304304 }
305305 }
306306 }
307307
308308
309309
310310 @Callable(i)
311311 func rejectPurchase (purchase) = {
312312 let caller = toBase58String(i.caller.bytes)
313313 let status = getValuePurchaseStatus(purchase)
314314 let supplier = getValuePurchaseSupplier(purchase)
315315 let item = getValuePurchaseItem(purchase)
316316 let notFound = (item == NONE)
317317 if (notFound)
318318 then throw(("Purchase not found " + purchase))
319319 else if (if ((supplier == NONE))
320320 then true
321321 else (caller != supplier))
322322 then throw("Your are not the owner of this item")
323323 else if ((status != APPROVAL))
324324 then throw("You cannot reject this purchased")
325325 else {
326326 let keyPurchaseStatus = getKeyPurchaseStatus(purchase)
327327 let keyPurchaseAmount = getKeyPurchaseAmount(purchase)
328328 let keySupplierBalance = getKeySupplierBalance(supplier)
329329 let keyItemSoldCounter = getKeyItemSoldCounter(item)
330330 let user = getValuePurchaseUser(purchase)
331331 let amount = getValuePurchaseAmount(purchase)
332332 let supplierBalance = (getValueSupplierBalance(supplier) - amount)
333333 let itemSoldCounter = (getValueItemSoldCounter(item) - 1)
334334 let address = addressFromStringValue(user)
335335 [StringEntry(keyPurchaseStatus, REJECTED), IntegerEntry(keyPurchaseAmount, 0), ScriptTransfer(address, amount, unit)]
336336 }
337337 }
338338
339339
340340
341341 @Callable(i)
342342 func acceptPurchase (purchase,couponAssetId) = {
343343 let caller = toBase58String(i.caller.bytes)
344344 let status = getValuePurchaseStatus(purchase)
345345 let supplier = getValuePurchaseSupplier(purchase)
346346 let item = getValuePurchaseItem(purchase)
347347 let expire = getValueItemExpireTime(item)
348348 let notFound = (item == NONE)
349349 if (notFound)
350350 then throw(("Purchase not found " + purchase))
351351 else if (if ((supplier == NONE))
352352 then true
353353 else (caller != supplier))
354354 then throw("Your are not the owner of this item")
355355 else if ((status != APPROVAL))
356356 then throw("You cannot reject this purchased")
357357 else if (if ((expire > 0))
358358 then (lastBlock.timestamp >= expire)
359359 else false)
360360 then throw("Coupon expired")
361361 else {
362362 let keyPurchaseStatus = getKeyPurchaseStatus(purchase)
363363 let keyPurchaseAssetId = getKeyPurchaseAssetId(purchase)
364364 let keySupplierBalance = getKeySupplierBalance(supplier)
365365 let keyItemSoldCounter = getKeyItemSoldCounter(item)
366366 let keyCouponPurchase = getKeyCouponPurchase(couponAssetId)
367367 let keyCouponItem = getKeyCouponItem(couponAssetId)
368368 let amount = getValuePurchaseAmount(purchase)
369369 let supplierBalance = (getValueSupplierBalance(supplier) + amount)
370370 let itemSoldCounter = (getValueItemSoldCounter(item) + 1)
371371 let user = getValuePurchaseUser(purchase)
372372 let address = addressFromStringValue(user)
373373 [StringEntry(keyPurchaseStatus, ACCEPTED), StringEntry(keyCouponPurchase, purchase), StringEntry(keyCouponItem, item), StringEntry(keyPurchaseAssetId, couponAssetId), IntegerEntry(keySupplierBalance, supplierBalance), IntegerEntry(keyItemSoldCounter, itemSoldCounter)]
374374 }
375375 }
376376
377377
378378
379379 @Callable(i)
380380 func burn () = {
381381 let caller = toBase58String(i.caller.bytes)
382382 let pmt = if ((size(i.payments) == 1))
383383 then i.payments[0]
384384 else throw("An attached coupon is required as payment[0]")
385385 if ((isDefined(pmt.assetId) == false))
386386 then throw("Need a coupon to burn")
387387 else {
388388 let assetId = match pmt.assetId {
389389 case e: ByteVector =>
390390 e
391391 case _ =>
392392 throw("Need a coupon to burn")
393393 }
394394 let asset = toBase58String(assetId)
395395 let purchase = getValueCouponPurchase(asset)
396396 let supplier = getValuePurchaseSupplier(purchase)
397397 if ((caller != supplier))
398398 then throw("Your are not the supplier for this coupon")
399399 else {
400400 let amount = getValuePurchaseAmount(purchase)
401401 let keySupplierAvailableBalance = getKeySupplierAvailableBalance(supplier)
402402 let availableBalance = (getValueSupplierAvailableBalance(supplier) + amount)
403403 [Burn(assetId, 1), IntegerEntry(keySupplierAvailableBalance, availableBalance)]
404404 }
405405 }
406406 }
407407
408408
409409
410410 @Callable(i)
411411 func withdraw () = {
412412 let supplier = toBase58String(i.caller.bytes)
413413 let account = getSupplierAccount(supplier)
414414 if ((account == NONE))
415415 then throw("You are not registred as supplier")
416416 else {
417417 let balance = getValueSupplierBalance(supplier)
418418 let available = getValueSupplierAvailableBalance(supplier)
419419 let amount = if ((0 > (balance - available)))
420420 then 0
421421 else available
422422 if ((amount == 0))
423423 then throw("Nothing to withdraw. You need to burn coupon to unlock balance")
424424 else {
425425 let keySupplierBalance = getKeySupplierBalance(supplier)
426426 let keySupplierAvailableBalance = getKeySupplierAvailableBalance(supplier)
427427 let newBalance = (balance - amount)
428428 [IntegerEntry(keySupplierBalance, newBalance), IntegerEntry(keySupplierAvailableBalance, 0), ScriptTransfer(i.caller, amount, unit)]
429429 }
430430 }
431431 }
432432
433433
434434
435435 @Callable(i)
436436 func voteCommit (item,hash) = {
437437 let user = toBase58String(i.caller.bytes)
438438 let commitsCount = getValueCommitsCount(item)
439439 let status = getValueItemStatus(item)
440440 if ((commitsCount >= VOTERS))
441441 then throw("Reached max number of voters")
442442 else if ((getValueCommit(item, user) != NONE))
443443 then throw("You voted already")
444444 else if ((getKeyItemSupplier(item) == NONE))
445445 then throw("Item does not exists")
446446 else if (if ((status != NONE))
447447 then (status != VOTING)
448448 else false)
449449 then throw("Voting is not active for this item now")
450450 else {
451451 let newStatus = if ((commitsCount == VOTERS))
452452 then REVEAL
453453 else VOTING
454454 [StringEntry(getKeyCommit(item, user), hash), IntegerEntry(getKeyCommitsCount(item), (commitsCount + 1)), StringEntry(getKeyItemStatus(item), newStatus)]
455455 }
456456 }
457457
458458
459459
460460 @Callable(i)
461461 func voteReveal (item,vote,salt) = {
462462 let user = toBase58String(i.caller.bytes)
463463 let status = getValueItemStatus(item)
464464 let newVotesCount = (getValueVotesCount(item, vote) + 1)
465465 let saltedVote = toBase58String(sha256(toBytes(((item + vote) + salt))))
466466 if ((saltedVote != getValueCommit(item, user)))
467467 then throw("Reveal data is not valid")
468468 else if ((VOTERS > getValueCommitsCount(item)))
469469 then throw("Max number of voters not reached")
470470 else if ((getValueReveal(item, user) != NONE))
471471 then throw("You voted already")
472472 else if (if ((status != VOTING))
473473 then (status != REVEAL)
474474 else false)
475475 then throw("Voting is not active for this item now")
476476 else if (if ((vote != FEATURED))
477477 then (vote != DELISTED)
478478 else false)
479479 then throw("Provided voting option is incorrect")
480480 else {
481481 let newStatus = if ((newVotesCount >= QUORUM))
482482 then vote
483483 else REVEAL
484484 [StringEntry(getKeyReveal(item, user), vote), IntegerEntry(getKeyVotesCount(item, user), newVotesCount), StringEntry(getKeyItemStatus(item), newStatus)]
485485 }
486486 }
487487
488488
489489 @Verifier(tx)
490490 func verify () = match tx {
491491 case t: SetScriptTransaction =>
492492 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
493493 case t: IssueTransaction =>
494494 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
495495 case t: TransferTransaction =>
496496 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
497497 case _ =>
498498 false
499499 }
500500

github/deemru/w8io/169f3d6 
71.95 ms