tx · 6MDdQpzBLoHzBxAfej8fSKzrshwdCB781wS4mxR7hUCd 3N4Z7j4oSNfJVUtP4kmMKbhZD5n4xPFpPAu: -0.01400000 Waves 2019.01.30 23:22 [473475] smart account 3N4Z7j4oSNfJVUtP4kmMKbhZD5n4xPFpPAu > SELF 0.00000000 Waves
{ "type": 13, "id": "6MDdQpzBLoHzBxAfej8fSKzrshwdCB781wS4mxR7hUCd", "fee": 1400000, "feeAssetId": null, "timestamp": 1548879738064, "version": 1, "sender": "3N4Z7j4oSNfJVUtP4kmMKbhZD5n4xPFpPAu", "senderPublicKey": "F3DbYSfYZz6arcD6Mst8HdWScxTeWvTvatC7jp4DGryX", "proofs": [ "XgNKe5MeP3PKHJfSCEp2sVXJFwm4WvLo1fYtHS747Xf6dUydg19FdDjQ92BLcH8vLY1zzrGCDipoZRRfLZ5f1Ek" ], "script": "base64:AQQAAAACbWUIBQAAAAJ0eAAAAAZzZW5kZXIEAAAABm9yYWNsZQkBAAAAB2V4dHJhY3QAAAABCQEAAAARYWRkcmVzc0Zyb21TdHJpbmcAAAABAgAAACMzTkN6YVlUTkRHdFI4emY5eWZjcWVQRmpDcUZ4OVM1emhzNAQAAAAJZGF0YVR4RmVlAAAAAAAAD0JABAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAAKd2l0aGRyYXdUeAUAAAAHJG1hdGNoMAQAAAAEdHhJZAkBAAAAB2V4dHJhY3QAAAABCQAEHQAAAAIFAAAAAm1lCQACWAAAAAEJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAQQAAAAHJG1hdGNoMQkAA+gAAAABCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAEDCQAAAQAAAAIFAAAAByRtYXRjaDECAAAAE1RyYW5zZmVyVHJhbnNhY3Rpb24EAAAACXBheW1lbnRUeAUAAAAHJG1hdGNoM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 } View: original | compacted Prev: GkVfWHNu7Y41a5wwvMojUAPkBZSkfrYcT4RbJ58Sh1NE Next: GgkZ4iKbKtGhRKWLo8owD1EMbenWKp2hihHHFp2zjXmm Diff:
Old | New | Differences | |
---|---|---|---|
70 | 70 | case dtx: DataTransaction => | |
71 | 71 | let paymentTxIdStr = extract(dtx.data[0].key) | |
72 | 72 | let paymentTx = transactionById(fromBase58String(paymentTxIdStr)) | |
73 | - | let isFeeCorrect = (dtx.fee | |
73 | + | let isFeeCorrect = (dataTxFee >= dtx.fee) | |
74 | 74 | let isPaymentAlreadyMentioned = isDefined(getString(me, paymentTxIdStr)) | |
75 | 75 | let withdrawTransactionId = fromBase58String(extract(getString(me, paymentTxIdStr))) | |
76 | 76 | let isWithdrawExist = isDefined(transactionById(withdrawTransactionId)) |
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 keyforHeight = (key + fromBase58String("height")) | |
19 | 19 | let heightRes = extract(getInteger(oracle, toBase58String(key))) | |
20 | 20 | let isCheater = (extract(transactionHeightById(paymentTx.id)) >= heightRes) | |
21 | 21 | let valComplex = extract(getBinary(oracle, toBase58String(key))) | |
22 | 22 | let koeff = if ((type == drop(toBytes(0), 7))) | |
23 | 23 | then 35 | |
24 | 24 | else if ((type == drop(toBytes(1), 7))) | |
25 | 25 | then 1 | |
26 | 26 | else if ((type == drop(toBytes(2), 7))) | |
27 | 27 | then 1 | |
28 | 28 | else if ((type == drop(toBytes(3), 7))) | |
29 | 29 | then 1 | |
30 | 30 | else if ((type == drop(toBytes(4), 7))) | |
31 | 31 | then 2 | |
32 | 32 | else if ((type == drop(toBytes(5), 7))) | |
33 | 33 | then 2 | |
34 | 34 | else if ((type == drop(toBytes(6), 7))) | |
35 | 35 | then 2 | |
36 | 36 | else 0 | |
37 | 37 | let ver = take(valComplex, 1) | |
38 | 38 | let valReal = if ((type == drop(toBytes(0), 7))) | |
39 | 39 | then drop(take(valComplex, 2), 1) | |
40 | 40 | else if ((type == drop(toBytes(1), 7))) | |
41 | 41 | then drop(take(valComplex, 3), 2) | |
42 | 42 | else if ((type == drop(toBytes(2), 7))) | |
43 | 43 | then drop(take(valComplex, 4), 3) | |
44 | 44 | else if ((type == drop(toBytes(3), 7))) | |
45 | 45 | then drop(take(valComplex, 5), 4) | |
46 | 46 | else if ((type == drop(toBytes(4), 7))) | |
47 | 47 | then drop(take(valComplex, 6), 5) | |
48 | 48 | else if ((type == drop(toBytes(5), 7))) | |
49 | 49 | then drop(take(valComplex, 7), 5) | |
50 | 50 | else if ((type == drop(toBytes(6), 7))) | |
51 | 51 | then drop(take(valComplex, 8), 6) | |
52 | 52 | else toBytes(38) | |
53 | 53 | let isWin = if ((val == valReal)) | |
54 | 54 | then (val != toBytes(38)) | |
55 | 55 | else false | |
56 | 56 | let isAmountOk = (withdrawTx.amount == (((paymentTx.amount * koeff) - dataTxFee) - withdrawTx.fee)) | |
57 | 57 | let isFeeInWaves = !(isDefined(withdrawTx.feeAssetId)) | |
58 | 58 | if (if (if (if (isPaymentTookPlace) | |
59 | 59 | then isWin | |
60 | 60 | else false) | |
61 | 61 | then isAmountOk | |
62 | 62 | else false) | |
63 | 63 | then isFeeInWaves | |
64 | 64 | else false) | |
65 | 65 | then !(isCheater) | |
66 | 66 | else false | |
67 | 67 | case _ => | |
68 | 68 | false | |
69 | 69 | } | |
70 | 70 | case dtx: DataTransaction => | |
71 | 71 | let paymentTxIdStr = extract(dtx.data[0].key) | |
72 | 72 | let paymentTx = transactionById(fromBase58String(paymentTxIdStr)) | |
73 | - | let isFeeCorrect = (dtx.fee | |
73 | + | let isFeeCorrect = (dataTxFee >= dtx.fee) | |
74 | 74 | let isPaymentAlreadyMentioned = isDefined(getString(me, paymentTxIdStr)) | |
75 | 75 | let withdrawTransactionId = fromBase58String(extract(getString(me, paymentTxIdStr))) | |
76 | 76 | let isWithdrawExist = isDefined(transactionById(withdrawTransactionId)) | |
77 | 77 | match paymentTx { | |
78 | 78 | case paymentTx: TransferTransaction => | |
79 | 79 | let isDtxSignedByPayer = sigVerify(dtx.bodyBytes, dtx.proofs[0], paymentTx.senderPublicKey) | |
80 | 80 | if (if (if (!(isPaymentAlreadyMentioned)) | |
81 | 81 | then true | |
82 | 82 | else !(isWithdrawExist)) | |
83 | 83 | then isDtxSignedByPayer | |
84 | 84 | else false) | |
85 | 85 | then isFeeCorrect | |
86 | 86 | else false | |
87 | 87 | case _ => | |
88 | 88 | false | |
89 | 89 | } | |
90 | 90 | case _ => | |
91 | 91 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
92 | 92 | } |
github/deemru/w8io/169f3d6 100.26 ms ◑