tx · 6N8Je9stNvh5QMAWrtxEdmPHFDBC87GNQvtuzeq5ocTA 3N1NcGcztR7MMNbTmtNv96A9Q75b3foNWtk: -0.01400000 Waves 2019.07.08 16:43 [576709] smart account 3N1NcGcztR7MMNbTmtNv96A9Q75b3foNWtk > SELF 0.00000000 Waves
{ "type": 13, "id": "6N8Je9stNvh5QMAWrtxEdmPHFDBC87GNQvtuzeq5ocTA", "fee": 1400000, "feeAssetId": null, "timestamp": 1562593496290, "version": 1, "sender": "3N1NcGcztR7MMNbTmtNv96A9Q75b3foNWtk", "senderPublicKey": "G2s7RQed7v8vaaSdJUzzvKbooceGFVF9y5SPF2pww4Vu", "proofs": [ "45eVdQogR5deMsKdmrAT86oJmETLxkr5DUiLvyiowVXwMCeNU5NTjfjaeytfMhpGq8LMVJ6LNB3BudPC8thcJUab" ], "script": "base64:AAIDAAAAAAAAAAAAAAAhAAAAAAZWT1RFUlMAAAAAAAAAAAMAAAAABlFVT1JVTQAAAAAAAAAAAgAAAAAGVk9USU5HAgAAAAZ2b3RpbmcAAAAABlJFVkVBTAIAAAAGcmV2ZWFsAAAAAAhGRUFUVVJFRAIAAAAIZmVhdHVyZWQAAAAACERFTElTVEVEAgAAAAhkZWxpc3RlZAAAAAAETk9ORQIAAAAEbm9uZQEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABAAAAA2tleQQAAAADbnVtBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABQAAAANudW0BAAAAC2dldFN0ckJ5S2V5AAAAAQAAAANrZXkEAAAAA3N0cgQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQUAAAAETk9ORQUAAAADc3RyAQ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gUAAAAEaXRlbQUAAAAEdm90ZQUAAAAMbmV3Vm90ZUNvdW50CQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAAQZ2V0S2V5SXRlbVN0YXR1cwAAAAEFAAAABGl0ZW0DCQAAZwAAAAIFAAAADG5ld1ZvdGVDb3VudAUAAAAGUVVPUlVNBQAAAAR2b3RlBQAAAAZSRVZFQUwFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAEAAAAByRtYXRjaDAFAAAAAnR4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgQAAAABZAUAAAAHJG1hdGNoMAYDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAD0RhdGFUcmFuc2FjdGlvbgQAAAABZAUAAAAHJG1hdGNoMAYDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAE1RyYW5zZmVyVHJhbnNhY3Rpb24EAAAAAWQFAAAAByRtYXRjaDAGBjLkqcI=", "chainId": 84, "height": 576709, "spentComplexity": 0 } View: original | compacted Prev: 8gsk83P8XCnpqsU52DxvEoZYqqjZmYkCjnpUks9PXbv9 Next: 5YQv2bZ7kt75bcNhsFzonMMpua6tV5Rka2kCf1wBLBH5 Diff:
Old | New | Differences | |
---|---|---|---|
129 | 129 | func addItem (w,U,V) = { | |
130 | 130 | let W = toBase58String(T.caller.bytes) | |
131 | 131 | let p = u(W, w) | |
132 | + | let X = R(P(), W) | |
132 | 133 | if ((0 >= U)) | |
133 | 134 | then throw("purchase amount cannot be higher than item pice") | |
134 | 135 | else if ((z(p) != g)) | |
135 | 136 | then throw("an item is already exist") | |
136 | - | else WriteSet([DataEntry(y(p), W), DataEntry(o(p), U), DataEntry(x(p), V)]) | |
137 | + | else if ((X == O)) | |
138 | + | then throw("supplier's account as been blacklisted") | |
139 | + | else WriteSet([DataEntry(y(p), W), DataEntry(o(p), U), DataEntry(x(p), V), DataEntry(Q(W), X)]) | |
137 | 140 | } | |
138 | 141 | ||
139 | 142 | ||
140 | 143 | ||
141 | 144 | @Callable(T) | |
142 | 145 | func purchase (p) = { | |
143 | - | let | |
144 | - | if (isDefined( | |
146 | + | let Y = extract(T.payment) | |
147 | + | if (isDefined(Y.assetId)) | |
145 | 148 | then throw("Waves tokens only at the moment") | |
146 | 149 | else { | |
147 | - | let | |
150 | + | let Z = toBase58String(T.caller.bytes) | |
148 | 151 | let U = q(p) | |
149 | 152 | let W = z(p) | |
150 | - | if ((U > | |
153 | + | if ((U > Y.amount)) | |
151 | 154 | then throw("purchase amount cannot be less than item price") | |
152 | - | else if (( | |
155 | + | else if ((Y.amount > U)) | |
153 | 156 | then throw("purchase amount cannot be higher than item price") | |
154 | 157 | else if ((W == g)) | |
155 | 158 | then throw("supplier does not exist") | |
156 | - | else WriteSet([DataEntry(r( | |
159 | + | else WriteSet([DataEntry(r(Z, p), (t(Z, p) + 1)), DataEntry(A(W), (C(W) + Y.amount))]) | |
157 | 160 | } | |
158 | 161 | } | |
159 | 162 | ||
162 | 165 | @Callable(T) | |
163 | 166 | func withdraw () = { | |
164 | 167 | let W = toBase58String(T.caller.bytes) | |
165 | - | let | |
166 | - | if ((0 >= | |
168 | + | let aa = C(W) | |
169 | + | if ((0 >= aa)) | |
167 | 170 | then throw("insufficient balance") | |
168 | - | else ScriptResult(WriteSet([DataEntry(A(W), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(W), | |
171 | + | else ScriptResult(WriteSet([DataEntry(A(W), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(W), aa, unit)])) | |
169 | 172 | } | |
170 | 173 | ||
171 | 174 | ||
172 | 175 | ||
173 | 176 | @Callable(T) | |
174 | - | func voteCommit (p, | |
177 | + | func voteCommit (p,ab) = { | |
175 | 178 | let s = toBase58String(T.caller.bytes) | |
176 | - | let | |
177 | - | let | |
178 | - | if (( | |
179 | + | let ac = G(p) | |
180 | + | let ad = K(p) | |
181 | + | if ((ac >= a)) | |
179 | 182 | then throw("reached max num of voters") | |
180 | 183 | else if ((E(p, s) != g)) | |
181 | 184 | then throw("user has already participated") | |
182 | 185 | else if ((y(p) == g)) | |
183 | 186 | then throw("item does not exist") | |
184 | - | else if (if (( | |
185 | - | then ( | |
187 | + | else if (if ((ad != g)) | |
188 | + | then (ad != c) | |
186 | 189 | else false) | |
187 | 190 | then throw("voting is not possible") | |
188 | - | else WriteSet([DataEntry(D(p, s), | |
191 | + | else WriteSet([DataEntry(D(p, s), ab), DataEntry(F(p), (ac + 1)), DataEntry(J(p), if ((ac == a)) | |
189 | 192 | then d | |
190 | 193 | else c)]) | |
191 | 194 | } | |
193 | 196 | ||
194 | 197 | ||
195 | 198 | @Callable(T) | |
196 | - | func voteReveal (p,M, | |
199 | + | func voteReveal (p,M,ae) = { | |
197 | 200 | let s = toBase58String(T.caller.bytes) | |
198 | - | let | |
199 | - | let | |
200 | - | if ((toBase58String(sha256(toBytes((M + | |
201 | + | let ad = K(p) | |
202 | + | let af = (N(p, M) + 1) | |
203 | + | if ((toBase58String(sha256(toBytes((M + ae)))) != E(p, s))) | |
201 | 204 | then throw("reveal data is not valid") | |
202 | 205 | else if ((a > G(p))) | |
203 | 206 | then throw("max num of voters hasn't reached yet") | |
204 | 207 | else if ((I(p, s) != g)) | |
205 | 208 | then throw("user has already participated") | |
206 | - | else if (if (( | |
207 | - | then ( | |
209 | + | else if (if ((ad != c)) | |
210 | + | then (ad != d) | |
208 | 211 | else false) | |
209 | 212 | then throw("wrong status") | |
210 | 213 | else if (if ((M != e)) | |
211 | 214 | then true | |
212 | - | else ( | |
215 | + | else (ad == f)) | |
213 | 216 | then throw("worng vote") | |
214 | - | else if (if (( | |
217 | + | else if (if ((ad == e)) | |
215 | 218 | then true | |
216 | - | else ( | |
219 | + | else (ad == f)) | |
217 | 220 | then throw("vote has finished") | |
218 | - | else WriteSet([DataEntry(H(p, s), M), DataEntry(L(p, M), | |
221 | + | else WriteSet([DataEntry(H(p, s), M), DataEntry(L(p, M), af), DataEntry(J(p), if ((af >= b)) | |
219 | 222 | then M | |
220 | 223 | else d)]) | |
221 | 224 | } | |
222 | 225 | ||
223 | 226 | ||
224 | - | @Verifier( | |
225 | - | func | |
226 | - | let k = | |
227 | + | @Verifier(ag) | |
228 | + | func ah () = { | |
229 | + | let k = ag | |
227 | 230 | if ($isInstanceOf(k, "SetScriptTransaction")) | |
228 | 231 | then { | |
229 | - | let | |
232 | + | let ai = k | |
230 | 233 | true | |
231 | 234 | } | |
232 | 235 | else if ($isInstanceOf(k, "DataTransaction")) | |
233 | 236 | then { | |
234 | - | let | |
237 | + | let ai = k | |
235 | 238 | true | |
236 | 239 | } | |
237 | 240 | else if ($isInstanceOf(k, "TransferTransaction")) | |
238 | 241 | then { | |
239 | - | let | |
242 | + | let ai = k | |
240 | 243 | true | |
241 | 244 | } | |
242 | 245 | else true |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = 3 | |
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) = (p + "_price") | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func q (p) = h(o(p)) | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func r (s,p) = (((p + "_") + s) + "_cnt") | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func t (s,p) = h(r(s, p)) | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func u (v,w) = ("item_" + toBase58String(sha256(toBytes((v + w))))) | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func x (p) = (p + "_data") | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func y (p) = (p + "_owner") | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func z (p) = m(y(p)) | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func A (B) = (B + "_balance") | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func C (B) = h(A(B)) | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func D (p,s) = (((p + "_") + s) + "_commit") | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func E (p,s) = m(D(p, s)) | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func F (p) = (p + "_comcnt") | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func G (p) = h(F(p)) | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func H (p,s) = (((p + "_") + s) + "_reveal") | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func I (p,s) = m(H(p, s)) | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func J (p) = (p + "_status") | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func K (p) = m(J(p)) | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func L (p,M) = ((p + "_res:") + M) | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | func N (p,M) = h(L(p, M)) | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | let O = "blacklist" | |
107 | 107 | ||
108 | 108 | func P () = extract(addressFromString("3N9f4YfQA9QPX1RiVvbhHYaChKw7B6giXrZ")) | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func Q (B) = (B + "_verifier_status") | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func R (S,B) = { | |
115 | 115 | let n = { | |
116 | 116 | let k = getString(S, Q(B)) | |
117 | 117 | if ($isInstanceOf(k, "String")) | |
118 | 118 | then { | |
119 | 119 | let l = k | |
120 | 120 | l | |
121 | 121 | } | |
122 | 122 | else g | |
123 | 123 | } | |
124 | 124 | n | |
125 | 125 | } | |
126 | 126 | ||
127 | 127 | ||
128 | 128 | @Callable(T) | |
129 | 129 | func addItem (w,U,V) = { | |
130 | 130 | let W = toBase58String(T.caller.bytes) | |
131 | 131 | let p = u(W, w) | |
132 | + | let X = R(P(), W) | |
132 | 133 | if ((0 >= U)) | |
133 | 134 | then throw("purchase amount cannot be higher than item pice") | |
134 | 135 | else if ((z(p) != g)) | |
135 | 136 | then throw("an item is already exist") | |
136 | - | else WriteSet([DataEntry(y(p), W), DataEntry(o(p), U), DataEntry(x(p), V)]) | |
137 | + | else if ((X == O)) | |
138 | + | then throw("supplier's account as been blacklisted") | |
139 | + | else WriteSet([DataEntry(y(p), W), DataEntry(o(p), U), DataEntry(x(p), V), DataEntry(Q(W), X)]) | |
137 | 140 | } | |
138 | 141 | ||
139 | 142 | ||
140 | 143 | ||
141 | 144 | @Callable(T) | |
142 | 145 | func purchase (p) = { | |
143 | - | let | |
144 | - | if (isDefined( | |
146 | + | let Y = extract(T.payment) | |
147 | + | if (isDefined(Y.assetId)) | |
145 | 148 | then throw("Waves tokens only at the moment") | |
146 | 149 | else { | |
147 | - | let | |
150 | + | let Z = toBase58String(T.caller.bytes) | |
148 | 151 | let U = q(p) | |
149 | 152 | let W = z(p) | |
150 | - | if ((U > | |
153 | + | if ((U > Y.amount)) | |
151 | 154 | then throw("purchase amount cannot be less than item price") | |
152 | - | else if (( | |
155 | + | else if ((Y.amount > U)) | |
153 | 156 | then throw("purchase amount cannot be higher than item price") | |
154 | 157 | else if ((W == g)) | |
155 | 158 | then throw("supplier does not exist") | |
156 | - | else WriteSet([DataEntry(r( | |
159 | + | else WriteSet([DataEntry(r(Z, p), (t(Z, p) + 1)), DataEntry(A(W), (C(W) + Y.amount))]) | |
157 | 160 | } | |
158 | 161 | } | |
159 | 162 | ||
160 | 163 | ||
161 | 164 | ||
162 | 165 | @Callable(T) | |
163 | 166 | func withdraw () = { | |
164 | 167 | let W = toBase58String(T.caller.bytes) | |
165 | - | let | |
166 | - | if ((0 >= | |
168 | + | let aa = C(W) | |
169 | + | if ((0 >= aa)) | |
167 | 170 | then throw("insufficient balance") | |
168 | - | else ScriptResult(WriteSet([DataEntry(A(W), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(W), | |
171 | + | else ScriptResult(WriteSet([DataEntry(A(W), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(W), aa, unit)])) | |
169 | 172 | } | |
170 | 173 | ||
171 | 174 | ||
172 | 175 | ||
173 | 176 | @Callable(T) | |
174 | - | func voteCommit (p, | |
177 | + | func voteCommit (p,ab) = { | |
175 | 178 | let s = toBase58String(T.caller.bytes) | |
176 | - | let | |
177 | - | let | |
178 | - | if (( | |
179 | + | let ac = G(p) | |
180 | + | let ad = K(p) | |
181 | + | if ((ac >= a)) | |
179 | 182 | then throw("reached max num of voters") | |
180 | 183 | else if ((E(p, s) != g)) | |
181 | 184 | then throw("user has already participated") | |
182 | 185 | else if ((y(p) == g)) | |
183 | 186 | then throw("item does not exist") | |
184 | - | else if (if (( | |
185 | - | then ( | |
187 | + | else if (if ((ad != g)) | |
188 | + | then (ad != c) | |
186 | 189 | else false) | |
187 | 190 | then throw("voting is not possible") | |
188 | - | else WriteSet([DataEntry(D(p, s), | |
191 | + | else WriteSet([DataEntry(D(p, s), ab), DataEntry(F(p), (ac + 1)), DataEntry(J(p), if ((ac == a)) | |
189 | 192 | then d | |
190 | 193 | else c)]) | |
191 | 194 | } | |
192 | 195 | ||
193 | 196 | ||
194 | 197 | ||
195 | 198 | @Callable(T) | |
196 | - | func voteReveal (p,M, | |
199 | + | func voteReveal (p,M,ae) = { | |
197 | 200 | let s = toBase58String(T.caller.bytes) | |
198 | - | let | |
199 | - | let | |
200 | - | if ((toBase58String(sha256(toBytes((M + | |
201 | + | let ad = K(p) | |
202 | + | let af = (N(p, M) + 1) | |
203 | + | if ((toBase58String(sha256(toBytes((M + ae)))) != E(p, s))) | |
201 | 204 | then throw("reveal data is not valid") | |
202 | 205 | else if ((a > G(p))) | |
203 | 206 | then throw("max num of voters hasn't reached yet") | |
204 | 207 | else if ((I(p, s) != g)) | |
205 | 208 | then throw("user has already participated") | |
206 | - | else if (if (( | |
207 | - | then ( | |
209 | + | else if (if ((ad != c)) | |
210 | + | then (ad != d) | |
208 | 211 | else false) | |
209 | 212 | then throw("wrong status") | |
210 | 213 | else if (if ((M != e)) | |
211 | 214 | then true | |
212 | - | else ( | |
215 | + | else (ad == f)) | |
213 | 216 | then throw("worng vote") | |
214 | - | else if (if (( | |
217 | + | else if (if ((ad == e)) | |
215 | 218 | then true | |
216 | - | else ( | |
219 | + | else (ad == f)) | |
217 | 220 | then throw("vote has finished") | |
218 | - | else WriteSet([DataEntry(H(p, s), M), DataEntry(L(p, M), | |
221 | + | else WriteSet([DataEntry(H(p, s), M), DataEntry(L(p, M), af), DataEntry(J(p), if ((af >= b)) | |
219 | 222 | then M | |
220 | 223 | else d)]) | |
221 | 224 | } | |
222 | 225 | ||
223 | 226 | ||
224 | - | @Verifier( | |
225 | - | func | |
226 | - | let k = | |
227 | + | @Verifier(ag) | |
228 | + | func ah () = { | |
229 | + | let k = ag | |
227 | 230 | if ($isInstanceOf(k, "SetScriptTransaction")) | |
228 | 231 | then { | |
229 | - | let | |
232 | + | let ai = k | |
230 | 233 | true | |
231 | 234 | } | |
232 | 235 | else if ($isInstanceOf(k, "DataTransaction")) | |
233 | 236 | then { | |
234 | - | let | |
237 | + | let ai = k | |
235 | 238 | true | |
236 | 239 | } | |
237 | 240 | else if ($isInstanceOf(k, "TransferTransaction")) | |
238 | 241 | then { | |
239 | - | let | |
242 | + | let ai = k | |
240 | 243 | true | |
241 | 244 | } | |
242 | 245 | else true | |
243 | 246 | } | |
244 | 247 |
github/deemru/w8io/169f3d6 74.58 ms ◑