tx · 26fFeL7rS8uvndf8WfrvFZx9ZZw8dKKGcgTEKwngXkBH 3NCHZUUsYc46so2ZeGjR2c2h73SEgJ6wFfV: -0.01500000 Waves 2021.02.10 14:34 [1392033] smart account 3NCHZUUsYc46so2ZeGjR2c2h73SEgJ6wFfV > SELF 0.00000000 Waves
{ "type": 13, "id": "26fFeL7rS8uvndf8WfrvFZx9ZZw8dKKGcgTEKwngXkBH", "fee": 1500000, "feeAssetId": null, "timestamp": 1612956897589, "version": 2, "chainId": 84, "sender": "3NCHZUUsYc46so2ZeGjR2c2h73SEgJ6wFfV", "senderPublicKey": "HTxyWnce2b2YsEFVZF1qx5GWj4Gqr23x9GhcHxcTbMfL", "proofs": [ "28vJYuRvKwtSbNHYPd4N6S68dYK84Fb4af7WXBqcn2dgLywBAC8GHPLZSwMgHrj3xbwZ55anpr5pVTpMdiaR9JPC" ], "script": "base64:AAIDAAAAAAAAAA0IARIHCgUBAQEBCBIAAAAAEgAAAAAKZEFwcEFkZHJlcwIAAAArRjlEQ0dpWWdUOHl2QnExQVFGY1NwR0c0cDhzZHpOejltWmN6RHZKNDVMTAAAAAALdGlja2V0QXNzZXQBAAAAIEYc9ZUgYtXiRrToDJgiMgFmnQRu3R1NoyARqb9irygsAAAAAA10b2tlbnNQZXJQbGF5AAAAAAAF9eEAAAAAAA1sb3R0ZXJ5YW1vdW50AgAAAAdfYW1vdW50AAAAABJsb3R0ZXJ5cHJvYmFiaWxpdHkCAAAADF9wcm9iYWJpbGl0eQAAAAAZbG90dGVyeXByb2JhYmlsaXR5ZGVjaW1hbAIAAAAUX3Byb2JhYmlsaXR5X2RlY2ltYWwAAAAADGxvdHRlcnlQcmljZQIAAAAGX3ByaWNlAAAAAA1sb3R0ZXJ5UHJpY2VzAgAAAA9fbG90dGVyeV9wcmljZXMAAAAADmxvdHRlcnlBc3NldElkAgAAABFfbG90dGVyeV9hc3NldF9pZAAAAAANY291bnRPZlByaWNlcwIAAAANX2NvdW50X3ByaWNlcwAAAAA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Qgc2l6ZSBleGNlZWQgNQQAAAAJdG9rZW5TaXplCQAAZQAAAAIJAAExAAAAAQUAAAASc3RvcmVkVG9rZW5zVmFsdWVzCQABMQAAAAEFAAAABXRva2VuBAAAAA11cGRhdGVkUHJpY2VzCQEAAAAJdGFrZVJpZ2h0AAAAAgUAAAASc3RvcmVkVG9rZW5zVmFsdWVzBQAAAAl0b2tlblNpemUJAAACAAAAAQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACBQAAAA11cGRhdGVkUHJpY2VzAgAAAAQgOjogBQAAAAV0b2tlbgIAAAASIDo6IG9sZCB2YWx1ZXMgOjogBQAAABJzdG9yZWRUb2tlbnNWYWx1ZXMAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABAAAAAckbWF0Y2gwBQAAAAJ0eAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXngIuH/", "height": 1392033, "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 $list97549804 = priceList | |
284 | + | let $size97549804 = size($list97549804) | |
285 | + | let $acc097549804 = token | |
286 | + | if (($size97549804 == 0)) | |
287 | + | then $acc097549804 | |
288 | + | else { | |
289 | + | let $acc197549804 = generateNewListOfPrices($acc097549804, $list97549804[0]) | |
290 | + | if (($size97549804 == 1)) | |
291 | + | then $acc197549804 | |
292 | + | else { | |
293 | + | let $acc297549804 = generateNewListOfPrices($acc197549804, $list97549804[1]) | |
294 | + | if (($size97549804 == 2)) | |
295 | + | then $acc297549804 | |
296 | + | else { | |
297 | + | let $acc397549804 = generateNewListOfPrices($acc297549804, $list97549804[2]) | |
298 | + | if (($size97549804 == 3)) | |
299 | + | then $acc397549804 | |
300 | + | else { | |
301 | + | let $acc497549804 = generateNewListOfPrices($acc397549804, $list97549804[3]) | |
302 | + | if (($size97549804 == 4)) | |
303 | + | then $acc497549804 | |
304 | + | else { | |
305 | + | let $acc597549804 = generateNewListOfPrices($acc497549804, $list97549804[4]) | |
306 | + | if (($size97549804 == 5)) | |
307 | + | then $acc597549804 | |
308 | + | else { | |
309 | + | let $acc697549804 = generateNewListOfPrices($acc597549804, $list97549804[5]) | |
310 | + | throw("List size exceed 5") | |
311 | + | } | |
312 | + | } | |
313 | + | } | |
314 | + | } | |
315 | + | } | |
316 | + | } | |
317 | + | } | |
318 | + | let tokenSize = (size(storedTokensValues) - size(token)) | |
319 | + | let updatedPrices = takeRight(storedTokensValues, tokenSize) | |
320 | + | throw(((((updatedPrices + " :: ") + token) + " :: old values :: ") + storedTokensValues)) | |
321 | + | } | |
322 | + | else { | |
323 | + | let storedTokensValues = { | |
324 | + | let $list1147511525 = priceList | |
325 | + | let $size1147511525 = size($list1147511525) | |
326 | + | let $acc01147511525 = token | |
327 | + | if (($size1147511525 == 0)) | |
328 | + | then $acc01147511525 | |
329 | + | else { | |
330 | + | let $acc11147511525 = generateNewListOfPrices($acc01147511525, $list1147511525[0]) | |
331 | + | if (($size1147511525 == 1)) | |
332 | + | then $acc11147511525 | |
333 | + | else { | |
334 | + | let $acc21147511525 = generateNewListOfPrices($acc11147511525, $list1147511525[1]) | |
335 | + | if (($size1147511525 == 2)) | |
336 | + | then $acc21147511525 | |
337 | + | else { | |
338 | + | let $acc31147511525 = generateNewListOfPrices($acc21147511525, $list1147511525[2]) | |
339 | + | if (($size1147511525 == 3)) | |
340 | + | then $acc31147511525 | |
341 | + | else { | |
342 | + | let $acc41147511525 = generateNewListOfPrices($acc31147511525, $list1147511525[3]) | |
343 | + | if (($size1147511525 == 4)) | |
344 | + | then $acc41147511525 | |
345 | + | else { | |
346 | + | let $acc51147511525 = generateNewListOfPrices($acc41147511525, $list1147511525[4]) | |
347 | + | if (($size1147511525 == 5)) | |
348 | + | then $acc51147511525 | |
349 | + | else { | |
350 | + | let $acc61147511525 = generateNewListOfPrices($acc51147511525, $list1147511525[5]) | |
351 | + | throw("List size exceed 5") | |
352 | + | } | |
353 | + | } | |
354 | + | } | |
355 | + | } | |
356 | + | } | |
357 | + | } | |
358 | + | } | |
359 | + | let tokenSize = (size(storedTokensValues) - size(token)) | |
360 | + | let updatedPrices = takeRight(storedTokensValues, tokenSize) | |
361 | + | throw(((((updatedPrices + " :: ") + token) + " :: old values :: ") + storedTokensValues)) | |
362 | + | } | |
363 | + | } | |
364 | + | } | |
365 | + | } | |
366 | + | ||
367 | + | ||
368 | + | @Verifier(tx) | |
369 | + | func verify () = match tx { | |
370 | + | case _ => | |
371 | + | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
372 | + | } | |
373 | + |
github/deemru/w8io/026f985 45.70 ms ◑