tx · 8esqGdozpuPopFTCHVB5ffSe2jJQXrHJyP1RhgXjqwqS 3N17A1zqJZ1R2dZtMvyChQwSzepRZ1d98t9: -0.01400000 Waves 2019.11.25 18:58 [781010] smart account 3N17A1zqJZ1R2dZtMvyChQwSzepRZ1d98t9 > SELF 0.00000000 Waves
{ "type": 13, "id": "8esqGdozpuPopFTCHVB5ffSe2jJQXrHJyP1RhgXjqwqS", "fee": 1400000, "feeAssetId": null, "timestamp": 1574697457690, "version": 1, "sender": "3N17A1zqJZ1R2dZtMvyChQwSzepRZ1d98t9", "senderPublicKey": "AXt3aNDevk6MRY2RVvB3HzC5FgWDoMFZ4EuW9kHN9VpW", "proofs": [ "CbuzibUZ5R919nFbmq7eH9U7yTb5YT1CzSdR4hk6xRiriGTt7oS9W1G8M3ctxZcUkYBKkSECRXhRdPc43YLrLhH" ], "script": "base64:AAIDAAAAAAAAAAkIARIFCgMICAgAAAAFAQAAAAZwYXlyZWYAAAAEAAAAAmxkAAAABHVzZXIAAAAFcmVmZXIAAAAGcmVmc3VtBAAAAANsZGUIBQAAAAJsZAAAAARkYXRhBAAAAAdpc3JlZmVyBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMJAAEsAAAAAgIAAAAEcmVmXwUAAAAEdXNlcgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAADCQAAAAAAAAIFAAAAB2lzcmVmZXICAAAAAAQAAAAHbGFzdGJhbAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzCQABLAAAAAICAAAAB3dhbGxldF8FAAAABXJlZmVyAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAEAAAACmxhc3RyZWZiYWwEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwkAASwAAAACAgAAAAdyZWZwYXlfBQAAA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ldAQAAAAEZHNsNAkBAAAADmNoZWNrbmV4dHJvdW5kAAAAAwUAAAAEZHNsMwUAAAAObmV3VGlja2V0Y291bnQFAAAAC251bWJlcnJvdW5kBAAAAApyZWZwYXltZW50CQAAaAAAAAIJAABoAAAAAgUAAAAJcGF5dGlja2V0AAAAAAAAAAAKBQAAAAF4BAAAAARkc2w1CQEAAAAGcGF5cmVmAAAABAUAAAAEZHNsNAUAAAAEdXNlcgUAAAAFcmVmZXIFAAAACnJlZnBheW1lbnQFAAAABGRzbDUAAAAAh07jlA==", "chainId": 84, "height": 781010, "spentComplexity": 0 } View: original | compacted Prev: AoUKh4WyLa31VuvEbFYdd8VhD1yjTdMBAEzq72eUWNcc Next: FpjCia3TtTmjJ15jTFBupDyTMoH4sLpCFcKuvGCi2MxX Diff:
Old | New | Differences | |
---|---|---|---|
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func payref (ld,user,refer,refsum) = { | |
5 | 5 | let lde = ld.data | |
6 | - | let isrefer = match getString(this, ( | |
6 | + | let isrefer = match getString(this, ("ref_" + user)) { | |
7 | 7 | case a: String => | |
8 | 8 | a | |
9 | 9 | case _ => | |
11 | 11 | } | |
12 | 12 | if ((isrefer == "")) | |
13 | 13 | then { | |
14 | - | let lastbal = match getInteger(this, ( | |
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 | - | let lastrefbal = match getInteger(this, ( | |
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 dsl = DataEntry(( | |
27 | - | let dslref = DataEntry(( | |
26 | + | let dsl = DataEntry(("wallet_" + refer), (lastbal + refsum)) :: lde | |
27 | + | let dslref = DataEntry(("refpay_" + refer), (lastrefbal + refsum)) :: dsl | |
28 | 28 | let dsl1 = WriteSet(dslref) | |
29 | 29 | dsl1 | |
30 | 30 | } | |
31 | 31 | else { | |
32 | - | let lastbal1 = match getInteger(this, ( | |
32 | + | let lastbal1 = match getInteger(this, ("wallet_" + isrefer)) { | |
33 | 33 | case a: Int => | |
34 | 34 | a | |
35 | 35 | case _ => | |
36 | 36 | 0 | |
37 | 37 | } | |
38 | - | let lastrefbal1 = match getInteger(this, ( | |
38 | + | let lastrefbal1 = match getInteger(this, ("refpay_" + isrefer)) { | |
39 | 39 | case a: Int => | |
40 | 40 | a | |
41 | 41 | case _ => | |
42 | 42 | 0 | |
43 | 43 | } | |
44 | - | let dsl2 = DataEntry(( | |
45 | - | let dslref1 = DataEntry(( | |
44 | + | let dsl2 = DataEntry(("wallet_" + isrefer), (lastbal1 + refsum)) :: lde | |
45 | + | let dslref1 = DataEntry(("refpay_" + isrefer), (lastrefbal1 + refsum)) :: dsl2 | |
46 | 46 | let dsl3 = WriteSet(dslref1) | |
47 | 47 | dsl3 | |
48 | 48 | } | |
51 | 51 | ||
52 | 52 | func setref (ld,user,refer) = { | |
53 | 53 | let lde = ld.data | |
54 | - | let isrefer = match getString(this, ( | |
54 | + | let isrefer = match getString(this, ("ref_" + user)) { | |
55 | 55 | case a: String => | |
56 | 56 | a | |
57 | 57 | case _ => | |
59 | 59 | } | |
60 | 60 | if ((isrefer == "")) | |
61 | 61 | then { | |
62 | - | let dsl = DataEntry(( | |
63 | - | let dslref = DataEntry((refer + | |
62 | + | let dsl = DataEntry(("ref_" + user), refer) :: lde | |
63 | + | let dslref = DataEntry(("refer_" + refer), user) :: dsl | |
64 | 64 | let dsl1 = WriteSet(dslref) | |
65 | 65 | dsl1 | |
66 | 66 | } |
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 | - | let isrefer = match getString(this, ( | |
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 | - | let lastbal = match getInteger(this, ( | |
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 | - | let lastrefbal = match getInteger(this, ( | |
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 dsl = DataEntry(( | |
27 | - | let dslref = DataEntry(( | |
26 | + | let dsl = DataEntry(("wallet_" + refer), (lastbal + refsum)) :: lde | |
27 | + | let dslref = DataEntry(("refpay_" + refer), (lastrefbal + refsum)) :: dsl | |
28 | 28 | let dsl1 = WriteSet(dslref) | |
29 | 29 | dsl1 | |
30 | 30 | } | |
31 | 31 | else { | |
32 | - | let lastbal1 = match getInteger(this, ( | |
32 | + | let lastbal1 = match getInteger(this, ("wallet_" + isrefer)) { | |
33 | 33 | case a: Int => | |
34 | 34 | a | |
35 | 35 | case _ => | |
36 | 36 | 0 | |
37 | 37 | } | |
38 | - | let lastrefbal1 = match getInteger(this, ( | |
38 | + | let lastrefbal1 = match getInteger(this, ("refpay_" + isrefer)) { | |
39 | 39 | case a: Int => | |
40 | 40 | a | |
41 | 41 | case _ => | |
42 | 42 | 0 | |
43 | 43 | } | |
44 | - | let dsl2 = DataEntry(( | |
45 | - | let dslref1 = DataEntry(( | |
44 | + | let dsl2 = DataEntry(("wallet_" + isrefer), (lastbal1 + refsum)) :: lde | |
45 | + | let dslref1 = DataEntry(("refpay_" + isrefer), (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 | - | let isrefer = match getString(this, ( | |
54 | + | let isrefer = match getString(this, ("ref_" + user)) { | |
55 | 55 | case a: String => | |
56 | 56 | a | |
57 | 57 | case _ => | |
58 | 58 | "" | |
59 | 59 | } | |
60 | 60 | if ((isrefer == "")) | |
61 | 61 | then { | |
62 | - | let dsl = DataEntry(( | |
63 | - | let dslref = DataEntry((refer + | |
62 | + | let dsl = DataEntry(("ref_" + user), refer) :: lde | |
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) / 100000000) | |
103 | 103 | let x = parseIntValue(betx) | |
104 | 104 | let payticket = (payval * x) | |
105 | 105 | if ((payticket > payval)) | |
106 | 106 | then throw("Ticket price is 1 WAVES") | |
107 | 107 | else { | |
108 | 108 | let lastfondprize = match getInteger(this, "fondprize") { | |
109 | 109 | case a: Int => | |
110 | 110 | a | |
111 | 111 | case _ => | |
112 | 112 | 0 | |
113 | 113 | } | |
114 | 114 | let newfondprize = DataEntry("fondprize", (lastfondprize + (payticket / 2))) | |
115 | 115 | let dsl = WriteSet([newfondprize]) | |
116 | 116 | let numberround = match getInteger(this, "numberofround") { | |
117 | 117 | case a: Int => | |
118 | 118 | a | |
119 | 119 | case _ => | |
120 | 120 | 1 | |
121 | 121 | } | |
122 | 122 | let user = toString(inv.caller) | |
123 | 123 | let dsl1 = setref(dsl, user, refer) | |
124 | 124 | let currentTicketcount = match getInteger(this, "ticketcount") { | |
125 | 125 | case a: Int => | |
126 | 126 | a | |
127 | 127 | case _ => | |
128 | 128 | 0 | |
129 | 129 | } | |
130 | 130 | let newTicketcount = (currentTicketcount + 1) | |
131 | 131 | let dsl2 = nextcountticket(dsl1, newTicketcount) | |
132 | 132 | let currentkeyticket = ((((("ticket_" + toString(numberround)) + "_") + toString(newTicketcount)) + "_") + user) | |
133 | 133 | let dsl3 = dataticket(dsl2, currentkeyticket, ticket) | |
134 | 134 | let dsl4 = checknextround(dsl3, newTicketcount, numberround) | |
135 | 135 | let refpayment = ((payticket * 10) * x) | |
136 | 136 | let dsl5 = payref(dsl4, user, refer, refpayment) | |
137 | 137 | dsl5 | |
138 | 138 | } | |
139 | 139 | } | |
140 | 140 | ||
141 | 141 |
github/deemru/w8io/169f3d6 153.89 ms ◑