tx · 8YVQTvj68zepSUv9UznKyuNaQGYJYwQPRxwvoDivMJA 3MpjwMAGCaNqNFRa34foE5sTfV6zb76bYja: -0.01000010 Waves 2021.07.07 16:42 [1603249] smart account 3MpjwMAGCaNqNFRa34foE5sTfV6zb76bYja > SELF 0.00000000 Waves
{ "type": 13, "id": "8YVQTvj68zepSUv9UznKyuNaQGYJYwQPRxwvoDivMJA", "fee": 1000010, "feeAssetId": null, "timestamp": 1625665410990, "version": 2, "chainId": 84, "sender": "3MpjwMAGCaNqNFRa34foE5sTfV6zb76bYja", "senderPublicKey": "7Cy4wXHvgCRHP6MMhu9tTdayLHr9P9Dc342DVcCoCPzm", "proofs": [ "4538zkyXPMkzFYuKkeRazdoMqLT9k48dVyY1YCThT31hxQDVNbbvqvkAJPAwMJEQqkthD5kXBUTL1oCkzQFgwEg3" ], "script": "base64:AAIFAAAAAAAAAlEIAhIECgIICBIFCgMICAgaDAoCYTESBlZPVEVSUxoMCgJhMhIGUVVPUlVNGgwKAmEzEgZWT1RJTkcaDAoCYTQSBlJFVkVBTBoOCgJhNRIIRkVBVFVSRUQaDgoCYTYSCERFTElTVEVEGgoKAmE3EgROT05FGhQKAmE4Eg5nZXROdW1iZXJCeUtleRoJCgJhORIDa2V5GgkKAmIxEgNudW0aDQoCYjISByRtYXRjaDAaBwoCYjMSAWEaEQoCYjQSC2dldFN0ckJ5S2V5GgkKAmI1EgNzdHIaGAoCYjYSEmdldEtleUl0ZW1TdXBwbGllchoKCgJiNxIEaXRlbRoSCgJiOBIMZ2V0S2V5Q29tbWl0GgoKAmI5EgR1c2VyGhQKAmMxEg5nZXRWYWx1ZUNvbW1pdBoYCgJjMhISZ2V0S2V5Q29tbWl0c0NvdW50GhoKAmMzEhRnZXRWYWx1ZUNvbW1pdHNDb3VudBoSCgJjNBIMZ2V0S2V5UmV2ZWFsGhQKAmM1Eg5nZXRWYWx1ZVJldmVhbBoWCgJjNhIQZ2V0S2V5SXRlbVN0YXR1cxoYCgJjNxISZ2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kBAAAAAiE9AAAAAgUAAAACYzkFAAAAAmE2BwkAAAIAAAABAgAAABF2b3RlIGhhcyBmaW5pc2hlZAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQEAAAACYzQAAAACBQAAAAJiNwUAAAACYjkFAAAAAmM5CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQEAAAACYzgAAAACBQAAAAJiNwUAAAACYzkFAAAAAmQ3CQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAQAAAAJjNgAAAAEFAAAAAmI3AwkAAGcAAAACBQAAAAJkNwUAAAACYTIFAAAAAmM5BQAAAAJhNAUAAAADbmlsAAAAABsO9M0=", "height": 1603249, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DwFK241mEgQAXuVhGhBdwJkQdwmeZ1X8F3iTQ4RvM2uu Next: GHW7a3uPTqoVsjsSsVqXxaUB1F5sMfeFbaFrqL61PVZA Diff:
Old | New | Differences | |
---|---|---|---|
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = 3 | |
5 | 5 | ||
6 | - | let b = | |
6 | + | let b = 2 | |
7 | 7 | ||
8 | - | let c = " | |
8 | + | let c = "voting" | |
9 | 9 | ||
10 | - | let d = " | |
10 | + | let d = "reveal" | |
11 | 11 | ||
12 | - | func e (f) = { | |
13 | - | let g = { | |
14 | - | let h = getInteger(this, f) | |
15 | - | if ($isInstanceOf(h, "Int")) | |
12 | + | let e = "featured" | |
13 | + | ||
14 | + | let f = "delisted" | |
15 | + | ||
16 | + | let g = "none" | |
17 | + | ||
18 | + | func h (i) = { | |
19 | + | let j = { | |
20 | + | let k = getInteger(this, i) | |
21 | + | if ($isInstanceOf(k, "Int")) | |
16 | 22 | then { | |
17 | - | let | |
18 | - | | |
23 | + | let l = k | |
24 | + | l | |
19 | 25 | } | |
20 | 26 | else 0 | |
21 | 27 | } | |
22 | - | | |
28 | + | j | |
23 | 29 | } | |
24 | 30 | ||
25 | 31 | ||
26 | - | func | |
27 | - | let | |
28 | - | let | |
29 | - | if ($isInstanceOf( | |
32 | + | func m (i) = { | |
33 | + | let n = { | |
34 | + | let k = getString(this, i) | |
35 | + | if ($isInstanceOf(k, "String")) | |
30 | 36 | then { | |
31 | - | let | |
32 | - | | |
37 | + | let l = k | |
38 | + | l | |
33 | 39 | } | |
34 | - | else | |
40 | + | else g | |
35 | 41 | } | |
36 | - | | |
42 | + | n | |
37 | 43 | } | |
38 | 44 | ||
39 | 45 | ||
40 | - | func | |
46 | + | func o (p) = (p + "_data") | |
41 | 47 | ||
42 | 48 | ||
43 | - | func | |
49 | + | func q (p,r) = (((p + "_") + r) + "_commit") | |
44 | 50 | ||
45 | 51 | ||
46 | - | func | |
52 | + | func s (p,r) = m(q(p, r)) | |
47 | 53 | ||
48 | 54 | ||
49 | - | func | |
55 | + | func t (p) = (p + "_comcnt") | |
50 | 56 | ||
51 | 57 | ||
52 | - | func | |
58 | + | func u (p) = h(t(p)) | |
53 | 59 | ||
54 | 60 | ||
55 | - | func | |
61 | + | func v (p,r) = (((p + "_") + r) + "_reveal") | |
56 | 62 | ||
57 | 63 | ||
58 | - | func | |
64 | + | func w (p,r) = m(v(p, r)) | |
59 | 65 | ||
60 | 66 | ||
61 | - | @Callable(u) | |
62 | - | func voteCommit (m,v) = { | |
63 | - | let o = toBase58String(u.caller.bytes) | |
64 | - | let w = r(m) | |
65 | - | let x = t(m) | |
66 | - | if ((w >= a)) | |
67 | + | func x (p) = (p + "_status") | |
68 | + | ||
69 | + | ||
70 | + | func y (p) = m(x(p)) | |
71 | + | ||
72 | + | ||
73 | + | func z (p,A) = ((p + "_res:") + A) | |
74 | + | ||
75 | + | ||
76 | + | func B (p,A) = h(z(p, A)) | |
77 | + | ||
78 | + | ||
79 | + | @Callable(C) | |
80 | + | func voteCommit (p,D) = { | |
81 | + | let r = toBase58String(C.caller.bytes) | |
82 | + | let E = u(p) | |
83 | + | let F = y(p) | |
84 | + | if ((E >= a)) | |
67 | 85 | then throw("osiągnięto maksymaną liczbę głosujących") | |
68 | - | else if ((p | |
86 | + | else if ((s(p, r) != g)) | |
69 | 87 | then throw("użtykownik już głosuje") | |
70 | - | else if (( | |
88 | + | else if ((o(p) == g)) | |
71 | 89 | then throw("nie istnieje taki przedmiot") | |
72 | - | else if (if (( | |
73 | - | then ( | |
90 | + | else if (if ((F != g)) | |
91 | + | then (F != c) | |
74 | 92 | else false) | |
75 | 93 | then throw("głosowanie nie jest możliwe") | |
76 | - | else [StringEntry(n(m, o), v), IntegerEntry(q(m), (w + 1)), StringEntry(s(m), if ((w == a)) | |
77 | - | then c | |
78 | - | else b)] | |
94 | + | else [StringEntry(q(p, r), D), IntegerEntry(t(p), (E + 1)), StringEntry(x(p), if ((E == a)) | |
95 | + | then d | |
96 | + | else c)] | |
97 | + | } | |
98 | + | ||
99 | + | ||
100 | + | ||
101 | + | @Callable(C) | |
102 | + | func voteReveal (p,A,G) = { | |
103 | + | let r = toBase58String(C.caller.bytes) | |
104 | + | let F = y(p) | |
105 | + | let H = (B(p, A) + 1) | |
106 | + | if ((toBase58String(sha256(toBytes((A + G)))) != s(p, r))) | |
107 | + | then throw("reveal data is not valid") | |
108 | + | else if ((a > u(p))) | |
109 | + | then throw("max number of voters hasn't reached yet") | |
110 | + | else if ((w(p, r) != g)) | |
111 | + | then throw("user has already participated") | |
112 | + | else if (if ((F != c)) | |
113 | + | then (F != d) | |
114 | + | else false) | |
115 | + | then throw("wrong status") | |
116 | + | else if (if ((A != e)) | |
117 | + | then (A != f) | |
118 | + | else false) | |
119 | + | then throw("vote has finished") | |
120 | + | else [StringEntry(v(p, r), A), IntegerEntry(z(p, A), H), StringEntry(x(p), if ((H >= b)) | |
121 | + | then A | |
122 | + | else d)] | |
79 | 123 | } | |
80 | 124 | ||
81 | 125 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = 3 | |
5 | 5 | ||
6 | - | let b = | |
6 | + | let b = 2 | |
7 | 7 | ||
8 | - | let c = " | |
8 | + | let c = "voting" | |
9 | 9 | ||
10 | - | let d = " | |
10 | + | let d = "reveal" | |
11 | 11 | ||
12 | - | func e (f) = { | |
13 | - | let g = { | |
14 | - | let h = getInteger(this, f) | |
15 | - | if ($isInstanceOf(h, "Int")) | |
12 | + | let e = "featured" | |
13 | + | ||
14 | + | let f = "delisted" | |
15 | + | ||
16 | + | let g = "none" | |
17 | + | ||
18 | + | func h (i) = { | |
19 | + | let j = { | |
20 | + | let k = getInteger(this, i) | |
21 | + | if ($isInstanceOf(k, "Int")) | |
16 | 22 | then { | |
17 | - | let | |
18 | - | | |
23 | + | let l = k | |
24 | + | l | |
19 | 25 | } | |
20 | 26 | else 0 | |
21 | 27 | } | |
22 | - | | |
28 | + | j | |
23 | 29 | } | |
24 | 30 | ||
25 | 31 | ||
26 | - | func | |
27 | - | let | |
28 | - | let | |
29 | - | if ($isInstanceOf( | |
32 | + | func m (i) = { | |
33 | + | let n = { | |
34 | + | let k = getString(this, i) | |
35 | + | if ($isInstanceOf(k, "String")) | |
30 | 36 | then { | |
31 | - | let | |
32 | - | | |
37 | + | let l = k | |
38 | + | l | |
33 | 39 | } | |
34 | - | else | |
40 | + | else g | |
35 | 41 | } | |
36 | - | | |
42 | + | n | |
37 | 43 | } | |
38 | 44 | ||
39 | 45 | ||
40 | - | func | |
46 | + | func o (p) = (p + "_data") | |
41 | 47 | ||
42 | 48 | ||
43 | - | func | |
49 | + | func q (p,r) = (((p + "_") + r) + "_commit") | |
44 | 50 | ||
45 | 51 | ||
46 | - | func | |
52 | + | func s (p,r) = m(q(p, r)) | |
47 | 53 | ||
48 | 54 | ||
49 | - | func | |
55 | + | func t (p) = (p + "_comcnt") | |
50 | 56 | ||
51 | 57 | ||
52 | - | func | |
58 | + | func u (p) = h(t(p)) | |
53 | 59 | ||
54 | 60 | ||
55 | - | func | |
61 | + | func v (p,r) = (((p + "_") + r) + "_reveal") | |
56 | 62 | ||
57 | 63 | ||
58 | - | func | |
64 | + | func w (p,r) = m(v(p, r)) | |
59 | 65 | ||
60 | 66 | ||
61 | - | @Callable(u) | |
62 | - | func voteCommit (m,v) = { | |
63 | - | let o = toBase58String(u.caller.bytes) | |
64 | - | let w = r(m) | |
65 | - | let x = t(m) | |
66 | - | if ((w >= a)) | |
67 | + | func x (p) = (p + "_status") | |
68 | + | ||
69 | + | ||
70 | + | func y (p) = m(x(p)) | |
71 | + | ||
72 | + | ||
73 | + | func z (p,A) = ((p + "_res:") + A) | |
74 | + | ||
75 | + | ||
76 | + | func B (p,A) = h(z(p, A)) | |
77 | + | ||
78 | + | ||
79 | + | @Callable(C) | |
80 | + | func voteCommit (p,D) = { | |
81 | + | let r = toBase58String(C.caller.bytes) | |
82 | + | let E = u(p) | |
83 | + | let F = y(p) | |
84 | + | if ((E >= a)) | |
67 | 85 | then throw("osiągnięto maksymaną liczbę głosujących") | |
68 | - | else if ((p | |
86 | + | else if ((s(p, r) != g)) | |
69 | 87 | then throw("użtykownik już głosuje") | |
70 | - | else if (( | |
88 | + | else if ((o(p) == g)) | |
71 | 89 | then throw("nie istnieje taki przedmiot") | |
72 | - | else if (if (( | |
73 | - | then ( | |
90 | + | else if (if ((F != g)) | |
91 | + | then (F != c) | |
74 | 92 | else false) | |
75 | 93 | then throw("głosowanie nie jest możliwe") | |
76 | - | else [StringEntry(n(m, o), v), IntegerEntry(q(m), (w + 1)), StringEntry(s(m), if ((w == a)) | |
77 | - | then c | |
78 | - | else b)] | |
94 | + | else [StringEntry(q(p, r), D), IntegerEntry(t(p), (E + 1)), StringEntry(x(p), if ((E == a)) | |
95 | + | then d | |
96 | + | else c)] | |
97 | + | } | |
98 | + | ||
99 | + | ||
100 | + | ||
101 | + | @Callable(C) | |
102 | + | func voteReveal (p,A,G) = { | |
103 | + | let r = toBase58String(C.caller.bytes) | |
104 | + | let F = y(p) | |
105 | + | let H = (B(p, A) + 1) | |
106 | + | if ((toBase58String(sha256(toBytes((A + G)))) != s(p, r))) | |
107 | + | then throw("reveal data is not valid") | |
108 | + | else if ((a > u(p))) | |
109 | + | then throw("max number of voters hasn't reached yet") | |
110 | + | else if ((w(p, r) != g)) | |
111 | + | then throw("user has already participated") | |
112 | + | else if (if ((F != c)) | |
113 | + | then (F != d) | |
114 | + | else false) | |
115 | + | then throw("wrong status") | |
116 | + | else if (if ((A != e)) | |
117 | + | then (A != f) | |
118 | + | else false) | |
119 | + | then throw("vote has finished") | |
120 | + | else [StringEntry(v(p, r), A), IntegerEntry(z(p, A), H), StringEntry(x(p), if ((H >= b)) | |
121 | + | then A | |
122 | + | else d)] | |
79 | 123 | } | |
80 | 124 | ||
81 | 125 |
github/deemru/w8io/169f3d6 63.94 ms ◑