tx · 2u7z9Qm4z5LuxTjv7geWobtEpHL9PFBbBsg7XMyTpCSW 3N9HhS6vJzYLJunmBJDq7jFtm7Xj2gnkFKr: -0.01500000 Waves 2019.08.05 16:44 [617679] smart account 3N9HhS6vJzYLJunmBJDq7jFtm7Xj2gnkFKr > SELF 0.00000000 Waves
{ "type": 13, "id": "2u7z9Qm4z5LuxTjv7geWobtEpHL9PFBbBsg7XMyTpCSW", "fee": 1500000, "feeAssetId": null, "timestamp": 1565012673059, "version": 1, "sender": "3N9HhS6vJzYLJunmBJDq7jFtm7Xj2gnkFKr", "senderPublicKey": "GpSs1j5ktYmC9jxfdsR99KpS9p16dfJVpBAy4v5Abu8S", "proofs": [ "2WC8iUxi2eQdGrY1fPHW6z3oghLz6VRoGAh6ZusLiUnXVqKoPT5Vx4Sh1bHz8wArks4roEArikeLsPzrqwpgLvkG" ], "script": "base64:AAIDAAAAAAAAAAAAAAAZAAAAAAlSU0FQVUJMSUMJAAJbAAAAAQIAAAGPYmFzZTY0Ok1JSUJJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBbXB1WGNJL280cElCNXl3djlET09HYXBUQlV3UlZsTS82K0g2aEZlbE9YdGtyd1kvWUl0bVB4RURwejdyQWVyUVBRZTl0RFBFYUF2L0dubEV6dHliT0ZYZ3U5RHpEZThZb01SRDF2YWtnb0Fjb2dtYlk1OFFENktNajVIa29Wai95VE5JYzlzemo1cWhJbHJBZG1iM0tMTDZoUVU3eTgrSmo2OUJXVlBzYVFna3NwU2RlWXRiMXRIUWM3dDk1bjdPWjU2cjJBN0czK2JRZjZuU01rUGtBaElyRXBiQ201OG9pR0JjemRUZC9McUZTVm90WnNiTDdZaDZTSExmbkhlRCtRZ2NmSnJuYW04T0hNR0pFSlRSWGpJTGVIR2psUkNQOG9WcGlvSHJ5MVMyeFB4NXNWekltMk1NK0N6WWVuQUdsbzBqMjZhdEJoaVVMb1R1bHdEM3BRSURBUUFCAAAAAAZTRVJW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AgUAAAAJc2Vzc2lvbklkCQABkQAAAAIIBQAAAANkdHgAAAAEZGF0YQAAAAAAAAAAAgcDCQAAZwAAAAIAAAAAAAAAAAMFAAAAEGRhdGFFbnRyaWVzQ291bnQGCQEAAAAOdmFsaWRhdGVEdHhLZXkAAAACBQAAAAlzZXNzaW9uSWQJAAGRAAAAAggFAAAAA2R0eAAAAARkYXRhAAAAAAAAAAADBwMJAABnAAAAAgAAAAAAAAAABAUAAAAQZGF0YUVudHJpZXNDb3VudAYJAQAAAA52YWxpZGF0ZUR0eEtleQAAAAIFAAAACXNlc3Npb25JZAkAAZEAAAACCAUAAAADZHR4AAAABGRhdGEAAAAAAAAAAAQHAwkAAGcAAAACAAAAAAAAAAAFBQAAABBkYXRhRW50cmllc0NvdW50BgkBAAAADnZhbGlkYXRlRHR4S2V5AAAAAgUAAAAJc2Vzc2lvbklkCQABkQAAAAIIBQAAAANkdHgAAAAEZGF0YQAAAAAAAAAABQcDAwMJAAAAAAAAAgUAAAAJZHJhd1N0YXRlBQAAAAlTVEFURUlOSVQFAAAACHNpZ1ZhbGlkBwUAAAANZGF0YVNpemVWYWxpZAcFAAAACWtleXNWYWxpZAcDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAFFNldFNjcmlwdFRyYW5zYWN0aW9uBAAAAARzc3R4BQAAAAckbWF0Y2gwBgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAADdHR4BQAAAAckbWF0Y2gwBge62w55", "chainId": 84, "height": 617679, "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:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmpuXcI/o4pIB5ywv9DOOGapTBUwRVlM/6+H6hFelOXtkrwY/YItmPxEDpz7rAerQPQe9tDPEaAv/GnlEztybOFXgu9DzDe8YoMRD1vakgoAcogmbY58QD6KMj5HkoVj/yTNIc9szj5qhIlrAdmb3KLL6hQU7y8+Jj69BWVPsaQgkspSdeYtb1tHQc7t95n7OZ56r2A7G3+bQf6nSMkPkAhIrEpbCm58oiGBczdTd/LqFSVotZsbL7Yh6SHLfnHeD+QgcfJrnam8OHMGJEJTRXjILeHGjlRCP8oVpioHry1S2xPx5sVzIm2MM+CzYenAGlo0j26atBhiULoTulwD3pQIDAQAB") | |
5 | + | ||
6 | + | let SERVER = addressFromStringValue("3NCiG28LmWyTigWG13E5QnvdHBsZFYXSS2j") | |
7 | + | ||
8 | + | let WAVELET = ((100 * 1000) * 1000) | |
9 | + | ||
10 | + | let SESSIONIDFIXSIZE = 44 | |
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) = 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")) | |
146 | + | } | |
147 | + | else false | |
148 | + | ||
149 | + | ||
150 | + | func validateAndGetRandsPmt (randsCount,pmt,minDataPmt) = { | |
151 | + | let bound1 = 1000 | |
152 | + | let basePrice1 = ((13 * WAVELET) / 100) | |
153 | + | let div1 = 50 | |
154 | + | let diff1 = ((8 * WAVELET) / 100) | |
155 | + | let bound2 = 5000 | |
156 | + | let basePrice2 = ((297 * WAVELET) / 100) | |
157 | + | let div2 = 1000 | |
158 | + | let diff2 = ((143 * WAVELET) / 100) | |
159 | + | let bound3 = 50000 | |
160 | + | let basePrice3 = ((1427 * WAVELET) / 100) | |
161 | + | let div3 = 5000 | |
162 | + | let diff3 = ((705 * WAVELET) / 100) | |
163 | + | let minRandsPmt = if ((bound1 > randsCount)) | |
164 | + | then (basePrice1 + ((randsCount / div1) * diff1)) | |
165 | + | else if ((bound2 > randsCount)) | |
166 | + | then (basePrice2 + (((randsCount / div2) - 1) * diff2)) | |
167 | + | else if ((bound3 > randsCount)) | |
168 | + | then (basePrice3 + (((randsCount / div3) - 1) * diff3)) | |
169 | + | else throw("Please contact our sales team to generate more than 50k rands") | |
170 | + | let minPmt = (minRandsPmt + minDataPmt) | |
171 | + | if (isDefined(pmt.assetId)) | |
172 | + | then throw("Only WAVES can be used as a payment for rands generation") | |
173 | + | else if ((minPmt > pmt.amount)) | |
174 | + | then throw(((((("Attached payment is to small to generate " + toString(randsCount)) + " unique randoms numbers and upload at least 1 data tx: actualPmt=") + toString(pmt.amount)) + " but minPmt is ") + toString(minPmt))) | |
175 | + | else minRandsPmt | |
176 | + | } | |
177 | + | ||
178 | + | ||
179 | + | @Callable(i) | |
180 | + | func initDraw (randFrom,randTo,randsCount) = { | |
181 | + | let sessionId = toBase58String(i.transactionId) | |
182 | + | let rangeLength = ((randTo - randFrom) + 1) | |
183 | + | let maxRangeLength = (rangeLength / 2) | |
184 | + | 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 > rangeLength)) | |
191 | + | then throw(((((((("Impossible to generate " + toString(randsCount)) + " unique numbers for provided random range [") + toString(randFrom)) + ", ") + toString(randTo)) + "] with actual size ") + toString(rangeLength))) | |
192 | + | else if ((randsCount > maxRangeLength)) | |
193 | + | then throw(((((((((("randsCount must be less then 50% of passed range length: range=[" + toString(randFrom)) + ", ") + toString(randTo)) + "], rangeLength=") + toString(rangeLength)) + " randsCount=") + toString(randsCount)) + " allowedRandsCount=") + toString(maxRangeLength))) | |
194 | + | else if (!(isDefined(i.payment))) | |
195 | + | then throw("Please provide payment to generate unique random numbers") | |
196 | + | else { | |
197 | + | let pmt = extract(i.payment) | |
198 | + | let minDataPmt = ((5 * WAVELET) / 1000) | |
199 | + | let randsPmt = validateAndGetRandsPmt(randsCount, pmt, minDataPmt) | |
200 | + | let organizerPubKey58 = toBase58String(i.callerPublicKey) | |
201 | + | let randsCountStr = toString(randsCount) | |
202 | + | let initState = formatStateDataStr(STATEINIT, organizerPubKey58, toString(randFrom), toString(randTo), randsCountStr, randsCountStr, "null", "0", "") | |
203 | + | ScriptResult(WriteSet([DataEntry(sessionId, initState)]), TransferSet([ScriptTransfer(SERVER, randsPmt, unit)])) | |
204 | + | } | |
205 | + | } | |
206 | + | ||
207 | + | ||
208 | + | ||
209 | + | @Callable(i) | |
210 | + | func ready (sessionId) = { | |
211 | + | let drawParamsList = extractGameDataList(sessionId) | |
212 | + | let drawState = drawParamsList[IdxState] | |
213 | + | let organizerPubKey58 = drawParamsList[IdxOrganizerPub] | |
214 | + | let randsCountStr = drawParamsList[IdxRandsCount] | |
215 | + | let remainRandsCountStr = drawParamsList[IdxRemainRandsCount] | |
216 | + | let fromStr = drawParamsList[IdxRandFrom] | |
217 | + | let toStr = drawParamsList[IdxRandTo] | |
218 | + | let organizerPubKey = fromBase58String(organizerPubKey58) | |
219 | + | if ((drawState != STATEINIT)) | |
220 | + | then throw((sessionId + " draw: moving into READY state is allowed only from INIT state")) | |
221 | + | else if ((organizerPubKey != i.callerPublicKey)) | |
222 | + | then throw((sessionId + "draw: moving into READY state is allowed for organizer only")) | |
223 | + | else { | |
224 | + | let readyState = formatStateDataStr(DATADONE, organizerPubKey58, fromStr, toStr, randsCountStr, remainRandsCountStr, toBase58String(i.transactionId), "0", "") | |
225 | + | WriteSet([DataEntry(sessionId, readyState)]) | |
226 | + | } | |
227 | + | } | |
228 | + | ||
229 | + | ||
230 | + | ||
231 | + | @Callable(i) | |
232 | + | func random (sessionId,rsaSign) = { | |
233 | + | let drawParamsList = extractGameDataList(sessionId) | |
234 | + | let drawState = drawParamsList[IdxState] | |
235 | + | let organizerPubKey58 = drawParamsList[IdxOrganizerPub] | |
236 | + | let randsCountStr = drawParamsList[IdxRandsCount] | |
237 | + | let remainRandsCount = parseIntValue(drawParamsList[IdxRemainRandsCount]) | |
238 | + | let lastOffsetBytes = parseIntValue(drawParamsList[IdxLastOffset]) | |
239 | + | let currRandsStr = drawParamsList[IdxCurrRands] | |
240 | + | let fromStr = drawParamsList[IdxRandFrom] | |
241 | + | let toStr = drawParamsList[IdxRandTo] | |
242 | + | let dataDoneTxId = drawParamsList[IdxDataDoneTxId] | |
243 | + | let from = parseIntValue(fromStr) | |
244 | + | let to = parseIntValue(toStr) | |
245 | + | let organizerPubKey = fromBase58String(organizerPubKey58) | |
246 | + | if ((drawState != DATADONE)) | |
247 | + | then throw((sessionId + " draw: it must be in READY state to generate random numbers")) | |
248 | + | else if (!(rsaVerify(SHA256, (toBytes(sessionId) + toBytes(dataDoneTxId)), rsaSign, RSAPUBLIC))) | |
249 | + | then throw("Invalid RSA signature") | |
250 | + | else { | |
251 | + | let randGenInfo = generateRand(sessionId, from, to, rsaSign, currRandsStr, remainRandsCount, lastOffsetBytes) | |
252 | + | let newRandsStr = randGenInfo[0] | |
253 | + | let newRemainRandsCountStr = randGenInfo[1] | |
254 | + | let newOffsetBytes = randGenInfo[2] | |
255 | + | let newState = if ((newRemainRandsCountStr == "0")) | |
256 | + | then STATEFINISHED | |
257 | + | else DATADONE | |
258 | + | WriteSet([DataEntry(sessionId, formatStateDataStr(newState, organizerPubKey58, fromStr, toStr, randsCountStr, newRemainRandsCountStr, dataDoneTxId, newOffsetBytes, newRandsStr))]) | |
259 | + | } | |
260 | + | } | |
261 | + | ||
262 | + | ||
263 | + | @Verifier(tx) | |
264 | + | func verify () = match tx { | |
265 | + | case dtx: DataTransaction => | |
266 | + | let data0 = dtx.data[0] | |
267 | + | let sessionId = take(data0.key, SESSIONIDFIXSIZE) | |
268 | + | let drawParamsList = extractGameDataList(sessionId) | |
269 | + | let drawState = drawParamsList[0] | |
270 | + | let organizerPubKey58 = drawParamsList[1] | |
271 | + | let organizerPubKey = fromBase58String(organizerPubKey58) | |
272 | + | let dataEntriesCount = size(dtx.data) | |
273 | + | let sigValid = sigVerify(tx.bodyBytes, tx.proofs[0], organizerPubKey) | |
274 | + | let dataSizeValid = if ((dataEntriesCount > 0)) | |
275 | + | then (5 >= dataEntriesCount) | |
276 | + | else false | |
277 | + | let keysValid = if (if (if (if (if (validateDtxKey(sessionId, data0)) | |
278 | + | then if ((1 >= dataEntriesCount)) | |
279 | + | then true | |
280 | + | else validateDtxKey(sessionId, dtx.data[1]) | |
281 | + | else false) | |
282 | + | then if ((2 >= dataEntriesCount)) | |
283 | + | then true | |
284 | + | else validateDtxKey(sessionId, dtx.data[2]) | |
285 | + | else false) | |
286 | + | then if ((3 >= dataEntriesCount)) | |
287 | + | then true | |
288 | + | else validateDtxKey(sessionId, dtx.data[3]) | |
289 | + | else false) | |
290 | + | then if ((4 >= dataEntriesCount)) | |
291 | + | then true | |
292 | + | else validateDtxKey(sessionId, dtx.data[4]) | |
293 | + | else false) | |
294 | + | then if ((5 >= dataEntriesCount)) | |
295 | + | then true | |
296 | + | else validateDtxKey(sessionId, dtx.data[5]) | |
297 | + | else false | |
298 | + | if (if (if ((drawState == STATEINIT)) | |
299 | + | then sigValid | |
300 | + | else false) | |
301 | + | then dataSizeValid | |
302 | + | else false) | |
303 | + | then keysValid | |
304 | + | else false | |
305 | + | case sstx: SetScriptTransaction => | |
306 | + | true | |
307 | + | case ttx: TransferTransaction => | |
308 | + | true | |
309 | + | case _ => | |
310 | + | false | |
311 | + | } | |
312 | + |
github/deemru/w8io/026f985 23.40 ms ◑