tx · E7kdGeKUvaWAQXHi33iKFajNzK6eyfsMWGXEjtUoJGi3 3MqtTwie8XKCcUcntgFAFYnfLEnffezju4Y: -0.01500000 Waves 2019.07.25 18:23 [601739] smart account 3MqtTwie8XKCcUcntgFAFYnfLEnffezju4Y > SELF 0.00000000 Waves
{ "type": 13, "id": "E7kdGeKUvaWAQXHi33iKFajNzK6eyfsMWGXEjtUoJGi3", "fee": 1500000, "feeAssetId": null, "timestamp": 1564068184731, "version": 1, "sender": "3MqtTwie8XKCcUcntgFAFYnfLEnffezju4Y", "senderPublicKey": "Gf4eU8JJaQziR7AfnST6tmzhUgFmeKavkwyoceen3PK1", "proofs": [ "3YnHpi56XCjALg57KGtpGG9Y5iJyv3Eh7EPUp1KE2Ar1n51vcpWpQp74NnBtvvvnhUj6uGihMiLj8WuX6C19gMni" ], "script": "base64:AAIDAAAAAAAAAAAAAAAYAAAAAAlSU0FQVUJMSUMJAAJbAAAAAQIAAAGPYmFzZTY0Ok1JSUJJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBcWxBaUFOU21CcERIWUtQOXNLZ2VOL2wxYkFiMjhnL3RHbGdEa3dUNUZpTU40WDNwd2R2ZHhFN212U1I4LzQxZFU5cng0akcrNnRacGIxVUxWRFBzNDMxdFIySVJhVFh3NUNqK0FjMnZoTCs1SmFtQ2VyR0QxVVcrYmgvRUdRdHhvOFczWUxEcm9mWEI1UUhKeDRQa3oyS2dmK29TL0M4aEh1Qi9VNGtyTzc2VTA1MDdHVGpaUFA5a1JRMHVMU01lcVFYdDh3WFMrbk1wNXdhanF4UHBETE1hU1JFZ3NLd3YvQUVrUDRkenBUWWJpa0xCWWw0cXRkSnNEODRITEZTa2l3ZDNCaGNPclBqb0lZbUx4UXVCRDVUSU1LVEtEM3NkWmdhWTlyc3lxeDNBMDBpbm55eEQ2enAzYjRnRnBVT1g4SnhLWmRFQzJteUVxbGVOZ2c3R3p3SURBUUFCAAAAAAZTRVJWRVIJ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c5ua6qNa5FH6RaHwSpQL Next: F6RpxQT5HqcMhmoYwPTaxvfC5AdZ9JNwsdsAU6tCBuGR Diff:
Old | New | Differences | |
---|---|---|---|
7 | 7 | ||
8 | 8 | let WAVELET = ((100 * 1000) * 1000) | |
9 | 9 | ||
10 | - | let SESSIONIDFIXSIZE = | |
10 | + | let SESSIONIDFIXSIZE = 44 | |
11 | 11 | ||
12 | 12 | let RANDCYCLEPRICE = ((5 * WAVELET) / 1000) | |
13 | 13 | ||
133 | 133 | } | |
134 | 134 | ||
135 | 135 | ||
136 | - | func validateDtxKey (sessionId,data,dataEntriesCount,iteration) = { | |
137 | - | let sessionIdFromKey = take(data.key, SESSIONIDFIXSIZE) | |
138 | - | if ((iteration >= dataEntriesCount)) | |
139 | - | then true | |
140 | - | else if (if (if ((sessionId == sessionIdFromKey)) | |
141 | - | then (size(data.key) > SESSIONIDFIXSIZE) | |
142 | - | else false) | |
143 | - | then !(isDefined(getString(this, data.key))) | |
144 | - | else false) | |
145 | - | then match data.value { | |
146 | - | case str: String => | |
147 | - | true | |
148 | - | case _ => | |
149 | - | throw((sessionId + " draw: only String type is accepted for data transactions")) | |
150 | - | } | |
151 | - | else false | |
136 | + | func validateDtxKey (sessionId,data) = if (if (if ((sessionId == take(data.key, SESSIONIDFIXSIZE))) | |
137 | + | then (size(data.key) > SESSIONIDFIXSIZE) | |
138 | + | else false) | |
139 | + | then !(isDefined(getString(this, data.key))) | |
140 | + | else false) | |
141 | + | then match data.value { | |
142 | + | case str: String => | |
143 | + | true | |
144 | + | case _ => | |
145 | + | throw((sessionId + " draw: only String type is accepted for data transactions")) | |
152 | 146 | } | |
147 | + | else false | |
153 | 148 | ||
154 | 149 | ||
155 | 150 | @Callable(i) | |
237 | 232 | let organizerPubKey58 = drawParamsList[1] | |
238 | 233 | let organizerPubKey = fromBase58String(organizerPubKey58) | |
239 | 234 | let dataEntriesCount = size(dtx.data) | |
240 | - | if (if (if (if (if (if (if (if (if ((drawState == STATEINIT)) | |
241 | - | then sigVerify(tx.bodyBytes, tx.proofs[0], organizerPubKey) | |
235 | + | let sigValid = sigVerify(tx.bodyBytes, tx.proofs[0], organizerPubKey) | |
236 | + | let dataSizeValid = if ((dataEntriesCount > 0)) | |
237 | + | then (5 >= dataEntriesCount) | |
238 | + | else false | |
239 | + | let keysValid = if (if (if (if (if (validateDtxKey(sessionId, data0)) | |
240 | + | then if ((1 >= dataEntriesCount)) | |
241 | + | then true | |
242 | + | else validateDtxKey(sessionId, dtx.data[1]) | |
242 | 243 | else false) | |
243 | - | then (dataEntriesCount > 0) | |
244 | + | then if ((2 >= dataEntriesCount)) | |
245 | + | then true | |
246 | + | else validateDtxKey(sessionId, dtx.data[2]) | |
244 | 247 | else false) | |
245 | - | then (5 >= dataEntriesCount) | |
248 | + | then if ((3 >= dataEntriesCount)) | |
249 | + | then true | |
250 | + | else validateDtxKey(sessionId, dtx.data[3]) | |
246 | 251 | else false) | |
247 | - | then validateDtxKey(sessionId, data0, dataEntriesCount, 0) | |
252 | + | then if ((4 >= dataEntriesCount)) | |
253 | + | then true | |
254 | + | else validateDtxKey(sessionId, dtx.data[4]) | |
248 | 255 | else false) | |
249 | - | then validateDtxKey(sessionId, dtx.data[1], dataEntriesCount, 1) | |
256 | + | then if ((5 >= dataEntriesCount)) | |
257 | + | then true | |
258 | + | else validateDtxKey(sessionId, dtx.data[5]) | |
259 | + | else false | |
260 | + | if (if (if ((drawState == STATEINIT)) | |
261 | + | then sigValid | |
250 | 262 | else false) | |
251 | - | then | |
263 | + | then dataSizeValid | |
252 | 264 | else false) | |
253 | - | then validateDtxKey(sessionId, dtx.data[3], dataEntriesCount, 3) | |
254 | - | else false) | |
255 | - | then validateDtxKey(sessionId, dtx.data[4], dataEntriesCount, 4) | |
256 | - | else false) | |
257 | - | then validateDtxKey(sessionId, dtx.data[5], dataEntriesCount, 5) | |
265 | + | then keysValid | |
258 | 266 | else false | |
259 | 267 | case sstx: SetScriptTransaction => | |
260 | 268 | true |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqlAiANSmBpDHYKP9sKgeN/l1bAb28g/tGlgDkwT5FiMN4X3pwdvdxE7mvSR8/41dU9rx4jG+6tZpb1ULVDPs431tR2IRaTXw5Cj+Ac2vhL+5JamCerGD1UW+bh/EGQtxo8W3YLDrofXB5QHJx4Pkz2Kgf+oS/C8hHuB/U4krO76U0507GTjZPP9kRQ0uLSMeqQXt8wXS+nMp5wajqxPpDLMaSREgsKwv/AEkP4dzpTYbikLBYl4qtdJsD84HLFSkiwd3BhcOrPjoIYmLxQuBD5TIMKTKD3sdZgaY9rsyqx3A00innyxD6zp3b4gFpUOX8JxKZdEC2myEqleNgg7GzwIDAQAB") | |
5 | 5 | ||
6 | 6 | let SERVER = addressFromStringValue("3NCiG28LmWyTigWG13E5QnvdHBsZFYXSS2j") | |
7 | 7 | ||
8 | 8 | let WAVELET = ((100 * 1000) * 1000) | |
9 | 9 | ||
10 | - | let SESSIONIDFIXSIZE = | |
10 | + | let SESSIONIDFIXSIZE = 44 | |
11 | 11 | ||
12 | 12 | let RANDCYCLEPRICE = ((5 * WAVELET) / 1000) | |
13 | 13 | ||
14 | 14 | let MAXRANDSPERCYCLE = 14 | |
15 | 15 | ||
16 | 16 | let STATEINIT = "INIT" | |
17 | 17 | ||
18 | 18 | let DATADONE = "READY" | |
19 | 19 | ||
20 | 20 | let STATEFINISHED = "FINISHED" | |
21 | 21 | ||
22 | 22 | let IdxState = 0 | |
23 | 23 | ||
24 | 24 | let IdxOrganizerPub = 1 | |
25 | 25 | ||
26 | 26 | let IdxRandFrom = 2 | |
27 | 27 | ||
28 | 28 | let IdxRandTo = 3 | |
29 | 29 | ||
30 | 30 | let IdxRandsCount = 4 | |
31 | 31 | ||
32 | 32 | let IdxRemainRandsCount = 5 | |
33 | 33 | ||
34 | 34 | let IdxDataDoneTxId = 6 | |
35 | 35 | ||
36 | 36 | let IdxLastOffset = 7 | |
37 | 37 | ||
38 | 38 | let IdxCurrRands = 8 | |
39 | 39 | ||
40 | 40 | func abs (val) = if ((0 > val)) | |
41 | 41 | then -(val) | |
42 | 42 | else val | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func formatStateDataStr (drawState,organizerPubKey58,randFrom,randTo,randsCount,remainingRands,dataDoneTxId,lastOffset,randOrEmpty) = { | |
46 | 46 | let fullStateStr = ((((((((((((((drawState + "_") + organizerPubKey58) + "_") + randFrom) + "_") + randTo) + "_") + randsCount) + "_") + remainingRands) + "_") + dataDoneTxId) + "_") + lastOffset) | |
47 | 47 | if ((randOrEmpty == "")) | |
48 | 48 | then ((fullStateStr + "_") + "-") | |
49 | 49 | else ((fullStateStr + "_") + randOrEmpty) | |
50 | 50 | } | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | func extractGameDataList (sessionId) = { | |
54 | 54 | let rawDataStr = getStringValue(this, sessionId) | |
55 | 55 | split(rawDataStr, "_") | |
56 | 56 | } | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | func nextRand (div,min,currRandsStr,remainingRands,remainingHash) = { | |
60 | 60 | let nextRandInt = ((abs(toInt(remainingHash)) % div) + min) | |
61 | 61 | let nextRandStr = toString(nextRandInt) | |
62 | 62 | let duplicate = isDefined(indexOf(currRandsStr, nextRandStr)) | |
63 | 63 | if (if (!(duplicate)) | |
64 | 64 | then (remainingRands > 0) | |
65 | 65 | else false) | |
66 | 66 | then [((currRandsStr + "-") + nextRandStr), "yes"] | |
67 | 67 | else [currRandsStr, ""] | |
68 | 68 | } | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func generateRand (sessionId,from,to,rsaSign,currRandsStr,remainingRands,lastOffsetBytes) = { | |
72 | 72 | let randHash = rsaSign | |
73 | 73 | let div = ((to - from) + 1) | |
74 | 74 | let rand1 = nextRand(div, from, currRandsStr, remainingRands, drop(randHash, (lastOffsetBytes + 1))) | |
75 | 75 | let rem1 = if ((rand1[1] != "")) | |
76 | 76 | then (remainingRands - 1) | |
77 | 77 | else remainingRands | |
78 | 78 | let rand2 = nextRand(div, from, rand1[0], rem1, drop(randHash, (lastOffsetBytes + 2))) | |
79 | 79 | let rem2 = if ((rand2[1] != "")) | |
80 | 80 | then (rem1 - 1) | |
81 | 81 | else rem1 | |
82 | 82 | let rand3 = nextRand(div, from, rand2[0], rem2, drop(randHash, (lastOffsetBytes + 3))) | |
83 | 83 | let rem3 = if ((rand3[1] != "")) | |
84 | 84 | then (rem2 - 1) | |
85 | 85 | else rem2 | |
86 | 86 | let rand4 = nextRand(div, from, rand3[0], rem3, drop(randHash, (lastOffsetBytes + 4))) | |
87 | 87 | let rem4 = if ((rand4[1] != "")) | |
88 | 88 | then (rem3 - 1) | |
89 | 89 | else rem3 | |
90 | 90 | let rand5 = nextRand(div, from, rand4[0], rem4, drop(randHash, (lastOffsetBytes + 5))) | |
91 | 91 | let rem5 = if ((rand5[1] != "")) | |
92 | 92 | then (rem4 - 1) | |
93 | 93 | else rem4 | |
94 | 94 | let rand6 = nextRand(div, from, rand5[0], rem5, drop(randHash, (lastOffsetBytes + 6))) | |
95 | 95 | let rem6 = if ((rand6[1] != "")) | |
96 | 96 | then (rem5 - 1) | |
97 | 97 | else rem5 | |
98 | 98 | let rand7 = nextRand(div, from, rand6[0], rem6, drop(randHash, (lastOffsetBytes + 7))) | |
99 | 99 | let rem7 = if ((rand7[1] != "")) | |
100 | 100 | then (rem6 - 1) | |
101 | 101 | else rem6 | |
102 | 102 | let rand8 = nextRand(div, from, rand7[0], rem7, drop(randHash, (lastOffsetBytes + 8))) | |
103 | 103 | let rem8 = if ((rand8[1] != "")) | |
104 | 104 | then (rem7 - 1) | |
105 | 105 | else rem7 | |
106 | 106 | let rand9 = nextRand(div, from, rand8[0], rem8, drop(randHash, (lastOffsetBytes + 9))) | |
107 | 107 | let rem9 = if ((rand9[1] != "")) | |
108 | 108 | then (rem8 - 1) | |
109 | 109 | else rem8 | |
110 | 110 | let rand10 = nextRand(div, from, rand9[0], rem9, drop(randHash, (lastOffsetBytes + 10))) | |
111 | 111 | let rem10 = if ((rand10[1] != "")) | |
112 | 112 | then (rem9 - 1) | |
113 | 113 | else rem9 | |
114 | 114 | let rand11 = nextRand(div, from, rand10[0], rem10, drop(randHash, (lastOffsetBytes + 11))) | |
115 | 115 | let rem11 = if ((rand11[1] != "")) | |
116 | 116 | then (rem10 - 1) | |
117 | 117 | else rem10 | |
118 | 118 | let rand12 = nextRand(div, from, rand11[0], rem11, drop(randHash, (lastOffsetBytes + 12))) | |
119 | 119 | let rem12 = if ((rand12[1] != "")) | |
120 | 120 | then (rem11 - 1) | |
121 | 121 | else rem11 | |
122 | 122 | let rand13 = nextRand(div, from, rand12[0], rem12, drop(randHash, (lastOffsetBytes + 13))) | |
123 | 123 | let rem13 = if ((rand13[1] != "")) | |
124 | 124 | then (rem12 - 1) | |
125 | 125 | else rem12 | |
126 | 126 | let rand14 = nextRand(div, from, rand13[0], rem13, drop(randHash, (lastOffsetBytes + 14))) | |
127 | 127 | let rem14 = if ((rand14[1] != "")) | |
128 | 128 | then (rem13 - 1) | |
129 | 129 | else rem13 | |
130 | 130 | [rand14[0], if ((rem14 == 0)) | |
131 | 131 | then "0" | |
132 | 132 | else toString(rem14), toString((lastOffsetBytes + 14))] | |
133 | 133 | } | |
134 | 134 | ||
135 | 135 | ||
136 | - | func validateDtxKey (sessionId,data,dataEntriesCount,iteration) = { | |
137 | - | let sessionIdFromKey = take(data.key, SESSIONIDFIXSIZE) | |
138 | - | if ((iteration >= dataEntriesCount)) | |
139 | - | then true | |
140 | - | else if (if (if ((sessionId == sessionIdFromKey)) | |
141 | - | then (size(data.key) > SESSIONIDFIXSIZE) | |
142 | - | else false) | |
143 | - | then !(isDefined(getString(this, data.key))) | |
144 | - | else false) | |
145 | - | then match data.value { | |
146 | - | case str: String => | |
147 | - | true | |
148 | - | case _ => | |
149 | - | throw((sessionId + " draw: only String type is accepted for data transactions")) | |
150 | - | } | |
151 | - | else false | |
136 | + | func validateDtxKey (sessionId,data) = if (if (if ((sessionId == take(data.key, SESSIONIDFIXSIZE))) | |
137 | + | then (size(data.key) > SESSIONIDFIXSIZE) | |
138 | + | else false) | |
139 | + | then !(isDefined(getString(this, data.key))) | |
140 | + | else false) | |
141 | + | then match data.value { | |
142 | + | case str: String => | |
143 | + | true | |
144 | + | case _ => | |
145 | + | throw((sessionId + " draw: only String type is accepted for data transactions")) | |
152 | 146 | } | |
147 | + | else false | |
153 | 148 | ||
154 | 149 | ||
155 | 150 | @Callable(i) | |
156 | 151 | func initDraw (randFrom,randTo,randsCount) = { | |
157 | 152 | let sessionId = toBase58String(i.transactionId) | |
158 | 153 | if (if ((0 >= randFrom)) | |
159 | 154 | then true | |
160 | 155 | else (0 >= randTo)) | |
161 | 156 | then throw("randFrom and randTo must be greater than 0") | |
162 | 157 | else if ((randFrom >= randTo)) | |
163 | 158 | then throw("randFrom must be strict less then randTo") | |
164 | 159 | else if ((randsCount > ((randTo - randFrom) + 1))) | |
165 | 160 | then throw(((((("Impossible to generate " + toString(randsCount)) + " for provided random range - from ") + toString(randFrom)) + " to ") + toString(randTo))) | |
166 | 161 | else { | |
167 | 162 | let organizerPubKey58 = toBase58String(i.callerPublicKey) | |
168 | 163 | let randsCountStr = toString(randsCount) | |
169 | 164 | let initState = formatStateDataStr(STATEINIT, organizerPubKey58, toString(randFrom), toString(randTo), randsCountStr, randsCountStr, "null", "0", "") | |
170 | 165 | ScriptResult(WriteSet([DataEntry(sessionId, initState)]), TransferSet([ScriptTransfer(SERVER, 1000, unit)])) | |
171 | 166 | } | |
172 | 167 | } | |
173 | 168 | ||
174 | 169 | ||
175 | 170 | ||
176 | 171 | @Callable(i) | |
177 | 172 | func ready (sessionId) = { | |
178 | 173 | let drawParamsList = extractGameDataList(sessionId) | |
179 | 174 | let drawState = drawParamsList[IdxState] | |
180 | 175 | let organizerPubKey58 = drawParamsList[IdxOrganizerPub] | |
181 | 176 | let randsCountStr = drawParamsList[IdxRandsCount] | |
182 | 177 | let remainRandsCountStr = drawParamsList[IdxRemainRandsCount] | |
183 | 178 | let fromStr = drawParamsList[IdxRandFrom] | |
184 | 179 | let toStr = drawParamsList[IdxRandTo] | |
185 | 180 | let organizerPubKey = fromBase58String(organizerPubKey58) | |
186 | 181 | if ((drawState != STATEINIT)) | |
187 | 182 | then throw((sessionId + " draw: moving into READY state is allowed only from INIT state")) | |
188 | 183 | else if ((organizerPubKey != i.callerPublicKey)) | |
189 | 184 | then throw((sessionId + "draw: moving into READY state is allowed for organizer only")) | |
190 | 185 | else { | |
191 | 186 | let readyState = formatStateDataStr(DATADONE, organizerPubKey58, fromStr, toStr, randsCountStr, remainRandsCountStr, toBase58String(i.transactionId), "0", "") | |
192 | 187 | WriteSet([DataEntry(sessionId, readyState)]) | |
193 | 188 | } | |
194 | 189 | } | |
195 | 190 | ||
196 | 191 | ||
197 | 192 | ||
198 | 193 | @Callable(i) | |
199 | 194 | func random (sessionId,rsaSign) = { | |
200 | 195 | let drawParamsList = extractGameDataList(sessionId) | |
201 | 196 | let drawState = drawParamsList[IdxState] | |
202 | 197 | let organizerPubKey58 = drawParamsList[IdxOrganizerPub] | |
203 | 198 | let randsCountStr = drawParamsList[IdxRandsCount] | |
204 | 199 | let remainRandsCount = parseIntValue(drawParamsList[IdxRemainRandsCount]) | |
205 | 200 | let lastOffsetBytes = parseIntValue(drawParamsList[IdxLastOffset]) | |
206 | 201 | let currRandsStr = drawParamsList[IdxCurrRands] | |
207 | 202 | let fromStr = drawParamsList[IdxRandFrom] | |
208 | 203 | let toStr = drawParamsList[IdxRandTo] | |
209 | 204 | let dataDoneTxId = drawParamsList[IdxDataDoneTxId] | |
210 | 205 | let from = parseIntValue(fromStr) | |
211 | 206 | let to = parseIntValue(toStr) | |
212 | 207 | let organizerPubKey = fromBase58String(organizerPubKey58) | |
213 | 208 | if ((drawState != DATADONE)) | |
214 | 209 | then throw((sessionId + " draw: it must be in READY state to generate random numbers")) | |
215 | 210 | else if (!(rsaVerify(SHA256, (toBytes(sessionId) + toBytes(dataDoneTxId)), rsaSign, RSAPUBLIC))) | |
216 | 211 | then throw("Invalid RSA signature") | |
217 | 212 | else { | |
218 | 213 | let randGenInfo = generateRand(sessionId, from, to, rsaSign, currRandsStr, remainRandsCount, lastOffsetBytes) | |
219 | 214 | let newRandsStr = randGenInfo[0] | |
220 | 215 | let newRemainRandsCountStr = randGenInfo[1] | |
221 | 216 | let newOffsetBytes = randGenInfo[2] | |
222 | 217 | let newState = if ((newRemainRandsCountStr == "0")) | |
223 | 218 | then STATEFINISHED | |
224 | 219 | else DATADONE | |
225 | 220 | WriteSet([DataEntry(sessionId, formatStateDataStr(newState, organizerPubKey58, fromStr, toStr, randsCountStr, newRemainRandsCountStr, dataDoneTxId, newOffsetBytes, newRandsStr))]) | |
226 | 221 | } | |
227 | 222 | } | |
228 | 223 | ||
229 | 224 | ||
230 | 225 | @Verifier(tx) | |
231 | 226 | func verify () = match tx { | |
232 | 227 | case dtx: DataTransaction => | |
233 | 228 | let data0 = dtx.data[0] | |
234 | 229 | let sessionId = take(data0.key, SESSIONIDFIXSIZE) | |
235 | 230 | let drawParamsList = extractGameDataList(sessionId) | |
236 | 231 | let drawState = drawParamsList[0] | |
237 | 232 | let organizerPubKey58 = drawParamsList[1] | |
238 | 233 | let organizerPubKey = fromBase58String(organizerPubKey58) | |
239 | 234 | let dataEntriesCount = size(dtx.data) | |
240 | - | if (if (if (if (if (if (if (if (if ((drawState == STATEINIT)) | |
241 | - | then sigVerify(tx.bodyBytes, tx.proofs[0], organizerPubKey) | |
235 | + | let sigValid = sigVerify(tx.bodyBytes, tx.proofs[0], organizerPubKey) | |
236 | + | let dataSizeValid = if ((dataEntriesCount > 0)) | |
237 | + | then (5 >= dataEntriesCount) | |
238 | + | else false | |
239 | + | let keysValid = if (if (if (if (if (validateDtxKey(sessionId, data0)) | |
240 | + | then if ((1 >= dataEntriesCount)) | |
241 | + | then true | |
242 | + | else validateDtxKey(sessionId, dtx.data[1]) | |
242 | 243 | else false) | |
243 | - | then (dataEntriesCount > 0) | |
244 | + | then if ((2 >= dataEntriesCount)) | |
245 | + | then true | |
246 | + | else validateDtxKey(sessionId, dtx.data[2]) | |
244 | 247 | else false) | |
245 | - | then (5 >= dataEntriesCount) | |
248 | + | then if ((3 >= dataEntriesCount)) | |
249 | + | then true | |
250 | + | else validateDtxKey(sessionId, dtx.data[3]) | |
246 | 251 | else false) | |
247 | - | then validateDtxKey(sessionId, data0, dataEntriesCount, 0) | |
252 | + | then if ((4 >= dataEntriesCount)) | |
253 | + | then true | |
254 | + | else validateDtxKey(sessionId, dtx.data[4]) | |
248 | 255 | else false) | |
249 | - | then validateDtxKey(sessionId, dtx.data[1], dataEntriesCount, 1) | |
256 | + | then if ((5 >= dataEntriesCount)) | |
257 | + | then true | |
258 | + | else validateDtxKey(sessionId, dtx.data[5]) | |
259 | + | else false | |
260 | + | if (if (if ((drawState == STATEINIT)) | |
261 | + | then sigValid | |
250 | 262 | else false) | |
251 | - | then | |
263 | + | then dataSizeValid | |
252 | 264 | else false) | |
253 | - | then validateDtxKey(sessionId, dtx.data[3], dataEntriesCount, 3) | |
254 | - | else false) | |
255 | - | then validateDtxKey(sessionId, dtx.data[4], dataEntriesCount, 4) | |
256 | - | else false) | |
257 | - | then validateDtxKey(sessionId, dtx.data[5], dataEntriesCount, 5) | |
265 | + | then keysValid | |
258 | 266 | else false | |
259 | 267 | case sstx: SetScriptTransaction => | |
260 | 268 | true | |
261 | 269 | case ttx: TransferTransaction => | |
262 | 270 | true | |
263 | 271 | case _ => | |
264 | 272 | false | |
265 | 273 | } | |
266 | 274 |
github/deemru/w8io/026f985 57.25 ms ◑