tx · 8iT18PtvLRmp6ZEqrCxArK6hjCdwJ8m3Z8iRu9zxVjEk 3N3PDx6B7JgTBDJ1Z9hGkU3GDCTSDFtFPT3: -0.01400000 Waves 2019.03.15 21:14 [537597] smart account 3N3PDx6B7JgTBDJ1Z9hGkU3GDCTSDFtFPT3 > SELF 0.00000000 Waves
{ "type": 13, "id": "8iT18PtvLRmp6ZEqrCxArK6hjCdwJ8m3Z8iRu9zxVjEk", "fee": 1400000, "feeAssetId": null, "timestamp": 1552673749463, "version": 1, "sender": "3N3PDx6B7JgTBDJ1Z9hGkU3GDCTSDFtFPT3", "senderPublicKey": "C9pkfWzNEjCWoh9PBNFpVJzc5bnpFVeJi8Ca13UneBz5", "proofs": [ "5TPXFoapKSgWYjQZf52BSmySYQPcyaubzCbYvJedu6fuzjP4CbMJADvSdyvjrXMufzB5Etc8QgwqHuFqfnqu38tt" ], "script": "base64:AQQAAAAGYXV0aG9yAgAAABVNYURhTWEgTGFicyBAZGFpZGFsb3MEAAAACG9uZVdhdmVzAAAAAAAF9eEABAAAAApwYWlkQW1vdW50CQAAaAAAAAIAAAAAAAAAAAEFAAAACG9uZVdhdmVzBAAAAAl3aW5BbW91bnQJAABoAAAAAgAAAAAAAAAACgUAAAAIb25lV2F2ZXMEAAAACXBhaWRUeEZlZQkAAGkAAAACBQAAAAhvbmVXYXZlcwAAAAAAAAAAZAQAAAAJZGF0YVR4RmVlCQAAaQAAAAIFAAAACG9uZVdhdmVzAAAAAAAAAABkBAAAAAh3aW5UeEZlZQkAAGkAAAACBQAAAAhvbmVXYXZlcwAAAAAAAAAAZAQAAAAIc3RhcnRQb3MAAAAAAAAAAAAEAAAABmVuZFBvcwAAAAAAAAAAGAQAAAAKc2FsdExlbmd0aAAAAAAAAAAAMgQAAAAJbWVBZGRyZXNzCAUAAAACdHgAAAAGc2VuZGVyBAAAAAttZVB1YmxpY0tleQgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQMJAQAAAAIhPQAAAAIFAAAACW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muzmsS", "chainId": 84, "height": 537597, "spentComplexity": 0 } View: original | compacted Prev: none Next: none 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 paidAmount = (1 * oneWaves) | |
6 | + | let winAmount = (10 * oneWaves) | |
7 | + | let paidTxFee = (oneWaves / 100) | |
8 | + | let dataTxFee = (oneWaves / 100) | |
9 | + | let winTxFee = (oneWaves / 100) | |
10 | + | let startPos = 0 | |
11 | + | let endPos = 24 | |
12 | + | let saltLength = 50 | |
13 | + | let meAddress = tx.sender | |
14 | + | let mePublicKey = tx.senderPublicKey | |
15 | + | if ((meAddress != addressFromPublicKey(mePublicKey))) | |
16 | + | then throw("INIT: SENDER IS WRONG") | |
17 | + | else { | |
18 | + | let serverAddressPublicKey = fromBase58String(extract(getString(tx.sender, "serverAddress"))) | |
19 | + | let serverAddress = addressFromPublicKey(serverAddressPublicKey) | |
20 | + | match tx { | |
21 | + | case dataTx: DataTransaction => | |
22 | + | let insertPosCheck = isDefined(getInteger(dataTx.data, "pos")) | |
23 | + | if (!(insertPosCheck)) | |
24 | + | then throw("DT: POSITION value is not an integer") | |
25 | + | else { | |
26 | + | let insertPos = extract(getInteger(dataTx.data, "pos")) | |
27 | + | let validPos = if ((insertPos >= startPos)) | |
28 | + | then (endPos >= insertPos) | |
29 | + | else false | |
30 | + | if (!(validPos)) | |
31 | + | then throw("DT: POSITION is not valid") | |
32 | + | else { | |
33 | + | let insertPosStringTemp = if ((insertPos > 9)) | |
34 | + | then toString(insertPos) | |
35 | + | else ("0" + toString(insertPos)) | |
36 | + | let insertPosString = ("pos" + insertPosStringTemp) | |
37 | + | let paymentTxId = extract(getString(dataTx.data, insertPosString)) | |
38 | + | let satisfiesFormat = if (if (if (if ((size(dataTx.data) == 3)) | |
39 | + | then insertPosCheck | |
40 | + | else false) | |
41 | + | then isDefined(getString(dataTx.data, insertPosString)) | |
42 | + | else false) | |
43 | + | then isDefined(getBoolean(dataTx.data, paymentTxId)) | |
44 | + | else false) | |
45 | + | then (extract(getBoolean(dataTx.data, paymentTxId)) == true) | |
46 | + | else false | |
47 | + | if (!(satisfiesFormat)) | |
48 | + | then throw("DT: DATA FORMAT is not valid") | |
49 | + | else { | |
50 | + | let posNotUsed = !(isDefined(getString(meAddress, insertPosString))) | |
51 | + | if (!(posNotUsed)) | |
52 | + | then throw("DT: POSISTION alredy used") | |
53 | + | else { | |
54 | + | let txIdNotUsed = !(isDefined(getBoolean(meAddress, paymentTxId))) | |
55 | + | if (!(txIdNotUsed)) | |
56 | + | then throw("DT: TXID alredy used") | |
57 | + | else { | |
58 | + | let dataTransactionIsValid = if (if (if (validPos) | |
59 | + | then satisfiesFormat | |
60 | + | else false) | |
61 | + | then posNotUsed | |
62 | + | else false) | |
63 | + | then txIdNotUsed | |
64 | + | else false | |
65 | + | let paymentTx = transactionById(fromBase58String(paymentTxId)) | |
66 | + | match paymentTx { | |
67 | + | case paymentTx: TransferTransaction => | |
68 | + | if (if (if (if (if (if (if (if (if (dataTransactionIsValid) | |
69 | + | then (addressFromPublicKey(paymentTx.attachment) == meAddress) | |
70 | + | else false) | |
71 | + | then (paymentTx.sender != meAddress) | |
72 | + | else false) | |
73 | + | then (paymentTx.sender != serverAddress) | |
74 | + | else false) | |
75 | + | then (paymentTx.recipient == serverAddress) | |
76 | + | else false) | |
77 | + | then (paymentTx.amount >= (paidAmount - paidTxFee)) | |
78 | + | else false) | |
79 | + | then !(isDefined(paymentTx.assetId)) | |
80 | + | else false) | |
81 | + | then !(isDefined(paymentTx.feeAssetId)) | |
82 | + | else false) | |
83 | + | then sigVerify(dataTx.bodyBytes, dataTx.proofs[0], paymentTx.senderPublicKey) | |
84 | + | else false) | |
85 | + | then (dataTx.fee == dataTxFee) | |
86 | + | else false | |
87 | + | case _ => | |
88 | + | throw("DT: TRANSACTION type is not a TransferTransaction") | |
89 | + | } | |
90 | + | } | |
91 | + | } | |
92 | + | } | |
93 | + | } | |
94 | + | } | |
95 | + | case winTx: MassTransferTransaction => | |
96 | + | let winTransferAttachment = winTx.attachment | |
97 | + | if ((size(winTransferAttachment) != (saltLength + 5))) | |
98 | + | then throw("MTT: ATTACHMENT SIZE is wrong") | |
99 | + | else { | |
100 | + | let unitsBytes = takeRightBytes(take(winTransferAttachment, 2), 1) | |
101 | + | let tensBytes = take(winTransferAttachment, 1) | |
102 | + | let winBytes = takeRightBytes(take(winTransferAttachment, 4), 1) | |
103 | + | let unitsInt = if ((unitsBytes == toBytes("0"))) | |
104 | + | then 0 | |
105 | + | else if ((unitsBytes == toBytes("1"))) | |
106 | + | then 1 | |
107 | + | else if ((unitsBytes == toBytes("2"))) | |
108 | + | then 2 | |
109 | + | else if ((unitsBytes == toBytes("3"))) | |
110 | + | then 3 | |
111 | + | else if ((unitsBytes == toBytes("4"))) | |
112 | + | then 4 | |
113 | + | else if ((unitsBytes == toBytes("5"))) | |
114 | + | then 5 | |
115 | + | else if ((unitsBytes == toBytes("6"))) | |
116 | + | then 6 | |
117 | + | else if ((unitsBytes == toBytes("7"))) | |
118 | + | then 7 | |
119 | + | else if ((unitsBytes == toBytes("8"))) | |
120 | + | then 8 | |
121 | + | else if ((unitsBytes == toBytes("9"))) | |
122 | + | then 9 | |
123 | + | else 0 | |
124 | + | let tensInt = if ((tensBytes == toBytes("0"))) | |
125 | + | then 0 | |
126 | + | else if ((tensBytes == toBytes("1"))) | |
127 | + | then 10 | |
128 | + | else if ((tensBytes == toBytes("2"))) | |
129 | + | then 20 | |
130 | + | else 0 | |
131 | + | let posInt = (tensInt + unitsInt) | |
132 | + | let validPos = if ((posInt >= startPos)) | |
133 | + | then (endPos >= posInt) | |
134 | + | else false | |
135 | + | if (!(validPos)) | |
136 | + | then throw("MTT: POSITION NUMBER is not valid") | |
137 | + | else { | |
138 | + | let posString = if ((posInt > 9)) | |
139 | + | then toString(posInt) | |
140 | + | else ("0" + toString(posInt)) | |
141 | + | let posHashDefined = isDefined(getString(meAddress, ("hash" + posString))) | |
142 | + | if (!(posHashDefined)) | |
143 | + | then throw("MTT: POSITION HASH did not found in data") | |
144 | + | else { | |
145 | + | let posHash = extract(getString(meAddress, ("hash" + posString))) | |
146 | + | let validateAttachment = (sha256(winTransferAttachment) == fromBase58String(posHash)) | |
147 | + | if (!(validateAttachment)) | |
148 | + | then throw("MTT: ATTACHMENT HASH is not valid") | |
149 | + | else { | |
150 | + | let serverAddressCheck = if ((winTx.transfers[0].recipient == serverAddress)) | |
151 | + | then (size(winTx.transfers) == 2) | |
152 | + | else false | |
153 | + | if (!(serverAddressCheck)) | |
154 | + | then throw("MTT: SERVER ADDRESS is wrong") | |
155 | + | else { | |
156 | + | let isWinner = (winBytes == toBytes("1")) | |
157 | + | if (!(isWinner)) | |
158 | + | then throw("MTT: POSITION is not winner") | |
159 | + | else { | |
160 | + | let paymentTxId = extract(getString(meAddress, ("pos" + posString))) | |
161 | + | let paymentTx = transactionById(fromBase58String(paymentTxId)) | |
162 | + | match paymentTx { | |
163 | + | case paymentTx: TransferTransaction => | |
164 | + | let recipientIsThePayment = (winTx.transfers[1].recipient == paymentTx.sender) | |
165 | + | if (!(recipientIsThePayment)) | |
166 | + | then throw("MTT: WINNER RECIPIENT is wrong") | |
167 | + | else if (if (if (if (if ((winTx.transfers[0].amount == ((wavesBalance(meAddress) - winAmount) - winTxFee))) | |
168 | + | then (winTx.transfers[1].amount == winAmount) | |
169 | + | else false) | |
170 | + | then !(isDefined(paymentTx.assetId)) | |
171 | + | else false) | |
172 | + | then !(isDefined(paymentTx.feeAssetId)) | |
173 | + | else false) | |
174 | + | then (winTx.fee == winTxFee) | |
175 | + | else false) | |
176 | + | then if (sigVerify(winTx.bodyBytes, winTx.proofs[0], mePublicKey)) | |
177 | + | then true | |
178 | + | else sigVerify(winTx.bodyBytes, winTx.proofs[0], paymentTx.senderPublicKey) | |
179 | + | else false | |
180 | + | case _ => | |
181 | + | throw("MTT: TRANSACTION type is not a TransferTransaction") | |
182 | + | } | |
183 | + | } | |
184 | + | } | |
185 | + | } | |
186 | + | } | |
187 | + | } | |
188 | + | } | |
189 | + | case serviceTx: TransferTransaction => | |
190 | + | let wavesRestCheck = ((winAmount + winTxFee) > wavesBalance(meAddress)) | |
191 | + | if (!(wavesRestCheck)) | |
192 | + | then throw("TT: WAVES balance is more then win amount") | |
193 | + | else { | |
194 | + | let serverAddressCheck = (serviceTx.recipient == serverAddress) | |
195 | + | if (!(serverAddressCheck)) | |
196 | + | then throw("TT: SERVER ADDRESS is wrong") | |
197 | + | else if (sigVerify(serviceTx.bodyBytes, serviceTx.proofs[0], mePublicKey)) | |
198 | + | then (serviceTx.fee == winTxFee) | |
199 | + | else false | |
200 | + | } | |
201 | + | case _ => | |
202 | + | sigVerify(tx.bodyBytes, tx.proofs[0], mePublicKey) | |
203 | + | } | |
204 | + | } |
github/deemru/w8io/169f3d6 36.24 ms ◑