tx · GHweLyFPFfDCEsLBtc9veysBntj6MHWdHfYiD89Ms38c 3N54JoRXk5QW3xx9xDpxUpUkoDzriibARu1: -0.01400000 Waves 2021.02.09 11:15 [1390389] smart account 3N54JoRXk5QW3xx9xDpxUpUkoDzriibARu1 > SELF 0.00000000 Waves
{ "type": 13, "id": "GHweLyFPFfDCEsLBtc9veysBntj6MHWdHfYiD89Ms38c", "fee": 1400000, "feeAssetId": null, "timestamp": 1612858620637, "version": 2, "chainId": 84, "sender": "3N54JoRXk5QW3xx9xDpxUpUkoDzriibARu1", "senderPublicKey": "4ZSmQKKSEVi7FUZVartg8PJgDtovcTaKW3HWpdXKkjx2", "proofs": [ "2qPSEK7W8oeS1Vdty7zBtTD6E4MmoGLhqzS8uFZR51EYzdK3DBrKkGrhdsPpWrnTS8nZz4ikdNXQcat6icZ3d537" ], "script": "base64:AAIDAAAAAAAAAA0IARIHCgUBAQEBCBIAAAAAEAAAAAANbG90dGVyeWFtb3VudAIAAAAHX2Ftb3VudAAAAAASbG90dGVyeXByb2JhYmlsaXR5AgAAAAxfcHJvYmFiaWxpdHkAAAAAGWxvdHRlcnlwcm9iYWJpbGl0eWRlY2ltYWwCAAAAFF9wcm9iYWJpbGl0eV9kZWNpbWFsAAAAAAxsb3R0ZXJ5UHJpY2UCAAAABl9wcmljZQAAAAANbG90dGVyeVByaWNlcwIAAAAPX2xvdHRlcnlfcHJpY2VzAAAAAA5sb3R0ZXJ5QXNzZXRJZAIAAAARX2xvdHRlcnlfYXNzZXRfaWQAAAAADWNvdW50T2ZQcmljZXMCAAAADV9jb3VudF9wcmljZXMAAAAAFGxhc3RIYXNoUmFuZG9tTnVtYmVyAgAAABVsYXN0X3NwaW5fcmFuZG9tX2hhc2gAAAAAE2xhc3RUb2tlblJhbmRvbUhhc2gCAAAAFmxhc3RfdG9rZW5fcmFuZG9tX2hhc2gAAAAACmRBcHBBZGRyZXMCAAAALDNCS0ZRTGVvNUV4WjVZMXB0OUZ0enNubzdhUnd6RDk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nByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleT4ucgk=", "height": 1390389, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CMRrFNaNYe52nc3yrqTYwramWxHuv8EpsSqmRkgiUr4k Next: HHnnA3EqUkGzpjv35mmtSKadGNjwfkDGTvoYC6nZroya Diff:
Old | New | Differences | |
---|---|---|---|
67 | 67 | } | |
68 | 68 | ||
69 | 69 | ||
70 | - | func procedLottery (win,token) = { | |
71 | - | let tokenProbability = getIntegerValue(this, (token + lotteryprobability)) | |
72 | - | let tokenProbabilityDecimal = getIntegerValue(this, (token + lotteryprobabilitydecimal)) | |
73 | - | let probabilityValue = (tokenProbabilityDecimal * 1000) | |
74 | - | let hash = (tokenProbabilityDecimal % probabilityValue) | |
75 | - | let sizeOfWin = size(win) | |
76 | - | if ((sizeOfWin == 1)) | |
77 | - | then { | |
78 | - | let randomNumber = win[0] | |
79 | - | if ((probabilityValue > hash)) | |
80 | - | then { | |
81 | - | let newList = token :: win | |
82 | - | newList | |
83 | - | } | |
84 | - | else win | |
85 | - | } | |
86 | - | else win | |
87 | - | } | |
70 | + | func procedLottery (win,token) = if (isDefined(token)) | |
71 | + | then { | |
72 | + | let tokenProbability = getIntegerValue(this, (token + lotteryprobability)) | |
73 | + | let tokenProbabilityDecimal = getIntegerValue(this, (token + lotteryprobabilitydecimal)) | |
74 | + | let probabilityValue = (tokenProbabilityDecimal * 1000) | |
75 | + | let hash = (tokenProbabilityDecimal % probabilityValue) | |
76 | + | let sizeOfWin = size(win) | |
77 | + | if ((sizeOfWin == 1)) | |
78 | + | then { | |
79 | + | let randomNumber = win[0] | |
80 | + | if ((probabilityValue > hash)) | |
81 | + | then { | |
82 | + | let newList = token :: win | |
83 | + | newList | |
84 | + | } | |
85 | + | else win | |
86 | + | } | |
87 | + | else win | |
88 | + | } | |
89 | + | else win | |
88 | 90 | ||
89 | 91 | ||
90 | 92 | @Callable(i) | |
206 | 208 | let priceList = getPriceArray() | |
207 | 209 | let randNumber = toInt(randhash) | |
208 | 210 | let winningToken = { | |
209 | - | let $ | |
210 | - | let $ | |
211 | - | let $ | |
212 | - | if (($ | |
213 | - | then $ | |
211 | + | let $list73937431 = priceList | |
212 | + | let $size73937431 = size($list73937431) | |
213 | + | let $acc073937431 = nil | |
214 | + | if (($size73937431 == 0)) | |
215 | + | then $acc073937431 | |
214 | 216 | else { | |
215 | - | let $ | |
216 | - | if (($ | |
217 | - | then $ | |
217 | + | let $acc173937431 = procedLottery($acc073937431, $list73937431[0]) | |
218 | + | if (($size73937431 == 1)) | |
219 | + | then $acc173937431 | |
218 | 220 | else { | |
219 | - | let $ | |
220 | - | if (($ | |
221 | - | then $ | |
221 | + | let $acc273937431 = procedLottery($acc173937431, $list73937431[1]) | |
222 | + | if (($size73937431 == 2)) | |
223 | + | then $acc273937431 | |
222 | 224 | else { | |
223 | - | let $ | |
224 | - | if (($ | |
225 | - | then $ | |
225 | + | let $acc373937431 = procedLottery($acc273937431, $list73937431[2]) | |
226 | + | if (($size73937431 == 3)) | |
227 | + | then $acc373937431 | |
226 | 228 | else { | |
227 | - | let $ | |
228 | - | if (($ | |
229 | - | then $ | |
229 | + | let $acc473937431 = procedLottery($acc373937431, $list73937431[3]) | |
230 | + | if (($size73937431 == 4)) | |
231 | + | then $acc473937431 | |
230 | 232 | else { | |
231 | - | let $ | |
232 | - | if (($ | |
233 | - | then $ | |
233 | + | let $acc573937431 = procedLottery($acc473937431, $list73937431[4]) | |
234 | + | if (($size73937431 == 5)) | |
235 | + | then $acc573937431 | |
234 | 236 | else { | |
235 | - | let $ | |
236 | - | if (($ | |
237 | - | then $ | |
237 | + | let $acc673937431 = procedLottery($acc573937431, $list73937431[5]) | |
238 | + | if (($size73937431 == 6)) | |
239 | + | then $acc673937431 | |
238 | 240 | else { | |
239 | - | let $ | |
240 | - | if (($ | |
241 | - | then $ | |
241 | + | let $acc773937431 = procedLottery($acc673937431, $list73937431[6]) | |
242 | + | if (($size73937431 == 7)) | |
243 | + | then $acc773937431 | |
242 | 244 | else { | |
243 | - | let $ | |
244 | - | if (($ | |
245 | - | then $ | |
245 | + | let $acc873937431 = procedLottery($acc773937431, $list73937431[7]) | |
246 | + | if (($size73937431 == 8)) | |
247 | + | then $acc873937431 | |
246 | 248 | else { | |
247 | - | let $ | |
248 | - | if (($ | |
249 | - | then $ | |
249 | + | let $acc973937431 = procedLottery($acc873937431, $list73937431[8]) | |
250 | + | if (($size73937431 == 9)) | |
251 | + | then $acc973937431 | |
250 | 252 | else { | |
251 | - | let $ | |
252 | - | if (($ | |
253 | - | then $ | |
253 | + | let $acc1073937431 = procedLottery($acc973937431, $list73937431[9]) | |
254 | + | if (($size73937431 == 10)) | |
255 | + | then $acc1073937431 | |
254 | 256 | else { | |
255 | - | let $ | |
256 | - | if (($ | |
257 | - | then $ | |
257 | + | let $acc1173937431 = procedLottery($acc1073937431, $list73937431[10]) | |
258 | + | if (($size73937431 == 11)) | |
259 | + | then $acc1173937431 | |
258 | 260 | else { | |
259 | - | let $ | |
260 | - | if (($ | |
261 | - | then $ | |
261 | + | let $acc1273937431 = procedLottery($acc1173937431, $list73937431[11]) | |
262 | + | if (($size73937431 == 12)) | |
263 | + | then $acc1273937431 | |
262 | 264 | else { | |
263 | - | let $ | |
264 | - | if (($ | |
265 | - | then $ | |
265 | + | let $acc1373937431 = procedLottery($acc1273937431, $list73937431[12]) | |
266 | + | if (($size73937431 == 13)) | |
267 | + | then $acc1373937431 | |
266 | 268 | else { | |
267 | - | let $ | |
268 | - | if (($ | |
269 | - | then $ | |
269 | + | let $acc1473937431 = procedLottery($acc1373937431, $list73937431[13]) | |
270 | + | if (($size73937431 == 14)) | |
271 | + | then $acc1473937431 | |
270 | 272 | else { | |
271 | - | let $ | |
273 | + | let $acc1573937431 = procedLottery($acc1473937431, $list73937431[14]) | |
272 | 274 | throw("List size exceed 14") | |
273 | 275 | } | |
274 | 276 | } | |
304 | 306 | if ((actualAmount == 0)) | |
305 | 307 | then { | |
306 | 308 | let storedTokensValues = { | |
307 | - | let $ | |
308 | - | let $ | |
309 | - | let $ | |
310 | - | if (($ | |
311 | - | then $ | |
309 | + | let $list82668317 = priceList | |
310 | + | let $size82668317 = size($list82668317) | |
311 | + | let $acc082668317 = token | |
312 | + | if (($size82668317 == 0)) | |
313 | + | then $acc082668317 | |
312 | 314 | else { | |
313 | - | let $ | |
314 | - | if (($ | |
315 | - | then $ | |
315 | + | let $acc182668317 = generateNewListOfPrices($acc082668317, $list82668317[0]) | |
316 | + | if (($size82668317 == 1)) | |
317 | + | then $acc182668317 | |
316 | 318 | else { | |
317 | - | let $ | |
318 | - | if (($ | |
319 | - | then $ | |
319 | + | let $acc282668317 = generateNewListOfPrices($acc182668317, $list82668317[1]) | |
320 | + | if (($size82668317 == 2)) | |
321 | + | then $acc282668317 | |
320 | 322 | else { | |
321 | - | let $ | |
322 | - | if (($ | |
323 | - | then $ | |
323 | + | let $acc382668317 = generateNewListOfPrices($acc282668317, $list82668317[2]) | |
324 | + | if (($size82668317 == 3)) | |
325 | + | then $acc382668317 | |
324 | 326 | else { | |
325 | - | let $ | |
326 | - | if (($ | |
327 | - | then $ | |
327 | + | let $acc482668317 = generateNewListOfPrices($acc382668317, $list82668317[3]) | |
328 | + | if (($size82668317 == 4)) | |
329 | + | then $acc482668317 | |
328 | 330 | else { | |
329 | - | let $ | |
330 | - | if (($ | |
331 | - | then $ | |
331 | + | let $acc582668317 = generateNewListOfPrices($acc482668317, $list82668317[4]) | |
332 | + | if (($size82668317 == 5)) | |
333 | + | then $acc582668317 | |
332 | 334 | else { | |
333 | - | let $ | |
334 | - | if (($ | |
335 | - | then $ | |
335 | + | let $acc682668317 = generateNewListOfPrices($acc582668317, $list82668317[5]) | |
336 | + | if (($size82668317 == 6)) | |
337 | + | then $acc682668317 | |
336 | 338 | else { | |
337 | - | let $ | |
338 | - | if (($ | |
339 | - | then $ | |
339 | + | let $acc782668317 = generateNewListOfPrices($acc682668317, $list82668317[6]) | |
340 | + | if (($size82668317 == 7)) | |
341 | + | then $acc782668317 | |
340 | 342 | else { | |
341 | - | let $ | |
342 | - | if (($ | |
343 | - | then $ | |
343 | + | let $acc882668317 = generateNewListOfPrices($acc782668317, $list82668317[7]) | |
344 | + | if (($size82668317 == 8)) | |
345 | + | then $acc882668317 | |
344 | 346 | else { | |
345 | - | let $ | |
346 | - | if (($ | |
347 | - | then $ | |
347 | + | let $acc982668317 = generateNewListOfPrices($acc882668317, $list82668317[8]) | |
348 | + | if (($size82668317 == 9)) | |
349 | + | then $acc982668317 | |
348 | 350 | else { | |
349 | - | let $ | |
350 | - | if (($ | |
351 | - | then $ | |
351 | + | let $acc1082668317 = generateNewListOfPrices($acc982668317, $list82668317[9]) | |
352 | + | if (($size82668317 == 10)) | |
353 | + | then $acc1082668317 | |
352 | 354 | else { | |
353 | - | let $ | |
354 | - | if (($ | |
355 | - | then $ | |
355 | + | let $acc1182668317 = generateNewListOfPrices($acc1082668317, $list82668317[10]) | |
356 | + | if (($size82668317 == 11)) | |
357 | + | then $acc1182668317 | |
356 | 358 | else { | |
357 | - | let $ | |
358 | - | if (($ | |
359 | - | then $ | |
359 | + | let $acc1282668317 = generateNewListOfPrices($acc1182668317, $list82668317[11]) | |
360 | + | if (($size82668317 == 12)) | |
361 | + | then $acc1282668317 | |
360 | 362 | else { | |
361 | - | let $ | |
362 | - | if (($ | |
363 | - | then $ | |
363 | + | let $acc1382668317 = generateNewListOfPrices($acc1282668317, $list82668317[12]) | |
364 | + | if (($size82668317 == 13)) | |
365 | + | then $acc1382668317 | |
364 | 366 | else { | |
365 | - | let $ | |
366 | - | if (($ | |
367 | - | then $ | |
367 | + | let $acc1482668317 = generateNewListOfPrices($acc1382668317, $list82668317[13]) | |
368 | + | if (($size82668317 == 14)) | |
369 | + | then $acc1482668317 | |
368 | 370 | else { | |
369 | - | let $ | |
371 | + | let $acc1582668317 = generateNewListOfPrices($acc1482668317, $list82668317[14]) | |
370 | 372 | throw("List size exceed 14") | |
371 | 373 | } | |
372 | 374 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let lotteryamount = "_amount" | |
5 | 5 | ||
6 | 6 | let lotteryprobability = "_probability" | |
7 | 7 | ||
8 | 8 | let lotteryprobabilitydecimal = "_probability_decimal" | |
9 | 9 | ||
10 | 10 | let lotteryPrice = "_price" | |
11 | 11 | ||
12 | 12 | let lotteryPrices = "_lottery_prices" | |
13 | 13 | ||
14 | 14 | let lotteryAssetId = "_lottery_asset_id" | |
15 | 15 | ||
16 | 16 | let countOfPrices = "_count_prices" | |
17 | 17 | ||
18 | 18 | let lastHashRandomNumber = "last_spin_random_hash" | |
19 | 19 | ||
20 | 20 | let lastTokenRandomHash = "last_token_random_hash" | |
21 | 21 | ||
22 | 22 | let dAppAddres = "3BKFQLeo5ExZ5Y1pt9Ftzsno7aRwzD96zoYVHP3tcLgV" | |
23 | 23 | ||
24 | 24 | let allowSizeLottery = 14 | |
25 | 25 | ||
26 | 26 | func randomizer (inv) = { | |
27 | 27 | let lastPlay = match getBinary(this, lastHashRandomNumber) { | |
28 | 28 | case s: ByteVector => | |
29 | 29 | s | |
30 | 30 | case _: Unit => | |
31 | 31 | base58'2ee4oFDYriWJ9EMeR' | |
32 | 32 | case _ => | |
33 | 33 | throw("Match error") | |
34 | 34 | } | |
35 | 35 | let rand = (((((lastPlay + inv.transactionId) + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)) | |
36 | 36 | sha256(rand) | |
37 | 37 | } | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func generatorRandomHash (inv) = { | |
41 | 41 | let lastHashForToken = match getBinary(this, lastTokenRandomHash) { | |
42 | 42 | case s: ByteVector => | |
43 | 43 | s | |
44 | 44 | case _: Unit => | |
45 | 45 | base58'4dD7osCQzvuXJdTiGfKvTwnKT' | |
46 | 46 | case _ => | |
47 | 47 | throw("Match error") | |
48 | 48 | } | |
49 | 49 | let rand = (((((lastHashForToken + inv.transactionId) + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)) | |
50 | 50 | sha256(rand) | |
51 | 51 | } | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func getPriceArray () = { | |
55 | 55 | let tempPrices = getStringValue(this, lotteryPrices) | |
56 | 56 | let trimPrices = take(tempPrices, (size(tempPrices) - 1)) | |
57 | 57 | let newArray = split(trimPrices, ",") | |
58 | 58 | newArray | |
59 | 59 | } | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func generateNewListOfPrices (token,val) = { | |
63 | 63 | let indexOfComma = indexOf(token, ",") | |
64 | 64 | if ((indexOfComma == unit)) | |
65 | 65 | then (val + ",") | |
66 | 66 | else ((token + val) + ",") | |
67 | 67 | } | |
68 | 68 | ||
69 | 69 | ||
70 | - | func procedLottery (win,token) = { | |
71 | - | let tokenProbability = getIntegerValue(this, (token + lotteryprobability)) | |
72 | - | let tokenProbabilityDecimal = getIntegerValue(this, (token + lotteryprobabilitydecimal)) | |
73 | - | let probabilityValue = (tokenProbabilityDecimal * 1000) | |
74 | - | let hash = (tokenProbabilityDecimal % probabilityValue) | |
75 | - | let sizeOfWin = size(win) | |
76 | - | if ((sizeOfWin == 1)) | |
77 | - | then { | |
78 | - | let randomNumber = win[0] | |
79 | - | if ((probabilityValue > hash)) | |
80 | - | then { | |
81 | - | let newList = token :: win | |
82 | - | newList | |
83 | - | } | |
84 | - | else win | |
85 | - | } | |
86 | - | else win | |
87 | - | } | |
70 | + | func procedLottery (win,token) = if (isDefined(token)) | |
71 | + | then { | |
72 | + | let tokenProbability = getIntegerValue(this, (token + lotteryprobability)) | |
73 | + | let tokenProbabilityDecimal = getIntegerValue(this, (token + lotteryprobabilitydecimal)) | |
74 | + | let probabilityValue = (tokenProbabilityDecimal * 1000) | |
75 | + | let hash = (tokenProbabilityDecimal % probabilityValue) | |
76 | + | let sizeOfWin = size(win) | |
77 | + | if ((sizeOfWin == 1)) | |
78 | + | then { | |
79 | + | let randomNumber = win[0] | |
80 | + | if ((probabilityValue > hash)) | |
81 | + | then { | |
82 | + | let newList = token :: win | |
83 | + | newList | |
84 | + | } | |
85 | + | else win | |
86 | + | } | |
87 | + | else win | |
88 | + | } | |
89 | + | else win | |
88 | 90 | ||
89 | 91 | ||
90 | 92 | @Callable(i) | |
91 | 93 | func updateprobability (probability,amount,poolprice,probDecimal,assetId) = { | |
92 | 94 | let token = toBase64String(generatorRandomHash(i)) | |
93 | 95 | let paymentIsDefined = if (!(isDefined(i.payment))) | |
94 | 96 | then false | |
95 | 97 | else true | |
96 | 98 | let lotteryAssetTN = if ((assetId == "")) | |
97 | 99 | then true | |
98 | 100 | else false | |
99 | 101 | let totalRequiredAmount = (amount * poolprice) | |
100 | 102 | if ((paymentIsDefined == true)) | |
101 | 103 | then { | |
102 | 104 | let payment = extract(i.payment) | |
103 | 105 | let paymentAssetId = match payment.assetId { | |
104 | 106 | case a: ByteVector => | |
105 | 107 | toBase64String(a) | |
106 | 108 | case _: Unit => | |
107 | 109 | "" | |
108 | 110 | case _ => | |
109 | 111 | throw("Match error") | |
110 | 112 | } | |
111 | 113 | let paymentAmount = payment.amount | |
112 | 114 | if ((paymentAssetId != assetId)) | |
113 | 115 | then throw("Asset Id not matching with Payment Asset Id") | |
114 | 116 | else if ((totalRequiredAmount > paymentAmount)) | |
115 | 117 | then throw("Not enough Asset Amount") | |
116 | 118 | else { | |
117 | 119 | let tempValue = match getString(this, lotteryPrices) { | |
118 | 120 | case a: String => | |
119 | 121 | a | |
120 | 122 | case _: Unit => | |
121 | 123 | "" | |
122 | 124 | case _ => | |
123 | 125 | throw("Match error") | |
124 | 126 | } | |
125 | 127 | let containKey = indexOf(tempValue, token) | |
126 | 128 | let storedTokensValues = match containKey { | |
127 | 129 | case _: Unit => | |
128 | 130 | ((tempValue + token) + ",") | |
129 | 131 | case x: Int => | |
130 | 132 | throw("Token is duplicated") | |
131 | 133 | case _ => | |
132 | 134 | throw("Match error") | |
133 | 135 | } | |
134 | 136 | let countTokens = match getInteger(this, countOfPrices) { | |
135 | 137 | case a: Int => | |
136 | 138 | a | |
137 | 139 | case _: Unit => | |
138 | 140 | 0 | |
139 | 141 | case _ => | |
140 | 142 | throw("Match error") | |
141 | 143 | } | |
142 | 144 | if ((allowSizeLottery > countTokens)) | |
143 | 145 | then { | |
144 | 146 | let updateLotteryPool = WriteSet([DataEntry((token + lotteryamount), amount), DataEntry((token + lotteryprobability), probability), DataEntry((token + lotteryPrice), poolprice), DataEntry(lotteryPrices, storedTokensValues), DataEntry(countOfPrices, (countTokens + 1)), DataEntry((token + lotteryprobabilitydecimal), probDecimal), DataEntry((token + lotteryAssetId), assetId), DataEntry(lastTokenRandomHash, token)]) | |
145 | 147 | ScriptResult(updateLotteryPool, TransferSet(nil)) | |
146 | 148 | } | |
147 | 149 | else throw(("Lottery prices has reached maximum " + toString(allowSizeLottery))) | |
148 | 150 | } | |
149 | 151 | } | |
150 | 152 | else { | |
151 | 153 | let tnBalance = if (lotteryAssetTN) | |
152 | 154 | then wavesBalance(this) | |
153 | 155 | else assetBalance(this, fromBase64String(assetId)) | |
154 | 156 | if ((totalRequiredAmount > tnBalance)) | |
155 | 157 | then throw("Not enough Asset Amount") | |
156 | 158 | else { | |
157 | 159 | let tempValue = match getString(this, lotteryPrices) { | |
158 | 160 | case a: String => | |
159 | 161 | a | |
160 | 162 | case _: Unit => | |
161 | 163 | "" | |
162 | 164 | case _ => | |
163 | 165 | throw("Match error") | |
164 | 166 | } | |
165 | 167 | let containKey = indexOf(tempValue, token) | |
166 | 168 | let storedTokensValues = match containKey { | |
167 | 169 | case _: Unit => | |
168 | 170 | ((tempValue + token) + ",") | |
169 | 171 | case x: Int => | |
170 | 172 | throw("Token is duplicated") | |
171 | 173 | case _ => | |
172 | 174 | throw("Match error") | |
173 | 175 | } | |
174 | 176 | let countTokens = match getInteger(this, countOfPrices) { | |
175 | 177 | case a: Int => | |
176 | 178 | a | |
177 | 179 | case _: Unit => | |
178 | 180 | 0 | |
179 | 181 | case _ => | |
180 | 182 | throw("Match error") | |
181 | 183 | } | |
182 | 184 | if ((allowSizeLottery >= countTokens)) | |
183 | 185 | then { | |
184 | 186 | let updateLotteryPool = WriteSet([DataEntry((token + lotteryamount), amount), DataEntry((token + lotteryprobability), probability), DataEntry((token + lotteryPrice), poolprice), DataEntry(lotteryPrices, storedTokensValues), DataEntry(countOfPrices, (countTokens + 1)), DataEntry((token + lotteryprobabilitydecimal), probDecimal), DataEntry((token + lotteryAssetId), assetId), DataEntry(lastTokenRandomHash, token)]) | |
185 | 187 | ScriptResult(updateLotteryPool, TransferSet(nil)) | |
186 | 188 | } | |
187 | 189 | else throw("Lottery prices has reached maximum 15") | |
188 | 190 | } | |
189 | 191 | } | |
190 | 192 | } | |
191 | 193 | ||
192 | 194 | ||
193 | 195 | ||
194 | 196 | @Callable(i) | |
195 | 197 | func startlotto () = { | |
196 | 198 | let currentKey = toBase58String(i.caller.bytes) | |
197 | 199 | let randhash = randomizer(i) | |
198 | 200 | let countTokens = match getInteger(this, countOfPrices) { | |
199 | 201 | case a: Int => | |
200 | 202 | a | |
201 | 203 | case _: Unit => | |
202 | 204 | 0 | |
203 | 205 | case _ => | |
204 | 206 | throw("Match error") | |
205 | 207 | } | |
206 | 208 | let priceList = getPriceArray() | |
207 | 209 | let randNumber = toInt(randhash) | |
208 | 210 | let winningToken = { | |
209 | - | let $ | |
210 | - | let $ | |
211 | - | let $ | |
212 | - | if (($ | |
213 | - | then $ | |
211 | + | let $list73937431 = priceList | |
212 | + | let $size73937431 = size($list73937431) | |
213 | + | let $acc073937431 = nil | |
214 | + | if (($size73937431 == 0)) | |
215 | + | then $acc073937431 | |
214 | 216 | else { | |
215 | - | let $ | |
216 | - | if (($ | |
217 | - | then $ | |
217 | + | let $acc173937431 = procedLottery($acc073937431, $list73937431[0]) | |
218 | + | if (($size73937431 == 1)) | |
219 | + | then $acc173937431 | |
218 | 220 | else { | |
219 | - | let $ | |
220 | - | if (($ | |
221 | - | then $ | |
221 | + | let $acc273937431 = procedLottery($acc173937431, $list73937431[1]) | |
222 | + | if (($size73937431 == 2)) | |
223 | + | then $acc273937431 | |
222 | 224 | else { | |
223 | - | let $ | |
224 | - | if (($ | |
225 | - | then $ | |
225 | + | let $acc373937431 = procedLottery($acc273937431, $list73937431[2]) | |
226 | + | if (($size73937431 == 3)) | |
227 | + | then $acc373937431 | |
226 | 228 | else { | |
227 | - | let $ | |
228 | - | if (($ | |
229 | - | then $ | |
229 | + | let $acc473937431 = procedLottery($acc373937431, $list73937431[3]) | |
230 | + | if (($size73937431 == 4)) | |
231 | + | then $acc473937431 | |
230 | 232 | else { | |
231 | - | let $ | |
232 | - | if (($ | |
233 | - | then $ | |
233 | + | let $acc573937431 = procedLottery($acc473937431, $list73937431[4]) | |
234 | + | if (($size73937431 == 5)) | |
235 | + | then $acc573937431 | |
234 | 236 | else { | |
235 | - | let $ | |
236 | - | if (($ | |
237 | - | then $ | |
237 | + | let $acc673937431 = procedLottery($acc573937431, $list73937431[5]) | |
238 | + | if (($size73937431 == 6)) | |
239 | + | then $acc673937431 | |
238 | 240 | else { | |
239 | - | let $ | |
240 | - | if (($ | |
241 | - | then $ | |
241 | + | let $acc773937431 = procedLottery($acc673937431, $list73937431[6]) | |
242 | + | if (($size73937431 == 7)) | |
243 | + | then $acc773937431 | |
242 | 244 | else { | |
243 | - | let $ | |
244 | - | if (($ | |
245 | - | then $ | |
245 | + | let $acc873937431 = procedLottery($acc773937431, $list73937431[7]) | |
246 | + | if (($size73937431 == 8)) | |
247 | + | then $acc873937431 | |
246 | 248 | else { | |
247 | - | let $ | |
248 | - | if (($ | |
249 | - | then $ | |
249 | + | let $acc973937431 = procedLottery($acc873937431, $list73937431[8]) | |
250 | + | if (($size73937431 == 9)) | |
251 | + | then $acc973937431 | |
250 | 252 | else { | |
251 | - | let $ | |
252 | - | if (($ | |
253 | - | then $ | |
253 | + | let $acc1073937431 = procedLottery($acc973937431, $list73937431[9]) | |
254 | + | if (($size73937431 == 10)) | |
255 | + | then $acc1073937431 | |
254 | 256 | else { | |
255 | - | let $ | |
256 | - | if (($ | |
257 | - | then $ | |
257 | + | let $acc1173937431 = procedLottery($acc1073937431, $list73937431[10]) | |
258 | + | if (($size73937431 == 11)) | |
259 | + | then $acc1173937431 | |
258 | 260 | else { | |
259 | - | let $ | |
260 | - | if (($ | |
261 | - | then $ | |
261 | + | let $acc1273937431 = procedLottery($acc1173937431, $list73937431[11]) | |
262 | + | if (($size73937431 == 12)) | |
263 | + | then $acc1273937431 | |
262 | 264 | else { | |
263 | - | let $ | |
264 | - | if (($ | |
265 | - | then $ | |
265 | + | let $acc1373937431 = procedLottery($acc1273937431, $list73937431[12]) | |
266 | + | if (($size73937431 == 13)) | |
267 | + | then $acc1373937431 | |
266 | 268 | else { | |
267 | - | let $ | |
268 | - | if (($ | |
269 | - | then $ | |
269 | + | let $acc1473937431 = procedLottery($acc1373937431, $list73937431[13]) | |
270 | + | if (($size73937431 == 14)) | |
271 | + | then $acc1473937431 | |
270 | 272 | else { | |
271 | - | let $ | |
273 | + | let $acc1573937431 = procedLottery($acc1473937431, $list73937431[14]) | |
272 | 274 | throw("List size exceed 14") | |
273 | 275 | } | |
274 | 276 | } | |
275 | 277 | } | |
276 | 278 | } | |
277 | 279 | } | |
278 | 280 | } | |
279 | 281 | } | |
280 | 282 | } | |
281 | 283 | } | |
282 | 284 | } | |
283 | 285 | } | |
284 | 286 | } | |
285 | 287 | } | |
286 | 288 | } | |
287 | 289 | } | |
288 | 290 | } | |
289 | 291 | let sizeOfWinPrices = size(winningToken) | |
290 | 292 | if ((sizeOfWinPrices == 0)) | |
291 | 293 | then { | |
292 | 294 | let writeSets = WriteSet(nil) | |
293 | 295 | ScriptResult(writeSets, TransferSet(nil)) | |
294 | 296 | } | |
295 | 297 | else { | |
296 | 298 | let token = winningToken[1] | |
297 | 299 | let currentAmount = getIntegerValue(this, (token + lotteryamount)) | |
298 | 300 | if ((currentAmount == 0)) | |
299 | 301 | then throw("Amount exceeded") | |
300 | 302 | else { | |
301 | 303 | let actualAmount = (currentAmount - 1) | |
302 | 304 | let tokenPrice = getIntegerValue(this, (token + lotteryPrice)) | |
303 | 305 | let tokenAssetId = getStringValue(this, (token + lotteryAssetId)) | |
304 | 306 | if ((actualAmount == 0)) | |
305 | 307 | then { | |
306 | 308 | let storedTokensValues = { | |
307 | - | let $ | |
308 | - | let $ | |
309 | - | let $ | |
310 | - | if (($ | |
311 | - | then $ | |
309 | + | let $list82668317 = priceList | |
310 | + | let $size82668317 = size($list82668317) | |
311 | + | let $acc082668317 = token | |
312 | + | if (($size82668317 == 0)) | |
313 | + | then $acc082668317 | |
312 | 314 | else { | |
313 | - | let $ | |
314 | - | if (($ | |
315 | - | then $ | |
315 | + | let $acc182668317 = generateNewListOfPrices($acc082668317, $list82668317[0]) | |
316 | + | if (($size82668317 == 1)) | |
317 | + | then $acc182668317 | |
316 | 318 | else { | |
317 | - | let $ | |
318 | - | if (($ | |
319 | - | then $ | |
319 | + | let $acc282668317 = generateNewListOfPrices($acc182668317, $list82668317[1]) | |
320 | + | if (($size82668317 == 2)) | |
321 | + | then $acc282668317 | |
320 | 322 | else { | |
321 | - | let $ | |
322 | - | if (($ | |
323 | - | then $ | |
323 | + | let $acc382668317 = generateNewListOfPrices($acc282668317, $list82668317[2]) | |
324 | + | if (($size82668317 == 3)) | |
325 | + | then $acc382668317 | |
324 | 326 | else { | |
325 | - | let $ | |
326 | - | if (($ | |
327 | - | then $ | |
327 | + | let $acc482668317 = generateNewListOfPrices($acc382668317, $list82668317[3]) | |
328 | + | if (($size82668317 == 4)) | |
329 | + | then $acc482668317 | |
328 | 330 | else { | |
329 | - | let $ | |
330 | - | if (($ | |
331 | - | then $ | |
331 | + | let $acc582668317 = generateNewListOfPrices($acc482668317, $list82668317[4]) | |
332 | + | if (($size82668317 == 5)) | |
333 | + | then $acc582668317 | |
332 | 334 | else { | |
333 | - | let $ | |
334 | - | if (($ | |
335 | - | then $ | |
335 | + | let $acc682668317 = generateNewListOfPrices($acc582668317, $list82668317[5]) | |
336 | + | if (($size82668317 == 6)) | |
337 | + | then $acc682668317 | |
336 | 338 | else { | |
337 | - | let $ | |
338 | - | if (($ | |
339 | - | then $ | |
339 | + | let $acc782668317 = generateNewListOfPrices($acc682668317, $list82668317[6]) | |
340 | + | if (($size82668317 == 7)) | |
341 | + | then $acc782668317 | |
340 | 342 | else { | |
341 | - | let $ | |
342 | - | if (($ | |
343 | - | then $ | |
343 | + | let $acc882668317 = generateNewListOfPrices($acc782668317, $list82668317[7]) | |
344 | + | if (($size82668317 == 8)) | |
345 | + | then $acc882668317 | |
344 | 346 | else { | |
345 | - | let $ | |
346 | - | if (($ | |
347 | - | then $ | |
347 | + | let $acc982668317 = generateNewListOfPrices($acc882668317, $list82668317[8]) | |
348 | + | if (($size82668317 == 9)) | |
349 | + | then $acc982668317 | |
348 | 350 | else { | |
349 | - | let $ | |
350 | - | if (($ | |
351 | - | then $ | |
351 | + | let $acc1082668317 = generateNewListOfPrices($acc982668317, $list82668317[9]) | |
352 | + | if (($size82668317 == 10)) | |
353 | + | then $acc1082668317 | |
352 | 354 | else { | |
353 | - | let $ | |
354 | - | if (($ | |
355 | - | then $ | |
355 | + | let $acc1182668317 = generateNewListOfPrices($acc1082668317, $list82668317[10]) | |
356 | + | if (($size82668317 == 11)) | |
357 | + | then $acc1182668317 | |
356 | 358 | else { | |
357 | - | let $ | |
358 | - | if (($ | |
359 | - | then $ | |
359 | + | let $acc1282668317 = generateNewListOfPrices($acc1182668317, $list82668317[11]) | |
360 | + | if (($size82668317 == 12)) | |
361 | + | then $acc1282668317 | |
360 | 362 | else { | |
361 | - | let $ | |
362 | - | if (($ | |
363 | - | then $ | |
363 | + | let $acc1382668317 = generateNewListOfPrices($acc1282668317, $list82668317[12]) | |
364 | + | if (($size82668317 == 13)) | |
365 | + | then $acc1382668317 | |
364 | 366 | else { | |
365 | - | let $ | |
366 | - | if (($ | |
367 | - | then $ | |
367 | + | let $acc1482668317 = generateNewListOfPrices($acc1382668317, $list82668317[13]) | |
368 | + | if (($size82668317 == 14)) | |
369 | + | then $acc1482668317 | |
368 | 370 | else { | |
369 | - | let $ | |
371 | + | let $acc1582668317 = generateNewListOfPrices($acc1482668317, $list82668317[14]) | |
370 | 372 | throw("List size exceed 14") | |
371 | 373 | } | |
372 | 374 | } | |
373 | 375 | } | |
374 | 376 | } | |
375 | 377 | } | |
376 | 378 | } | |
377 | 379 | } | |
378 | 380 | } | |
379 | 381 | } | |
380 | 382 | } | |
381 | 383 | } | |
382 | 384 | } | |
383 | 385 | } | |
384 | 386 | } | |
385 | 387 | } | |
386 | 388 | } | |
387 | 389 | let writeSets = WriteSet([DataEntry(("winning_token_" + token), token), DataEntry((currentKey + "_wininning_address_"), currentKey), DataEntry(countOfPrices, (countTokens - 1)), DataEntry(lotteryPrices, storedTokensValues), DataEntry(lastHashRandomNumber, randNumber)]) | |
388 | 390 | if ((tokenAssetId == "")) | |
389 | 391 | then { | |
390 | 392 | let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, unit)]) | |
391 | 393 | ScriptResult(writeSets, winTransfer) | |
392 | 394 | } | |
393 | 395 | else { | |
394 | 396 | let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, unit)]) | |
395 | 397 | ScriptResult(writeSets, winTransfer) | |
396 | 398 | } | |
397 | 399 | } | |
398 | 400 | else { | |
399 | 401 | let writeSets = WriteSet([DataEntry((currentKey + "_winning_token_"), token), DataEntry((currentKey + "_wininning_address_"), currentKey), DataEntry((token + lotteryamount), actualAmount), DataEntry(lastHashRandomNumber, randNumber)]) | |
400 | 402 | if ((tokenAssetId == "")) | |
401 | 403 | then { | |
402 | 404 | let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, unit)]) | |
403 | 405 | ScriptResult(writeSets, winTransfer) | |
404 | 406 | } | |
405 | 407 | else { | |
406 | 408 | let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, unit)]) | |
407 | 409 | ScriptResult(writeSets, winTransfer) | |
408 | 410 | } | |
409 | 411 | } | |
410 | 412 | } | |
411 | 413 | } | |
412 | 414 | } | |
413 | 415 | ||
414 | 416 | ||
415 | 417 | @Verifier(tx) | |
416 | 418 | func verify () = match tx { | |
417 | 419 | case _: DataTransaction => | |
418 | 420 | true | |
419 | 421 | case _: SetScriptTransaction => | |
420 | 422 | true | |
421 | 423 | case _ => | |
422 | 424 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
423 | 425 | } | |
424 | 426 |
github/deemru/w8io/169f3d6 235.20 ms ◑