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