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