tx · 3dpHz2e5WhLoc34zZXPDTo9fdJjKkBE94DDRygz5uWyH

3Mp4kiDoPrq4J8MkG3cDqV54Tw46oY1QTcF:  -0.01500000 Waves

2021.02.10 15:00 [1392061] smart account 3Mp4kiDoPrq4J8MkG3cDqV54Tw46oY1QTcF > SELF 0.00000000 Waves

{ "type": 13, "id": "3dpHz2e5WhLoc34zZXPDTo9fdJjKkBE94DDRygz5uWyH", "fee": 1500000, "feeAssetId": null, "timestamp": 1612958441474, "version": 2, "chainId": 84, "sender": "3Mp4kiDoPrq4J8MkG3cDqV54Tw46oY1QTcF", "senderPublicKey": "59p9taLzgNbtYpct8fYbKq51HMn41Lkk9fdMupbJ1L7D", "proofs": [ "3oqp3Em9QrTxEocTpuRMMqJTVg5sdtVeick6V4H7twgEzSJn8Kd2vTRXLrkXGtcdbyjDkTCoMaTFguo7zejrwMdJ" ], "script": "base64:AAIDAAAAAAAAAA0IARIHCgUBAQEBCBIAAAAAEgAAAAAKZEFwcEFkZHJlcwIAAAArRjlEQ0dpWWdUOHl2QnExQVFGY1NwR0c0cDhzZHpOejltWmN6RHZKNDVMTAAAAAALdGlja2V0QXNzZXQBAAAAIEYc9ZUgYtXiRrToDJgiMgFmnQRu3R1NoyARqb9irygsAAAAAA10b2tlbnNQZXJQbGF5AAAAAAAF9eEAAAAAAA1sb3R0ZXJ5YW1vdW50AgAAAAdfYW1vdW50AAAAABJsb3R0ZXJ5cHJvYmFiaWxpdHkCAAAADF9wcm9iYWJpbGl0eQAAAAAZbG90dGVyeXByb2JhYmlsaXR5ZGVjaW1hbAIAAAAUX3Byb2JhYmlsaXR5X2RlY2ltYWwAAAAADGxvdHRlcnlQcmljZQIAAAAGX3ByaWNlAAAAAA1sb3R0ZXJ5UHJpY2VzAgAAAA9fbG90dGVyeV9wcmljZXMAAAAADmxvdHRlcnlBc3NldElkAgAAABFfbG90dGVyeV9hc3NldF9pZAAAAAANY291bnRPZlByaWNlcwIAAAANX2NvdW50X3ByaWNlcwAAAAA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dHgJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5doqfmw==", "height": 1392061, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
OldNewDifferences
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 paymentIsDefined = if (!(isDefined(i.payment)))
218+ then false
219+ else true
220+ if ((paymentIsDefined == true))
221+ then {
222+ let pmt = extract(i.payment)
223+ if (if ((pmt.assetId != ticketAsset))
224+ then true
225+ else (pmt.amount != tokensPerPlay))
226+ then throw("Incorrect asset passed or incorrect quantity passed")
227+ else {
228+ let currentKey = toBase58String(i.caller.bytes)
229+ let randhash = randomizer(i)
230+ let countTokens = match getInteger(this, countOfPrices) {
231+ case a: Int =>
232+ a
233+ case _: Unit =>
234+ 0
235+ case _ =>
236+ throw("Match error")
237+ }
238+ let priceList = getPriceArray()
239+ let randNumber = toBase64String(randhash)
240+ let winningToken = {
241+ let $list84428489 = priceList
242+ let $size84428489 = size($list84428489)
243+ let $acc084428489 = [randNumber]
244+ if (($size84428489 == 0))
245+ then $acc084428489
246+ else {
247+ let $acc184428489 = procedLottery($acc084428489, $list84428489[0])
248+ if (($size84428489 == 1))
249+ then $acc184428489
250+ else {
251+ let $acc284428489 = procedLottery($acc184428489, $list84428489[1])
252+ if (($size84428489 == 2))
253+ then $acc284428489
254+ else {
255+ let $acc384428489 = procedLottery($acc284428489, $list84428489[2])
256+ if (($size84428489 == 3))
257+ then $acc384428489
258+ else {
259+ let $acc484428489 = procedLottery($acc384428489, $list84428489[3])
260+ if (($size84428489 == 4))
261+ then $acc484428489
262+ else {
263+ let $acc584428489 = procedLottery($acc484428489, $list84428489[4])
264+ if (($size84428489 == 5))
265+ then $acc584428489
266+ else {
267+ let $acc684428489 = procedLottery($acc584428489, $list84428489[5])
268+ throw("List size exceed 5")
269+ }
270+ }
271+ }
272+ }
273+ }
274+ }
275+ }
276+ let sizeOfWinPrices = size(winningToken)
277+ if ((sizeOfWinPrices == 1))
278+ then {
279+ let writeSets = WriteSet([DataEntry("message", "Better luck next time!")])
280+ ScriptResult(writeSets, TransferSet(nil))
281+ }
282+ else {
283+ let token = winningToken[0]
284+ let currentAmount = getIntegerValue(this, (token + lotteryamount))
285+ if ((currentAmount == 0))
286+ then throw("Amount exceeded")
287+ else {
288+ let actualAmount = (currentAmount - 1)
289+ let tokenPrice = getIntegerValue(this, (token + lotteryPrice))
290+ let tokenAssetId = getStringValue(this, (token + lotteryAssetId))
291+ if ((actualAmount == 0))
292+ then {
293+ let storedTokensValues = {
294+ let $list95949644 = priceList
295+ let $size95949644 = size($list95949644)
296+ let $acc095949644 = token
297+ if (($size95949644 == 0))
298+ then $acc095949644
299+ else {
300+ let $acc195949644 = generateNewListOfPrices($acc095949644, $list95949644[0])
301+ if (($size95949644 == 1))
302+ then $acc195949644
303+ else {
304+ let $acc295949644 = generateNewListOfPrices($acc195949644, $list95949644[1])
305+ if (($size95949644 == 2))
306+ then $acc295949644
307+ else {
308+ let $acc395949644 = generateNewListOfPrices($acc295949644, $list95949644[2])
309+ if (($size95949644 == 3))
310+ then $acc395949644
311+ else {
312+ let $acc495949644 = generateNewListOfPrices($acc395949644, $list95949644[3])
313+ if (($size95949644 == 4))
314+ then $acc495949644
315+ else {
316+ let $acc595949644 = generateNewListOfPrices($acc495949644, $list95949644[4])
317+ if (($size95949644 == 5))
318+ then $acc595949644
319+ else {
320+ let $acc695949644 = generateNewListOfPrices($acc595949644, $list95949644[5])
321+ throw("List size exceed 5")
322+ }
323+ }
324+ }
325+ }
326+ }
327+ }
328+ }
329+ let tokenSize = ((size(storedTokensValues) - size(token)) - 1)
330+ let updatedPrices = takeRight(storedTokensValues, tokenSize)
331+ 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!")])
332+ if ((tokenAssetId == ""))
333+ then {
334+ let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, unit)])
335+ ScriptResult(writeSets, winTransfer)
336+ }
337+ else {
338+ let actualAssetId = fromBase58String(tokenAssetId)
339+ let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, actualAssetId)])
340+ ScriptResult(writeSets, winTransfer)
341+ }
342+ }
343+ else {
344+ let storedTokensValues = {
345+ let $list1128611336 = priceList
346+ let $size1128611336 = size($list1128611336)
347+ let $acc01128611336 = token
348+ if (($size1128611336 == 0))
349+ then $acc01128611336
350+ else {
351+ let $acc11128611336 = generateNewListOfPrices($acc01128611336, $list1128611336[0])
352+ if (($size1128611336 == 1))
353+ then $acc11128611336
354+ else {
355+ let $acc21128611336 = generateNewListOfPrices($acc11128611336, $list1128611336[1])
356+ if (($size1128611336 == 2))
357+ then $acc21128611336
358+ else {
359+ let $acc31128611336 = generateNewListOfPrices($acc21128611336, $list1128611336[2])
360+ if (($size1128611336 == 3))
361+ then $acc31128611336
362+ else {
363+ let $acc41128611336 = generateNewListOfPrices($acc31128611336, $list1128611336[3])
364+ if (($size1128611336 == 4))
365+ then $acc41128611336
366+ else {
367+ let $acc51128611336 = generateNewListOfPrices($acc41128611336, $list1128611336[4])
368+ if (($size1128611336 == 5))
369+ then $acc51128611336
370+ else {
371+ let $acc61128611336 = generateNewListOfPrices($acc51128611336, $list1128611336[5])
372+ throw("List size exceed 5")
373+ }
374+ }
375+ }
376+ }
377+ }
378+ }
379+ }
380+ let tokenSize = ((size(storedTokensValues) - size(token)) - 1)
381+ let updatedPrices = takeRight(storedTokensValues, tokenSize)
382+ 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!")])
383+ if ((tokenAssetId == ""))
384+ then {
385+ let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, unit)])
386+ ScriptResult(writeSets, winTransfer)
387+ }
388+ else {
389+ let actualAssetId = fromBase58String(tokenAssetId)
390+ let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, actualAssetId)])
391+ ScriptResult(writeSets, winTransfer)
392+ }
393+ }
394+ }
395+ }
396+ }
397+ }
398+ else throw((("You need " + toBase58String(ticketAsset)) + " to play this game."))
399+ }
400+
401+
402+@Verifier(tx)
403+func verify () = match tx {
404+ case _ =>
405+ sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
406+}
407+

github/deemru/w8io/026f985 
40.08 ms