tx · Et5wC2vgp9NXw3Sy7nCMSvcy7Yo4N6VegS3PuG1qF6tA 3N4Z7j4oSNfJVUtP4kmMKbhZD5n4xPFpPAu: -0.01400000 Waves 2019.01.30 22:32 [473423] smart account 3N4Z7j4oSNfJVUtP4kmMKbhZD5n4xPFpPAu > SELF 0.00000000 Waves
{ "type": 13, "id": "Et5wC2vgp9NXw3Sy7nCMSvcy7Yo4N6VegS3PuG1qF6tA", "fee": 1400000, "feeAssetId": null, "timestamp": 1548876805740, "version": 1, "sender": "3N4Z7j4oSNfJVUtP4kmMKbhZD5n4xPFpPAu", "senderPublicKey": "F3DbYSfYZz6arcD6Mst8HdWScxTeWvTvatC7jp4DGryX", "proofs": [ "5DL7tG6XTmPgeqRyWLWABnyDDx1PepVvLP2vuwiYqvVmmm3kc3hkww5rbUYJr9KwgHgy4qSXFxVN6BEM9kX671QM" ], "script": "base64:AQQAAAACbWUIBQAAAAJ0eAAAAAZzZW5kZXIEAAAABm9yYWNsZQkBAAAAB2V4dHJhY3QAAAABCQEAAAARYWRkcmVzc0Zyb21TdHJpbmcAAAABAgAAACMzTkN6YVlUTkRHdFI4emY5eWZjcWVQRmpDcUZ4OVM1emhzNAQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAE1RyYW5zZmVyVHJhbnNhY3Rpb24EAAAACndpdGhkcmF3VHgFAAAAByRtYXRjaDAEAAAABHR4SWQJAQAAAAdleHRyYWN0AAAAAQkABB0AAAACBQAAAAJtZQkAAlgAAAABCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAEEAAAAByRtYXRjaDEJAAPoAAAAAQkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAABAwkAAAEAAAACBQAAAAckbWF0Y2gxAgAAABNUcmFuc2ZlclRyYW5zYWN0aW9uBAAAAAlwYXltZW50VHgFAAAAByRtYXRjaDEEAAAAEmlzUGF5bWVudFRvb2tQbGFjZ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BheWVyCQAB9AAAAAMIBQAAAANkdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAANkdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAAJcGF5bWVudFR4AAAAD3NlbmRlclB1YmxpY0tleQMDCQEAAAABIQAAAAEFAAAAGWlzUGF5bWVudEFscmVhZHlNZW50aW9uZWQGCQEAAAABIQAAAAEFAAAAD2lzV2l0aGRyYXdFeGlzdAUAAAASaXNEdHhTaWduZWRCeVBheWVyBwcJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5KrsUcw==", "chainId": 84, "height": 473423, "spentComplexity": 0 } View: original | compacted Prev: 5HEksdH47jo1ju1ejzHCVJhfA5kLwxDoCxaDM5z9A6Gn Next: BCQLfFh7cqhkDGJFHw8eBefQbaYLQYFb8zAygvTQFmLv Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 1 #-} | |
2 | 2 | {-# CONTENT_TYPE EXPRESSION #-} | |
3 | 3 | let me = tx.sender | |
4 | 4 | let oracle = extract(addressFromString("3NCzaYTNDGtR8zf9yfcqePFjCqFx9S5zhs4")) | |
5 | 5 | match tx { | |
6 | 6 | case withdrawTx: TransferTransaction => | |
7 | 7 | let txId = extract(getString(me, toBase58String(tx.proofs[1]))) | |
8 | 8 | match transactionById(tx.proofs[1]) { | |
9 | 9 | case paymentTx: TransferTransaction => | |
10 | 10 | let isPaymentTookPlace = if ((txId == toBase58String(tx.id))) | |
11 | 11 | then sigVerify(tx.bodyBytes, tx.proofs[0], paymentTx.senderPublicKey) | |
12 | 12 | else false | |
13 | 13 | let att = paymentTx.attachment | |
14 | 14 | let type = dropRightBytes(takeRightBytes(att, 2), 1) | |
15 | 15 | let val = takeRightBytes(att, 1) | |
16 | 16 | let key = dropRightBytes(att, 2) | |
17 | 17 | let valComplex = extract(getBinary(oracle, toBase58String(key))) | |
18 | 18 | let koeff = if ((type == drop(toBytes(0), 7))) | |
19 | 19 | then 35 | |
20 | 20 | else if ((type == drop(toBytes(1), 7))) | |
21 | 21 | then 1 | |
22 | 22 | else if ((type == drop(toBytes(2), 7))) | |
23 | 23 | then 1 | |
24 | 24 | else if ((type == drop(toBytes(3), 7))) | |
25 | 25 | then 1 | |
26 | 26 | else if ((type == drop(toBytes(4), 7))) | |
27 | 27 | then 2 | |
28 | 28 | else if ((type == drop(toBytes(5), 7))) | |
29 | 29 | then 2 | |
30 | 30 | else if ((type == drop(toBytes(6), 7))) | |
31 | 31 | then 2 | |
32 | 32 | else 0 | |
33 | 33 | let ver = take(valComplex, 1) | |
34 | 34 | let valReal = if ((type == drop(toBytes(0), 7))) | |
35 | 35 | then drop(take(valComplex, 2), 1) | |
36 | 36 | else if ((type == drop(toBytes(1), 7))) | |
37 | 37 | then drop(take(valComplex, 3), 2) | |
38 | 38 | else if ((type == drop(toBytes(2), 7))) | |
39 | 39 | then drop(take(valComplex, 4), 3) | |
40 | 40 | else if ((type == drop(toBytes(3), 7))) | |
41 | 41 | then drop(take(valComplex, 5), 4) | |
42 | 42 | else if ((type == drop(toBytes(4), 7))) | |
43 | 43 | then drop(take(valComplex, 6), 5) | |
44 | 44 | else if ((type == drop(toBytes(5), 7))) | |
45 | 45 | then drop(take(valComplex, 7), 5) | |
46 | 46 | else if ((type == drop(toBytes(6), 7))) | |
47 | 47 | then drop(take(valComplex, 8), 6) | |
48 | 48 | else toBytes(38) | |
49 | 49 | let isWin = if ((val == valReal)) | |
50 | 50 | then (val != toBytes(38)) | |
51 | 51 | else false | |
52 | 52 | let isAmountOk = (withdrawTx.amount == (paymentTx.amount * koeff)) | |
53 | 53 | if (if (isPaymentTookPlace) | |
54 | 54 | then isWin | |
55 | 55 | else false) | |
56 | 56 | then isAmountOk | |
57 | 57 | else false | |
58 | 58 | case _ => | |
59 | 59 | false | |
60 | 60 | } | |
61 | 61 | case dtx: DataTransaction => | |
62 | 62 | let paymentTxIdStr = extract(dtx.data[0].key) | |
63 | 63 | let paymentTx = transactionById(fromBase58String(paymentTxIdStr)) | |
64 | 64 | let isPaymentAlreadyMentioned = isDefined(getString(me, paymentTxIdStr)) | |
65 | 65 | let withdrawTransactionId = fromBase58String(extract(getString(me, paymentTxIdStr))) | |
66 | 66 | let isWithdrawExist = isDefined(transactionById(withdrawTransactionId)) | |
67 | 67 | match paymentTx { | |
68 | 68 | case paymentTx: TransferTransaction => | |
69 | 69 | let isDtxSignedByPayer = sigVerify(dtx.bodyBytes, dtx.proofs[0], paymentTx.senderPublicKey) | |
70 | 70 | if (if (!(isPaymentAlreadyMentioned)) | |
71 | 71 | then true | |
72 | 72 | else !(isWithdrawExist)) | |
73 | 73 | then isDtxSignedByPayer | |
74 | 74 | else false | |
75 | 75 | case _ => | |
76 | 76 | false | |
77 | 77 | } | |
78 | 78 | case _ => | |
79 | 79 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
80 | 80 | } |
github/deemru/w8io/169f3d6 32.32 ms ◑