tx · 8dwZDc6rK3v5zCU3Eorb5eGrrZZJoPAT9CXykNXbnpZd 3N4Z7j4oSNfJVUtP4kmMKbhZD5n4xPFpPAu: -0.01400000 Waves 2019.02.01 23:57 [476421] smart account 3N4Z7j4oSNfJVUtP4kmMKbhZD5n4xPFpPAu > SELF 0.00000000 Waves
{ "type": 13, "id": "8dwZDc6rK3v5zCU3Eorb5eGrrZZJoPAT9CXykNXbnpZd", "fee": 1400000, "feeAssetId": null, "timestamp": 1549054665002, "version": 1, "sender": "3N4Z7j4oSNfJVUtP4kmMKbhZD5n4xPFpPAu", "senderPublicKey": "F3DbYSfYZz6arcD6Mst8HdWScxTeWvTvatC7jp4DGryX", "proofs": [ "4m1ZoqrP51RL6EMFi7d6991nJRy7Ujoiv6mP5KpusR2jN3FfYi8twLP6SZHQrFNLAkkqh7oWWr1buAxF7Zy8dHb3" ], "script": "base64:AQQAAAACbWUIBQAAAAJ0eAAAAAZzZW5kZXIEAAAABm9yYWNsZQkBAAAAB2V4dHJhY3QAAAABCQEAAAARYWRkcmVzc0Zyb21TdHJpbmcAAAABAgAAACMzTkN6YVlUTkRHdFI4emY5eWZjcWVQRmpDcUZ4OVM1emhzNAQAAAAJZGF0YVR4RmVlAAAAAAAAD0JABAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAAKd2l0aGRyYXdUeAUAAAAHJG1hdGNoMAQAAAAEdHhJZAkBAAAAB2V4dHJhY3QAAAABCQAEHQAAAAIFAAAAAm1lCQACWAAAAAEJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAQQAAAAHJG1hdGNoMQkAA+gAAAABCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAEDCQAAAQAAAAIFAAAAByRtYXRjaDECAAAAE1RyYW5zZmVyVHJhbnNhY3Rpb24EAAAACXBheW1lbnRUeAUAAAAHJG1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mF3VHJhbnNhY3Rpb25JZAQAAAAHJG1hdGNoMQUAAAAJcGF5bWVudFR4AwkAAAEAAAACBQAAAAckbWF0Y2gxAgAAABNUcmFuc2ZlclRyYW5zYWN0aW9uBAAAAAlwYXltZW50VHgFAAAAByRtYXRjaDEEAAAAEmlzRHR4U2lnbmVkQnlQYXllcgkAAfQAAAADCAUAAAADZHR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAADZHR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAACXBheW1lbnRUeAAAAA9zZW5kZXJQdWJsaWNLZXkDAwMJAQAAAAEhAAAAAQUAAAAZaXNQYXltZW50QWxyZWFkeU1lbnRpb25lZAYJAQAAAAEhAAAAAQUAAAAPaXNXaXRoZHJhd0V4aXN0BQAAABJpc0R0eFNpZ25lZEJ5UGF5ZXIHBQAAAAxpc0ZlZUNvcnJlY3QHBwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXlYG4XN", "chainId": 84, "height": 476421, "spentComplexity": 0 } View: original | compacted Prev: B4o7WGfL6fUwFrRCwikaVbYem1UhareyXyXnuDkSRrE9 Next: 6x5ShNHEhdW4QCFRuZEtxPz5FutpaFTLZZ1oY8K1CdEs 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 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 ver = take(valComplex, 1) | |
33 | 33 | let valReal = if ((type == drop(toBytes(0), 7))) | |
34 | 34 | then drop(take(valComplex, 2), 1) | |
35 | 35 | else if ((type == drop(toBytes(1), 7))) | |
36 | 36 | then drop(take(valComplex, 3), 2) | |
37 | 37 | else if ((type == drop(toBytes(2), 7))) | |
38 | 38 | then drop(take(valComplex, 4), 3) | |
39 | 39 | else if ((type == drop(toBytes(3), 7))) | |
40 | 40 | then drop(take(valComplex, 5), 4) | |
41 | 41 | else if ((type == drop(toBytes(4), 7))) | |
42 | 42 | then drop(take(valComplex, 6), 5) | |
43 | 43 | else if ((type == drop(toBytes(5), 7))) | |
44 | 44 | then drop(take(valComplex, 7), 5) | |
45 | 45 | else toBytes(38) | |
46 | 46 | let isWin = if ((val == valReal)) | |
47 | 47 | then (val != toBytes(38)) | |
48 | 48 | else false | |
49 | 49 | let isAmountOk = (withdrawTx.amount == (((paymentTx.amount * koeff) - dataTxFee) - withdrawTx.fee)) | |
50 | 50 | let isInWaves = if (!(isDefined(withdrawTx.feeAssetId))) | |
51 | 51 | then !(isDefined(withdrawTx.assetId)) | |
52 | 52 | else false | |
53 | 53 | if (if (if (isPaymentTookPlace) | |
54 | 54 | then isWin | |
55 | 55 | else false) | |
56 | 56 | then isAmountOk | |
57 | 57 | else false) | |
58 | 58 | then isInWaves | |
59 | 59 | else false | |
60 | 60 | case _ => | |
61 | 61 | false | |
62 | 62 | } | |
63 | 63 | case dtx: DataTransaction => | |
64 | 64 | let paymentTxIdStr = extract(dtx.data[0].key) | |
65 | 65 | let paymentTx = transactionById(fromBase58String(paymentTxIdStr)) | |
66 | 66 | let isFeeCorrect = (dataTxFee >= dtx.fee) | |
67 | 67 | let isPaymentAlreadyMentioned = isDefined(getString(me, paymentTxIdStr)) | |
68 | 68 | let withdrawTransactionId = fromBase58String(extract(getString(me, paymentTxIdStr))) | |
69 | 69 | let isWithdrawExist = isDefined(transactionById(withdrawTransactionId)) | |
70 | 70 | match paymentTx { | |
71 | 71 | case paymentTx: TransferTransaction => | |
72 | 72 | let isDtxSignedByPayer = sigVerify(dtx.bodyBytes, dtx.proofs[0], paymentTx.senderPublicKey) | |
73 | 73 | if (if (if (!(isPaymentAlreadyMentioned)) | |
74 | 74 | then true | |
75 | 75 | else !(isWithdrawExist)) | |
76 | 76 | then isDtxSignedByPayer | |
77 | 77 | else false) | |
78 | 78 | then isFeeCorrect | |
79 | 79 | else false | |
80 | 80 | case _ => | |
81 | 81 | false | |
82 | 82 | } | |
83 | 83 | case _ => | |
84 | 84 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
85 | 85 | } |
github/deemru/w8io/169f3d6 22.98 ms ◑