tx · BdaP2JgxZR6Hurkkyi6Ft7N3JPWWtykpqoAStUEem7Cv 3NCpxjNiyjDTMFvpCpSiqdxmydPNC5JzoNZ: -0.01500000 Waves 2021.02.09 16:06 [1390694] smart account 3NCpxjNiyjDTMFvpCpSiqdxmydPNC5JzoNZ > SELF 0.00000000 Waves
{ "type": 13, "id": "BdaP2JgxZR6Hurkkyi6Ft7N3JPWWtykpqoAStUEem7Cv", "fee": 1500000, "feeAssetId": null, "timestamp": 1612876035088, "version": 2, "chainId": 84, "sender": "3NCpxjNiyjDTMFvpCpSiqdxmydPNC5JzoNZ", "senderPublicKey": "5QBLfSEMTG51UhsfuvV8C1XNLoaTjiVbr9iSYwwY8JQE", "proofs": [ "9LEhcEMEcpVokhPDzBz6MzVvKyN6D4AWRcuWKL9fVWLWEjbfhue2aedDCy2YqWRXUgotj8BggemmN3TEZeJi19T" ], "script": "base64:AAIDAAAAAAAAAA0IARIHCgUBAQEBCBIAAAAAEAAAAAANbG90dGVyeWFtb3VudAIAAAAHX2Ftb3VudAAAAAASbG90dGVyeXByb2JhYmlsaXR5AgAAAAxfcHJvYmFiaWxpdHkAAAAAGWxvdHRlcnlwcm9iYWJpbGl0eWRlY2ltYWwCAAAAFF9wcm9iYWJpbGl0eV9kZWNpbWFsAAAAAAxsb3R0ZXJ5UHJpY2UCAAAABl9wcmljZQAAAAANbG90dGVyeVByaWNlcwIAAAAPX2xvdHRlcnlfcHJpY2VzAAAAAA5sb3R0ZXJ5QXNzZXRJZAIAAAARX2xvdHRlcnlfYXNzZXRfaWQAAAAADWNvdW50T2ZQcmljZXMCAAAADV9jb3VudF9wcmljZXMAAAAAFGxhc3RIYXNoUmFuZG9tTnVtYmVyAgAAABVsYXN0X3NwaW5fcmFuZG9tX2hhc2gAAAAAE2xhc3RUb2tlblJhbmRvbUhhc2gCAAAAFmxhc3RfdG9rZW5fcmFuZG9tX2hhc2gAAAAACmRBcHBBZGRyZXMCAAAALDNCS0ZRTGVvNUV4WjVZMXB0OU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5zZmVyCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAKdG9rZW5QcmljZQUAAAANYWN0dWFsQXNzZXRJZAUAAAADbmlsCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgUAAAAJd3JpdGVTZXRzBQAAAAt3aW5UcmFuc2ZlcgAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAEAAAAByRtYXRjaDAFAAAAAnR4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAA9EYXRhVHJhbnNhY3Rpb24GAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgYJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5DeBcrg==", "height": 1390694, "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 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 = 5 | |
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) = 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 probCompare = (tokenProbabilityDecimal % probabilityValue) | |
76 | + | let sizeOfWin = size(win) | |
77 | + | if ((sizeOfWin == 1)) | |
78 | + | then { | |
79 | + | let randomNumber = win[1] | |
80 | + | let comp = toInt(fromBase64String(randomNumber)) | |
81 | + | if ((probCompare > comp)) | |
82 | + | then { | |
83 | + | let newList = token :: win | |
84 | + | newList | |
85 | + | } | |
86 | + | else win | |
87 | + | } | |
88 | + | else win | |
89 | + | } | |
90 | + | else win | |
91 | + | ||
92 | + | ||
93 | + | @Callable(i) | |
94 | + | func updateprobability (probability,amount,poolprice,probDecimal,assetId) = { | |
95 | + | let token = toBase64String(generatorRandomHash(i)) | |
96 | + | let paymentIsDefined = if (!(isDefined(i.payment))) | |
97 | + | then false | |
98 | + | else true | |
99 | + | let lotteryAssetTN = if ((assetId == "")) | |
100 | + | then true | |
101 | + | else false | |
102 | + | let totalRequiredAmount = (amount * poolprice) | |
103 | + | if ((paymentIsDefined == true)) | |
104 | + | then { | |
105 | + | let payment = extract(i.payment) | |
106 | + | let paymentAssetId = match payment.assetId { | |
107 | + | case a: ByteVector => | |
108 | + | toBase64String(a) | |
109 | + | case _: Unit => | |
110 | + | "" | |
111 | + | case _ => | |
112 | + | throw("Match error") | |
113 | + | } | |
114 | + | let paymentAmount = payment.amount | |
115 | + | if ((paymentAssetId != assetId)) | |
116 | + | then throw("Asset Id not matching with Payment Asset Id") | |
117 | + | else if ((totalRequiredAmount > paymentAmount)) | |
118 | + | then throw("Not enough Asset Amount") | |
119 | + | else { | |
120 | + | let tempValue = match getString(this, lotteryPrices) { | |
121 | + | case a: String => | |
122 | + | a | |
123 | + | case _: Unit => | |
124 | + | "" | |
125 | + | case _ => | |
126 | + | throw("Match error") | |
127 | + | } | |
128 | + | let containKey = indexOf(tempValue, token) | |
129 | + | let storedTokensValues = match containKey { | |
130 | + | case _: Unit => | |
131 | + | ((tempValue + token) + ",") | |
132 | + | case x: Int => | |
133 | + | throw("Token is duplicated") | |
134 | + | case _ => | |
135 | + | throw("Match error") | |
136 | + | } | |
137 | + | let countTokens = match getInteger(this, countOfPrices) { | |
138 | + | case a: Int => | |
139 | + | a | |
140 | + | case _: Unit => | |
141 | + | 0 | |
142 | + | case _ => | |
143 | + | throw("Match error") | |
144 | + | } | |
145 | + | if ((allowSizeLottery > countTokens)) | |
146 | + | then { | |
147 | + | 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)]) | |
148 | + | ScriptResult(updateLotteryPool, TransferSet(nil)) | |
149 | + | } | |
150 | + | else throw(("Lottery prices has reached maximum " + toString(allowSizeLottery))) | |
151 | + | } | |
152 | + | } | |
153 | + | else { | |
154 | + | let tnBalance = if (lotteryAssetTN) | |
155 | + | then wavesBalance(this) | |
156 | + | else assetBalance(this, fromBase64String(assetId)) | |
157 | + | if ((totalRequiredAmount > tnBalance)) | |
158 | + | then throw("Not enough Asset Amount") | |
159 | + | else { | |
160 | + | let tempValue = match getString(this, lotteryPrices) { | |
161 | + | case a: String => | |
162 | + | a | |
163 | + | case _: Unit => | |
164 | + | "" | |
165 | + | case _ => | |
166 | + | throw("Match error") | |
167 | + | } | |
168 | + | let containKey = indexOf(tempValue, token) | |
169 | + | let storedTokensValues = match containKey { | |
170 | + | case _: Unit => | |
171 | + | ((tempValue + token) + ",") | |
172 | + | case x: Int => | |
173 | + | throw("Token is duplicated") | |
174 | + | case _ => | |
175 | + | throw("Match error") | |
176 | + | } | |
177 | + | let countTokens = match getInteger(this, countOfPrices) { | |
178 | + | case a: Int => | |
179 | + | a | |
180 | + | case _: Unit => | |
181 | + | 0 | |
182 | + | case _ => | |
183 | + | throw("Match error") | |
184 | + | } | |
185 | + | if ((allowSizeLottery > countTokens)) | |
186 | + | then { | |
187 | + | 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)]) | |
188 | + | ScriptResult(updateLotteryPool, TransferSet(nil)) | |
189 | + | } | |
190 | + | else throw(("Lottery prices has reached maximum " + toString(allowSizeLottery))) | |
191 | + | } | |
192 | + | } | |
193 | + | } | |
194 | + | ||
195 | + | ||
196 | + | ||
197 | + | @Callable(i) | |
198 | + | func startlotto () = { | |
199 | + | let currentKey = toBase58String(i.caller.bytes) | |
200 | + | let randhash = randomizer(i) | |
201 | + | let countTokens = match getInteger(this, countOfPrices) { | |
202 | + | case a: Int => | |
203 | + | a | |
204 | + | case _: Unit => | |
205 | + | 0 | |
206 | + | case _ => | |
207 | + | throw("Match error") | |
208 | + | } | |
209 | + | let priceList = getPriceArray() | |
210 | + | let randNumber = toInt(randhash) | |
211 | + | let winningToken = { | |
212 | + | let $list74957554 = priceList | |
213 | + | let $size74957554 = size($list74957554) | |
214 | + | let $acc074957554 = [toString(randNumber)] | |
215 | + | if (($size74957554 == 0)) | |
216 | + | then $acc074957554 | |
217 | + | else { | |
218 | + | let $acc174957554 = procedLottery($acc074957554, $list74957554[0]) | |
219 | + | if (($size74957554 == 1)) | |
220 | + | then $acc174957554 | |
221 | + | else { | |
222 | + | let $acc274957554 = procedLottery($acc174957554, $list74957554[1]) | |
223 | + | if (($size74957554 == 2)) | |
224 | + | then $acc274957554 | |
225 | + | else { | |
226 | + | let $acc374957554 = procedLottery($acc274957554, $list74957554[2]) | |
227 | + | if (($size74957554 == 3)) | |
228 | + | then $acc374957554 | |
229 | + | else { | |
230 | + | let $acc474957554 = procedLottery($acc374957554, $list74957554[3]) | |
231 | + | if (($size74957554 == 4)) | |
232 | + | then $acc474957554 | |
233 | + | else { | |
234 | + | let $acc574957554 = procedLottery($acc474957554, $list74957554[4]) | |
235 | + | if (($size74957554 == 5)) | |
236 | + | then $acc574957554 | |
237 | + | else { | |
238 | + | let $acc674957554 = procedLottery($acc574957554, $list74957554[5]) | |
239 | + | if (($size74957554 == 6)) | |
240 | + | then $acc674957554 | |
241 | + | else { | |
242 | + | let $acc774957554 = procedLottery($acc674957554, $list74957554[6]) | |
243 | + | if (($size74957554 == 7)) | |
244 | + | then $acc774957554 | |
245 | + | else { | |
246 | + | let $acc874957554 = procedLottery($acc774957554, $list74957554[7]) | |
247 | + | if (($size74957554 == 8)) | |
248 | + | then $acc874957554 | |
249 | + | else { | |
250 | + | let $acc974957554 = procedLottery($acc874957554, $list74957554[8]) | |
251 | + | if (($size74957554 == 9)) | |
252 | + | then $acc974957554 | |
253 | + | else { | |
254 | + | let $acc1074957554 = procedLottery($acc974957554, $list74957554[9]) | |
255 | + | if (($size74957554 == 10)) | |
256 | + | then $acc1074957554 | |
257 | + | else { | |
258 | + | let $acc1174957554 = procedLottery($acc1074957554, $list74957554[10]) | |
259 | + | if (($size74957554 == 11)) | |
260 | + | then $acc1174957554 | |
261 | + | else { | |
262 | + | let $acc1274957554 = procedLottery($acc1174957554, $list74957554[11]) | |
263 | + | if (($size74957554 == 12)) | |
264 | + | then $acc1274957554 | |
265 | + | else { | |
266 | + | let $acc1374957554 = procedLottery($acc1274957554, $list74957554[12]) | |
267 | + | if (($size74957554 == 13)) | |
268 | + | then $acc1374957554 | |
269 | + | else { | |
270 | + | let $acc1474957554 = procedLottery($acc1374957554, $list74957554[13]) | |
271 | + | if (($size74957554 == 14)) | |
272 | + | then $acc1474957554 | |
273 | + | else { | |
274 | + | let $acc1574957554 = procedLottery($acc1474957554, $list74957554[14]) | |
275 | + | throw("List size exceed 14") | |
276 | + | } | |
277 | + | } | |
278 | + | } | |
279 | + | } | |
280 | + | } | |
281 | + | } | |
282 | + | } | |
283 | + | } | |
284 | + | } | |
285 | + | } | |
286 | + | } | |
287 | + | } | |
288 | + | } | |
289 | + | } | |
290 | + | } | |
291 | + | } | |
292 | + | let sizeOfWinPrices = size(winningToken) | |
293 | + | if ((sizeOfWinPrices == 0)) | |
294 | + | then { | |
295 | + | let writeSets = WriteSet(nil) | |
296 | + | ScriptResult(writeSets, TransferSet(nil)) | |
297 | + | } | |
298 | + | else { | |
299 | + | let token = winningToken[1] | |
300 | + | let currentAmount = getIntegerValue(this, (token + lotteryamount)) | |
301 | + | if ((currentAmount == 0)) | |
302 | + | then throw("Amount exceeded") | |
303 | + | else { | |
304 | + | let actualAmount = -(1) | |
305 | + | let tokenPrice = getIntegerValue(this, (token + lotteryPrice)) | |
306 | + | let tokenAssetId = getStringValue(this, (token + lotteryAssetId)) | |
307 | + | if ((actualAmount == 0)) | |
308 | + | then { | |
309 | + | let storedTokensValues = { | |
310 | + | let $list83758425 = priceList | |
311 | + | let $size83758425 = size($list83758425) | |
312 | + | let $acc083758425 = token | |
313 | + | if (($size83758425 == 0)) | |
314 | + | then $acc083758425 | |
315 | + | else { | |
316 | + | let $acc183758425 = generateNewListOfPrices($acc083758425, $list83758425[0]) | |
317 | + | if (($size83758425 == 1)) | |
318 | + | then $acc183758425 | |
319 | + | else { | |
320 | + | let $acc283758425 = generateNewListOfPrices($acc183758425, $list83758425[1]) | |
321 | + | if (($size83758425 == 2)) | |
322 | + | then $acc283758425 | |
323 | + | else { | |
324 | + | let $acc383758425 = generateNewListOfPrices($acc283758425, $list83758425[2]) | |
325 | + | if (($size83758425 == 3)) | |
326 | + | then $acc383758425 | |
327 | + | else { | |
328 | + | let $acc483758425 = generateNewListOfPrices($acc383758425, $list83758425[3]) | |
329 | + | if (($size83758425 == 4)) | |
330 | + | then $acc483758425 | |
331 | + | else { | |
332 | + | let $acc583758425 = generateNewListOfPrices($acc483758425, $list83758425[4]) | |
333 | + | if (($size83758425 == 5)) | |
334 | + | then $acc583758425 | |
335 | + | else { | |
336 | + | let $acc683758425 = generateNewListOfPrices($acc583758425, $list83758425[5]) | |
337 | + | throw("List size exceed 5") | |
338 | + | } | |
339 | + | } | |
340 | + | } | |
341 | + | } | |
342 | + | } | |
343 | + | } | |
344 | + | } | |
345 | + | let writeSets = WriteSet([DataEntry(("winning_token_" + token), token), DataEntry((currentKey + "_wininning_address_"), currentKey), DataEntry(countOfPrices, (countTokens - 1)), DataEntry(lotteryPrices, storedTokensValues), DataEntry(lastHashRandomNumber, randNumber)]) | |
346 | + | if ((tokenAssetId == "")) | |
347 | + | then { | |
348 | + | let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, unit)]) | |
349 | + | ScriptResult(writeSets, winTransfer) | |
350 | + | } | |
351 | + | else { | |
352 | + | let actualAssetId = fromBase64String(tokenAssetId) | |
353 | + | let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, actualAssetId)]) | |
354 | + | ScriptResult(writeSets, winTransfer) | |
355 | + | } | |
356 | + | } | |
357 | + | else { | |
358 | + | let writeSets = WriteSet([DataEntry((currentKey + "_winning_token_"), token), DataEntry((currentKey + "_wininning_address_"), currentKey), DataEntry((token + lotteryamount), actualAmount), DataEntry(lastHashRandomNumber, randNumber)]) | |
359 | + | if ((tokenAssetId == "")) | |
360 | + | then { | |
361 | + | let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, unit)]) | |
362 | + | ScriptResult(writeSets, winTransfer) | |
363 | + | } | |
364 | + | else { | |
365 | + | let actualAssetId = fromBase64String(tokenAssetId) | |
366 | + | let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, actualAssetId)]) | |
367 | + | ScriptResult(writeSets, winTransfer) | |
368 | + | } | |
369 | + | } | |
370 | + | } | |
371 | + | } | |
372 | + | } | |
373 | + | ||
374 | + | ||
375 | + | @Verifier(tx) | |
376 | + | func verify () = match tx { | |
377 | + | case _: DataTransaction => | |
378 | + | true | |
379 | + | case _: SetScriptTransaction => | |
380 | + | true | |
381 | + | case _ => | |
382 | + | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
383 | + | } | |
384 | + |
github/deemru/w8io/169f3d6 35.08 ms ◑