tx · CPHX19BH6pSacwrDaiubkjp9XR65DxudYJQrNWKXcPKt

3MxbbkRa5VF14vB5ZtTfTmhMjWmBpGn46tF:  -0.01500000 Waves

2019.07.04 20:33 [571014] smart account 3MxbbkRa5VF14vB5ZtTfTmhMjWmBpGn46tF > SELF 0.00000000 Waves

{ "type": 13, "id": "CPHX19BH6pSacwrDaiubkjp9XR65DxudYJQrNWKXcPKt", "fee": 1500000, "feeAssetId": null, "timestamp": 1562261660024, "version": 1, "sender": "3MxbbkRa5VF14vB5ZtTfTmhMjWmBpGn46tF", "senderPublicKey": "Cbypqw9xC4dKPhUE9Mor41PKzgcxwcN9Uf4Y3P9EyCVe", "proofs": [ "5mZnpYgmDcv3EPqmAJse6Pn28ooGd5n8CKJQ2m9Aqwh3KRAU3R9quc8Ng5zuo9B1HxZRmbvAEJzPzKEgtroFy2fk" ], "script": "base64:AAIDAAAAAAAAAAAAAAAcAAAAAAlSU0FQVUJMSUMJAAJbAAAAAQIAAAGPYmFzZTY0Ok1JSUJJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBcWxBaUFOU21CcERIWUtQOXNLZ2VOL2wxYkFiMjhnL3RHbGdEa3dUNUZpTU40WDNwd2R2ZHhFN212U1I4LzQxZFU5cng0akcrNnRacGIxVUxWRFBzNDMxdFIySVJhVFh3NUNqK0FjMnZoTCs1SmFtQ2VyR0QxVVcrYmgvRUdRdHhvOFczWUxEcm9mWEI1UUhKeDRQa3oyS2dmK29TL0M4aEh1Qi9VNGtyTzc2VTA1MDdHVGpaUFA5a1JRMHVMU01lcVFYdDh3WFMrbk1wNXdhanF4UHBETE1hU1JFZ3NLd3YvQUVrUDRkenBUWWJpa0xCWWw0cXRkSnNEODRITEZTa2l3ZDNCaGNPclBqb0lZbUx4UXVCRDVUSU1LVEtEM3NkWmdhWTlyc3lxeDNBMDBpbm55eEQ2enAzYjRnRnBVT1g4SnhLWmRFQzJteUVxbGVOZ2c3R3p3SURBUUFCAA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AAEZGF0YQAAAAAAAAAABQUAAAAQZGF0YUVudHJpZXNDb3VudAAAAAAAAAAABQcDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAFFNldFNjcmlwdFRyYW5zYWN0aW9uBAAAAARzc3R4BQAAAAckbWF0Y2gwBgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAADdHR4BQAAAAckbWF0Y2gwBgdHbjfG", "chainId": 84, "height": 571014, "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 = sha256(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 newRemainRandsCountStr = toString((remainRandsCount - uniqRands))
258+ let newOffsetBytes = randGenInfo[2]
259+ WriteSet([DataEntry(sessionId, formatStateDataStr(STATEFINISHED, organizerPubKey58, fromStr, toStr, randsCountStr, newRemainRandsCountStr, newOffsetBytes, newRandsStr))])
260+ }
261+ }
262+
263+
264+@Verifier(tx)
265+func verify () = match tx {
266+ case dtx: DataTransaction =>
267+ let data0 = dtx.data[0]
268+ let sessionId = take(data0.key, SESSIONIDFIXSIZE)
269+ let drawParamsList = extractGameDataList(sessionId)
270+ let drawState = drawParamsList[0]
271+ let organizerPubKey58 = drawParamsList[1]
272+ let organizerPubKey = fromBase58String(organizerPubKey58)
273+ let dataEntriesCount = size(dtx.data)
274+ if (if (if (if (if (if (if (if (if ((drawState == STATEINIT))
275+ then sigVerify(tx.bodyBytes, tx.proofs[0], organizerPubKey)
276+ else false)
277+ then (dataEntriesCount > 0)
278+ else false)
279+ then (5 >= dataEntriesCount)
280+ else false)
281+ then validateDtxKey(sessionId, data0, dataEntriesCount, 0)
282+ else false)
283+ then validateDtxKey(sessionId, dtx.data[1], dataEntriesCount, 1)
284+ else false)
285+ then validateDtxKey(sessionId, dtx.data[2], dataEntriesCount, 2)
286+ else false)
287+ then validateDtxKey(sessionId, dtx.data[3], dataEntriesCount, 3)
288+ else false)
289+ then validateDtxKey(sessionId, dtx.data[4], dataEntriesCount, 4)
290+ else false)
291+ then validateDtxKey(sessionId, dtx.data[5], dataEntriesCount, 5)
292+ else false
293+ case sstx: SetScriptTransaction =>
294+ true
295+ case ttx: TransferTransaction =>
296+ true
297+ case _ =>
298+ false
299+}
300+

github/deemru/w8io/169f3d6 
29.05 ms