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:AAIDAAAAAAAAABAIARIDCgEIEgASAwoBARIAAAAACgAAAAAHUlVOTklORwIAAAAHUlVOTklORwAAAAAGQ0xPU0VEAgAAAAZDTE9TRUQAAAAACENBTkNFTEVEAgAAAAhDQU5DRUxFRAAAAAAJREFQUE9XTkVSAgAAACMzTkJFYkZVNmRLcG9BY3NiYUVLMmFDNjJVUU1qWUZXNHhpTAAAAAAFV0FWRVMCAAAABVdBVkVTAAAAAAROT05FAgAAAAROT05FAAAAAANGRUUAAAAAAAANu6ABAAAACnJhbmRvbWl6ZXIAAAABAAAAA2ludgQAAAAIbGFzdFBsYXkEAAAAByRtYXRjaDAJAAQcAAAAAgUAAAAEdGhpcwIAAAAVY29udGVzdF9jdXJyZW50bnVtYmVyAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAApCeXRlVmVjdG9yBAAAAAFzBQAAAAckbWF0Y2gwBQAAAAFzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAARVbml0AQAAAAxXYXZlc0xvdHRvVjIJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IEAAAABHJhbmQJA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AAAA9EYXRhVHJhbnNhY3Rpb24JAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABdJbnZva2VTY3JpcHRUcmFuc2FjdGlvbgYGMY1xOA==", "height": 1406308, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EZxJScqqseu3gGmUZqAvVdXcQ2PTXkaZx68qAXLsdpsB Next: 7aTbzytd6x1nEox59f4sTkMCeS6f58HjhUTpk4DJCqFn Diff:
Old | New | Differences | |
---|---|---|---|
17 | 17 | ||
18 | 18 | func h (i) = { | |
19 | 19 | let j = { | |
20 | - | let k = | |
21 | - | if ($isInstanceOf(k, " | |
20 | + | let k = getBinary(this, "contest_currentnumber") | |
21 | + | if ($isInstanceOf(k, "ByteVector")) | |
22 | 22 | then { | |
23 | 23 | let l = k | |
24 | 24 | l | |
25 | 25 | } | |
26 | - | else 0 | |
26 | + | else if ($isInstanceOf(k, "Unit")) | |
27 | + | then base58'2ee4oFDYriWJ9EMeR' | |
28 | + | else throw("Match error") | |
27 | 29 | } | |
28 | - | j | |
30 | + | let m = (((((j + i.transactionId) + i.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)) | |
31 | + | sha256(m) | |
29 | 32 | } | |
30 | 33 | ||
31 | 34 | ||
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) | |
35 | 52 | if ($isInstanceOf(k, "String")) | |
36 | 53 | then { | |
37 | - | let | |
38 | - | | |
54 | + | let q = k | |
55 | + | q | |
39 | 56 | } | |
40 | 57 | else f | |
41 | 58 | } | |
42 | - | | |
59 | + | s | |
43 | 60 | } | |
44 | 61 | ||
45 | 62 | ||
46 | - | @Callable( | |
47 | - | func setContestStatus ( | |
48 | - | let | |
49 | - | let | |
50 | - | if (( | |
63 | + | @Callable(t) | |
64 | + | func setContestStatus (u) = { | |
65 | + | let v = toBase58String(t.caller.bytes) | |
66 | + | let w = n("contest_currentnumber") | |
67 | + | if ((v != d)) | |
51 | 68 | then throw("Only dAPP Owner can set Contest Status.") | |
52 | - | else if (if (( | |
53 | - | then ( | |
69 | + | else if (if ((u != c)) | |
70 | + | then (u != b) | |
54 | 71 | else false) | |
55 | - | then throw(("Invalid status: " + | |
56 | - | else WriteSet([DataEntry((("contest_" + toString( | |
72 | + | then throw(("Invalid status: " + u)) | |
73 | + | else WriteSet([DataEntry((("contest_" + toString(w)) + "_status"), u)]) | |
57 | 74 | } | |
58 | 75 | ||
59 | 76 | ||
60 | 77 | ||
61 | - | @Callable( | |
78 | + | @Callable(t) | |
62 | 79 | func setContestConfiguration () = { | |
63 | - | let | |
64 | - | let | |
65 | - | let | |
66 | - | let | |
67 | - | let | |
68 | - | if (( | |
69 | - | then throw(((("Only dAPP Owner can Configure Contest. Caller account: " + | |
70 | - | else if (( | |
71 | - | then throw(("You cannot configure a new Contest while old Contest status is: " + | |
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)) | |
72 | 89 | else { | |
73 | - | let | |
74 | - | WriteSet([DataEntry("contest_currentnumber", | |
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)]) | |
75 | 92 | } | |
76 | 93 | } | |
77 | 94 | ||
78 | 95 | ||
79 | 96 | ||
80 | - | @Callable( | |
81 | - | func bet ( | |
82 | - | let | |
83 | - | let | |
84 | - | let | |
85 | - | let | |
86 | - | let | |
87 | - | let | |
88 | - | let | |
89 | - | let | |
90 | - | let | |
91 | - | if ((height > ( | |
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)))) | |
92 | 109 | then throw("You cannot bet anymore at this height.") | |
93 | - | else if (( | |
94 | - | then throw(("Invalid status: you cannot bet now, contest status is: " + | |
95 | - | else if (if (( | |
96 | - | then ( | |
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) | |
97 | 114 | else false) | |
98 | - | then throw((("Another | |
99 | - | else if (( | |
100 | - | then throw("You can | |
101 | - | else WriteSet([DataEntry(((("bet_" + toString( | |
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))]) | |
102 | 119 | } | |
103 | 120 | ||
104 | 121 | ||
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 | |
108 | 151 | if (if ($isInstanceOf(k, "SetScriptTransaction")) | |
109 | 152 | then true | |
110 | 153 | else $isInstanceOf(k, "DataTransaction")) | |
111 | - | then sigVerify( | |
154 | + | then sigVerify(K.bodyBytes, K.proofs[0], K.senderPublicKey) | |
112 | 155 | else if ($isInstanceOf(k, "InvokeScriptTransaction")) | |
113 | 156 | then true | |
114 | 157 | else true |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "RUNNING" | |
5 | 5 | ||
6 | 6 | let b = "CLOSED" | |
7 | 7 | ||
8 | 8 | let c = "CANCELED" | |
9 | 9 | ||
10 | 10 | let d = "3NBEbFU6dKpoAcsbaEK2aC62UQMjYFW4xiL" | |
11 | 11 | ||
12 | 12 | let e = "WAVES" | |
13 | 13 | ||
14 | 14 | let f = "NONE" | |
15 | 15 | ||
16 | 16 | let g = 900000 | |
17 | 17 | ||
18 | 18 | func h (i) = { | |
19 | 19 | let j = { | |
20 | - | let k = | |
21 | - | if ($isInstanceOf(k, " | |
20 | + | let k = getBinary(this, "contest_currentnumber") | |
21 | + | if ($isInstanceOf(k, "ByteVector")) | |
22 | 22 | then { | |
23 | 23 | let l = k | |
24 | 24 | l | |
25 | 25 | } | |
26 | - | else 0 | |
26 | + | else if ($isInstanceOf(k, "Unit")) | |
27 | + | then base58'2ee4oFDYriWJ9EMeR' | |
28 | + | else throw("Match error") | |
27 | 29 | } | |
28 | - | j | |
30 | + | let m = (((((j + i.transactionId) + i.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)) | |
31 | + | sha256(m) | |
29 | 32 | } | |
30 | 33 | ||
31 | 34 | ||
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) | |
35 | 52 | if ($isInstanceOf(k, "String")) | |
36 | 53 | then { | |
37 | - | let | |
38 | - | | |
54 | + | let q = k | |
55 | + | q | |
39 | 56 | } | |
40 | 57 | else f | |
41 | 58 | } | |
42 | - | | |
59 | + | s | |
43 | 60 | } | |
44 | 61 | ||
45 | 62 | ||
46 | - | @Callable( | |
47 | - | func setContestStatus ( | |
48 | - | let | |
49 | - | let | |
50 | - | if (( | |
63 | + | @Callable(t) | |
64 | + | func setContestStatus (u) = { | |
65 | + | let v = toBase58String(t.caller.bytes) | |
66 | + | let w = n("contest_currentnumber") | |
67 | + | if ((v != d)) | |
51 | 68 | then throw("Only dAPP Owner can set Contest Status.") | |
52 | - | else if (if (( | |
53 | - | then ( | |
69 | + | else if (if ((u != c)) | |
70 | + | then (u != b) | |
54 | 71 | else false) | |
55 | - | then throw(("Invalid status: " + | |
56 | - | else WriteSet([DataEntry((("contest_" + toString( | |
72 | + | then throw(("Invalid status: " + u)) | |
73 | + | else WriteSet([DataEntry((("contest_" + toString(w)) + "_status"), u)]) | |
57 | 74 | } | |
58 | 75 | ||
59 | 76 | ||
60 | 77 | ||
61 | - | @Callable( | |
78 | + | @Callable(t) | |
62 | 79 | func setContestConfiguration () = { | |
63 | - | let | |
64 | - | let | |
65 | - | let | |
66 | - | let | |
67 | - | let | |
68 | - | if (( | |
69 | - | then throw(((("Only dAPP Owner can Configure Contest. Caller account: " + | |
70 | - | else if (( | |
71 | - | then throw(("You cannot configure a new Contest while old Contest status is: " + | |
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)) | |
72 | 89 | else { | |
73 | - | let | |
74 | - | WriteSet([DataEntry("contest_currentnumber", | |
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)]) | |
75 | 92 | } | |
76 | 93 | } | |
77 | 94 | ||
78 | 95 | ||
79 | 96 | ||
80 | - | @Callable( | |
81 | - | func bet ( | |
82 | - | let | |
83 | - | let | |
84 | - | let | |
85 | - | let | |
86 | - | let | |
87 | - | let | |
88 | - | let | |
89 | - | let | |
90 | - | let | |
91 | - | if ((height > ( | |
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)))) | |
92 | 109 | then throw("You cannot bet anymore at this height.") | |
93 | - | else if (( | |
94 | - | then throw(("Invalid status: you cannot bet now, contest status is: " + | |
95 | - | else if (if (( | |
96 | - | then ( | |
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) | |
97 | 114 | else false) | |
98 | - | then throw((("Another | |
99 | - | else if (( | |
100 | - | then throw("You can | |
101 | - | else WriteSet([DataEntry(((("bet_" + toString( | |
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))]) | |
102 | 119 | } | |
103 | 120 | ||
104 | 121 | ||
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 | |
108 | 151 | if (if ($isInstanceOf(k, "SetScriptTransaction")) | |
109 | 152 | then true | |
110 | 153 | else $isInstanceOf(k, "DataTransaction")) | |
111 | - | then sigVerify( | |
154 | + | then sigVerify(K.bodyBytes, K.proofs[0], K.senderPublicKey) | |
112 | 155 | else if ($isInstanceOf(k, "InvokeScriptTransaction")) | |
113 | 156 | then true | |
114 | 157 | else true | |
115 | 158 | } | |
116 | 159 |
github/deemru/w8io/169f3d6 53.56 ms ◑