tx · 75Uxeg7w2JEiCfqKtCSKMj7Mm33CNhc83w6BBPtRHN7F 3Mt5BW4KVsvfxGUYuDqcfDMeoacc5GPn179: -0.01400000 Waves 2019.03.10 20:52 [530305] smart account 3Mt5BW4KVsvfxGUYuDqcfDMeoacc5GPn179 > SELF 0.00000000 Waves
{ "type": 13, "id": "75Uxeg7w2JEiCfqKtCSKMj7Mm33CNhc83w6BBPtRHN7F", "fee": 1400000, "feeAssetId": null, "timestamp": 1552240412145, "version": 1, "sender": "3Mt5BW4KVsvfxGUYuDqcfDMeoacc5GPn179", "senderPublicKey": "F7KHa5J2ja7H22YreD3YJ8rBEFcvpa3DvQhFG4ZUXk8P", "proofs": [ "3hPh4DDg8XnTWWoPqjdbcCS8aDt1wcHz3RbRJSmAE8o9GEcCETipwUwbMBhcv9HfEsM7KMiKCFbgH97v82bQMNLu" ], "script": "base64:AQQAAAAGYXV0aG9yAgAAABVNYURhTWEgTGFicyBAZGFpZGFsb3MEAAAACG9uZVdhdmVzAAAAAAAF9eEABAAAAAtwYWllZEFtb3VudAkAAGgAAAACAAAAAAAAAAABBQAAAAhvbmVXYXZlcwQAAAAKcGFpZWRUeEZlZQkAAGkAAAACBQAAAAhvbmVXYXZlcwAAAAAAAAAAZAQAAAAJZGF0YVR4RmVlCQAAaQAAAAIFAAAACG9uZVdhdmVzAAAAAAAAAABkBAAAAAhzdGFydFBvcwAAAAAAAAAAAAQAAAAGZW5kUG9zAAAAAAAAAAAYBAAAABVhZGRyZXNzVG9QYXlQdWJsaWNLZXkBAAAAII59m1WbITiydrSsh5p7DTg06jWuC97IwDX0JxhY8UwtBAAAAAxhZGRyZXNzVG9QYXkJAQAAABRhZGRyZXNzRnJvbVB1YmxpY0tleQAAAAEFAAAAFWFkZHJlc3NUb1BheVB1YmxpY0tleQQAAAALbWVQdWJsaWNLZXkBAAAAINGhxwvEds7cbetxn2NKu1NHYRJroK33xbBnxqlOHo5YBAAAAAJtZQkBAAAAFGFkZHJlc3NGcm9tUHV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AAAAAAAIIBQAAAAZkYXRhVHgAAAADZmVlBQAAAAlkYXRhVHhGZWUHBwa/Tpgl", "chainId": 84, "height": 530305, "spentComplexity": 0 } View: original | compacted Prev: AiZsM4bsmsM7VBYMGEJKutANHdCX17ZExoZZLdbbpgsc Next: 72yhPJhWLUmKLv4RsJpi57wC3yYu2JbVfmnQk5qsR4yH Diff:
Old | New | Differences | |
---|---|---|---|
7 | 7 | let dataTxFee = (oneWaves / 100) | |
8 | 8 | let startPos = 0 | |
9 | 9 | let endPos = 24 | |
10 | - | let addressToPayPublicKey = base58' | |
10 | + | let addressToPayPublicKey = base58'AbDyruBD8QqodWvMWRxAx8FhwRuf4cMFZu6SA1G4YwWU' | |
11 | 11 | let addressToPay = addressFromPublicKey(addressToPayPublicKey) | |
12 | - | let mePublicKey = base58' | |
12 | + | let mePublicKey = base58'F7KHa5J2ja7H22YreD3YJ8rBEFcvpa3DvQhFG4ZUXk8P' | |
13 | 13 | let me = addressFromPublicKey(mePublicKey) | |
14 | 14 | match tx { | |
15 | 15 | case winTx: TransferTransaction => |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 1 #-} | |
2 | 2 | {-# CONTENT_TYPE EXPRESSION #-} | |
3 | 3 | let author = "MaDaMa Labs @daidalos" | |
4 | 4 | let oneWaves = 100000000 | |
5 | 5 | let paiedAmount = (1 * oneWaves) | |
6 | 6 | let paiedTxFee = (oneWaves / 100) | |
7 | 7 | let dataTxFee = (oneWaves / 100) | |
8 | 8 | let startPos = 0 | |
9 | 9 | let endPos = 24 | |
10 | - | let addressToPayPublicKey = base58' | |
10 | + | let addressToPayPublicKey = base58'AbDyruBD8QqodWvMWRxAx8FhwRuf4cMFZu6SA1G4YwWU' | |
11 | 11 | let addressToPay = addressFromPublicKey(addressToPayPublicKey) | |
12 | - | let mePublicKey = base58' | |
12 | + | let mePublicKey = base58'F7KHa5J2ja7H22YreD3YJ8rBEFcvpa3DvQhFG4ZUXk8P' | |
13 | 13 | let me = addressFromPublicKey(mePublicKey) | |
14 | 14 | match tx { | |
15 | 15 | case winTx: TransferTransaction => | |
16 | 16 | let hashAttachment = sha256(winTx.attachment) | |
17 | 17 | let untBytes = takeRightBytes(take(winTx.attachment, 2), 1) | |
18 | 18 | let decBytes = take(winTx.attachment, 1) | |
19 | 19 | let win = takeRightBytes(take(winTx.attachment, 4), 1) | |
20 | 20 | let untInt = if ((untBytes == toBytes("0"))) | |
21 | 21 | then 0 | |
22 | 22 | else if ((untBytes == toBytes("1"))) | |
23 | 23 | then 1 | |
24 | 24 | else if ((untBytes == toBytes("2"))) | |
25 | 25 | then 2 | |
26 | 26 | else if ((untBytes == toBytes("3"))) | |
27 | 27 | then 3 | |
28 | 28 | else if ((untBytes == toBytes("4"))) | |
29 | 29 | then 4 | |
30 | 30 | else if ((untBytes == toBytes("5"))) | |
31 | 31 | then 5 | |
32 | 32 | else if ((untBytes == toBytes("6"))) | |
33 | 33 | then 6 | |
34 | 34 | else if ((untBytes == toBytes("7"))) | |
35 | 35 | then 7 | |
36 | 36 | else if ((untBytes == toBytes("8"))) | |
37 | 37 | then 8 | |
38 | 38 | else if ((untBytes == toBytes("9"))) | |
39 | 39 | then 9 | |
40 | 40 | else 0 | |
41 | 41 | let decInt = if ((decBytes == toBytes("0"))) | |
42 | 42 | then 0 | |
43 | 43 | else if ((decBytes == toBytes("1"))) | |
44 | 44 | then 10 | |
45 | 45 | else if ((decBytes == toBytes("2"))) | |
46 | 46 | then 20 | |
47 | 47 | else 0 | |
48 | 48 | let pos = (decInt + untInt) | |
49 | 49 | let posString = if ((pos > 9)) | |
50 | 50 | then toString(pos) | |
51 | 51 | else ("0" + toString(pos)) | |
52 | 52 | let posHash = extract(getString(me, ("hash" + posString))) | |
53 | 53 | let paymentTxId = extract(getString(me, posString)) | |
54 | 54 | let paymentTx = transactionById(fromBase58String(paymentTxId)) | |
55 | 55 | match paymentTx { | |
56 | 56 | case paymentTx: TransferTransaction => | |
57 | 57 | if (if ((hashAttachment == fromBase58String(posHash))) | |
58 | 58 | then (win == toBytes("1")) | |
59 | 59 | else false) | |
60 | 60 | then (winTx.sender == paymentTx.sender) | |
61 | 61 | else false | |
62 | 62 | case _ => | |
63 | 63 | false | |
64 | 64 | } | |
65 | 65 | case dataTx: DataTransaction => | |
66 | 66 | let insertPos = extract(getInteger(dataTx.data, "pos")) | |
67 | 67 | let validPos = if ((insertPos >= startPos)) | |
68 | 68 | then (endPos >= insertPos) | |
69 | 69 | else false | |
70 | 70 | if (!(validPos)) | |
71 | 71 | then throw("POS not valid") | |
72 | 72 | else { | |
73 | 73 | let insertPosString = if ((insertPos > 9)) | |
74 | 74 | then toString(insertPos) | |
75 | 75 | else ("0" + toString(insertPos)) | |
76 | 76 | let paymentTxId = extract(getString(dataTx.data, insertPosString)) | |
77 | 77 | let satisfiesFormat = if (if (if (if ((size(dataTx.data) == 3)) | |
78 | 78 | then isDefined(getInteger(dataTx.data, "pos")) | |
79 | 79 | else false) | |
80 | 80 | then isDefined(getString(dataTx.data, insertPosString)) | |
81 | 81 | else false) | |
82 | 82 | then isDefined(getBoolean(dataTx.data, paymentTxId)) | |
83 | 83 | else false) | |
84 | 84 | then (extract(getBoolean(dataTx.data, paymentTxId)) == true) | |
85 | 85 | else false | |
86 | 86 | if (!(satisfiesFormat)) | |
87 | 87 | then throw("DATA FORMAT not valid") | |
88 | 88 | else { | |
89 | 89 | let posNotUsed = !(isDefined(getString(me, insertPosString))) | |
90 | 90 | if (!(posNotUsed)) | |
91 | 91 | then throw("POS alredy used") | |
92 | 92 | else { | |
93 | 93 | let txIdNotUsed = !(isDefined(getBoolean(me, paymentTxId))) | |
94 | 94 | if (!(txIdNotUsed)) | |
95 | 95 | then throw("TxId alredy used") | |
96 | 96 | else { | |
97 | 97 | let dataTransactionIsValid = if (if (if (satisfiesFormat) | |
98 | 98 | then validPos | |
99 | 99 | else false) | |
100 | 100 | then posNotUsed | |
101 | 101 | else false) | |
102 | 102 | then txIdNotUsed | |
103 | 103 | else false | |
104 | 104 | let paymentTx = transactionById(fromBase58String(paymentTxId)) | |
105 | 105 | match paymentTx { | |
106 | 106 | case paymentTx: TransferTransaction => | |
107 | 107 | if (if (if (if (if (dataTransactionIsValid) | |
108 | 108 | then (paymentTx.recipient == addressToPay) | |
109 | 109 | else false) | |
110 | 110 | then (paymentTx.amount >= (paiedAmount - paiedTxFee)) | |
111 | 111 | else false) | |
112 | 112 | then !(isDefined(paymentTx.assetId)) | |
113 | 113 | else false) | |
114 | 114 | then sigVerify(dataTx.bodyBytes, dataTx.proofs[0], paymentTx.senderPublicKey) | |
115 | 115 | else false) | |
116 | 116 | then (dataTx.fee == dataTxFee) | |
117 | 117 | else false | |
118 | 118 | case _ => | |
119 | 119 | false | |
120 | 120 | } | |
121 | 121 | } | |
122 | 122 | } | |
123 | 123 | } | |
124 | 124 | } | |
125 | 125 | case _ => | |
126 | 126 | true | |
127 | 127 | } |
github/deemru/w8io/026f985 32.39 ms ◑