tx · 297jcJw6PCXqJF4M7MmdgTi4Sr4feagrCxe6QUreoXT3 3N17A1zqJZ1R2dZtMvyChQwSzepRZ1d98t9: -0.01400000 Waves 2019.11.25 16:55 [780879] smart account 3N17A1zqJZ1R2dZtMvyChQwSzepRZ1d98t9 > SELF 0.00000000 Waves
{ "type": 13, "id": "297jcJw6PCXqJF4M7MmdgTi4Sr4feagrCxe6QUreoXT3", "fee": 1400000, "feeAssetId": null, "timestamp": 1574690142138, "version": 1, "sender": "3N17A1zqJZ1R2dZtMvyChQwSzepRZ1d98t9", "senderPublicKey": "AXt3aNDevk6MRY2RVvB3HzC5FgWDoMFZ4EuW9kHN9VpW", "proofs": [ "2rvkjUUEbsfSTTwuLWttFN2cAnSvpQQyYg92QvMkkvfcc6BxL4DieE4NQiGKmXEWsKttN2A3qRPCuzTt9BTarWVg" ], "script": "base64:AAIDAAAAAAAAAAkIARIFCgMICAgAAAAEAQAAAAZzZXRyZWYAAAADAAAAAmxkAAAABHVzZXIAAAAFcmVmZXIEAAAAA2xkZQgFAAAAAmxkAAAABGRhdGEEAAAAB2lzcmVmZXIEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwkAASwAAAACBQAAAAR1c2VyAgAAAARfcmVmAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWECAAAAAAMJAAAAAAAAAgUAAAAHaXNyZWZlcgIAAAAABAAAAANkc2wJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgUAAAAEdXNlcgIAAAAEX3JlZgUAAAAFcmVmZXIFAAAAA2xkZQQAAAAEZHNsMQkBAAAACFdyaXRlU2V0AAAAAQUAAAADZHNsBQAAAARkc2wxBQAAAAJsZAEAAAAPbmV4dGNvdW50dGlja2V0AAAAAgAAAAJsZAAAAAhuZXdjb3VudAQAAAADbGRlCAUAAAACbGQAAAAEZGF0YQQAAAALbmV3Y291bnR0aWsJAARM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QABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAAB3RpY2tldF8JAAGkAAAAAQUAAAALbnVtYmVycm91bmQCAAAAAV8JAAGkAAAAAQUAAAAObmV3VGlja2V0Y291bnQCAAAAAV8FAAAABHVzZXIEAAAABGRzbDMJAQAAAApkYXRhdGlja2V0AAAAAwUAAAAEZHNsMgUAAAAQY3VycmVudGtleXRpY2tldAUAAAAGdGlja2V0BAAAAARkc2w0CQEAAAAOY2hlY2tuZXh0cm91bmQAAAADBQAAAARkc2wzBQAAAA5uZXdUaWNrZXRjb3VudAUAAAALbnVtYmVycm91bmQFAAAABGRzbDQAAAAAlep9ZQ==", "chainId": 84, "height": 780879, "spentComplexity": 0 } View: original | compacted Prev: 8JNG5aMybu5EbN6wHHUTFwLFcwnRNKzNqPyEYPs7DtsJ Next: GYaYkb8qsVNkuWjZzz23Z9ZzJ5EUGKLaHLntrHbaTFo5 Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | ||
5 | - | ||
6 | - | @Callable(inv) | |
7 | - | func playbingo (ticket,refer) = { | |
8 | - | let numberround = match getInteger(this, "numberofround") { | |
9 | - | case a: Int => | |
10 | - | a | |
11 | - | case _ => | |
12 | - | 1 | |
13 | - | } | |
14 | - | let user = toString(inv.caller) | |
4 | + | func setref (ld,user,refer) = { | |
5 | + | let lde = ld.data | |
15 | 6 | let isrefer = match getString(this, (user + "_ref")) { | |
16 | 7 | case a: String => | |
17 | 8 | a | |
18 | 9 | case _ => | |
19 | 10 | "" | |
20 | 11 | } | |
21 | - | let setrefer = if ((isrefer == "")) | |
22 | - | then DataEntry((user + "_ref"), refer) | |
23 | - | else DataEntry((user + "_ref"), isrefer) | |
24 | - | let currentTicketcount = match getInteger(this, "ticketcount") { | |
25 | - | case a: Int => | |
26 | - | a | |
27 | - | case _ => | |
28 | - | 0 | |
12 | + | if ((isrefer == "")) | |
13 | + | then { | |
14 | + | let dsl = DataEntry((user + "_ref"), refer) :: lde | |
15 | + | let dsl1 = WriteSet(dsl) | |
16 | + | dsl1 | |
17 | + | } | |
18 | + | else ld | |
29 | 19 | } | |
30 | - | let newTicketcount = (currentTicketcount + 1) | |
31 | - | let currentkeyticket = ((((("ticket_" + toString(numberround)) + "_") + toString(newTicketcount)) + "_") + user) | |
32 | - | let nextround = if ((newTicketcount == 25)) | |
33 | - | then DataEntry("numberofround", (numberround + 1)) | |
34 | - | else DataEntry("numberofround", numberround) | |
35 | - | if ((numberround == 1)) | |
36 | - | then WriteSet([DataEntry("numberofround", numberround), DataEntry(currentkeyticket, ticket), DataEntry("ticketcount", newTicketcount), setrefer, nextround]) | |
37 | - | else WriteSet([DataEntry(currentkeyticket, ticket), DataEntry("ticketcount", newTicketcount), setrefer, nextround]) | |
20 | + | ||
21 | + | ||
22 | + | func nextcountticket (ld,newcount) = { | |
23 | + | let lde = ld.data | |
24 | + | let newcounttik = DataEntry("ticketcount", newcount) :: lde | |
25 | + | let nws = WriteSet(newcounttik) | |
26 | + | nws | |
27 | + | } | |
28 | + | ||
29 | + | ||
30 | + | func dataticket (ld,ticketkey,ticketdata) = { | |
31 | + | let lde = ld.data | |
32 | + | let newtikdata = DataEntry(ticketkey, ticketdata) :: lde | |
33 | + | let nws = WriteSet(newtikdata) | |
34 | + | nws | |
35 | + | } | |
36 | + | ||
37 | + | ||
38 | + | func checknextround (ld,ticketcount,numofround) = { | |
39 | + | let lde = ld.data | |
40 | + | if ((ticketcount == 100)) | |
41 | + | then { | |
42 | + | let newtikdata = DataEntry("numberofround", (numofround + 1)) :: lde | |
43 | + | let nws = WriteSet(newtikdata) | |
44 | + | nws | |
45 | + | } | |
46 | + | else ld | |
47 | + | } | |
48 | + | ||
49 | + | ||
50 | + | @Callable(inv) | |
51 | + | func playbingo (ticket,betx,refer) = { | |
52 | + | let pmt = extract(inv.payment) | |
53 | + | let payval = pmt.amount | |
54 | + | let x = parseIntValue(betx) | |
55 | + | let payticket = (payval * x) | |
56 | + | if ((1 > payticket)) | |
57 | + | then throw("Ticket price is 1 WAVES") | |
58 | + | else { | |
59 | + | let lastfondprize = match getInteger(this, "fondprize") { | |
60 | + | case a: Int => | |
61 | + | a | |
62 | + | case _ => | |
63 | + | 0 | |
64 | + | } | |
65 | + | let newfondprize = DataEntry("fondprize", (lastfondprize + (payticket / 2))) | |
66 | + | let dsl = WriteSet([newfondprize]) | |
67 | + | let numberround = match getInteger(this, "numberofround") { | |
68 | + | case a: Int => | |
69 | + | a | |
70 | + | case _ => | |
71 | + | 1 | |
72 | + | } | |
73 | + | let user = toString(inv.caller) | |
74 | + | let dsl1 = setref(dsl, user, refer) | |
75 | + | let currentTicketcount = match getInteger(this, "ticketcount") { | |
76 | + | case a: Int => | |
77 | + | a | |
78 | + | case _ => | |
79 | + | 0 | |
80 | + | } | |
81 | + | let newTicketcount = (currentTicketcount + 1) | |
82 | + | let dsl2 = nextcountticket(dsl1, newTicketcount) | |
83 | + | let currentkeyticket = ((((("ticket_" + toString(numberround)) + "_") + toString(newTicketcount)) + "_") + user) | |
84 | + | let dsl3 = dataticket(dsl2, currentkeyticket, ticket) | |
85 | + | let dsl4 = checknextround(dsl3, newTicketcount, numberround) | |
86 | + | dsl4 | |
87 | + | } | |
38 | 88 | } | |
39 | 89 | ||
40 | 90 |
github/deemru/w8io/169f3d6 37.39 ms ◑