tx · AGArpRAYWjvpgtCpEyy9hYvupnhUQUvBrKx6PF4zD9iX 3N17A1zqJZ1R2dZtMvyChQwSzepRZ1d98t9: -0.01400000 Waves 2019.11.25 18:33 [780987] smart account 3N17A1zqJZ1R2dZtMvyChQwSzepRZ1d98t9 > SELF 0.00000000 Waves
{ "type": 13, "id": "AGArpRAYWjvpgtCpEyy9hYvupnhUQUvBrKx6PF4zD9iX", "fee": 1400000, "feeAssetId": null, "timestamp": 1574696146704, "version": 1, "sender": "3N17A1zqJZ1R2dZtMvyChQwSzepRZ1d98t9", "senderPublicKey": "AXt3aNDevk6MRY2RVvB3HzC5FgWDoMFZ4EuW9kHN9VpW", "proofs": [ "3Sfths84CdcaENv27uDJpsmBT2iHxvJ6sqVnSJAz39y2ojLsVQMLTfAw3Q7takg4kUterqskw6ADSwuhrUS6d8hq" ], "script": "base64:AAIDAAAAAAAAAAkIARIFCgMICAgAAAAFAQAAAAZwYXlyZWYAAAAEAAAAAmxkAAAABHVzZXIAAAAFcmVmZXIAAAAGcmVmc3VtBAAAAANsZGUIBQAAAAJsZAAAAARkYXRhBAAAAAdpc3JlZmVyBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMJAAEsAAAAAgUAAAAEdXNlcgIAAAAEX3JlZgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAADCQAAAAAAAAIFAAAAB2lzcmVmZXICAAAAAAQAAAAHbGFzdGJhbAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzCQABLAAAAAIFAAAABXJlZmVyAgAAAAdfd2FsbGV0AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAEAAAACmxhc3RyZWZiYWwEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwkAASwAAAACBQAAAAVyZWZlcgIAAAAH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EZHNsNAkBAAAADmNoZWNrbmV4dHJvdW5kAAAAAwUAAAAEZHNsMwUAAAAObmV3VGlja2V0Y291bnQFAAAAC251bWJlcnJvdW5kBAAAAApyZWZwYXltZW50CQAAaAAAAAIJAABoAAAAAgUAAAAJcGF5dGlja2V0AAAAAAAAAAAKBQAAAAF4BAAAAARkc2w1CQEAAAAGcGF5cmVmAAAABAUAAAAEZHNsNAUAAAAEdXNlcgUAAAAFcmVmZXIFAAAACnJlZnBheW1lbnQFAAAABGRzbDUAAAAAIARwdg==", "chainId": 84, "height": 780987, "spentComplexity": 0 } View: original | compacted Prev: 6q8rzNCd5znAKxmAP6uwyWzoX5KFzfQuUjdd4eTJm61j Next: AoUKh4WyLa31VuvEbFYdd8VhD1yjTdMBAEzq72eUWNcc 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 | - | let ticketsum = (1 * x) | |
106 | - | if ((ticketsum > payticket)) | |
105 | + | if ((payticket > payval)) | |
107 | 106 | then throw("Ticket price is 1 WAVES") | |
108 | 107 | else { | |
109 | 108 | 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 | - | let ticketsum = (1 * x) | |
106 | - | if ((ticketsum > payticket)) | |
105 | + | if ((payticket > payval)) | |
107 | 106 | then throw("Ticket price is 1 WAVES") | |
108 | 107 | else { | |
109 | 108 | let lastfondprize = match getInteger(this, "fondprize") { | |
110 | 109 | case a: Int => | |
111 | 110 | a | |
112 | 111 | case _ => | |
113 | 112 | 0 | |
114 | 113 | } | |
115 | 114 | let newfondprize = DataEntry("fondprize", (lastfondprize + (payticket / 2))) | |
116 | 115 | let dsl = WriteSet([newfondprize]) | |
117 | 116 | let numberround = match getInteger(this, "numberofround") { | |
118 | 117 | case a: Int => | |
119 | 118 | a | |
120 | 119 | case _ => | |
121 | 120 | 1 | |
122 | 121 | } | |
123 | 122 | let user = toString(inv.caller) | |
124 | 123 | let dsl1 = setref(dsl, user, refer) | |
125 | 124 | let currentTicketcount = match getInteger(this, "ticketcount") { | |
126 | 125 | case a: Int => | |
127 | 126 | a | |
128 | 127 | case _ => | |
129 | 128 | 0 | |
130 | 129 | } | |
131 | 130 | let newTicketcount = (currentTicketcount + 1) | |
132 | 131 | let dsl2 = nextcountticket(dsl1, newTicketcount) | |
133 | 132 | let currentkeyticket = ((((("ticket_" + toString(numberround)) + "_") + toString(newTicketcount)) + "_") + user) | |
134 | 133 | let dsl3 = dataticket(dsl2, currentkeyticket, ticket) | |
135 | 134 | let dsl4 = checknextround(dsl3, newTicketcount, numberround) | |
136 | 135 | let refpayment = ((payticket * 10) * x) | |
137 | 136 | let dsl5 = payref(dsl4, user, refer, refpayment) | |
138 | 137 | dsl5 | |
139 | 138 | } | |
140 | 139 | } | |
141 | 140 | ||
142 | 141 |
github/deemru/w8io/169f3d6 47.69 ms ◑