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