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