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