tx · ArekSYd3TjA3cAGzHFvyWjxWG8bFGLhcUgT3psaVZ9WJ

3NBEbFU6dKpoAcsbaEK2aC62UQMjYFW4xiL:  -0.05000000 Waves

2021.02.20 12:53 [1406308] smart account 3NBEbFU6dKpoAcsbaEK2aC62UQMjYFW4xiL > SELF 0.00000000 Waves

{ "type": 13, "id": "ArekSYd3TjA3cAGzHFvyWjxWG8bFGLhcUgT3psaVZ9WJ", "fee": 5000000, "feeAssetId": null, "timestamp": 1613814816618, "version": 2, "chainId": 84, "sender": "3NBEbFU6dKpoAcsbaEK2aC62UQMjYFW4xiL", "senderPublicKey": "AwmS57W97dpK3Bs6tsewG3YaYgJukDtmEZFbG1oQTV4T", "proofs": [ "4B2w9H9PrNaZZ8149bJBPDbyuTZXzbxrhVxRqsFi5kEYnsMscKCNSKmR6oyAVRXqpCZRYL7zcoVutZY917UMEGrf" ], "script": "base64:AAIDAAAAAAAAABAIARIDCgEIEgASAwoBARIAAAAACgAAAAAHUlVOTklORwIAAAAHUlVOTklORwAAAAAGQ0xPU0VEAgAAAAZDTE9TRUQAAAAACENBTkNFTEVEAgAAAAhDQU5DRUxFRAAAAAAJREFQUE9XTkVSAgAAACMzTkJFYkZVNmRLcG9BY3NiYUVLMmFDNjJVUU1qWUZXNHhpTAAAAAAFV0FWRVMCAAAABVdBVkVTAAAAAAROT05FAgAAAAROT05FAAAAAANGRUUAAAAAAAANu6ABAAAACnJhbmRvbWl6ZXIAAAABAAAAA2ludgQAAAAIbGFzdFBsYXkEAAAAByRtYXRjaDAJAAQcAAAAAgUAAAAEdGhpcwIAAAAVY29udGVzdF9jdXJyZW50bnVtYmVyAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAApCeXRlVmVjdG9yBAAAAAFzBQAAAAckbWF0Y2gwBQAAAAFzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAARVbml0AQAAAAxXYXZlc0xvdHRvVjIJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IEAAAABHJhbmQJ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gAAAA9EYXRhVHJhbnNhY3Rpb24JAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABdJbnZva2VTY3JpcHRUcmFuc2FjdGlvbgYGMY1xOA==", "height": 1406308, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EZxJScqqseu3gGmUZqAvVdXcQ2PTXkaZx68qAXLsdpsB Next: 7aTbzytd6x1nEox59f4sTkMCeS6f58HjhUTpk4DJCqFn Diff:
OldNewDifferences
1717
1818 func h (i) = {
1919 let j = {
20- let k = getInteger(this, i)
21- if ($isInstanceOf(k, "Int"))
20+ let k = getBinary(this, "contest_currentnumber")
21+ if ($isInstanceOf(k, "ByteVector"))
2222 then {
2323 let l = k
2424 l
2525 }
26- else 0
26+ else if ($isInstanceOf(k, "Unit"))
27+ then base58'2ee4oFDYriWJ9EMeR'
28+ else throw("Match error")
2729 }
28- j
30+ let m = (((((j + i.transactionId) + i.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height))
31+ sha256(m)
2932 }
3033
3134
32-func m (i) = {
33- let n = {
34- let k = getString(this, i)
35+func n (o) = {
36+ let p = {
37+ let k = getInteger(this, o)
38+ if ($isInstanceOf(k, "Int"))
39+ then {
40+ let q = k
41+ q
42+ }
43+ else 0
44+ }
45+ p
46+ }
47+
48+
49+func r (o) = {
50+ let s = {
51+ let k = getString(this, o)
3552 if ($isInstanceOf(k, "String"))
3653 then {
37- let l = k
38- l
54+ let q = k
55+ q
3956 }
4057 else f
4158 }
42- n
59+ s
4360 }
4461
4562
46-@Callable(o)
47-func setContestStatus (p) = {
48- let q = toBase58String(o.caller.bytes)
49- let r = h("contest_currentnumber")
50- if ((q != d))
63+@Callable(t)
64+func setContestStatus (u) = {
65+ let v = toBase58String(t.caller.bytes)
66+ let w = n("contest_currentnumber")
67+ if ((v != d))
5168 then throw("Only dAPP Owner can set Contest Status.")
52- else if (if ((p != c))
53- then (p != b)
69+ else if (if ((u != c))
70+ then (u != b)
5471 else false)
55- then throw(("Invalid status: " + p))
56- else WriteSet([DataEntry((("contest_" + toString(r)) + "_status"), p)])
72+ then throw(("Invalid status: " + u))
73+ else WriteSet([DataEntry((("contest_" + toString(w)) + "_status"), u)])
5774 }
5875
5976
6077
61-@Callable(o)
78+@Callable(t)
6279 func setContestConfiguration () = {
63- let q = toBase58String(o.caller.bytes)
64- let r = h("contest_currentnumber")
65- let s = m((("contest_" + toString(r)) + "_status"))
66- let t = (r + 1)
67- let u = wavesBalance(this)
68- if ((q != d))
69- then throw(((("Only dAPP Owner can Configure Contest. Caller account: " + q) + " dapp owner: ") + d))
70- else if ((s == a))
71- then throw(("You cannot configure a new Contest while old Contest status is: " + s))
80+ let v = toBase58String(t.caller.bytes)
81+ let w = n("contest_currentnumber")
82+ let x = r((("contest_" + toString(w)) + "_status"))
83+ let y = (w + 1)
84+ let z = wavesBalance(this)
85+ if ((v != d))
86+ then throw(((("Only dAPP Owner can Configure Contest. Caller account: " + v) + " dapp owner: ") + d))
87+ else if ((x == a))
88+ then throw(("You cannot configure a new Contest while old Contest status is: " + x))
7289 else {
73- let v = (height + (6 * 1440))
74- WriteSet([DataEntry("contest_currentnumber", t), DataEntry((("contest_" + toString(t)) + "_finishheight"), v), DataEntry((("contest_" + toString(t)) + "_status"), a), DataEntry((("contest_" + toString(t)) + "_betcounter"), 0)])
90+ let A = (height + (6 * 1440))
91+ WriteSet([DataEntry("contest_currentnumber", y), DataEntry((("contest_" + toString(y)) + "_finishheight"), A), DataEntry((("contest_" + toString(y)) + "_status"), a), DataEntry((("contest_" + toString(y)) + "_betcounter"), 0)])
7592 }
7693 }
7794
7895
7996
80-@Callable(o)
81-func bet (w) = {
82- let q = toBase58String(o.caller.bytes)
83- let x = extract(o.payment)
84- let r = h("contest_currentnumber")
85- let y = h((("contest_" + toString(r)) + "_startheight"))
86- let v = h((("contest_" + toString(r)) + "_finishheight"))
87- let s = m((("contest_" + toString(r)) + "_status"))
88- let p = m((("contest_" + toString(r)) + "_status"))
89- let z = h((((("contest_" + toString(r)) + "_") + q) + "_bets"))
90- let A = m(((("bet_" + toString(r)) + "_") + toString(w)))
91- if ((height > (v - (2 * 1440))))
97+@Callable(t)
98+func bet (B) = {
99+ let v = toBase58String(t.caller.bytes)
100+ let C = extract(t.payment)
101+ let w = n("contest_currentnumber")
102+ let D = n((("contest_" + toString(w)) + "_startheight"))
103+ let A = n((("contest_" + toString(w)) + "_finishheight"))
104+ let x = r((("contest_" + toString(w)) + "_status"))
105+ let u = r((("contest_" + toString(w)) + "_status"))
106+ let E = n((((("contest_" + toString(w)) + "_") + v) + "_bets"))
107+ let F = r(((("bet_" + toString(w)) + "_") + toString(B)))
108+ if ((height > (A - (2 * 1440))))
92109 then throw("You cannot bet anymore at this height.")
93- else if ((s != a))
94- then throw(("Invalid status: you cannot bet now, contest status is: " + s))
95- else if (if ((A != f))
96- then (A != q)
110+ else if ((x != a))
111+ then throw(("Invalid status: you cannot bet now, contest status is: " + x))
112+ else if (if ((F != f))
113+ then (F != v)
97114 else false)
98- then throw((("Another user: " + A) + " did bet already on this rate."))
99- else if ((z >= 1))
100- then throw("You can do at most 1 bet.")
101- else WriteSet([DataEntry(((("bet_" + toString(r)) + "_") + toString(w)), q), DataEntry((((("contest_" + toString(r)) + "_") + q) + "_bets"), (z + 1))])
115+ then throw((("Another wallet: " + F) + " took this number."))
116+ else if ((E >= 1))
117+ then throw("You can chose at most one number.")
118+ else WriteSet([DataEntry(((("bet_" + toString(w)) + "_") + toString(B)), v), DataEntry((((("contest_" + toString(w)) + "_") + v) + "_bets"), (E + 1))])
102119 }
103120
104121
105-@Verifier(B)
106-func C () = {
107- let k = B
122+
123+@Callable(t)
124+func closecontest () = {
125+ let G = h(t)
126+ let w = n("contest_currentnumber")
127+ let H = r(((("bet_" + toString(w)) + "_") + toString(1)))
128+ let A = n((("contest_" + toString(w)) + "_finishheight"))
129+ let v = toBase58String(t.caller.bytes)
130+ let z = wavesBalance(this)
131+ let x = r((("contest_" + toString(w)) + "_status"))
132+ if ((v != d))
133+ then throw("Only dAPP Owner can Close the Lottery.")
134+ else if ((A > height))
135+ then throw(((("account: " + v) + ": Cannot close the contest before height:") + toString(A)))
136+ else if ((x != a))
137+ then throw(("Cannot close a contest in status: " + x))
138+ else if ((H != f))
139+ then {
140+ let I = wavesBalance(this)
141+ let J = TransferSet([ScriptTransfer(extract(addressFromString(H)), I, unit)])
142+ ScriptResult(WriteSet([DataEntry((("contest_" + toString(w)) + "_status"), b), DataEntry((("contest_" + toString(w)) + "_winner"), H), DataEntry((("contest_" + toString(w)) + "_rateheight"), height), DataEntry((("contest_" + toString(w)) + "_extractedNumber"), G), DataEntry((("contest_" + toString(w)) + "_prize"), I)]), J)
143+ }
144+ else WriteSet([DataEntry((("contest_" + toString(w)) + "_status"), b), DataEntry((("contest_" + toString(w)) + "_winner"), H), DataEntry((("contest_" + toString(w)) + "_extractedNumber"), G), DataEntry((("contest_" + toString(w)) + "_prize"), 0)])
145+ }
146+
147+
148+@Verifier(K)
149+func L () = {
150+ let k = K
108151 if (if ($isInstanceOf(k, "SetScriptTransaction"))
109152 then true
110153 else $isInstanceOf(k, "DataTransaction"))
111- then sigVerify(B.bodyBytes, B.proofs[0], B.senderPublicKey)
154+ then sigVerify(K.bodyBytes, K.proofs[0], K.senderPublicKey)
112155 else if ($isInstanceOf(k, "InvokeScriptTransaction"))
113156 then true
114157 else true
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "RUNNING"
55
66 let b = "CLOSED"
77
88 let c = "CANCELED"
99
1010 let d = "3NBEbFU6dKpoAcsbaEK2aC62UQMjYFW4xiL"
1111
1212 let e = "WAVES"
1313
1414 let f = "NONE"
1515
1616 let g = 900000
1717
1818 func h (i) = {
1919 let j = {
20- let k = getInteger(this, i)
21- if ($isInstanceOf(k, "Int"))
20+ let k = getBinary(this, "contest_currentnumber")
21+ if ($isInstanceOf(k, "ByteVector"))
2222 then {
2323 let l = k
2424 l
2525 }
26- else 0
26+ else if ($isInstanceOf(k, "Unit"))
27+ then base58'2ee4oFDYriWJ9EMeR'
28+ else throw("Match error")
2729 }
28- j
30+ let m = (((((j + i.transactionId) + i.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height))
31+ sha256(m)
2932 }
3033
3134
32-func m (i) = {
33- let n = {
34- let k = getString(this, i)
35+func n (o) = {
36+ let p = {
37+ let k = getInteger(this, o)
38+ if ($isInstanceOf(k, "Int"))
39+ then {
40+ let q = k
41+ q
42+ }
43+ else 0
44+ }
45+ p
46+ }
47+
48+
49+func r (o) = {
50+ let s = {
51+ let k = getString(this, o)
3552 if ($isInstanceOf(k, "String"))
3653 then {
37- let l = k
38- l
54+ let q = k
55+ q
3956 }
4057 else f
4158 }
42- n
59+ s
4360 }
4461
4562
46-@Callable(o)
47-func setContestStatus (p) = {
48- let q = toBase58String(o.caller.bytes)
49- let r = h("contest_currentnumber")
50- if ((q != d))
63+@Callable(t)
64+func setContestStatus (u) = {
65+ let v = toBase58String(t.caller.bytes)
66+ let w = n("contest_currentnumber")
67+ if ((v != d))
5168 then throw("Only dAPP Owner can set Contest Status.")
52- else if (if ((p != c))
53- then (p != b)
69+ else if (if ((u != c))
70+ then (u != b)
5471 else false)
55- then throw(("Invalid status: " + p))
56- else WriteSet([DataEntry((("contest_" + toString(r)) + "_status"), p)])
72+ then throw(("Invalid status: " + u))
73+ else WriteSet([DataEntry((("contest_" + toString(w)) + "_status"), u)])
5774 }
5875
5976
6077
61-@Callable(o)
78+@Callable(t)
6279 func setContestConfiguration () = {
63- let q = toBase58String(o.caller.bytes)
64- let r = h("contest_currentnumber")
65- let s = m((("contest_" + toString(r)) + "_status"))
66- let t = (r + 1)
67- let u = wavesBalance(this)
68- if ((q != d))
69- then throw(((("Only dAPP Owner can Configure Contest. Caller account: " + q) + " dapp owner: ") + d))
70- else if ((s == a))
71- then throw(("You cannot configure a new Contest while old Contest status is: " + s))
80+ let v = toBase58String(t.caller.bytes)
81+ let w = n("contest_currentnumber")
82+ let x = r((("contest_" + toString(w)) + "_status"))
83+ let y = (w + 1)
84+ let z = wavesBalance(this)
85+ if ((v != d))
86+ then throw(((("Only dAPP Owner can Configure Contest. Caller account: " + v) + " dapp owner: ") + d))
87+ else if ((x == a))
88+ then throw(("You cannot configure a new Contest while old Contest status is: " + x))
7289 else {
73- let v = (height + (6 * 1440))
74- WriteSet([DataEntry("contest_currentnumber", t), DataEntry((("contest_" + toString(t)) + "_finishheight"), v), DataEntry((("contest_" + toString(t)) + "_status"), a), DataEntry((("contest_" + toString(t)) + "_betcounter"), 0)])
90+ let A = (height + (6 * 1440))
91+ WriteSet([DataEntry("contest_currentnumber", y), DataEntry((("contest_" + toString(y)) + "_finishheight"), A), DataEntry((("contest_" + toString(y)) + "_status"), a), DataEntry((("contest_" + toString(y)) + "_betcounter"), 0)])
7592 }
7693 }
7794
7895
7996
80-@Callable(o)
81-func bet (w) = {
82- let q = toBase58String(o.caller.bytes)
83- let x = extract(o.payment)
84- let r = h("contest_currentnumber")
85- let y = h((("contest_" + toString(r)) + "_startheight"))
86- let v = h((("contest_" + toString(r)) + "_finishheight"))
87- let s = m((("contest_" + toString(r)) + "_status"))
88- let p = m((("contest_" + toString(r)) + "_status"))
89- let z = h((((("contest_" + toString(r)) + "_") + q) + "_bets"))
90- let A = m(((("bet_" + toString(r)) + "_") + toString(w)))
91- if ((height > (v - (2 * 1440))))
97+@Callable(t)
98+func bet (B) = {
99+ let v = toBase58String(t.caller.bytes)
100+ let C = extract(t.payment)
101+ let w = n("contest_currentnumber")
102+ let D = n((("contest_" + toString(w)) + "_startheight"))
103+ let A = n((("contest_" + toString(w)) + "_finishheight"))
104+ let x = r((("contest_" + toString(w)) + "_status"))
105+ let u = r((("contest_" + toString(w)) + "_status"))
106+ let E = n((((("contest_" + toString(w)) + "_") + v) + "_bets"))
107+ let F = r(((("bet_" + toString(w)) + "_") + toString(B)))
108+ if ((height > (A - (2 * 1440))))
92109 then throw("You cannot bet anymore at this height.")
93- else if ((s != a))
94- then throw(("Invalid status: you cannot bet now, contest status is: " + s))
95- else if (if ((A != f))
96- then (A != q)
110+ else if ((x != a))
111+ then throw(("Invalid status: you cannot bet now, contest status is: " + x))
112+ else if (if ((F != f))
113+ then (F != v)
97114 else false)
98- then throw((("Another user: " + A) + " did bet already on this rate."))
99- else if ((z >= 1))
100- then throw("You can do at most 1 bet.")
101- else WriteSet([DataEntry(((("bet_" + toString(r)) + "_") + toString(w)), q), DataEntry((((("contest_" + toString(r)) + "_") + q) + "_bets"), (z + 1))])
115+ then throw((("Another wallet: " + F) + " took this number."))
116+ else if ((E >= 1))
117+ then throw("You can chose at most one number.")
118+ else WriteSet([DataEntry(((("bet_" + toString(w)) + "_") + toString(B)), v), DataEntry((((("contest_" + toString(w)) + "_") + v) + "_bets"), (E + 1))])
102119 }
103120
104121
105-@Verifier(B)
106-func C () = {
107- let k = B
122+
123+@Callable(t)
124+func closecontest () = {
125+ let G = h(t)
126+ let w = n("contest_currentnumber")
127+ let H = r(((("bet_" + toString(w)) + "_") + toString(1)))
128+ let A = n((("contest_" + toString(w)) + "_finishheight"))
129+ let v = toBase58String(t.caller.bytes)
130+ let z = wavesBalance(this)
131+ let x = r((("contest_" + toString(w)) + "_status"))
132+ if ((v != d))
133+ then throw("Only dAPP Owner can Close the Lottery.")
134+ else if ((A > height))
135+ then throw(((("account: " + v) + ": Cannot close the contest before height:") + toString(A)))
136+ else if ((x != a))
137+ then throw(("Cannot close a contest in status: " + x))
138+ else if ((H != f))
139+ then {
140+ let I = wavesBalance(this)
141+ let J = TransferSet([ScriptTransfer(extract(addressFromString(H)), I, unit)])
142+ ScriptResult(WriteSet([DataEntry((("contest_" + toString(w)) + "_status"), b), DataEntry((("contest_" + toString(w)) + "_winner"), H), DataEntry((("contest_" + toString(w)) + "_rateheight"), height), DataEntry((("contest_" + toString(w)) + "_extractedNumber"), G), DataEntry((("contest_" + toString(w)) + "_prize"), I)]), J)
143+ }
144+ else WriteSet([DataEntry((("contest_" + toString(w)) + "_status"), b), DataEntry((("contest_" + toString(w)) + "_winner"), H), DataEntry((("contest_" + toString(w)) + "_extractedNumber"), G), DataEntry((("contest_" + toString(w)) + "_prize"), 0)])
145+ }
146+
147+
148+@Verifier(K)
149+func L () = {
150+ let k = K
108151 if (if ($isInstanceOf(k, "SetScriptTransaction"))
109152 then true
110153 else $isInstanceOf(k, "DataTransaction"))
111- then sigVerify(B.bodyBytes, B.proofs[0], B.senderPublicKey)
154+ then sigVerify(K.bodyBytes, K.proofs[0], K.senderPublicKey)
112155 else if ($isInstanceOf(k, "InvokeScriptTransaction"))
113156 then true
114157 else true
115158 }
116159

github/deemru/w8io/169f3d6 
53.56 ms