tx · 6q8rzNCd5znAKxmAP6uwyWzoX5KFzfQuUjdd4eTJm61j 3N17A1zqJZ1R2dZtMvyChQwSzepRZ1d98t9: -0.01400000 Waves 2019.11.25 18:31 [780984] smart account 3N17A1zqJZ1R2dZtMvyChQwSzepRZ1d98t9 > SELF 0.00000000 Waves
{ "type": 13, "id": "6q8rzNCd5znAKxmAP6uwyWzoX5KFzfQuUjdd4eTJm61j", "fee": 1400000, "feeAssetId": null, "timestamp": 1574695890498, "version": 1, "sender": "3N17A1zqJZ1R2dZtMvyChQwSzepRZ1d98t9", "senderPublicKey": "AXt3aNDevk6MRY2RVvB3HzC5FgWDoMFZ4EuW9kHN9VpW", "proofs": [ "2di7UKf1CAw7gx8H9SoXMERKTkbogFHDXHPVAQU6WaQP9YfmMYKfCBEcfWwTyCrYAqUgzSCxpHXv1mJHBFjtqmid" ], "script": "base64:AAIDAAAAAAAAAAkIARIFCgMICAgAAAAFAQAAAAZwYXlyZWYAAAAEAAAAAmxkAAAABHVzZXIAAAAFcmVmZXIAAAAGcmVmc3VtBAAAAANsZGUIBQAAAAJsZAAAAARkYXRhBAAAAAdpc3JlZmVyBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMJAAEsAAAAAgUAAAAEdXNlcgIAAAAEX3JlZgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAADCQAAAAAAAAIFAAAAB2lzcmVmZXICAAAAAAQAAAAHbGFzdGJhbAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzCQABLAAAAAIFAAAABXJlZmVyAgAAAAdfd2FsbGV0AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAEAAAACmxhc3RyZWZiYWwEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwkAASwAAAACBQAAAAVyZWZlcgI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QAAAADBQAAAARkc2wyBQAAABBjdXJyZW50a2V5dGlja2V0BQAAAAZ0aWNrZXQEAAAABGRzbDQJAQAAAA5jaGVja25leHRyb3VuZAAAAAMFAAAABGRzbDMFAAAADm5ld1RpY2tldGNvdW50BQAAAAtudW1iZXJyb3VuZAQAAAAKcmVmcGF5bWVudAkAAGgAAAACCQAAaAAAAAIFAAAACXBheXRpY2tldAAAAAAAAAAACgUAAAABeAQAAAAEZHNsNQkBAAAABnBheXJlZgAAAAQFAAAABGRzbDQFAAAABHVzZXIFAAAABXJlZmVyBQAAAApyZWZwYXltZW50BQAAAARkc2w1AAAAAFWLb6I=", "chainId": 84, "height": 780984, "spentComplexity": 0 } View: original | compacted Prev: 2sY3FLvxuNiWDd8Zjsc7z8sin4Z7hJ27XaSH95BitTXh Next: AGArpRAYWjvpgtCpEyy9hYvupnhUQUvBrKx6PF4zD9iX Diff:
Old | New | Differences | |
---|---|---|---|
102 | 102 | let payval = value(pmt.amount) | |
103 | 103 | let x = parseIntValue(betx) | |
104 | 104 | let payticket = ((payval * x) / 100000000) | |
105 | - | if ((1 > payticket)) | |
105 | + | let ticketsum = (1 * x) | |
106 | + | if ((ticketsum > payticket)) | |
106 | 107 | then throw("Ticket price is 1 WAVES") | |
107 | 108 | else { | |
108 | 109 | let lastfondprize = match getInteger(this, "fondprize") { |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func payref (ld,user,refer,refsum) = { | |
5 | 5 | let lde = ld.data | |
6 | 6 | let isrefer = match getString(this, (user + "_ref")) { | |
7 | 7 | case a: String => | |
8 | 8 | a | |
9 | 9 | case _ => | |
10 | 10 | "" | |
11 | 11 | } | |
12 | 12 | if ((isrefer == "")) | |
13 | 13 | then { | |
14 | 14 | let lastbal = match getInteger(this, (refer + "_wallet")) { | |
15 | 15 | case a: Int => | |
16 | 16 | a | |
17 | 17 | case _ => | |
18 | 18 | 0 | |
19 | 19 | } | |
20 | 20 | let lastrefbal = match getInteger(this, (refer + "_refpay")) { | |
21 | 21 | case a: Int => | |
22 | 22 | a | |
23 | 23 | case _ => | |
24 | 24 | 0 | |
25 | 25 | } | |
26 | 26 | let dsl = DataEntry((refer + "_wallet"), (lastbal + refsum)) :: lde | |
27 | 27 | let dslref = DataEntry((refer + "_refpay"), (lastrefbal + refsum)) :: dsl | |
28 | 28 | let dsl1 = WriteSet(dslref) | |
29 | 29 | dsl1 | |
30 | 30 | } | |
31 | 31 | else { | |
32 | 32 | let lastbal1 = match getInteger(this, (isrefer + "_wallet")) { | |
33 | 33 | case a: Int => | |
34 | 34 | a | |
35 | 35 | case _ => | |
36 | 36 | 0 | |
37 | 37 | } | |
38 | 38 | let lastrefbal1 = match getInteger(this, (isrefer + "_refpay")) { | |
39 | 39 | case a: Int => | |
40 | 40 | a | |
41 | 41 | case _ => | |
42 | 42 | 0 | |
43 | 43 | } | |
44 | 44 | let dsl2 = DataEntry((isrefer + "_wallet"), (lastbal1 + refsum)) :: lde | |
45 | 45 | let dslref1 = DataEntry((isrefer + "_refpay"), (lastrefbal1 + refsum)) :: dsl2 | |
46 | 46 | let dsl3 = WriteSet(dslref1) | |
47 | 47 | dsl3 | |
48 | 48 | } | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func setref (ld,user,refer) = { | |
53 | 53 | let lde = ld.data | |
54 | 54 | let isrefer = match getString(this, (user + "_ref")) { | |
55 | 55 | case a: String => | |
56 | 56 | a | |
57 | 57 | case _ => | |
58 | 58 | "" | |
59 | 59 | } | |
60 | 60 | if ((isrefer == "")) | |
61 | 61 | then { | |
62 | 62 | let dsl = DataEntry((user + "_ref"), refer) :: lde | |
63 | 63 | let dslref = DataEntry((refer + "_refer"), user) :: dsl | |
64 | 64 | let dsl1 = WriteSet(dslref) | |
65 | 65 | dsl1 | |
66 | 66 | } | |
67 | 67 | else ld | |
68 | 68 | } | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func nextcountticket (ld,newcount) = { | |
72 | 72 | let lde = ld.data | |
73 | 73 | let newcounttik = DataEntry("ticketcount", newcount) :: lde | |
74 | 74 | let nws = WriteSet(newcounttik) | |
75 | 75 | nws | |
76 | 76 | } | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func dataticket (ld,ticketkey,ticketdata) = { | |
80 | 80 | let lde = ld.data | |
81 | 81 | let newtikdata = DataEntry(ticketkey, ticketdata) :: lde | |
82 | 82 | let nws = WriteSet(newtikdata) | |
83 | 83 | nws | |
84 | 84 | } | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func checknextround (ld,ticketcount,numofround) = { | |
88 | 88 | let lde = ld.data | |
89 | 89 | if ((ticketcount == 100)) | |
90 | 90 | then { | |
91 | 91 | let newtikdata = DataEntry("numberofround", (numofround + 1)) :: lde | |
92 | 92 | let nws = WriteSet(newtikdata) | |
93 | 93 | nws | |
94 | 94 | } | |
95 | 95 | else ld | |
96 | 96 | } | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | @Callable(inv) | |
100 | 100 | func playbingo (ticket,betx,refer) = { | |
101 | 101 | let pmt = extract(inv.payment) | |
102 | 102 | let payval = value(pmt.amount) | |
103 | 103 | let x = parseIntValue(betx) | |
104 | 104 | let payticket = ((payval * x) / 100000000) | |
105 | - | if ((1 > payticket)) | |
105 | + | let ticketsum = (1 * x) | |
106 | + | if ((ticketsum > payticket)) | |
106 | 107 | then throw("Ticket price is 1 WAVES") | |
107 | 108 | else { | |
108 | 109 | let lastfondprize = match getInteger(this, "fondprize") { | |
109 | 110 | case a: Int => | |
110 | 111 | a | |
111 | 112 | case _ => | |
112 | 113 | 0 | |
113 | 114 | } | |
114 | 115 | let newfondprize = DataEntry("fondprize", (lastfondprize + (payticket / 2))) | |
115 | 116 | let dsl = WriteSet([newfondprize]) | |
116 | 117 | let numberround = match getInteger(this, "numberofround") { | |
117 | 118 | case a: Int => | |
118 | 119 | a | |
119 | 120 | case _ => | |
120 | 121 | 1 | |
121 | 122 | } | |
122 | 123 | let user = toString(inv.caller) | |
123 | 124 | let dsl1 = setref(dsl, user, refer) | |
124 | 125 | let currentTicketcount = match getInteger(this, "ticketcount") { | |
125 | 126 | case a: Int => | |
126 | 127 | a | |
127 | 128 | case _ => | |
128 | 129 | 0 | |
129 | 130 | } | |
130 | 131 | let newTicketcount = (currentTicketcount + 1) | |
131 | 132 | let dsl2 = nextcountticket(dsl1, newTicketcount) | |
132 | 133 | let currentkeyticket = ((((("ticket_" + toString(numberround)) + "_") + toString(newTicketcount)) + "_") + user) | |
133 | 134 | let dsl3 = dataticket(dsl2, currentkeyticket, ticket) | |
134 | 135 | let dsl4 = checknextround(dsl3, newTicketcount, numberround) | |
135 | 136 | let refpayment = ((payticket * 10) * x) | |
136 | 137 | let dsl5 = payref(dsl4, user, refer, refpayment) | |
137 | 138 | dsl5 | |
138 | 139 | } | |
139 | 140 | } | |
140 | 141 | ||
141 | 142 |
github/deemru/w8io/026f985 38.58 ms ◑