tx · 3bFTvvFvR8nVKppyo39X9WqQNRKYm3TvrDbMP1X9phRs 3Muvy41fihv5QzReZKY2oXKYKU6FkHNU3F7: -0.01500000 Waves 2021.03.12 05:57 [1433894] smart account 3Muvy41fihv5QzReZKY2oXKYKU6FkHNU3F7 > SELF 0.00000000 Waves
{ "type": 13, "id": "3bFTvvFvR8nVKppyo39X9WqQNRKYm3TvrDbMP1X9phRs", "fee": 1500000, "feeAssetId": null, "timestamp": 1615517847873, "version": 2, "chainId": 84, "sender": "3Muvy41fihv5QzReZKY2oXKYKU6FkHNU3F7", "senderPublicKey": "C3vbo1k4JZVcvb6DJNCyFbje3nxHsvmLJpCjkny3s97U", "proofs": [ "4xnp1oZhCSrQYBDo4qXEgnpL6ThtxAsS9Mz2R2Db5NKvVxoPLSPGaMfWZdqcP5dWoP2oaWyBmdWbv6zTYKgU6X2x" ], "script": "base64:AAIDAAAAAAAAAAYIARIAEgAAAAAWAAAAAApkQXBwQWRkcmVzAgAAACtGOURDR2lZZ1Q4eXZCcTFBUUZjU3BHRzRwOHNkek56OW1aY3pEdko0NUxMAAAAAAx0b2tlbkFzc2V0SWQCAAAALDVpaDlqZDRLVjlrU2V5NTV5dktNZ0xTSGN3c1lZa1E0cFJESnRSTm94VWh5AAAAAA11c2VHYXJsaWNDb2luBwAAAAANdG9rZW5zUGVyUGxheQAAAAAAAJiWgAAAAAANbG90dGVyeWFtb3VudAIAAAAHX2Ftb3VudAAAAAASbG90dGVyeXByb2JhYmlsaXR5AgAAAAxfcHJvYmFiaWxpdHkAAAAAGWxvdHRlcnlwcm9iYWJpbGl0eWRlY2ltYWwCAAAAFF9wcm9iYWJpbGl0eV9kZWNpbWFsAAAAABVsb3R0ZXJ5V2lubmluZ0FkZHJlc3MCAAAAEF93aW5uaW5nX2FkZHJlc3MAAAAADGxvdHRlcnlQcmljZQIAAAAGX3ByaWNlAAAAAA1sb3R0ZXJ5UHJpY2VzAgAAAA9fbG90dGVyeV9wcmljZXMAAAAADmxvdHR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Jlc3VsdAAAAAIFAAAACXdyaXRlU2V0cwUAAAALd2luVHJhbnNmZXIEAAAAC3dpblRyYW5zZmVyCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAASbG90dGVyeVByaWNlVG9rZW5CBQAAAAR1bml0BQAAAANuaWwJAQAAAAxTY3JpcHRSZXN1bHQAAAACBQAAAAl3cml0ZVNldHMFAAAAC3dpblRyYW5zZmVyCQAAAgAAAAEJAAEsAAAAAgkAASwAAAACAgAAAAlZb3UgbmVlZCAFAAAADHRva2VuQXNzZXRJZAIAAAATIHRvIHBsYXkgdGhpcyBnYW1lLgAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAEAAAAByRtYXRjaDAFAAAAAnR4CQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleYlhcbc=", "height": 1433894, "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 tokenAssetId = "5ih9jd4KV9kSey55yvKMgLSHcwsYYkQ4pRDJtRNoxUhy" | |
7 | + | ||
8 | + | let useGarlicCoin = false | |
9 | + | ||
10 | + | let tokensPerPlay = 10000000 | |
11 | + | ||
12 | + | let lotteryamount = "_amount" | |
13 | + | ||
14 | + | let lotteryprobability = "_probability" | |
15 | + | ||
16 | + | let lotteryprobabilitydecimal = "_probability_decimal" | |
17 | + | ||
18 | + | let lotteryWinningAddress = "_winning_address" | |
19 | + | ||
20 | + | let lotteryPrice = "_price" | |
21 | + | ||
22 | + | let lotteryPrices = "_lottery_prices" | |
23 | + | ||
24 | + | let lotteryAssetId = "_lottery_asset_id" | |
25 | + | ||
26 | + | let countOfPrices = "_count_prices" | |
27 | + | ||
28 | + | let lastHashRandomNumber = "last_spin_random_hash" | |
29 | + | ||
30 | + | let allowSizeLottery = 3 | |
31 | + | ||
32 | + | let totalPricesInPool = "total_prizes_pool" | |
33 | + | ||
34 | + | let tokenAId = "f2MzwrmN5wiMn5DwbBL33247fdsf432FV9kSe" | |
35 | + | ||
36 | + | let tokenBId = "f1MzwrmN4wiMn4DwbBL43242fsdf434Ffsdfs" | |
37 | + | ||
38 | + | let tokenCId = "f3MzwrmN4wiMn5DsdBL436542fsdf434Ffsdw" | |
39 | + | ||
40 | + | func randomizer (inv) = { | |
41 | + | let lastPlay = match getBinary(this, lastHashRandomNumber) { | |
42 | + | case s: ByteVector => | |
43 | + | s | |
44 | + | case _: Unit => | |
45 | + | base58'2ee4oFDYriWJ9EMeR' | |
46 | + | case _ => | |
47 | + | throw("Match error") | |
48 | + | } | |
49 | + | let rand = (((((lastPlay + inv.transactionId) + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)) | |
50 | + | sha256(rand) | |
51 | + | } | |
52 | + | ||
53 | + | ||
54 | + | func getPriceArray () = { | |
55 | + | let currentPrices = match getString(this, lotteryPrices) { | |
56 | + | case a: String => | |
57 | + | a | |
58 | + | case _: Unit => | |
59 | + | "" | |
60 | + | case _ => | |
61 | + | throw("Match error") | |
62 | + | } | |
63 | + | let sizePrices = size(currentPrices) | |
64 | + | if ((sizePrices == 0)) | |
65 | + | then nil | |
66 | + | else { | |
67 | + | let trimPrices = take(currentPrices, (size(currentPrices) - 1)) | |
68 | + | let newArray = split(trimPrices, ",") | |
69 | + | newArray | |
70 | + | } | |
71 | + | } | |
72 | + | ||
73 | + | ||
74 | + | func getCurrentBalance () = if ((useGarlicCoin == true)) | |
75 | + | then assetBalance(this, fromBase58String(tokenAssetId)) | |
76 | + | else wavesBalance(this) | |
77 | + | ||
78 | + | ||
79 | + | func procedLottery (win,token) = if (if (isDefined(token)) | |
80 | + | then true | |
81 | + | else (token != "")) | |
82 | + | then { | |
83 | + | let tokenProbability = getIntegerValue(this, (token + lotteryprobability)) | |
84 | + | let tokenProbabilityDecimal = getIntegerValue(this, (token + lotteryprobabilitydecimal)) | |
85 | + | let sizeOfWin = size(win) | |
86 | + | if ((sizeOfWin == 1)) | |
87 | + | then { | |
88 | + | let randomNumber = win[0] | |
89 | + | let convertedRandomNumber = fromBase64String(randomNumber) | |
90 | + | let convertedDecimalNumber = (tokenProbabilityDecimal * 1000) | |
91 | + | let comparisonNumber = (toInt(convertedRandomNumber) % convertedDecimalNumber) | |
92 | + | if ((tokenProbability > comparisonNumber)) | |
93 | + | then token :: win | |
94 | + | else win | |
95 | + | } | |
96 | + | else win | |
97 | + | } | |
98 | + | else win | |
99 | + | ||
100 | + | ||
101 | + | @Callable(i) | |
102 | + | func setGarlicCoinLottery () = { | |
103 | + | let balance = getCurrentBalance() | |
104 | + | let randomHash = randomizer(i) | |
105 | + | if ((69 > balance)) | |
106 | + | then throw("Not enought Amount") | |
107 | + | else { | |
108 | + | let storedTokensValues = (((((tokenAId + ",") + tokenBId) + ",") + tokenCId) + ",") | |
109 | + | if (useGarlicCoin) | |
110 | + | then { | |
111 | + | let updateLotteryPool = WriteSet([DataEntry((tokenAId + lotteryprobability), 69), DataEntry((tokenAId + lotteryPrice), 69), DataEntry((tokenAId + lotteryprobabilitydecimal), 100000), DataEntry((tokenAId + lotteryAssetId), tokenAssetId), DataEntry((tokenBId + lotteryprobability), 69), DataEntry((tokenBId + lotteryPrice), 6900000000), DataEntry((tokenBId + lotteryprobabilitydecimal), 10000), DataEntry((tokenBId + lotteryAssetId), tokenAssetId), DataEntry((tokenCId + lotteryprobability), 69), DataEntry((tokenCId + lotteryPrice), 690000000), DataEntry((tokenCId + lotteryprobabilitydecimal), 1000), DataEntry((tokenCId + lotteryAssetId), tokenAssetId), DataEntry(lastHashRandomNumber, randomHash), DataEntry(lotteryPrices, storedTokensValues), DataEntry(countOfPrices, 3)]) | |
112 | + | ScriptResult(updateLotteryPool, TransferSet(nil)) | |
113 | + | } | |
114 | + | else { | |
115 | + | let updateLotteryPool = WriteSet([DataEntry((tokenAId + lotteryprobability), 69), DataEntry((tokenAId + lotteryPrice), 69), DataEntry((tokenAId + lotteryprobabilitydecimal), 100000), DataEntry((tokenAId + lotteryAssetId), ""), DataEntry((tokenBId + lotteryamount), 6900000000), DataEntry((tokenBId + lotteryprobability), 69), DataEntry((tokenBId + lotteryPrice), 6900000000), DataEntry((tokenBId + lotteryprobabilitydecimal), 10000), DataEntry((tokenBId + lotteryAssetId), ""), DataEntry((tokenCId + lotteryprobability), 69), DataEntry((tokenCId + lotteryPrice), 690000000), DataEntry((tokenCId + lotteryprobabilitydecimal), 1), DataEntry((tokenCId + lotteryAssetId), ""), DataEntry(lotteryPrices, storedTokensValues), DataEntry(countOfPrices, 3)]) | |
116 | + | ScriptResult(updateLotteryPool, TransferSet(nil)) | |
117 | + | } | |
118 | + | } | |
119 | + | } | |
120 | + | ||
121 | + | ||
122 | + | ||
123 | + | @Callable(i) | |
124 | + | func startlotto () = { | |
125 | + | let paymentIsDefined = if (!(isDefined(i.payment))) | |
126 | + | then false | |
127 | + | else true | |
128 | + | if ((paymentIsDefined == true)) | |
129 | + | then { | |
130 | + | let pmt = extract(i.payment) | |
131 | + | if (isDefined(pmt.assetId)) | |
132 | + | then if ((pmt.amount != tokensPerPlay)) | |
133 | + | then throw("Incorrect asset passed or incorrect quantity passed") | |
134 | + | else if ((fromBase58String(tokenAssetId) != pmt.assetId)) | |
135 | + | then throw("Incorrect asset passed or incorrect quantity passed") | |
136 | + | else { | |
137 | + | let currentKey = toBase58String(i.caller.bytes) | |
138 | + | let randhash = randomizer(i) | |
139 | + | let priceList = getPriceArray() | |
140 | + | let randNumber = toBase64String(randhash) | |
141 | + | let listWinningPrices = [randNumber] | |
142 | + | let winningToken = { | |
143 | + | let $list68406892 = priceList | |
144 | + | let $size68406892 = size($list68406892) | |
145 | + | let $acc068406892 = listWinningPrices | |
146 | + | if (($size68406892 == 0)) | |
147 | + | then $acc068406892 | |
148 | + | else { | |
149 | + | let $acc168406892 = procedLottery($acc068406892, $list68406892[0]) | |
150 | + | if (($size68406892 == 1)) | |
151 | + | then $acc168406892 | |
152 | + | else { | |
153 | + | let $acc268406892 = procedLottery($acc168406892, $list68406892[1]) | |
154 | + | if (($size68406892 == 2)) | |
155 | + | then $acc268406892 | |
156 | + | else { | |
157 | + | let $acc368406892 = procedLottery($acc268406892, $list68406892[2]) | |
158 | + | if (($size68406892 == 3)) | |
159 | + | then $acc368406892 | |
160 | + | else { | |
161 | + | let $acc468406892 = procedLottery($acc368406892, $list68406892[3]) | |
162 | + | throw("List size exceed 3") | |
163 | + | } | |
164 | + | } | |
165 | + | } | |
166 | + | } | |
167 | + | } | |
168 | + | let sizeOfWinPrices = size(winningToken) | |
169 | + | if ((sizeOfWinPrices == 1)) | |
170 | + | then { | |
171 | + | let writeSets = WriteSet([DataEntry("message", "<h1>Better luck next time!</h1><br><p>Invite more friends to keep playing!<p>"), DataEntry(lastHashRandomNumber, randNumber)]) | |
172 | + | ScriptResult(writeSets, TransferSet(nil)) | |
173 | + | } | |
174 | + | else { | |
175 | + | let token = winningToken[0] | |
176 | + | let callerAddress = toBase58String(i.caller.bytes) | |
177 | + | let addressBalance = getCurrentBalance() | |
178 | + | if ((addressBalance == 0)) | |
179 | + | then throw("Not Enough Garlic Coin") | |
180 | + | else if ((token == tokenAId)) | |
181 | + | then { | |
182 | + | let lotteryPriceTokenA = match getInteger(this, (tokenAId + lotteryPrice)) { | |
183 | + | case t: Int => | |
184 | + | t | |
185 | + | case _: Unit => | |
186 | + | 0 | |
187 | + | case _ => | |
188 | + | throw("Match error") | |
189 | + | } | |
190 | + | let winningAmount = (lotteryPriceTokenA * addressBalance) | |
191 | + | let writeSets = WriteSet([DataEntry((token + lotteryamount), winningAmount), DataEntry((token + lotteryWinningAddress), callerAddress), DataEntry(lastHashRandomNumber, randNumber), DataEntry("message", (((("<h1>Congratulations you won!</h1><br><p>You have won " + toString(winningAmount)) + " ") + token) + "!<p>"))]) | |
192 | + | if (useGarlicCoin) | |
193 | + | then { | |
194 | + | let winTransfer = TransferSet([ScriptTransfer(i.caller, winningAmount, fromBase58String(tokenAssetId))]) | |
195 | + | ScriptResult(writeSets, winTransfer) | |
196 | + | } | |
197 | + | else { | |
198 | + | let winTransfer = TransferSet([ScriptTransfer(i.caller, winningAmount, unit)]) | |
199 | + | ScriptResult(writeSets, winTransfer) | |
200 | + | } | |
201 | + | } | |
202 | + | else { | |
203 | + | let lotteryPriceTokenB = match getInteger(this, (token + lotteryprobability)) { | |
204 | + | case t: Int => | |
205 | + | t | |
206 | + | case _: Unit => | |
207 | + | 0 | |
208 | + | case _ => | |
209 | + | throw("Match error") | |
210 | + | } | |
211 | + | let writeSets = WriteSet([DataEntry((token + lotteryamount), lotteryPriceTokenB), DataEntry(lastHashRandomNumber, randNumber), DataEntry((token + lotteryWinningAddress), callerAddress), DataEntry("message", (((("<h1>Congratulations you won!</h1><br><p>You have won " + toString(lotteryPriceTokenB)) + " ") + token) + "!<p>"))]) | |
212 | + | if (useGarlicCoin) | |
213 | + | then { | |
214 | + | let winTransfer = TransferSet([ScriptTransfer(i.caller, lotteryPriceTokenB, fromBase58String(tokenAssetId))]) | |
215 | + | ScriptResult(writeSets, winTransfer) | |
216 | + | } | |
217 | + | else { | |
218 | + | let winTransfer = TransferSet([ScriptTransfer(i.caller, lotteryPriceTokenB, unit)]) | |
219 | + | ScriptResult(writeSets, winTransfer) | |
220 | + | } | |
221 | + | } | |
222 | + | } | |
223 | + | } | |
224 | + | else if ((pmt.amount != tokensPerPlay)) | |
225 | + | then throw("Incorrect asset passed or incorrect quantity passed") | |
226 | + | else { | |
227 | + | let currentKey = toBase58String(i.caller.bytes) | |
228 | + | let randhash = randomizer(i) | |
229 | + | let priceList = getPriceArray() | |
230 | + | let randNumber = toBase64String(randhash) | |
231 | + | let listWinningPrices = [randNumber] | |
232 | + | let winningToken = { | |
233 | + | let $list1197712029 = priceList | |
234 | + | let $size1197712029 = size($list1197712029) | |
235 | + | let $acc01197712029 = listWinningPrices | |
236 | + | if (($size1197712029 == 0)) | |
237 | + | then $acc01197712029 | |
238 | + | else { | |
239 | + | let $acc11197712029 = procedLottery($acc01197712029, $list1197712029[0]) | |
240 | + | if (($size1197712029 == 1)) | |
241 | + | then $acc11197712029 | |
242 | + | else { | |
243 | + | let $acc21197712029 = procedLottery($acc11197712029, $list1197712029[1]) | |
244 | + | if (($size1197712029 == 2)) | |
245 | + | then $acc21197712029 | |
246 | + | else { | |
247 | + | let $acc31197712029 = procedLottery($acc21197712029, $list1197712029[2]) | |
248 | + | if (($size1197712029 == 3)) | |
249 | + | then $acc31197712029 | |
250 | + | else { | |
251 | + | let $acc41197712029 = procedLottery($acc31197712029, $list1197712029[3]) | |
252 | + | throw("List size exceed 3") | |
253 | + | } | |
254 | + | } | |
255 | + | } | |
256 | + | } | |
257 | + | } | |
258 | + | let sizeOfWinPrices = size(winningToken) | |
259 | + | if ((sizeOfWinPrices == 1)) | |
260 | + | then { | |
261 | + | let writeSets = WriteSet([DataEntry("message", "<h1>Better luck next time!</h1><br><p>Invite more friends to keep playing!<p>"), DataEntry(lastHashRandomNumber, randNumber)]) | |
262 | + | ScriptResult(writeSets, TransferSet(nil)) | |
263 | + | } | |
264 | + | else { | |
265 | + | let token = winningToken[0] | |
266 | + | let callerAddress = toBase58String(i.caller.bytes) | |
267 | + | let addressBalance = getCurrentBalance() | |
268 | + | if ((addressBalance == 0)) | |
269 | + | then throw("Not Enough Garlic Coin") | |
270 | + | else if ((token == tokenAId)) | |
271 | + | then { | |
272 | + | let lotteryPriceTokenA = match getInteger(this, (tokenAId + lotteryPrice)) { | |
273 | + | case t: Int => | |
274 | + | t | |
275 | + | case _: Unit => | |
276 | + | 0 | |
277 | + | case _ => | |
278 | + | throw("Match error") | |
279 | + | } | |
280 | + | let winningAmount = (lotteryPriceTokenA * addressBalance) | |
281 | + | let writeSets = WriteSet([DataEntry((token + lotteryamount), winningAmount), DataEntry((token + lotteryWinningAddress), callerAddress), DataEntry(lastHashRandomNumber, randNumber), DataEntry("message", (((("<h1>Congratulations you won!</h1><br><p>You have won " + toString(winningAmount)) + " ") + token) + "!<p>"))]) | |
282 | + | if (useGarlicCoin) | |
283 | + | then { | |
284 | + | let winTransfer = TransferSet([ScriptTransfer(i.caller, winningAmount, fromBase58String(tokenAssetId))]) | |
285 | + | ScriptResult(writeSets, winTransfer) | |
286 | + | } | |
287 | + | else { | |
288 | + | let winTransfer = TransferSet([ScriptTransfer(i.caller, winningAmount, unit)]) | |
289 | + | ScriptResult(writeSets, winTransfer) | |
290 | + | } | |
291 | + | } | |
292 | + | else { | |
293 | + | let lotteryPriceTokenB = match getInteger(this, (token + lotteryprobability)) { | |
294 | + | case t: Int => | |
295 | + | t | |
296 | + | case _: Unit => | |
297 | + | 0 | |
298 | + | case _ => | |
299 | + | throw("Match error") | |
300 | + | } | |
301 | + | let writeSets = WriteSet([DataEntry((token + lotteryamount), lotteryPriceTokenB), DataEntry(lastHashRandomNumber, randNumber), DataEntry((token + lotteryWinningAddress), callerAddress), DataEntry("message", (((("<h1>Congratulations you won!</h1><br><p>You have won " + toString(lotteryPriceTokenB)) + " ") + token) + "!<p>"))]) | |
302 | + | if (useGarlicCoin) | |
303 | + | then { | |
304 | + | let winTransfer = TransferSet([ScriptTransfer(i.caller, lotteryPriceTokenB, fromBase58String(tokenAssetId))]) | |
305 | + | ScriptResult(writeSets, winTransfer) | |
306 | + | } | |
307 | + | else { | |
308 | + | let winTransfer = TransferSet([ScriptTransfer(i.caller, lotteryPriceTokenB, unit)]) | |
309 | + | ScriptResult(writeSets, winTransfer) | |
310 | + | } | |
311 | + | } | |
312 | + | } | |
313 | + | } | |
314 | + | } | |
315 | + | else throw((("You need " + tokenAssetId) + " to play this game.")) | |
316 | + | } | |
317 | + | ||
318 | + | ||
319 | + | @Verifier(tx) | |
320 | + | func verify () = match tx { | |
321 | + | case _ => | |
322 | + | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
323 | + | } | |
324 | + |
github/deemru/w8io/026f985 27.91 ms ◑