tx · 4RHX2RQ3TufUAWaBLFJcaTJZ5kBdpDxZfHCFuKkdmbi7

3N4g7H9nnQiD6HynbEKfQzYmFaxjNRrcdmu:  -0.01500000 Waves

2019.07.04 21:10 [571057] smart account 3N4g7H9nnQiD6HynbEKfQzYmFaxjNRrcdmu > SELF 0.00000000 Waves

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

github/deemru/w8io/169f3d6 
28.39 ms