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