tx · 4bDx9CWuGRtNFD9Yd668p1zxN4Amzhz7XcDgZUzJXs3w 3N9gJ74bD96G8fMq5smzXvLXSq8JfLJAtwD: -0.01400000 Waves 2019.07.03 11:12 [568979] smart account 3N9gJ74bD96G8fMq5smzXvLXSq8JfLJAtwD > SELF 0.00000000 Waves
{ "type": 13, "id": "4bDx9CWuGRtNFD9Yd668p1zxN4Amzhz7XcDgZUzJXs3w", "fee": 1400000, "feeAssetId": null, "timestamp": 1562141606663, "version": 1, "sender": "3N9gJ74bD96G8fMq5smzXvLXSq8JfLJAtwD", "senderPublicKey": "Du28dC9gJhbPxUVfdZMHFfBWfWfR28ihAMcqXh5tHqwK", "proofs": [ "3PPqfidRNrzWRvVfVLbQ5pFvV7ZKCbJPW4wYbSS1KkiQdjjGNLWU2GG7tHFPgDbD9hjCYFYax1Hy8xxk7dgFQP1H" ], "script": "base64:AAIDAAAAAAAAAAAAAAAhAAAAAAROT05FAgAAAARub25lAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAANudW0EAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAFAAAAA251bQEAAAALZ2V0U3RyQnlLZXkAAAABAAAAA2tleQQAAAADc3RyBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhBQAAAAROT05FBQAAAANzdHIBAAAAD2dldEtleUl0ZW1QcmljZQAAAAEAAAAEaXRlbQkAASwAAAACBQAAAARpdGVtAgAAAAZfcHJpY2UBAAAAEWdldFZhbHVlSXRlbVByaWNlAAAAAQAAAARpdGVtCQEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABCQEAAAAPZ2V0S2V5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Complexity": 0 } View: original | compacted Prev: FxUqGZMEV9x5PTTTEvSfLNQDzFEK6C56jBKHEnWL87EM Next: none Diff:
Old | New | Differences | |
---|---|---|---|
134 | 134 | then throw("purchase amount cannot be less than item price") | |
135 | 135 | else if ((t(j) != a)) | |
136 | 136 | then throw("an item is already exist") | |
137 | - | else WriteSet([DataEntry(s(j), W), DataEntry(i(j), U), DataEntry(r(j), V)]) | |
137 | + | else if ((X == P)) | |
138 | + | then throw("supplier's account has been blacklisted") | |
139 | + | else WriteSet([DataEntry(s(j), W), DataEntry(i(j), U), DataEntry(r(j), V)]) | |
138 | 140 | } | |
139 | 141 | ||
140 | 142 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "none" | |
5 | 5 | ||
6 | 6 | func b (c) = { | |
7 | 7 | let d = { | |
8 | 8 | let e = getInteger(this, c) | |
9 | 9 | if ($isInstanceOf(e, "Int")) | |
10 | 10 | then { | |
11 | 11 | let f = e | |
12 | 12 | f | |
13 | 13 | } | |
14 | 14 | else 0 | |
15 | 15 | } | |
16 | 16 | d | |
17 | 17 | } | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func g (c) = { | |
21 | 21 | let h = { | |
22 | 22 | let e = getString(this, c) | |
23 | 23 | if ($isInstanceOf(e, "String")) | |
24 | 24 | then { | |
25 | 25 | let f = e | |
26 | 26 | f | |
27 | 27 | } | |
28 | 28 | else a | |
29 | 29 | } | |
30 | 30 | h | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func i (j) = (j + "_price") | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | func k (j) = b(i(j)) | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func l (m,j) = (((j + "_") + m) + "_cnt") | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func n (m,j) = b(l(m, j)) | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func o (p,q) = ("item_" + toBase58String(sha256(toBytes((p + q))))) | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func r (j) = (j + "_data") | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func s (j) = (j + "_owner") | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func t (j) = g(s(j)) | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func u (v) = (v + "_balance") | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func w (v) = b(u(v)) | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | let x = 3 | |
65 | 65 | ||
66 | 66 | let y = 2 | |
67 | 67 | ||
68 | 68 | let z = "voting" | |
69 | 69 | ||
70 | 70 | let A = "reveal" | |
71 | 71 | ||
72 | 72 | let B = "featured" | |
73 | 73 | ||
74 | 74 | let C = "delisted" | |
75 | 75 | ||
76 | 76 | func D (j,m) = (((j + "_") + m) + "_commit") | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func E (j,m) = g(D(j, m)) | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func F (j) = (j + "_comcnt") | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func G (j) = b(F(j)) | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func H (j,m) = (((j + "_") + m) + "_reveal") | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func I (j,m) = g(H(j, m)) | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func J (j) = (j + "_status") | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func K (j) = g(J(j)) | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func L (j,M) = ((j + "_res:") + M) | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | func N (j,M) = b(L(j, M)) | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | func O () = extract(addressFromString("3MrEbuyPRf2S5YYhkgBhaec4EZxo5SvJycM")) | |
107 | 107 | ||
108 | 108 | ||
109 | 109 | let P = "blacklist" | |
110 | 110 | ||
111 | 111 | func Q (v) = (v + "_verifier_status") | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func R (S,v) = { | |
115 | 115 | let h = { | |
116 | 116 | let e = getString(S, Q(v)) | |
117 | 117 | if ($isInstanceOf(e, "String")) | |
118 | 118 | then { | |
119 | 119 | let f = e | |
120 | 120 | f | |
121 | 121 | } | |
122 | 122 | else a | |
123 | 123 | } | |
124 | 124 | h | |
125 | 125 | } | |
126 | 126 | ||
127 | 127 | ||
128 | 128 | @Callable(T) | |
129 | 129 | func addItem (q,U,V) = { | |
130 | 130 | let W = toBase58String(T.caller.bytes) | |
131 | 131 | let j = o(W, q) | |
132 | 132 | let X = R(O(), W) | |
133 | 133 | if ((0 >= U)) | |
134 | 134 | then throw("purchase amount cannot be less than item price") | |
135 | 135 | else if ((t(j) != a)) | |
136 | 136 | then throw("an item is already exist") | |
137 | - | else WriteSet([DataEntry(s(j), W), DataEntry(i(j), U), DataEntry(r(j), V)]) | |
137 | + | else if ((X == P)) | |
138 | + | then throw("supplier's account has been blacklisted") | |
139 | + | else WriteSet([DataEntry(s(j), W), DataEntry(i(j), U), DataEntry(r(j), V)]) | |
138 | 140 | } | |
139 | 141 | ||
140 | 142 | ||
141 | 143 | ||
142 | 144 | @Callable(T) | |
143 | 145 | func purchase (j) = { | |
144 | 146 | let Y = extract(T.payment) | |
145 | 147 | if (isDefined(Y.assetId)) | |
146 | 148 | then throw("WAVES tokens only at the moment") | |
147 | 149 | else { | |
148 | 150 | let Z = toBase58String(T.caller.bytes) | |
149 | 151 | let U = k(j) | |
150 | 152 | let W = t(j) | |
151 | 153 | if ((U > Y.amount)) | |
152 | 154 | then throw("purchase amount cannot be less than item price") | |
153 | 155 | else if ((Y.amount > U)) | |
154 | 156 | then throw("purchase amount cannot be highter than item price") | |
155 | 157 | else if ((W == a)) | |
156 | 158 | then throw("supplier does not exist") | |
157 | 159 | else WriteSet([DataEntry(l(Z, j), (n(Z, j) + 1)), DataEntry(u(W), (w(W) + Y.amount))]) | |
158 | 160 | } | |
159 | 161 | } | |
160 | 162 | ||
161 | 163 | ||
162 | 164 | ||
163 | 165 | @Callable(T) | |
164 | 166 | func withdraw () = { | |
165 | 167 | let W = toBase58String(T.caller.bytes) | |
166 | 168 | let aa = w(W) | |
167 | 169 | if ((0 >= aa)) | |
168 | 170 | then throw("insufficient balance") | |
169 | 171 | else ScriptResult(WriteSet([DataEntry(u(W), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(W), aa, unit)])) | |
170 | 172 | } | |
171 | 173 | ||
172 | 174 | ||
173 | 175 | ||
174 | 176 | @Callable(T) | |
175 | 177 | func voteCommit (j,ab) = { | |
176 | 178 | let m = toBase58String(T.caller.bytes) | |
177 | 179 | let ac = G(j) | |
178 | 180 | let ad = K(j) | |
179 | 181 | if ((ac >= x)) | |
180 | 182 | then throw("reached max num of voters") | |
181 | 183 | else if ((E(j, m) != a)) | |
182 | 184 | then throw("user has already participated") | |
183 | 185 | else if (if ((ad != a)) | |
184 | 186 | then (ad != z) | |
185 | 187 | else false) | |
186 | 188 | then throw("voting is not possible") | |
187 | 189 | else WriteSet([DataEntry(D(j, m), ab), DataEntry(F(j), (ac + 1)), DataEntry(J(j), if ((ac == x)) | |
188 | 190 | then A | |
189 | 191 | else z)]) | |
190 | 192 | } | |
191 | 193 | ||
192 | 194 | ||
193 | 195 | ||
194 | 196 | @Callable(T) | |
195 | 197 | func voteReveal (j,M,ae) = { | |
196 | 198 | let m = toBase58String(T.caller.bytes) | |
197 | 199 | let ad = K(j) | |
198 | 200 | let af = (N(j, M) + 1) | |
199 | 201 | if ((toBase58String(sha256(toBytes((M + ae)))) != E(j, m))) | |
200 | 202 | then throw("reveal data is not valid") | |
201 | 203 | else if ((x > G(j))) | |
202 | 204 | then throw("max num of voters hasn't reached yet") | |
203 | 205 | else if ((I(j, m) != a)) | |
204 | 206 | then throw("user has already participated") | |
205 | 207 | else if (if ((ad != z)) | |
206 | 208 | then (ad != A) | |
207 | 209 | else false) | |
208 | 210 | then throw("wrong status") | |
209 | 211 | else if (if ((M != B)) | |
210 | 212 | then (M != C) | |
211 | 213 | else false) | |
212 | 214 | then throw("wrong vote") | |
213 | 215 | else if (if ((ad == B)) | |
214 | 216 | then true | |
215 | 217 | else (ad == C)) | |
216 | 218 | then throw("vote has finished") | |
217 | 219 | else WriteSet([DataEntry(H(j, m), M), DataEntry(L(j, M), af), DataEntry(J(j), if ((af >= y)) | |
218 | 220 | then M | |
219 | 221 | else A)]) | |
220 | 222 | } | |
221 | 223 | ||
222 | 224 |
github/deemru/w8io/026f985 31.27 ms ◑