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