tx · E7kdGeKUvaWAQXHi33iKFajNzK6eyfsMWGXEjtUoJGi3

3MqtTwie8XKCcUcntgFAFYnfLEnffezju4Y:  -0.01500000 Waves

2019.07.25 18:23 [601739] smart account 3MqtTwie8XKCcUcntgFAFYnfLEnffezju4Y > SELF 0.00000000 Waves

{ "type": 13, "id": "E7kdGeKUvaWAQXHi33iKFajNzK6eyfsMWGXEjtUoJGi3", "fee": 1500000, "feeAssetId": null, "timestamp": 1564068184731, "version": 1, "sender": "3MqtTwie8XKCcUcntgFAFYnfLEnffezju4Y", "senderPublicKey": "Gf4eU8JJaQziR7AfnST6tmzhUgFmeKavkwyoceen3PK1", "proofs": [ "3YnHpi56XCjALg57KGtpGG9Y5iJyv3Eh7EPUp1KE2Ar1n51vcpWpQp74NnBtvvvnhUj6uGihMiLj8WuX6C19gMni" ], "script": "base64:AAIDAAAAAAAAAAAAAAAYAAAAAAlSU0FQVUJMSUMJAAJbAAAAAQIAAAGPYmFzZTY0Ok1JSUJJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBcWxBaUFOU21CcERIWUtQOXNLZ2VOL2wxYkFiMjhnL3RHbGdEa3dUNUZpTU40WDNwd2R2ZHhFN212U1I4LzQxZFU5cng0akcrNnRacGIxVUxWRFBzNDMxdFIySVJhVFh3NUNqK0FjMnZoTCs1SmFtQ2VyR0QxVVcrYmgvRUdRdHhvOFczWUxEcm9mWEI1UUhKeDRQa3oyS2dmK29TL0M4aEh1Qi9VNGtyTzc2VTA1MDdHVGpaUFA5a1JRMHVMU01lcVFYdDh3WFMrbk1wNXdhanF4UHBETE1hU1JFZ3NLd3YvQUVrUDRkenBUWWJpa0xCWWw0cXRkSnNEODRITEZTa2l3ZDNCaGNPclBqb0lZbUx4UXVCRDVUSU1LVEtEM3NkWmdhWTlyc3lxeDNBMDBpbm55eEQ2enAzYjRnRnBVT1g4SnhLWmRFQzJteUVxbGVOZ2c3R3p3SURBUUFCAAAAAAZTRVJWRVI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Rc5ua6qNa5FH6RaHwSpQL Next: F6RpxQT5HqcMhmoYwPTaxvfC5AdZ9JNwsdsAU6tCBuGR Diff:
OldNewDifferences
77
88 let WAVELET = ((100 * 1000) * 1000)
99
10-let SESSIONIDFIXSIZE = 50
10+let SESSIONIDFIXSIZE = 44
1111
1212 let RANDCYCLEPRICE = ((5 * WAVELET) / 1000)
1313
133133 }
134134
135135
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
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"))
152146 }
147+ else false
153148
154149
155150 @Callable(i)
237232 let organizerPubKey58 = drawParamsList[1]
238233 let organizerPubKey = fromBase58String(organizerPubKey58)
239234 let dataEntriesCount = size(dtx.data)
240- if (if (if (if (if (if (if (if (if ((drawState == STATEINIT))
241- then sigVerify(tx.bodyBytes, tx.proofs[0], organizerPubKey)
235+ let sigValid = sigVerify(tx.bodyBytes, tx.proofs[0], organizerPubKey)
236+ let dataSizeValid = if ((dataEntriesCount > 0))
237+ then (5 >= dataEntriesCount)
238+ else false
239+ let keysValid = if (if (if (if (if (validateDtxKey(sessionId, data0))
240+ then if ((1 >= dataEntriesCount))
241+ then true
242+ else validateDtxKey(sessionId, dtx.data[1])
242243 else false)
243- then (dataEntriesCount > 0)
244+ then if ((2 >= dataEntriesCount))
245+ then true
246+ else validateDtxKey(sessionId, dtx.data[2])
244247 else false)
245- then (5 >= dataEntriesCount)
248+ then if ((3 >= dataEntriesCount))
249+ then true
250+ else validateDtxKey(sessionId, dtx.data[3])
246251 else false)
247- then validateDtxKey(sessionId, data0, dataEntriesCount, 0)
252+ then if ((4 >= dataEntriesCount))
253+ then true
254+ else validateDtxKey(sessionId, dtx.data[4])
248255 else false)
249- then validateDtxKey(sessionId, dtx.data[1], dataEntriesCount, 1)
256+ then if ((5 >= dataEntriesCount))
257+ then true
258+ else validateDtxKey(sessionId, dtx.data[5])
259+ else false
260+ if (if (if ((drawState == STATEINIT))
261+ then sigValid
250262 else false)
251- then validateDtxKey(sessionId, dtx.data[2], dataEntriesCount, 2)
263+ then dataSizeValid
252264 else false)
253- then validateDtxKey(sessionId, dtx.data[3], dataEntriesCount, 3)
254- else false)
255- then validateDtxKey(sessionId, dtx.data[4], dataEntriesCount, 4)
256- else false)
257- then validateDtxKey(sessionId, dtx.data[5], dataEntriesCount, 5)
265+ then keysValid
258266 else false
259267 case sstx: SetScriptTransaction =>
260268 true
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqlAiANSmBpDHYKP9sKgeN/l1bAb28g/tGlgDkwT5FiMN4X3pwdvdxE7mvSR8/41dU9rx4jG+6tZpb1ULVDPs431tR2IRaTXw5Cj+Ac2vhL+5JamCerGD1UW+bh/EGQtxo8W3YLDrofXB5QHJx4Pkz2Kgf+oS/C8hHuB/U4krO76U0507GTjZPP9kRQ0uLSMeqQXt8wXS+nMp5wajqxPpDLMaSREgsKwv/AEkP4dzpTYbikLBYl4qtdJsD84HLFSkiwd3BhcOrPjoIYmLxQuBD5TIMKTKD3sdZgaY9rsyqx3A00innyxD6zp3b4gFpUOX8JxKZdEC2myEqleNgg7GzwIDAQAB")
55
66 let SERVER = addressFromStringValue("3NCiG28LmWyTigWG13E5QnvdHBsZFYXSS2j")
77
88 let WAVELET = ((100 * 1000) * 1000)
99
10-let SESSIONIDFIXSIZE = 50
10+let SESSIONIDFIXSIZE = 44
1111
1212 let RANDCYCLEPRICE = ((5 * WAVELET) / 1000)
1313
1414 let MAXRANDSPERCYCLE = 14
1515
1616 let STATEINIT = "INIT"
1717
1818 let DATADONE = "READY"
1919
2020 let STATEFINISHED = "FINISHED"
2121
2222 let IdxState = 0
2323
2424 let IdxOrganizerPub = 1
2525
2626 let IdxRandFrom = 2
2727
2828 let IdxRandTo = 3
2929
3030 let IdxRandsCount = 4
3131
3232 let IdxRemainRandsCount = 5
3333
3434 let IdxDataDoneTxId = 6
3535
3636 let IdxLastOffset = 7
3737
3838 let IdxCurrRands = 8
3939
4040 func abs (val) = if ((0 > val))
4141 then -(val)
4242 else val
4343
4444
4545 func formatStateDataStr (drawState,organizerPubKey58,randFrom,randTo,randsCount,remainingRands,dataDoneTxId,lastOffset,randOrEmpty) = {
4646 let fullStateStr = ((((((((((((((drawState + "_") + organizerPubKey58) + "_") + randFrom) + "_") + randTo) + "_") + randsCount) + "_") + remainingRands) + "_") + dataDoneTxId) + "_") + lastOffset)
4747 if ((randOrEmpty == ""))
4848 then ((fullStateStr + "_") + "-")
4949 else ((fullStateStr + "_") + randOrEmpty)
5050 }
5151
5252
5353 func extractGameDataList (sessionId) = {
5454 let rawDataStr = getStringValue(this, sessionId)
5555 split(rawDataStr, "_")
5656 }
5757
5858
5959 func nextRand (div,min,currRandsStr,remainingRands,remainingHash) = {
6060 let nextRandInt = ((abs(toInt(remainingHash)) % div) + min)
6161 let nextRandStr = toString(nextRandInt)
6262 let duplicate = isDefined(indexOf(currRandsStr, nextRandStr))
6363 if (if (!(duplicate))
6464 then (remainingRands > 0)
6565 else false)
6666 then [((currRandsStr + "-") + nextRandStr), "yes"]
6767 else [currRandsStr, ""]
6868 }
6969
7070
7171 func generateRand (sessionId,from,to,rsaSign,currRandsStr,remainingRands,lastOffsetBytes) = {
7272 let randHash = rsaSign
7373 let div = ((to - from) + 1)
7474 let rand1 = nextRand(div, from, currRandsStr, remainingRands, drop(randHash, (lastOffsetBytes + 1)))
7575 let rem1 = if ((rand1[1] != ""))
7676 then (remainingRands - 1)
7777 else remainingRands
7878 let rand2 = nextRand(div, from, rand1[0], rem1, drop(randHash, (lastOffsetBytes + 2)))
7979 let rem2 = if ((rand2[1] != ""))
8080 then (rem1 - 1)
8181 else rem1
8282 let rand3 = nextRand(div, from, rand2[0], rem2, drop(randHash, (lastOffsetBytes + 3)))
8383 let rem3 = if ((rand3[1] != ""))
8484 then (rem2 - 1)
8585 else rem2
8686 let rand4 = nextRand(div, from, rand3[0], rem3, drop(randHash, (lastOffsetBytes + 4)))
8787 let rem4 = if ((rand4[1] != ""))
8888 then (rem3 - 1)
8989 else rem3
9090 let rand5 = nextRand(div, from, rand4[0], rem4, drop(randHash, (lastOffsetBytes + 5)))
9191 let rem5 = if ((rand5[1] != ""))
9292 then (rem4 - 1)
9393 else rem4
9494 let rand6 = nextRand(div, from, rand5[0], rem5, drop(randHash, (lastOffsetBytes + 6)))
9595 let rem6 = if ((rand6[1] != ""))
9696 then (rem5 - 1)
9797 else rem5
9898 let rand7 = nextRand(div, from, rand6[0], rem6, drop(randHash, (lastOffsetBytes + 7)))
9999 let rem7 = if ((rand7[1] != ""))
100100 then (rem6 - 1)
101101 else rem6
102102 let rand8 = nextRand(div, from, rand7[0], rem7, drop(randHash, (lastOffsetBytes + 8)))
103103 let rem8 = if ((rand8[1] != ""))
104104 then (rem7 - 1)
105105 else rem7
106106 let rand9 = nextRand(div, from, rand8[0], rem8, drop(randHash, (lastOffsetBytes + 9)))
107107 let rem9 = if ((rand9[1] != ""))
108108 then (rem8 - 1)
109109 else rem8
110110 let rand10 = nextRand(div, from, rand9[0], rem9, drop(randHash, (lastOffsetBytes + 10)))
111111 let rem10 = if ((rand10[1] != ""))
112112 then (rem9 - 1)
113113 else rem9
114114 let rand11 = nextRand(div, from, rand10[0], rem10, drop(randHash, (lastOffsetBytes + 11)))
115115 let rem11 = if ((rand11[1] != ""))
116116 then (rem10 - 1)
117117 else rem10
118118 let rand12 = nextRand(div, from, rand11[0], rem11, drop(randHash, (lastOffsetBytes + 12)))
119119 let rem12 = if ((rand12[1] != ""))
120120 then (rem11 - 1)
121121 else rem11
122122 let rand13 = nextRand(div, from, rand12[0], rem12, drop(randHash, (lastOffsetBytes + 13)))
123123 let rem13 = if ((rand13[1] != ""))
124124 then (rem12 - 1)
125125 else rem12
126126 let rand14 = nextRand(div, from, rand13[0], rem13, drop(randHash, (lastOffsetBytes + 14)))
127127 let rem14 = if ((rand14[1] != ""))
128128 then (rem13 - 1)
129129 else rem13
130130 [rand14[0], if ((rem14 == 0))
131131 then "0"
132132 else toString(rem14), toString((lastOffsetBytes + 14))]
133133 }
134134
135135
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
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"))
152146 }
147+ else false
153148
154149
155150 @Callable(i)
156151 func initDraw (randFrom,randTo,randsCount) = {
157152 let sessionId = toBase58String(i.transactionId)
158153 if (if ((0 >= randFrom))
159154 then true
160155 else (0 >= randTo))
161156 then throw("randFrom and randTo must be greater than 0")
162157 else if ((randFrom >= randTo))
163158 then throw("randFrom must be strict less then randTo")
164159 else if ((randsCount > ((randTo - randFrom) + 1)))
165160 then throw(((((("Impossible to generate " + toString(randsCount)) + " for provided random range - from ") + toString(randFrom)) + " to ") + toString(randTo)))
166161 else {
167162 let organizerPubKey58 = toBase58String(i.callerPublicKey)
168163 let randsCountStr = toString(randsCount)
169164 let initState = formatStateDataStr(STATEINIT, organizerPubKey58, toString(randFrom), toString(randTo), randsCountStr, randsCountStr, "null", "0", "")
170165 ScriptResult(WriteSet([DataEntry(sessionId, initState)]), TransferSet([ScriptTransfer(SERVER, 1000, unit)]))
171166 }
172167 }
173168
174169
175170
176171 @Callable(i)
177172 func ready (sessionId) = {
178173 let drawParamsList = extractGameDataList(sessionId)
179174 let drawState = drawParamsList[IdxState]
180175 let organizerPubKey58 = drawParamsList[IdxOrganizerPub]
181176 let randsCountStr = drawParamsList[IdxRandsCount]
182177 let remainRandsCountStr = drawParamsList[IdxRemainRandsCount]
183178 let fromStr = drawParamsList[IdxRandFrom]
184179 let toStr = drawParamsList[IdxRandTo]
185180 let organizerPubKey = fromBase58String(organizerPubKey58)
186181 if ((drawState != STATEINIT))
187182 then throw((sessionId + " draw: moving into READY state is allowed only from INIT state"))
188183 else if ((organizerPubKey != i.callerPublicKey))
189184 then throw((sessionId + "draw: moving into READY state is allowed for organizer only"))
190185 else {
191186 let readyState = formatStateDataStr(DATADONE, organizerPubKey58, fromStr, toStr, randsCountStr, remainRandsCountStr, toBase58String(i.transactionId), "0", "")
192187 WriteSet([DataEntry(sessionId, readyState)])
193188 }
194189 }
195190
196191
197192
198193 @Callable(i)
199194 func random (sessionId,rsaSign) = {
200195 let drawParamsList = extractGameDataList(sessionId)
201196 let drawState = drawParamsList[IdxState]
202197 let organizerPubKey58 = drawParamsList[IdxOrganizerPub]
203198 let randsCountStr = drawParamsList[IdxRandsCount]
204199 let remainRandsCount = parseIntValue(drawParamsList[IdxRemainRandsCount])
205200 let lastOffsetBytes = parseIntValue(drawParamsList[IdxLastOffset])
206201 let currRandsStr = drawParamsList[IdxCurrRands]
207202 let fromStr = drawParamsList[IdxRandFrom]
208203 let toStr = drawParamsList[IdxRandTo]
209204 let dataDoneTxId = drawParamsList[IdxDataDoneTxId]
210205 let from = parseIntValue(fromStr)
211206 let to = parseIntValue(toStr)
212207 let organizerPubKey = fromBase58String(organizerPubKey58)
213208 if ((drawState != DATADONE))
214209 then throw((sessionId + " draw: it must be in READY state to generate random numbers"))
215210 else if (!(rsaVerify(SHA256, (toBytes(sessionId) + toBytes(dataDoneTxId)), rsaSign, RSAPUBLIC)))
216211 then throw("Invalid RSA signature")
217212 else {
218213 let randGenInfo = generateRand(sessionId, from, to, rsaSign, currRandsStr, remainRandsCount, lastOffsetBytes)
219214 let newRandsStr = randGenInfo[0]
220215 let newRemainRandsCountStr = randGenInfo[1]
221216 let newOffsetBytes = randGenInfo[2]
222217 let newState = if ((newRemainRandsCountStr == "0"))
223218 then STATEFINISHED
224219 else DATADONE
225220 WriteSet([DataEntry(sessionId, formatStateDataStr(newState, organizerPubKey58, fromStr, toStr, randsCountStr, newRemainRandsCountStr, dataDoneTxId, newOffsetBytes, newRandsStr))])
226221 }
227222 }
228223
229224
230225 @Verifier(tx)
231226 func verify () = match tx {
232227 case dtx: DataTransaction =>
233228 let data0 = dtx.data[0]
234229 let sessionId = take(data0.key, SESSIONIDFIXSIZE)
235230 let drawParamsList = extractGameDataList(sessionId)
236231 let drawState = drawParamsList[0]
237232 let organizerPubKey58 = drawParamsList[1]
238233 let organizerPubKey = fromBase58String(organizerPubKey58)
239234 let dataEntriesCount = size(dtx.data)
240- if (if (if (if (if (if (if (if (if ((drawState == STATEINIT))
241- then sigVerify(tx.bodyBytes, tx.proofs[0], organizerPubKey)
235+ let sigValid = sigVerify(tx.bodyBytes, tx.proofs[0], organizerPubKey)
236+ let dataSizeValid = if ((dataEntriesCount > 0))
237+ then (5 >= dataEntriesCount)
238+ else false
239+ let keysValid = if (if (if (if (if (validateDtxKey(sessionId, data0))
240+ then if ((1 >= dataEntriesCount))
241+ then true
242+ else validateDtxKey(sessionId, dtx.data[1])
242243 else false)
243- then (dataEntriesCount > 0)
244+ then if ((2 >= dataEntriesCount))
245+ then true
246+ else validateDtxKey(sessionId, dtx.data[2])
244247 else false)
245- then (5 >= dataEntriesCount)
248+ then if ((3 >= dataEntriesCount))
249+ then true
250+ else validateDtxKey(sessionId, dtx.data[3])
246251 else false)
247- then validateDtxKey(sessionId, data0, dataEntriesCount, 0)
252+ then if ((4 >= dataEntriesCount))
253+ then true
254+ else validateDtxKey(sessionId, dtx.data[4])
248255 else false)
249- then validateDtxKey(sessionId, dtx.data[1], dataEntriesCount, 1)
256+ then if ((5 >= dataEntriesCount))
257+ then true
258+ else validateDtxKey(sessionId, dtx.data[5])
259+ else false
260+ if (if (if ((drawState == STATEINIT))
261+ then sigValid
250262 else false)
251- then validateDtxKey(sessionId, dtx.data[2], dataEntriesCount, 2)
263+ then dataSizeValid
252264 else false)
253- then validateDtxKey(sessionId, dtx.data[3], dataEntriesCount, 3)
254- else false)
255- then validateDtxKey(sessionId, dtx.data[4], dataEntriesCount, 4)
256- else false)
257- then validateDtxKey(sessionId, dtx.data[5], dataEntriesCount, 5)
265+ then keysValid
258266 else false
259267 case sstx: SetScriptTransaction =>
260268 true
261269 case ttx: TransferTransaction =>
262270 true
263271 case _ =>
264272 false
265273 }
266274

github/deemru/w8io/026f985 
40.58 ms