tx · 9hkaeyuZ6CQ6dKEDhmgeiSk6XPhqmQBMXGFMmt3MkGHS 3N4Z7j4oSNfJVUtP4kmMKbhZD5n4xPFpPAu: -0.01400000 Waves 2019.02.02 00:12 [476437] smart account 3N4Z7j4oSNfJVUtP4kmMKbhZD5n4xPFpPAu > SELF 0.00000000 Waves
{ "type": 13, "id": "9hkaeyuZ6CQ6dKEDhmgeiSk6XPhqmQBMXGFMmt3MkGHS", "fee": 1400000, "feeAssetId": null, "timestamp": 1549055626079, "version": 1, "sender": "3N4Z7j4oSNfJVUtP4kmMKbhZD5n4xPFpPAu", "senderPublicKey": "F3DbYSfYZz6arcD6Mst8HdWScxTeWvTvatC7jp4DGryX", "proofs": [ "3mDJVfqA4uYEr6BfEJCoRzDoVkNStHBcjtUvv993rpnTqdC13RDeLT6iBxAkytzjAzzr4ytoTqGpjREj9HS1FvHk" ], "script": "base64:AQQAAAACbWUIBQAAAAJ0eAAAAAZzZW5kZXIEAAAABm9yYWNsZQkBAAAAB2V4dHJhY3QAAAABCQEAAAARYWRkcmVzc0Zyb21TdHJpbmcAAAABAgAAACMzTkN6YVlUTkRHdFI4emY5eWZjcWVQRmpDcUZ4OVM1emhzNAQAAAAJZGF0YVR4RmVlAAAAAAAAD0JABAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAAKd2l0aGRyYXdUeAUAAAAHJG1hdGNoMAQAAAAEdHhJZAkBAAAAB2V4dHJhY3QAAAABCQAEHQAAAAIFAAAAAm1lCQACWAAAAAEJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAQQAAAAHJG1hdGNoMQkAA+gAAAABCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAEDCQAAAQAAAAIFAAAAByRtYXRjaDECAAAAE1RyYW5zZmVyVHJhbnNhY3Rpb24EAAAACXBheW1lbnRUeAUAAAAH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lCQAAygAAAAIJAAGaAAAAAQAAAAAAAAAAAwAAAAAAAAAABwkAAMoAAAACCQAAyQAAAAIFAAAACnZhbENvbXBsZXgAAAAAAAAAAAUAAAAAAAAAAAQDCQAAAAAAAAIFAAAABHR5cGUJAADKAAAAAgkAAZoAAAABAAAAAAAAAAAEAAAAAAAAAAAHCQAAygAAAAIJAADJAAAAAgUAAAAKdmFsQ29tcGxleAAAAAAAAAAABgAAAAAAAAAABQMJAAAAAAAAAgUAAAAEdHlwZQkAAMoAAAACCQABmgAAAAEAAAAAAAAAAAUAAAAAAAAAAAcJAADKAAAAAgkAAMkAAAACBQAAAAp2YWxDb21wbGV4AAAAAAAAAAAHAAAAAAAAAAAFCQABmgAAAAEAAAAAAAAAACYEAAAABWlzV2luAwkAAAAAAAACBQAAAAN2YWwFAAAAB3ZhbFJlYWwJAQAAAAIhPQAAAAIFAAAAA3ZhbAkAAZoAAAABAAAAAAAAAAAmBwMFAAAABWlzV2luCQEAAAABIQAAAAEFAAAACWlzQ2hlYXRlcgcHBwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXllFxiX", "chainId": 84, "height": 476437, "spentComplexity": 0 } View: original | compacted Prev: 2HsLi6t1YSD2MJAq7BEw6G3NFXFR1nuTVvUHMwdUSGFT Next: FKijJZ8t9Uj2oeKWxazm8eNFp8umZoFEfkCMFr4cxW2P Diff:
Old | New | Differences | |
---|---|---|---|
96 | 96 | let isWin = if ((val == valReal)) | |
97 | 97 | then (val != toBytes(38)) | |
98 | 98 | else false | |
99 | - | isWin | |
99 | + | if (isWin) | |
100 | + | then !(isCheater) | |
101 | + | else false | |
100 | 102 | } | |
101 | 103 | else false | |
102 | 104 | case _ => |
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 paymentTx = transactionById(fromBase58String(paymentTxIdStr)) | |
47 | 47 | let isFeeCorrect = (dataTxFee >= dtx.fee) | |
48 | 48 | let isPaymentAlreadyMentioned = isDefined(getString(me, paymentTxIdStr)) | |
49 | 49 | let withdrawTransactionId = fromBase58String(extract(getString(me, paymentTxIdStr))) | |
50 | 50 | let isWithdrawExist = isDefined(transactionById(withdrawTransactionId)) | |
51 | 51 | match paymentTx { | |
52 | 52 | case paymentTx: TransferTransaction => | |
53 | 53 | let isDtxSignedByPayer = sigVerify(dtx.bodyBytes, dtx.proofs[0], paymentTx.senderPublicKey) | |
54 | 54 | if (if (if (if (!(isPaymentAlreadyMentioned)) | |
55 | 55 | then true | |
56 | 56 | else !(isWithdrawExist)) | |
57 | 57 | then isDtxSignedByPayer | |
58 | 58 | else false) | |
59 | 59 | then isFeeCorrect | |
60 | 60 | else false) | |
61 | 61 | then { | |
62 | 62 | let att = paymentTx.attachment | |
63 | 63 | let type = dropRightBytes(takeRightBytes(att, 2), 1) | |
64 | 64 | let val = takeRightBytes(att, 1) | |
65 | 65 | let key = dropRightBytes(att, 2) | |
66 | 66 | let heightRes = extract(getInteger(oracle, (toBase58String(key) + "height"))) | |
67 | 67 | let isCheater = (extract(transactionHeightById(paymentTx.id)) >= heightRes) | |
68 | 68 | let valComplex = extract(getBinary(oracle, toBase58String(key))) | |
69 | 69 | let koeff = if ((type == drop(toBytes(0), 7))) | |
70 | 70 | then 35 | |
71 | 71 | else if ((type == drop(toBytes(1), 7))) | |
72 | 72 | then 1 | |
73 | 73 | else if ((type == drop(toBytes(2), 7))) | |
74 | 74 | then 1 | |
75 | 75 | else if ((type == drop(toBytes(3), 7))) | |
76 | 76 | then 1 | |
77 | 77 | else if ((type == drop(toBytes(4), 7))) | |
78 | 78 | then 2 | |
79 | 79 | else if ((type == drop(toBytes(5), 7))) | |
80 | 80 | then 2 | |
81 | 81 | else 0 | |
82 | 82 | let ver = take(valComplex, 1) | |
83 | 83 | let valReal = if ((type == drop(toBytes(0), 7))) | |
84 | 84 | then drop(take(valComplex, 2), 1) | |
85 | 85 | else if ((type == drop(toBytes(1), 7))) | |
86 | 86 | then drop(take(valComplex, 3), 2) | |
87 | 87 | else if ((type == drop(toBytes(2), 7))) | |
88 | 88 | then drop(take(valComplex, 4), 3) | |
89 | 89 | else if ((type == drop(toBytes(3), 7))) | |
90 | 90 | then drop(take(valComplex, 5), 4) | |
91 | 91 | else if ((type == drop(toBytes(4), 7))) | |
92 | 92 | then drop(take(valComplex, 6), 5) | |
93 | 93 | else if ((type == drop(toBytes(5), 7))) | |
94 | 94 | then drop(take(valComplex, 7), 5) | |
95 | 95 | else toBytes(38) | |
96 | 96 | let isWin = if ((val == valReal)) | |
97 | 97 | then (val != toBytes(38)) | |
98 | 98 | else false | |
99 | - | isWin | |
99 | + | if (isWin) | |
100 | + | then !(isCheater) | |
101 | + | else false | |
100 | 102 | } | |
101 | 103 | else false | |
102 | 104 | case _ => | |
103 | 105 | false | |
104 | 106 | } | |
105 | 107 | case _ => | |
106 | 108 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
107 | 109 | } |
github/deemru/w8io/169f3d6 37.61 ms ◑