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