tx · EigQthiRcwfkBtqGUVjmvMan6w8tvR4AEjRxD8abDnBX 3N2nCHvKXtFH8RUsGQB4LVEwVEWfTsT5i2B: -0.01400000 Waves 2019.07.14 21:23 [585772] smart account 3N2nCHvKXtFH8RUsGQB4LVEwVEWfTsT5i2B > SELF 0.00000000 Waves
{ "type": 13, "id": "EigQthiRcwfkBtqGUVjmvMan6w8tvR4AEjRxD8abDnBX", "fee": 1400000, "feeAssetId": null, "timestamp": 1563128630922, "version": 1, "sender": "3N2nCHvKXtFH8RUsGQB4LVEwVEWfTsT5i2B", "senderPublicKey": "6NXakHCUpkyyHNuwDVZ4gYubvvbuP2qL6v2WzJhniSN1", "proofs": [ "3496ezq83cmZkDaTmU5VxsFV4Ekw4WEzQaBnDbp24RLiCMf2j6KyKEPPGDh6Fy7jysdzHUxfTzM7Pc9zvB4nJsWV" ], "script": "base64:AAIDAAAAAAAAAAAAAAAdAAAAAAZWT1RFUlMAAAAAAAAAAAQAAAAABlFVT1JVTQAAAAAAAAAAAgAAAAAGVk9USU5HAgAAAAZ2b3RpbmcAAAAABlJFVkVBTAIAAAAGcmV2ZWFsAAAAAAhGRUFUVVJFRAIAAAAIZmVhdHVyZWQAAAAACERFTElTVEVEAgAAAAhkZWxpc3RlZAAAAAAETk9ORQIAAAAEbm9uZQEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABAAAAA2tleQQAAAADbnVtBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABQAAAANudW0BAAAAC2dldFN0ckJ5S2V5AAAAAQAAAANrZXkEAAAAA3N0cgQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQUAAAAETk9OR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laSB2b3RhbnRpIG5vbiDDqCBzdGF0byByYWdnaXVudG8DCQEAAAACIT0AAAACCQEAAAAOZ2V0VmFsdWVSZXZlYWwAAAACBQAAAARpdGVtBQAAAAR1c2VyBQAAAAROT05FCQAAAgAAAAECAAAAK2wndXRlbnRlIGhhIGdpw6AgcGFydGVjaXBhdG8gYWxsYSB2b3RhemlvbmUDAwkBAAAAAiE9AAAAAgUAAAAGc3RhdHVzBQAAAAZSRVZFQUwJAQAAAAIhPQAAAAIFAAAABnN0YXR1cwUAAAAGVk9USU5HBwkAAAIAAAABAgAAAAxTdGF0byBlcnJhdG8DAwkBAAAAAiE9AAAAAgUAAAAEdm90ZQUAAAAIRkVBVFVSRUQJAQAAAAIhPQAAAAIFAAAABHZvdGUFAAAACERFTElTVEVEBwkAAAIAAAABAgAAAAtWb3RvIGVycmF0bwMDCQAAAAAAAAIFAAAABnN0YXR1cwUAAAAIRkVBVFVSRUQGCQAAAAAAAAIFAAAABnN0YXR1cwUAAAAIREVMSVNURUQJAAACAAAAAQIAAAAbTGEgdm90YXppb25lIHNpIMOoIGNvbmNsdXNhCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAAMZ2V0S2V5UmV2ZWFsAAAAAgUAAAAEaXRlbQUAAAAEdXNlcgUAAAAEdm90ZQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAAD2dldEtleVZvdGVDb3VudAAAAAIFAAAABGl0ZW0FAAAABHZvdGUFAAAADG5ld1ZvdGVDb3VudAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAAEGdldEtleUl0ZW1TdGF0dXMAAAABBQAAAARpdGVtAwkAAGcAAAACBQAAAAxuZXdWb3RlQ291bnQFAAAABlFVT1JVTQUAAAAGVk9USU5HBQAAAAZSRVZFQUwFAAAAA25pbAAAAABcoM7w", "chainId": 84, "height": 585772, "spentComplexity": 0 } View: original | compacted Prev: BxAEFqLpLBmo8f6CiSvR8bTZPV5huyXPYvesVwkSBmJc Next: B4W5ixJoUcMmMq8uWTFLKxieQJmpjbE7UgW8Vo32Tat5 Diff:
Old | New | Differences | |
---|---|---|---|
117 | 117 | else if (if ((R != g)) | |
118 | 118 | then (R != c) | |
119 | 119 | else false) | |
120 | - | then throw("Votazione non possibile") | |
120 | + | then throw(("Votazione non possibile " + R)) | |
121 | 121 | else { | |
122 | 122 | let S = (Q + 1) | |
123 | 123 | WriteSet([DataEntry(o(p, q), P), DataEntry(s(p), S), DataEntry(w(p), if ((S == a)) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = 4 | |
5 | 5 | ||
6 | 6 | let b = 2 | |
7 | 7 | ||
8 | 8 | let c = "voting" | |
9 | 9 | ||
10 | 10 | let d = "reveal" | |
11 | 11 | ||
12 | 12 | let e = "featured" | |
13 | 13 | ||
14 | 14 | let f = "delisted" | |
15 | 15 | ||
16 | 16 | let g = "none" | |
17 | 17 | ||
18 | 18 | func h (i) = { | |
19 | 19 | let j = { | |
20 | 20 | let k = getInteger(this, i) | |
21 | 21 | if ($isInstanceOf(k, "Int")) | |
22 | 22 | then { | |
23 | 23 | let l = k | |
24 | 24 | l | |
25 | 25 | } | |
26 | 26 | else 0 | |
27 | 27 | } | |
28 | 28 | j | |
29 | 29 | } | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func m (i) = { | |
33 | 33 | let n = { | |
34 | 34 | let k = getString(this, i) | |
35 | 35 | if ($isInstanceOf(k, "String")) | |
36 | 36 | then { | |
37 | 37 | let l = k | |
38 | 38 | l | |
39 | 39 | } | |
40 | 40 | else g | |
41 | 41 | } | |
42 | 42 | n | |
43 | 43 | } | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func o (p,q) = (((p + "_") + q) + "_commit") | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func r (p,q) = m(o(p, q)) | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func s (p) = (p + "_commit_count") | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func t (p) = h(s(p)) | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func u (p,q) = (((p + "_") + q) + "_reveal") | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func v (p,q) = m(u(p, q)) | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func w (p) = (p + "_status") | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func x (p) = m(w(p)) | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func y (p,z) = ((p + "_res_") + z) | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func A (p,z) = h(y(p, z)) | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func B (p) = (p + "_price") | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func C (p) = h(B(p)) | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func D (q,p) = (((p + "_") + q) + "_cnt") | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func E (q,p) = h(D(q, p)) | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func F (G,H) = ("item_" + toBase58String(sha256(toBytes((G + H))))) | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func I (p) = (p + "_data") | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func J (p) = (p + "_owner") | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func K (p) = m(J(p)) | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func L (M) = (M + "_balance") | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | func N (M) = h(L(M)) | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | @Callable(O) | |
107 | 107 | func voteCommit (p,P) = { | |
108 | 108 | let q = toBase58String(O.caller.bytes) | |
109 | 109 | let Q = t(p) | |
110 | 110 | let R = x(p) | |
111 | 111 | if ((Q >= a)) | |
112 | 112 | then throw("Raggiunto il numero massimo di voti") | |
113 | 113 | else if ((r(p, q) != g)) | |
114 | 114 | then throw("Hai già espresso un voto per questo articolo") | |
115 | 115 | else if ((J(p) == g)) | |
116 | 116 | then throw("L'articolo che vuoi votare non esiste") | |
117 | 117 | else if (if ((R != g)) | |
118 | 118 | then (R != c) | |
119 | 119 | else false) | |
120 | - | then throw("Votazione non possibile") | |
120 | + | then throw(("Votazione non possibile " + R)) | |
121 | 121 | else { | |
122 | 122 | let S = (Q + 1) | |
123 | 123 | WriteSet([DataEntry(o(p, q), P), DataEntry(s(p), S), DataEntry(w(p), if ((S == a)) | |
124 | 124 | then d | |
125 | 125 | else c)]) | |
126 | 126 | } | |
127 | 127 | } | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | ||
131 | 131 | @Callable(O) | |
132 | 132 | func voteReveal (p,z,T) = { | |
133 | 133 | let q = toBase58String(O.caller.bytes) | |
134 | 134 | let R = x(p) | |
135 | 135 | let U = (A(p, z) + 1) | |
136 | 136 | if ((toBase58String(sha256(toBytes((z + T)))) != r(p, q))) | |
137 | 137 | then throw("Reveal data is not valid") | |
138 | 138 | else if ((a > t(p))) | |
139 | 139 | then throw("Il numero massimo dei votanti non è stato raggiunto") | |
140 | 140 | else if ((v(p, q) != g)) | |
141 | 141 | then throw("l'utente ha già partecipato alla votazione") | |
142 | 142 | else if (if ((R != d)) | |
143 | 143 | then (R != c) | |
144 | 144 | else false) | |
145 | 145 | then throw("Stato errato") | |
146 | 146 | else if (if ((z != e)) | |
147 | 147 | then (z != f) | |
148 | 148 | else false) | |
149 | 149 | then throw("Voto errato") | |
150 | 150 | else if (if ((R == e)) | |
151 | 151 | then true | |
152 | 152 | else (R == f)) | |
153 | 153 | then throw("La votazione si è conclusa") | |
154 | 154 | else WriteSet([DataEntry(u(p, q), z), DataEntry(y(p, z), U), DataEntry(w(p), if ((U >= b)) | |
155 | 155 | then c | |
156 | 156 | else d)]) | |
157 | 157 | } | |
158 | 158 | ||
159 | 159 |
github/deemru/w8io/026f985 34.81 ms ◑