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