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