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