tx · H1bYLn1n6CughXPjDrXiLPhCLts9tzsqT7peTDhD3Xdi 3Ms6Ht5bdVJa6sQnRBUg9nfNpEp7obSad8o: -0.05000000 Waves 2019.08.12 17:05 [627933] smart account 3Ms6Ht5bdVJa6sQnRBUg9nfNpEp7obSad8o > SELF 0.00000000 Waves
{ "type": 13, "id": "H1bYLn1n6CughXPjDrXiLPhCLts9tzsqT7peTDhD3Xdi", "fee": 5000000, "feeAssetId": null, "timestamp": 1565618746092, "version": 1, "sender": "3Ms6Ht5bdVJa6sQnRBUg9nfNpEp7obSad8o", "senderPublicKey": "Ebb2ffqL8cMnNmXPNvHLy53xrK7t5WaSFhneCPBSoxop", "proofs": [ "4p29wAXnHbGrSj11hXyJwrbHHiysbRqfD4xw1sNEUuVXndWJge3GBhGVHy1HCFyo3HEUpufRWWv9LZt4EaDYrta7" ], "script": "base64:AAIDAAAAAAAAAAAAAAAhAAAAAAROT05FAgAAAARub25lAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAANudW0EAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWkFAAAAByRtYXRjaDAFAAAAAWkAAAAAAAAAAAAFAAAAA251bQEAAAALZ2V0U3RyQnlLZXkAAAABAAAAA2tleQQAAAADc3RyBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFzBQAAAAckbWF0Y2gwBQAAAAFzBQAAAAROT05FBQAAAANzdHIBAAAAD2dldEtleUl0ZW1QcmljZQAAAAEAAAAEaXRlbQkAASwAAAACBQAAAARpdGVtAgAAAAZfcHJpY2UBAAAAEWdldFZhbHVlSXRlbVByaWNlAAAAAQAAAARpdGVtCQEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABCQEAAAAPZ2V0S2V5SXRlbVBy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m90ZQUAAAAMbmV3Vm90ZUNvdW50CQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAAQZ2V0S2V5SXRlbVN0YXR1cwAAAAEFAAAABGl0ZW0DCQAAZwAAAAIFAAAADG5ld1ZvdGVDb3VudAUAAAAGUVVPUlVNBQAAAAR2b3RlBQAAAAZSRVZFQUwFAAAAA25pbAAAAAA6bK+S", "chainId": 84, "height": 627933, "spentComplexity": 0 } View: original | compacted Prev: 33b3ZCKUHopEFAKjKDrPdigTdUDPXJLddNNXvkTgnhJi Next: E88ZinuGmcc7gmjkciyuttLizS5J97mPAx77aqWrDPVL Diff:
Old | New | Differences | |
---|---|---|---|
103 | 103 | func O (k,N) = b(M(k, N)) | |
104 | 104 | ||
105 | 105 | ||
106 | - | @Callable(P) | |
107 | - | func addItem (r,Q,R) = { | |
108 | - | let S = toBase58String(P.caller.bytes) | |
109 | - | let k = p(S, r) | |
110 | - | if ((0 >= Q)) | |
106 | + | func P () = extract(addressFromString("3MwyDYbjXQ9VRWnPkubmGgypox7663uCLxT")) | |
107 | + | ||
108 | + | ||
109 | + | let Q = "blacklisted" | |
110 | + | ||
111 | + | func R (w) = (w + "_verifier_status") | |
112 | + | ||
113 | + | ||
114 | + | func S (T,w) = { | |
115 | + | let h = { | |
116 | + | let e = getString(T, R(w)) | |
117 | + | if ($isInstanceOf(e, "String")) | |
118 | + | then { | |
119 | + | let U = e | |
120 | + | U | |
121 | + | } | |
122 | + | else a | |
123 | + | } | |
124 | + | h | |
125 | + | } | |
126 | + | ||
127 | + | ||
128 | + | @Callable(V) | |
129 | + | func addItem (r,W,X) = { | |
130 | + | let Y = toBase58String(V.caller.bytes) | |
131 | + | let k = p(Y, r) | |
132 | + | let Z = S(P(), R(Y)) | |
133 | + | if ((0 >= W)) | |
111 | 134 | then throw("Please add valid price") | |
112 | 135 | else if ((u(k) != a)) | |
113 | 136 | then throw((k + " - item already exists")) | |
114 | - | else WriteSet([DataEntry(t(k), S), DataEntry(j(k), Q), DataEntry(s(k), R)]) | |
137 | + | else if ((Z == Q)) | |
138 | + | then throw((("The supplier " + Y) + " was blacklisted")) | |
139 | + | else WriteSet([DataEntry(t(k), Y), DataEntry(j(k), W), DataEntry(s(k), X)]) | |
115 | 140 | } | |
116 | 141 | ||
117 | 142 | ||
118 | 143 | ||
119 | - | @Callable( | |
144 | + | @Callable(V) | |
120 | 145 | func purchase (k) = { | |
121 | - | let | |
122 | - | if (isDefined( | |
146 | + | let aa = extract(V.payment) | |
147 | + | if (isDefined(aa.assetId)) | |
123 | 148 | then throw("Only payments in WAVES are avalible") | |
124 | 149 | else { | |
125 | - | let | |
126 | - | let | |
127 | - | let | |
128 | - | if (( | |
150 | + | let ab = toBase58String(V.caller.bytes) | |
151 | + | let W = l(k) | |
152 | + | let Y = u(k) | |
153 | + | if ((W > aa.amount)) | |
129 | 154 | then throw("Please send exact coupon price") | |
130 | - | else if (( | |
155 | + | else if ((aa.amount > W)) | |
131 | 156 | then throw("Please send exact coupon price") | |
132 | - | else WriteSet([DataEntry(m( | |
157 | + | else WriteSet([DataEntry(m(ab, k), (o(ab, k) + 1)), DataEntry(v(Y), (x(Y) + aa.amount))]) | |
133 | 158 | } | |
134 | 159 | } | |
135 | 160 | ||
136 | 161 | ||
137 | 162 | ||
138 | - | @Callable( | |
163 | + | @Callable(V) | |
139 | 164 | func withdraw () = { | |
140 | - | let | |
141 | - | let | |
142 | - | if ((0 >= | |
165 | + | let Y = toBase58String(V.caller.bytes) | |
166 | + | let ac = x(Y) | |
167 | + | if ((0 >= ac)) | |
143 | 168 | then throw("Ballance is zero") | |
144 | - | else ScriptResult(WriteSet([DataEntry(v( | |
169 | + | else ScriptResult(WriteSet([DataEntry(v(Y), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(Y), ac, unit)])) | |
145 | 170 | } | |
146 | 171 | ||
147 | 172 | ||
148 | 173 | ||
149 | - | @Callable( | |
150 | - | func voteCommit (k, | |
151 | - | let n = toBase58String( | |
152 | - | let | |
153 | - | let | |
154 | - | if (( | |
174 | + | @Callable(V) | |
175 | + | func voteCommit (k,ad) = { | |
176 | + | let n = toBase58String(V.caller.bytes) | |
177 | + | let ae = H(k) | |
178 | + | let af = L(k) | |
179 | + | if ((ae >= y)) | |
155 | 180 | then throw("We have reached necessary number of voters") | |
156 | 181 | else if ((F(k, n) != a)) | |
157 | 182 | then throw("User has already voted") | |
158 | 183 | else if ((t(k) == a)) | |
159 | 184 | then throw("Item does not exist") | |
160 | - | else if (if (( | |
161 | - | then ( | |
185 | + | else if (if ((af != a)) | |
186 | + | then (af != A) | |
162 | 187 | else false) | |
163 | 188 | then throw("Voting is not possible") | |
164 | - | else WriteSet([DataEntry(E(k, n), | |
189 | + | else WriteSet([DataEntry(E(k, n), ad), DataEntry(G(k), (ae + 1)), DataEntry(K(k), if ((ae == y)) | |
165 | 190 | then B | |
166 | 191 | else A)]) | |
167 | 192 | } | |
168 | 193 | ||
169 | 194 | ||
170 | 195 | ||
171 | - | @Callable( | |
172 | - | func revealVotes (k,N, | |
173 | - | let n = toBase58String( | |
174 | - | let | |
175 | - | let | |
176 | - | let | |
177 | - | if ((toBase58String(sha256(toBytes((N + | |
196 | + | @Callable(V) | |
197 | + | func revealVotes (k,N,ag) = { | |
198 | + | let n = toBase58String(V.caller.bytes) | |
199 | + | let ae = H(k) | |
200 | + | let af = L(k) | |
201 | + | let ah = (O(k, N) + 1) | |
202 | + | if ((toBase58String(sha256(toBytes((N + ag)))) != F(k, n))) | |
178 | 203 | then throw("Reveal data is not valid") | |
179 | 204 | else if ((y > H(k))) | |
180 | 205 | then throw("Necessary number of voters hasn't reached yet") | |
181 | 206 | else if ((J(k, n) != a)) | |
182 | 207 | then throw("User has already revealed his vote") | |
183 | - | else if (if (( | |
184 | - | then ( | |
208 | + | else if (if ((af != A)) | |
209 | + | then (af != B) | |
185 | 210 | else false) | |
186 | 211 | then throw("Wrong status of vote") | |
187 | 212 | else if (if ((N != C)) | |
188 | 213 | then (N != D) | |
189 | 214 | else false) | |
190 | 215 | then throw("Wrong vote") | |
191 | - | else if (if (( | |
216 | + | else if (if ((af == C)) | |
192 | 217 | then true | |
193 | - | else ( | |
218 | + | else (af == D)) | |
194 | 219 | then throw("Voting complited") | |
195 | - | else WriteSet([DataEntry(I(k, n), N), DataEntry(M(k, N), | |
220 | + | else WriteSet([DataEntry(I(k, n), N), DataEntry(M(k, N), ah), DataEntry(K(k), if ((ah >= z)) | |
196 | 221 | then N | |
197 | 222 | else B)]) | |
198 | 223 | } |
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 i = e | |
26 | 26 | i | |
27 | 27 | } | |
28 | 28 | else a | |
29 | 29 | } | |
30 | 30 | h | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func j (k) = (k + "_price") | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | func l (k) = b(j(k)) | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func m (n,k) = (((k + "_") + n) + "_cnt") | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func o (n,k) = b(m(n, k)) | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func p (q,r) = ("item_" + toBase58String(sha256(toBytes((q + r))))) | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func s (k) = (k + "_data") | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func t (k) = (k + "_owner") | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func u (k) = g(t(k)) | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func v (w) = (w + "_balance") | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func x (w) = b(v(w)) | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | let y = 3 | |
65 | 65 | ||
66 | 66 | let z = 2 | |
67 | 67 | ||
68 | 68 | let A = "voting" | |
69 | 69 | ||
70 | 70 | let B = "reveal" | |
71 | 71 | ||
72 | 72 | let C = "featured" | |
73 | 73 | ||
74 | 74 | let D = "delisted" | |
75 | 75 | ||
76 | 76 | func E (k,n) = (((k + "_") + n) + "_commit") | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func F (k,n) = g(E(k, n)) | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func G (k) = (k + "_comcnt") | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func H (k) = b(G(k)) | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func I (k,n) = (((k + "_") + n) + "_reveal") | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func J (k,n) = g(I(k, n)) | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func K (k) = (k + "_status") | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func L (k) = g(K(k)) | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func M (k,N) = ((k + "_res:") + N) | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | func O (k,N) = b(M(k, N)) | |
104 | 104 | ||
105 | 105 | ||
106 | - | @Callable(P) | |
107 | - | func addItem (r,Q,R) = { | |
108 | - | let S = toBase58String(P.caller.bytes) | |
109 | - | let k = p(S, r) | |
110 | - | if ((0 >= Q)) | |
106 | + | func P () = extract(addressFromString("3MwyDYbjXQ9VRWnPkubmGgypox7663uCLxT")) | |
107 | + | ||
108 | + | ||
109 | + | let Q = "blacklisted" | |
110 | + | ||
111 | + | func R (w) = (w + "_verifier_status") | |
112 | + | ||
113 | + | ||
114 | + | func S (T,w) = { | |
115 | + | let h = { | |
116 | + | let e = getString(T, R(w)) | |
117 | + | if ($isInstanceOf(e, "String")) | |
118 | + | then { | |
119 | + | let U = e | |
120 | + | U | |
121 | + | } | |
122 | + | else a | |
123 | + | } | |
124 | + | h | |
125 | + | } | |
126 | + | ||
127 | + | ||
128 | + | @Callable(V) | |
129 | + | func addItem (r,W,X) = { | |
130 | + | let Y = toBase58String(V.caller.bytes) | |
131 | + | let k = p(Y, r) | |
132 | + | let Z = S(P(), R(Y)) | |
133 | + | if ((0 >= W)) | |
111 | 134 | then throw("Please add valid price") | |
112 | 135 | else if ((u(k) != a)) | |
113 | 136 | then throw((k + " - item already exists")) | |
114 | - | else WriteSet([DataEntry(t(k), S), DataEntry(j(k), Q), DataEntry(s(k), R)]) | |
137 | + | else if ((Z == Q)) | |
138 | + | then throw((("The supplier " + Y) + " was blacklisted")) | |
139 | + | else WriteSet([DataEntry(t(k), Y), DataEntry(j(k), W), DataEntry(s(k), X)]) | |
115 | 140 | } | |
116 | 141 | ||
117 | 142 | ||
118 | 143 | ||
119 | - | @Callable( | |
144 | + | @Callable(V) | |
120 | 145 | func purchase (k) = { | |
121 | - | let | |
122 | - | if (isDefined( | |
146 | + | let aa = extract(V.payment) | |
147 | + | if (isDefined(aa.assetId)) | |
123 | 148 | then throw("Only payments in WAVES are avalible") | |
124 | 149 | else { | |
125 | - | let | |
126 | - | let | |
127 | - | let | |
128 | - | if (( | |
150 | + | let ab = toBase58String(V.caller.bytes) | |
151 | + | let W = l(k) | |
152 | + | let Y = u(k) | |
153 | + | if ((W > aa.amount)) | |
129 | 154 | then throw("Please send exact coupon price") | |
130 | - | else if (( | |
155 | + | else if ((aa.amount > W)) | |
131 | 156 | then throw("Please send exact coupon price") | |
132 | - | else WriteSet([DataEntry(m( | |
157 | + | else WriteSet([DataEntry(m(ab, k), (o(ab, k) + 1)), DataEntry(v(Y), (x(Y) + aa.amount))]) | |
133 | 158 | } | |
134 | 159 | } | |
135 | 160 | ||
136 | 161 | ||
137 | 162 | ||
138 | - | @Callable( | |
163 | + | @Callable(V) | |
139 | 164 | func withdraw () = { | |
140 | - | let | |
141 | - | let | |
142 | - | if ((0 >= | |
165 | + | let Y = toBase58String(V.caller.bytes) | |
166 | + | let ac = x(Y) | |
167 | + | if ((0 >= ac)) | |
143 | 168 | then throw("Ballance is zero") | |
144 | - | else ScriptResult(WriteSet([DataEntry(v( | |
169 | + | else ScriptResult(WriteSet([DataEntry(v(Y), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(Y), ac, unit)])) | |
145 | 170 | } | |
146 | 171 | ||
147 | 172 | ||
148 | 173 | ||
149 | - | @Callable( | |
150 | - | func voteCommit (k, | |
151 | - | let n = toBase58String( | |
152 | - | let | |
153 | - | let | |
154 | - | if (( | |
174 | + | @Callable(V) | |
175 | + | func voteCommit (k,ad) = { | |
176 | + | let n = toBase58String(V.caller.bytes) | |
177 | + | let ae = H(k) | |
178 | + | let af = L(k) | |
179 | + | if ((ae >= y)) | |
155 | 180 | then throw("We have reached necessary number of voters") | |
156 | 181 | else if ((F(k, n) != a)) | |
157 | 182 | then throw("User has already voted") | |
158 | 183 | else if ((t(k) == a)) | |
159 | 184 | then throw("Item does not exist") | |
160 | - | else if (if (( | |
161 | - | then ( | |
185 | + | else if (if ((af != a)) | |
186 | + | then (af != A) | |
162 | 187 | else false) | |
163 | 188 | then throw("Voting is not possible") | |
164 | - | else WriteSet([DataEntry(E(k, n), | |
189 | + | else WriteSet([DataEntry(E(k, n), ad), DataEntry(G(k), (ae + 1)), DataEntry(K(k), if ((ae == y)) | |
165 | 190 | then B | |
166 | 191 | else A)]) | |
167 | 192 | } | |
168 | 193 | ||
169 | 194 | ||
170 | 195 | ||
171 | - | @Callable( | |
172 | - | func revealVotes (k,N, | |
173 | - | let n = toBase58String( | |
174 | - | let | |
175 | - | let | |
176 | - | let | |
177 | - | if ((toBase58String(sha256(toBytes((N + | |
196 | + | @Callable(V) | |
197 | + | func revealVotes (k,N,ag) = { | |
198 | + | let n = toBase58String(V.caller.bytes) | |
199 | + | let ae = H(k) | |
200 | + | let af = L(k) | |
201 | + | let ah = (O(k, N) + 1) | |
202 | + | if ((toBase58String(sha256(toBytes((N + ag)))) != F(k, n))) | |
178 | 203 | then throw("Reveal data is not valid") | |
179 | 204 | else if ((y > H(k))) | |
180 | 205 | then throw("Necessary number of voters hasn't reached yet") | |
181 | 206 | else if ((J(k, n) != a)) | |
182 | 207 | then throw("User has already revealed his vote") | |
183 | - | else if (if (( | |
184 | - | then ( | |
208 | + | else if (if ((af != A)) | |
209 | + | then (af != B) | |
185 | 210 | else false) | |
186 | 211 | then throw("Wrong status of vote") | |
187 | 212 | else if (if ((N != C)) | |
188 | 213 | then (N != D) | |
189 | 214 | else false) | |
190 | 215 | then throw("Wrong vote") | |
191 | - | else if (if (( | |
216 | + | else if (if ((af == C)) | |
192 | 217 | then true | |
193 | - | else ( | |
218 | + | else (af == D)) | |
194 | 219 | then throw("Voting complited") | |
195 | - | else WriteSet([DataEntry(I(k, n), N), DataEntry(M(k, N), | |
220 | + | else WriteSet([DataEntry(I(k, n), N), DataEntry(M(k, N), ah), DataEntry(K(k), if ((ah >= z)) | |
196 | 221 | then N | |
197 | 222 | else B)]) | |
198 | 223 | } | |
199 | 224 | ||
200 | 225 |
github/deemru/w8io/169f3d6 52.00 ms ◑