tx · 8R4EdPrwMUM9CpJCfufqsmr4LCwmAG4HHs7KtYrXKhCc 3MrHrorXsVweB34Jji3BVtDzu2ZSLbBHmY9: -0.01500000 Waves 2021.02.09 17:14 [1390759] smart account 3MrHrorXsVweB34Jji3BVtDzu2ZSLbBHmY9 > SELF 0.00000000 Waves
{ "type": 13, "id": "8R4EdPrwMUM9CpJCfufqsmr4LCwmAG4HHs7KtYrXKhCc", "fee": 1500000, "feeAssetId": null, "timestamp": 1612880051439, "version": 2, "chainId": 84, "sender": "3MrHrorXsVweB34Jji3BVtDzu2ZSLbBHmY9", "senderPublicKey": "3Q5WcYzHaXAX5EjGxKmA1rLCcvb56YRv6nsSfChMKnTQ", "proofs": [ "3xE9aE1um92R2rgxDWfksv39pQzGpm5BaVK8SgbJWs2x5krNM7VLmjY8R74wUyoxRfcyvzhr3qa2omYjbjHtHmPd" ], "script": "base64:AAIDAAAAAAAAAA0IARIHCgUBAQEBCBIAAAAAEAAAAAANbG90dGVyeWFtb3VudAIAAAAHX2Ftb3VudAAAAAASbG90dGVyeXByb2JhYmlsaXR5AgAAAAxfcHJvYmFiaWxpdHkAAAAAGWxvdHRlcnlwcm9iYWJpbGl0eWRlY2ltYWwCAAAAFF9wcm9iYWJpbGl0eV9kZWNpbWFsAAAAAAxsb3R0ZXJ5UHJpY2UCAAAABl9wcmljZQAAAAANbG90dGVyeVByaWNlcwIAAAAPX2xvdHRlcnlfcHJpY2VzAAAAAA5sb3R0ZXJ5QXNzZXRJZAIAAAARX2xvdHRlcnlfYXNzZXRfaWQAAAAADWNvdW50T2ZQcmljZXMCAAAADV9jb3VudF9wcmljZXMAAAAAFGxhc3RIYXNoUmFuZG9tTnVtYmVyAgAAABVsYXN0X3NwaW5fcmFuZG9tX2hhc2gAAAAAE2xhc3RUb2tlblJhbmRvbUhhc2gCAAAAFmxhc3RfdG9rZW5fcmFuZG9tX2hhc2gAAAAACmRBcHBBZGRyZXMCAAAALDNCS0ZRTGVvNUV4WjVZMXB0OUZ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IFAAAADHRva2VuQXNzZXRJZAIAAAAABAAAAAt3aW5UcmFuc2ZlcgkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAACnRva2VuUHJpY2UFAAAABHVuaXQFAAAAA25pbAkBAAAADFNjcmlwdFJlc3VsdAAAAAIFAAAACXdyaXRlU2V0cwUAAAALd2luVHJhbnNmZXIEAAAADWFjdHVhbEFzc2V0SWQJAAJbAAAAAQUAAAAMdG9rZW5Bc3NldElkBAAAAAt3aW5UcmFuc2ZlcgkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAACnRva2VuUHJpY2UFAAAADWFjdHVhbEFzc2V0SWQFAAAAA25pbAkBAAAADFNjcmlwdFJlc3VsdAAAAAIFAAAACXdyaXRlU2V0cwUAAAALd2luVHJhbnNmZXIAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPRGF0YVRyYW5zYWN0aW9uBgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAUU2V0U2NyaXB0VHJhbnNhY3Rpb24GCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleRDALFc=", "height": 1390759, "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 (if (isDefined(token)) | |
71 | + | then true | |
72 | + | else (token != "")) | |
73 | + | then { | |
74 | + | let tokenProbability = getIntegerValue(this, (token + lotteryprobability)) | |
75 | + | let tokenProbabilityDecimal = getIntegerValue(this, (token + lotteryprobabilitydecimal)) | |
76 | + | let probabilityValue = (tokenProbabilityDecimal * 1000) | |
77 | + | let probCompare = (tokenProbabilityDecimal % probabilityValue) | |
78 | + | let sizeOfWin = size(win) | |
79 | + | if ((sizeOfWin == 1)) | |
80 | + | then { | |
81 | + | let randomNumber = win[0] | |
82 | + | let comp = toInt(fromBase64String(randomNumber)) | |
83 | + | if ((probCompare > comp)) | |
84 | + | then token :: win | |
85 | + | else win | |
86 | + | } | |
87 | + | else win | |
88 | + | } | |
89 | + | else win | |
90 | + | ||
91 | + | ||
92 | + | @Callable(i) | |
93 | + | func updateprobability (probability,amount,poolprice,probDecimal,assetId) = { | |
94 | + | let token = toBase64String(generatorRandomHash(i)) | |
95 | + | let paymentIsDefined = if (!(isDefined(i.payment))) | |
96 | + | then false | |
97 | + | else true | |
98 | + | let lotteryAssetTN = if ((assetId == "")) | |
99 | + | then true | |
100 | + | else false | |
101 | + | let totalRequiredAmount = (amount * poolprice) | |
102 | + | if ((paymentIsDefined == true)) | |
103 | + | then { | |
104 | + | let payment = extract(i.payment) | |
105 | + | let paymentAssetId = match payment.assetId { | |
106 | + | case a: ByteVector => | |
107 | + | toBase64String(a) | |
108 | + | case _: Unit => | |
109 | + | "" | |
110 | + | case _ => | |
111 | + | throw("Match error") | |
112 | + | } | |
113 | + | let paymentAmount = payment.amount | |
114 | + | if ((paymentAssetId != assetId)) | |
115 | + | then throw("Asset Id not matching with Payment Asset Id") | |
116 | + | else if ((totalRequiredAmount > paymentAmount)) | |
117 | + | then throw("Not enough Asset Amount") | |
118 | + | else { | |
119 | + | let tempValue = match getString(this, lotteryPrices) { | |
120 | + | case a: String => | |
121 | + | a | |
122 | + | case _: Unit => | |
123 | + | "" | |
124 | + | case _ => | |
125 | + | throw("Match error") | |
126 | + | } | |
127 | + | let containKey = indexOf(tempValue, token) | |
128 | + | let storedTokensValues = match containKey { | |
129 | + | case _: Unit => | |
130 | + | ((tempValue + token) + ",") | |
131 | + | case x: Int => | |
132 | + | throw("Token is duplicated") | |
133 | + | case _ => | |
134 | + | throw("Match error") | |
135 | + | } | |
136 | + | let countTokens = match getInteger(this, countOfPrices) { | |
137 | + | case a: Int => | |
138 | + | a | |
139 | + | case _: Unit => | |
140 | + | 0 | |
141 | + | case _ => | |
142 | + | throw("Match error") | |
143 | + | } | |
144 | + | if ((allowSizeLottery > countTokens)) | |
145 | + | then { | |
146 | + | 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)]) | |
147 | + | ScriptResult(updateLotteryPool, TransferSet(nil)) | |
148 | + | } | |
149 | + | else throw(("Lottery prices has reached maximum " + toString(allowSizeLottery))) | |
150 | + | } | |
151 | + | } | |
152 | + | else { | |
153 | + | let tnBalance = if (lotteryAssetTN) | |
154 | + | then wavesBalance(this) | |
155 | + | else assetBalance(this, fromBase64String(assetId)) | |
156 | + | if ((totalRequiredAmount > tnBalance)) | |
157 | + | then throw("Not enough Asset Amount") | |
158 | + | else { | |
159 | + | let tempValue = match getString(this, lotteryPrices) { | |
160 | + | case a: String => | |
161 | + | a | |
162 | + | case _: Unit => | |
163 | + | "" | |
164 | + | case _ => | |
165 | + | throw("Match error") | |
166 | + | } | |
167 | + | let containKey = indexOf(tempValue, token) | |
168 | + | let storedTokensValues = match containKey { | |
169 | + | case _: Unit => | |
170 | + | ((tempValue + token) + ",") | |
171 | + | case x: Int => | |
172 | + | throw("Token is duplicated") | |
173 | + | case _ => | |
174 | + | throw("Match error") | |
175 | + | } | |
176 | + | let countTokens = match getInteger(this, countOfPrices) { | |
177 | + | case a: Int => | |
178 | + | a | |
179 | + | case _: Unit => | |
180 | + | 0 | |
181 | + | case _ => | |
182 | + | throw("Match error") | |
183 | + | } | |
184 | + | if ((allowSizeLottery > countTokens)) | |
185 | + | then { | |
186 | + | 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)]) | |
187 | + | ScriptResult(updateLotteryPool, TransferSet(nil)) | |
188 | + | } | |
189 | + | else throw(("Lottery prices has reached maximum " + toString(allowSizeLottery))) | |
190 | + | } | |
191 | + | } | |
192 | + | } | |
193 | + | ||
194 | + | ||
195 | + | ||
196 | + | @Callable(i) | |
197 | + | func startlotto () = { | |
198 | + | let currentKey = toBase58String(i.caller.bytes) | |
199 | + | let randhash = randomizer(i) | |
200 | + | let countTokens = match getInteger(this, countOfPrices) { | |
201 | + | case a: Int => | |
202 | + | a | |
203 | + | case _: Unit => | |
204 | + | 0 | |
205 | + | case _ => | |
206 | + | throw("Match error") | |
207 | + | } | |
208 | + | let priceList = getPriceArray() | |
209 | + | let randNumber = toBase64String(randhash) | |
210 | + | let winningToken = { | |
211 | + | let $list75227569 = priceList | |
212 | + | let $size75227569 = size($list75227569) | |
213 | + | let $acc075227569 = [randNumber] | |
214 | + | if (($size75227569 == 0)) | |
215 | + | then $acc075227569 | |
216 | + | else { | |
217 | + | let $acc175227569 = procedLottery($acc075227569, $list75227569[0]) | |
218 | + | if (($size75227569 == 1)) | |
219 | + | then $acc175227569 | |
220 | + | else { | |
221 | + | let $acc275227569 = procedLottery($acc175227569, $list75227569[1]) | |
222 | + | if (($size75227569 == 2)) | |
223 | + | then $acc275227569 | |
224 | + | else { | |
225 | + | let $acc375227569 = procedLottery($acc275227569, $list75227569[2]) | |
226 | + | if (($size75227569 == 3)) | |
227 | + | then $acc375227569 | |
228 | + | else { | |
229 | + | let $acc475227569 = procedLottery($acc375227569, $list75227569[3]) | |
230 | + | if (($size75227569 == 4)) | |
231 | + | then $acc475227569 | |
232 | + | else { | |
233 | + | let $acc575227569 = procedLottery($acc475227569, $list75227569[4]) | |
234 | + | if (($size75227569 == 5)) | |
235 | + | then $acc575227569 | |
236 | + | else { | |
237 | + | let $acc675227569 = procedLottery($acc575227569, $list75227569[5]) | |
238 | + | throw("List size exceed 5") | |
239 | + | } | |
240 | + | } | |
241 | + | } | |
242 | + | } | |
243 | + | } | |
244 | + | } | |
245 | + | } | |
246 | + | let sizeOfWinPrices = size(winningToken) | |
247 | + | if ((sizeOfWinPrices == 1)) | |
248 | + | then { | |
249 | + | let writeSets = WriteSet(nil) | |
250 | + | ScriptResult(writeSets, TransferSet(nil)) | |
251 | + | } | |
252 | + | else { | |
253 | + | let token = winningToken[0] | |
254 | + | let currentAmount = getIntegerValue(this, (token + lotteryamount)) | |
255 | + | if ((currentAmount == 0)) | |
256 | + | then throw("Amount exceeded") | |
257 | + | else { | |
258 | + | let actualAmount = (currentAmount - 1) | |
259 | + | let tokenPrice = getIntegerValue(this, (token + lotteryPrice)) | |
260 | + | let tokenAssetId = getStringValue(this, (token + lotteryAssetId)) | |
261 | + | if ((actualAmount == 0)) | |
262 | + | then { | |
263 | + | let storedTokensValues = { | |
264 | + | let $list84078457 = priceList | |
265 | + | let $size84078457 = size($list84078457) | |
266 | + | let $acc084078457 = token | |
267 | + | if (($size84078457 == 0)) | |
268 | + | then $acc084078457 | |
269 | + | else { | |
270 | + | let $acc184078457 = generateNewListOfPrices($acc084078457, $list84078457[0]) | |
271 | + | if (($size84078457 == 1)) | |
272 | + | then $acc184078457 | |
273 | + | else { | |
274 | + | let $acc284078457 = generateNewListOfPrices($acc184078457, $list84078457[1]) | |
275 | + | if (($size84078457 == 2)) | |
276 | + | then $acc284078457 | |
277 | + | else { | |
278 | + | let $acc384078457 = generateNewListOfPrices($acc284078457, $list84078457[2]) | |
279 | + | if (($size84078457 == 3)) | |
280 | + | then $acc384078457 | |
281 | + | else { | |
282 | + | let $acc484078457 = generateNewListOfPrices($acc384078457, $list84078457[3]) | |
283 | + | if (($size84078457 == 4)) | |
284 | + | then $acc484078457 | |
285 | + | else { | |
286 | + | let $acc584078457 = generateNewListOfPrices($acc484078457, $list84078457[4]) | |
287 | + | if (($size84078457 == 5)) | |
288 | + | then $acc584078457 | |
289 | + | else { | |
290 | + | let $acc684078457 = generateNewListOfPrices($acc584078457, $list84078457[5]) | |
291 | + | throw("List size exceed 5") | |
292 | + | } | |
293 | + | } | |
294 | + | } | |
295 | + | } | |
296 | + | } | |
297 | + | } | |
298 | + | } | |
299 | + | let writeSets = WriteSet([DataEntry(("winning_token_" + token), token), DataEntry((currentKey + "_wininning_address_"), currentKey), DataEntry(countOfPrices, (countTokens - 1)), DataEntry(lotteryPrices, storedTokensValues), DataEntry(lastHashRandomNumber, randNumber)]) | |
300 | + | if ((tokenAssetId == "")) | |
301 | + | then { | |
302 | + | let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, unit)]) | |
303 | + | ScriptResult(writeSets, winTransfer) | |
304 | + | } | |
305 | + | else { | |
306 | + | let actualAssetId = fromBase64String(tokenAssetId) | |
307 | + | let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, actualAssetId)]) | |
308 | + | ScriptResult(writeSets, winTransfer) | |
309 | + | } | |
310 | + | } | |
311 | + | else { | |
312 | + | let writeSets = WriteSet([DataEntry((currentKey + "_winning_token_"), token), DataEntry((currentKey + "_wininning_address_"), currentKey), DataEntry((token + lotteryamount), actualAmount), DataEntry(lastHashRandomNumber, randNumber)]) | |
313 | + | if ((tokenAssetId == "")) | |
314 | + | then { | |
315 | + | let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, unit)]) | |
316 | + | ScriptResult(writeSets, winTransfer) | |
317 | + | } | |
318 | + | else { | |
319 | + | let actualAssetId = fromBase64String(tokenAssetId) | |
320 | + | let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, actualAssetId)]) | |
321 | + | ScriptResult(writeSets, winTransfer) | |
322 | + | } | |
323 | + | } | |
324 | + | } | |
325 | + | } | |
326 | + | } | |
327 | + | ||
328 | + | ||
329 | + | @Verifier(tx) | |
330 | + | func verify () = match tx { | |
331 | + | case _: DataTransaction => | |
332 | + | true | |
333 | + | case _: SetScriptTransaction => | |
334 | + | true | |
335 | + | case _ => | |
336 | + | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
337 | + | } | |
338 | + |
github/deemru/w8io/169f3d6 32.00 ms ◑