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:AAIDAAAAAAAAAAkIARIFCgMICAgAAAAFAQAAAAZwYXlyZWYAAAAEAAAAAmxkAAAABHVzZXIAAAAFcmVmZXIAAAAGcmVmc3VtBAAAAANsZGUIBQAAAAJsZAAAAARkYXRhBAAAAAdpc3JlZmVyBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMJAAEsAAAAAgIAAAAEcmVmXwUAAAAEdXNlcgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAADCQAAAAAAAAIFAAAAB2lzcmVmZXICAAAAAAQAAAAHbGFzdGJhbAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzCQABLAAAAAICAAAAB3dhbGxldF8FAAAABXJlZmVyAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAEAAAACmxhc3RyZWZiYWwEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwkAASwAAAACAgAAAAdyZWZwYXlfBQAA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tldAQAAAAEZHNsNAkBAAAADmNoZWNrbmV4dHJvdW5kAAAAAwUAAAAEZHNsMwUAAAAObmV3VGlja2V0Y291bnQFAAAAC251bWJlcnJvdW5kBAAAAApyZWZwYXltZW50CQAAaAAAAAIJAABoAAAAAgUAAAAJcGF5dGlja2V0AAAAAAAAAAAKBQAAAAF4BAAAAARkc2w1CQEAAAAGcGF5cmVmAAAABAUAAAAEZHNsNAUAAAAEdXNlcgUAAAAFcmVmZXIFAAAACnJlZnBheW1lbnQFAAAABGRzbDUAAAAAh07jlA==", "chainId": 84, "height": 781010, "spentComplexity": 0 } View: original | compacted Prev: AoUKh4WyLa31VuvEbFYdd8VhD1yjTdMBAEzq72eUWNcc Next: FpjCia3TtTmjJ15jTFBupDyTMoH4sLpCFcKuvGCi2MxX Diff:
OldNewDifferences
33 {-# CONTENT_TYPE DAPP #-}
44 func payref (ld,user,refer,refsum) = {
55 let lde = ld.data
6- let isrefer = match getString(this, (user + "_ref")) {
6+ let isrefer = match getString(this, ("ref_" + user)) {
77 case a: String =>
88 a
99 case _ =>
1111 }
1212 if ((isrefer == ""))
1313 then {
14- let lastbal = match getInteger(this, (refer + "_wallet")) {
14+ let lastbal = match getInteger(this, ("wallet_" + refer)) {
1515 case a: Int =>
1616 a
1717 case _ =>
1818 0
1919 }
20- let lastrefbal = match getInteger(this, (refer + "_refpay")) {
20+ let lastrefbal = match getInteger(this, ("refpay_" + refer)) {
2121 case a: Int =>
2222 a
2323 case _ =>
2424 0
2525 }
26- let dsl = DataEntry((refer + "_wallet"), (lastbal + refsum)) :: lde
27- let dslref = DataEntry((refer + "_refpay"), (lastrefbal + refsum)) :: dsl
26+ let dsl = DataEntry(("wallet_" + refer), (lastbal + refsum)) :: lde
27+ let dslref = DataEntry(("refpay_" + refer), (lastrefbal + refsum)) :: dsl
2828 let dsl1 = WriteSet(dslref)
2929 dsl1
3030 }
3131 else {
32- let lastbal1 = match getInteger(this, (isrefer + "_wallet")) {
32+ let lastbal1 = match getInteger(this, ("wallet_" + isrefer)) {
3333 case a: Int =>
3434 a
3535 case _ =>
3636 0
3737 }
38- let lastrefbal1 = match getInteger(this, (isrefer + "_refpay")) {
38+ let lastrefbal1 = match getInteger(this, ("refpay_" + isrefer)) {
3939 case a: Int =>
4040 a
4141 case _ =>
4242 0
4343 }
44- let dsl2 = DataEntry((isrefer + "_wallet"), (lastbal1 + refsum)) :: lde
45- let dslref1 = DataEntry((isrefer + "_refpay"), (lastrefbal1 + refsum)) :: dsl2
44+ let dsl2 = DataEntry(("wallet_" + isrefer), (lastbal1 + refsum)) :: lde
45+ let dslref1 = DataEntry(("refpay_" + isrefer), (lastrefbal1 + refsum)) :: dsl2
4646 let dsl3 = WriteSet(dslref1)
4747 dsl3
4848 }
5151
5252 func setref (ld,user,refer) = {
5353 let lde = ld.data
54- let isrefer = match getString(this, (user + "_ref")) {
54+ let isrefer = match getString(this, ("ref_" + user)) {
5555 case a: String =>
5656 a
5757 case _ =>
5959 }
6060 if ((isrefer == ""))
6161 then {
62- let dsl = DataEntry((user + "_ref"), refer) :: lde
63- let dslref = DataEntry((refer + "_refer"), user) :: dsl
62+ let dsl = DataEntry(("ref_" + user), refer) :: lde
63+ let dslref = DataEntry(("refer_" + refer), user) :: dsl
6464 let dsl1 = WriteSet(dslref)
6565 dsl1
6666 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func payref (ld,user,refer,refsum) = {
55 let lde = ld.data
6- let isrefer = match getString(this, (user + "_ref")) {
6+ let isrefer = match getString(this, ("ref_" + user)) {
77 case a: String =>
88 a
99 case _ =>
1010 ""
1111 }
1212 if ((isrefer == ""))
1313 then {
14- let lastbal = match getInteger(this, (refer + "_wallet")) {
14+ let lastbal = match getInteger(this, ("wallet_" + refer)) {
1515 case a: Int =>
1616 a
1717 case _ =>
1818 0
1919 }
20- let lastrefbal = match getInteger(this, (refer + "_refpay")) {
20+ let lastrefbal = match getInteger(this, ("refpay_" + refer)) {
2121 case a: Int =>
2222 a
2323 case _ =>
2424 0
2525 }
26- let dsl = DataEntry((refer + "_wallet"), (lastbal + refsum)) :: lde
27- let dslref = DataEntry((refer + "_refpay"), (lastrefbal + refsum)) :: dsl
26+ let dsl = DataEntry(("wallet_" + refer), (lastbal + refsum)) :: lde
27+ let dslref = DataEntry(("refpay_" + refer), (lastrefbal + refsum)) :: dsl
2828 let dsl1 = WriteSet(dslref)
2929 dsl1
3030 }
3131 else {
32- let lastbal1 = match getInteger(this, (isrefer + "_wallet")) {
32+ let lastbal1 = match getInteger(this, ("wallet_" + isrefer)) {
3333 case a: Int =>
3434 a
3535 case _ =>
3636 0
3737 }
38- let lastrefbal1 = match getInteger(this, (isrefer + "_refpay")) {
38+ let lastrefbal1 = match getInteger(this, ("refpay_" + isrefer)) {
3939 case a: Int =>
4040 a
4141 case _ =>
4242 0
4343 }
44- let dsl2 = DataEntry((isrefer + "_wallet"), (lastbal1 + refsum)) :: lde
45- let dslref1 = DataEntry((isrefer + "_refpay"), (lastrefbal1 + refsum)) :: dsl2
44+ let dsl2 = DataEntry(("wallet_" + isrefer), (lastbal1 + refsum)) :: lde
45+ let dslref1 = DataEntry(("refpay_" + isrefer), (lastrefbal1 + refsum)) :: dsl2
4646 let dsl3 = WriteSet(dslref1)
4747 dsl3
4848 }
4949 }
5050
5151
5252 func setref (ld,user,refer) = {
5353 let lde = ld.data
54- let isrefer = match getString(this, (user + "_ref")) {
54+ let isrefer = match getString(this, ("ref_" + user)) {
5555 case a: String =>
5656 a
5757 case _ =>
5858 ""
5959 }
6060 if ((isrefer == ""))
6161 then {
62- let dsl = DataEntry((user + "_ref"), refer) :: lde
63- let dslref = DataEntry((refer + "_refer"), user) :: dsl
62+ let dsl = DataEntry(("ref_" + user), refer) :: lde
63+ let dslref = DataEntry(("refer_" + refer), user) :: dsl
6464 let dsl1 = WriteSet(dslref)
6565 dsl1
6666 }
6767 else ld
6868 }
6969
7070
7171 func nextcountticket (ld,newcount) = {
7272 let lde = ld.data
7373 let newcounttik = DataEntry("ticketcount", newcount) :: lde
7474 let nws = WriteSet(newcounttik)
7575 nws
7676 }
7777
7878
7979 func dataticket (ld,ticketkey,ticketdata) = {
8080 let lde = ld.data
8181 let newtikdata = DataEntry(ticketkey, ticketdata) :: lde
8282 let nws = WriteSet(newtikdata)
8383 nws
8484 }
8585
8686
8787 func checknextround (ld,ticketcount,numofround) = {
8888 let lde = ld.data
8989 if ((ticketcount == 100))
9090 then {
9191 let newtikdata = DataEntry("numberofround", (numofround + 1)) :: lde
9292 let nws = WriteSet(newtikdata)
9393 nws
9494 }
9595 else ld
9696 }
9797
9898
9999 @Callable(inv)
100100 func playbingo (ticket,betx,refer) = {
101101 let pmt = extract(inv.payment)
102102 let payval = (value(pmt.amount) / 100000000)
103103 let x = parseIntValue(betx)
104104 let payticket = (payval * x)
105105 if ((payticket > payval))
106106 then throw("Ticket price is 1 WAVES")
107107 else {
108108 let lastfondprize = match getInteger(this, "fondprize") {
109109 case a: Int =>
110110 a
111111 case _ =>
112112 0
113113 }
114114 let newfondprize = DataEntry("fondprize", (lastfondprize + (payticket / 2)))
115115 let dsl = WriteSet([newfondprize])
116116 let numberround = match getInteger(this, "numberofround") {
117117 case a: Int =>
118118 a
119119 case _ =>
120120 1
121121 }
122122 let user = toString(inv.caller)
123123 let dsl1 = setref(dsl, user, refer)
124124 let currentTicketcount = match getInteger(this, "ticketcount") {
125125 case a: Int =>
126126 a
127127 case _ =>
128128 0
129129 }
130130 let newTicketcount = (currentTicketcount + 1)
131131 let dsl2 = nextcountticket(dsl1, newTicketcount)
132132 let currentkeyticket = ((((("ticket_" + toString(numberround)) + "_") + toString(newTicketcount)) + "_") + user)
133133 let dsl3 = dataticket(dsl2, currentkeyticket, ticket)
134134 let dsl4 = checknextround(dsl3, newTicketcount, numberround)
135135 let refpayment = ((payticket * 10) * x)
136136 let dsl5 = payref(dsl4, user, refer, refpayment)
137137 dsl5
138138 }
139139 }
140140
141141

github/deemru/w8io/169f3d6 
153.89 ms