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