tx · 3Q1CXEN7yJVzHMQMHDMvnTC5iM7uvvN4ZBhT5WaVwyUj 3N4Z7j4oSNfJVUtP4kmMKbhZD5n4xPFpPAu: -0.01400000 Waves 2019.02.02 01:07 [476500] smart account 3N4Z7j4oSNfJVUtP4kmMKbhZD5n4xPFpPAu > SELF 0.00000000 Waves
{ "type": 13, "id": "3Q1CXEN7yJVzHMQMHDMvnTC5iM7uvvN4ZBhT5WaVwyUj", "fee": 1400000, "feeAssetId": null, "timestamp": 1549058872588, "version": 1, "sender": "3N4Z7j4oSNfJVUtP4kmMKbhZD5n4xPFpPAu", "senderPublicKey": "F3DbYSfYZz6arcD6Mst8HdWScxTeWvTvatC7jp4DGryX", "proofs": [ "254Mz5SweBPinRkD6GHzojt55zUHNS8EPwG9FRPcvNVng9vwGZe8Tz7ht7Mzr7pg1PYDVQT466aWrDyxDqiNZEdR" ], "script": "base64:AQQAAAACbWUIBQAAAAJ0eAAAAAZzZW5kZXIEAAAABm9yYWNsZQkBAAAAB2V4dHJhY3QAAAABCQEAAAARYWRkcmVzc0Zyb21TdHJpbmcAAAABAgAAACMzTkN6YVlUTkRHdFI4emY5eWZjcWVQRmpDcUZ4OVM1emhzNAQAAAAJZGF0YVR4RmVlAAAAAAAAD0JABAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAAKd2l0aGRyYXdUeAUAAAAHJG1hdGNoMAQAAAAEdHhJZAkBAAAAB2V4dHJhY3QAAAABCQAEHQAAAAIFAAAAAm1lCQACWAAAAAEJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAQQAAAAHJG1hdGNoMQkAA+gAAAABCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAEDCQAAAQAAAAIFAAAAByRtYXRjaDECAAAAE1RyYW5zZmVyVHJhbnNhY3Rpb24EAAAACXBheW1lbnRUeAUAAAAH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GyeGruTkHTk4ah3aJbDP2X 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 | let dataTxFee = 1000000 | |
6 | 6 | match tx { | |
7 | 7 | case withdrawTx: TransferTransaction => | |
8 | 8 | let txId = extract(getString(me, toBase58String(tx.proofs[1]))) | |
9 | 9 | match transactionById(tx.proofs[1]) { | |
10 | 10 | case paymentTx: TransferTransaction => | |
11 | 11 | let isPaymentTookPlace = if ((txId == toBase58String(tx.id))) | |
12 | 12 | then sigVerify(tx.bodyBytes, tx.proofs[0], paymentTx.senderPublicKey) | |
13 | 13 | else false | |
14 | 14 | let att = paymentTx.attachment | |
15 | 15 | let type = dropRightBytes(takeRightBytes(att, 2), 1) | |
16 | 16 | let val = takeRightBytes(att, 1) | |
17 | 17 | let key = dropRightBytes(att, 2) | |
18 | 18 | let valComplex = extract(getBinary(oracle, toBase58String(key))) | |
19 | 19 | let koeff = if ((type == drop(toBytes(0), 7))) | |
20 | 20 | then 35 | |
21 | 21 | else if ((type == drop(toBytes(1), 7))) | |
22 | 22 | then 1 | |
23 | 23 | else if ((type == drop(toBytes(2), 7))) | |
24 | 24 | then 1 | |
25 | 25 | else if ((type == drop(toBytes(3), 7))) | |
26 | 26 | then 1 | |
27 | 27 | else if ((type == drop(toBytes(4), 7))) | |
28 | 28 | then 2 | |
29 | 29 | else if ((type == drop(toBytes(5), 7))) | |
30 | 30 | then 2 | |
31 | 31 | else 0 | |
32 | 32 | let isAmountOk = (withdrawTx.amount == (((paymentTx.amount * koeff) - dataTxFee) - withdrawTx.fee)) | |
33 | 33 | let isInWaves = if (!(isDefined(withdrawTx.feeAssetId))) | |
34 | 34 | then !(isDefined(withdrawTx.assetId)) | |
35 | 35 | else false | |
36 | 36 | if (if (isPaymentTookPlace) | |
37 | 37 | then isAmountOk | |
38 | 38 | else false) | |
39 | 39 | then isInWaves | |
40 | 40 | else false | |
41 | 41 | case _ => | |
42 | 42 | false | |
43 | 43 | } | |
44 | 44 | case dtx: DataTransaction => | |
45 | 45 | let paymentTxIdStr = extract(dtx.data[0].key) | |
46 | 46 | let feesKey = (paymentTxIdStr + "_fees") | |
47 | 47 | let paymentTx = transactionById(fromBase58String(paymentTxIdStr)) | |
48 | 48 | let newFees = extract(getInteger(dtx.data, feesKey)) | |
49 | 49 | let oldFees = if (isDefined(getInteger(me, feesKey))) | |
50 | 50 | then extract(getInteger(me, feesKey)) | |
51 | 51 | else 0 | |
52 | 52 | let isFeeCorrect = (newFees == (oldFees + dtx.fee)) | |
53 | 53 | let isPaymentAlreadyMentioned = isDefined(getString(me, paymentTxIdStr)) | |
54 | 54 | let withdrawTransactionId = fromBase58String(extract(getString(me, paymentTxIdStr))) | |
55 | 55 | let isWithdrawExist = isDefined(transactionById(withdrawTransactionId)) | |
56 | 56 | match paymentTx { | |
57 | 57 | case paymentTx: TransferTransaction => | |
58 | 58 | let isDtxSignedByPayer = sigVerify(dtx.bodyBytes, dtx.proofs[0], paymentTx.senderPublicKey) | |
59 | 59 | if (if (if (if (!(isPaymentAlreadyMentioned)) | |
60 | 60 | then true | |
61 | 61 | else !(isWithdrawExist)) | |
62 | 62 | then isDtxSignedByPayer | |
63 | 63 | else false) | |
64 | 64 | then isFeeCorrect | |
65 | 65 | else false) | |
66 | 66 | then { | |
67 | 67 | let att = paymentTx.attachment | |
68 | 68 | let type = dropRightBytes(takeRightBytes(att, 2), 1) | |
69 | 69 | let val = takeRightBytes(att, 1) | |
70 | 70 | let key = dropRightBytes(att, 2) | |
71 | 71 | let heightRes = extract(getInteger(oracle, (toBase58String(key) + "height"))) | |
72 | 72 | let isCheater = (extract(transactionHeightById(paymentTx.id)) >= heightRes) | |
73 | 73 | let valComplex = extract(getBinary(oracle, toBase58String(key))) | |
74 | 74 | let koeff = if ((type == drop(toBytes(0), 7))) | |
75 | 75 | then 35 | |
76 | 76 | else if ((type == drop(toBytes(1), 7))) | |
77 | 77 | then 1 | |
78 | 78 | else if ((type == drop(toBytes(2), 7))) | |
79 | 79 | then 1 | |
80 | 80 | else if ((type == drop(toBytes(3), 7))) | |
81 | 81 | then 1 | |
82 | 82 | else if ((type == drop(toBytes(4), 7))) | |
83 | 83 | then 2 | |
84 | 84 | else if ((type == drop(toBytes(5), 7))) | |
85 | 85 | then 2 | |
86 | 86 | else 0 | |
87 | 87 | let ver = take(valComplex, 1) | |
88 | 88 | let valReal = if ((type == drop(toBytes(0), 7))) | |
89 | 89 | then drop(take(valComplex, 2), 1) | |
90 | 90 | else if ((type == drop(toBytes(1), 7))) | |
91 | 91 | then drop(take(valComplex, 3), 2) | |
92 | 92 | else if ((type == drop(toBytes(2), 7))) | |
93 | 93 | then drop(take(valComplex, 4), 3) | |
94 | 94 | else if ((type == drop(toBytes(3), 7))) | |
95 | 95 | then drop(take(valComplex, 5), 4) | |
96 | 96 | else if ((type == drop(toBytes(4), 7))) | |
97 | 97 | then drop(take(valComplex, 6), 5) | |
98 | 98 | else if ((type == drop(toBytes(5), 7))) | |
99 | 99 | then drop(take(valComplex, 7), 5) | |
100 | 100 | else toBytes(38) | |
101 | 101 | let isWin = if ((val == valReal)) | |
102 | 102 | then (val != toBytes(38)) | |
103 | 103 | else false | |
104 | 104 | isWin | |
105 | 105 | } | |
106 | 106 | else false | |
107 | 107 | case _ => | |
108 | 108 | false | |
109 | 109 | } | |
110 | 110 | case _ => | |
111 | 111 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
112 | 112 | } |
github/deemru/w8io/026f985 34.09 ms ◑