tx · EALXEC9wXp8w3Yb74H7jeuEBCvFbGG8hAxYPqGrTkYjr 3N1MvvKPNWqQ9JWYV1vWE84GnMKP3mENpSg: -0.01400000 Waves 2019.06.26 03:01 [558343] smart account 3N1MvvKPNWqQ9JWYV1vWE84GnMKP3mENpSg > SELF 0.00000000 Waves
{ "type": 13, "id": "EALXEC9wXp8w3Yb74H7jeuEBCvFbGG8hAxYPqGrTkYjr", "fee": 1400000, "feeAssetId": null, "timestamp": 1561507296063, "version": 1, "sender": "3N1MvvKPNWqQ9JWYV1vWE84GnMKP3mENpSg", "senderPublicKey": "GBcKAM5muVn8dBji3B7ciEqt4XzrT4CBrAKXoTVfbw7", "proofs": [ "uKQwDS5Vdw6SwYGF7FeUx9hxkRAEkvMiC2Yns1r4GxaKoKE5Bwzj3yYPMgAaaj9CfwbNbR8HWvCAxAspTMqGMBY" ], "script": "base64:AAIDAAAAAAAAAAAAAAAdAAAAAAROT05FAgAAAARub25lAAAAAAZWT1RFUlMAAAAAAAAAAAMAAAAABlFVT1JVTQAAAAAAAAAAAgAAAAAGVk9USU5HAgAAAAZ2b3RpbmcAAAAABlJFVkVBTAIAAAAGcmV2ZWFsAAAAAAhGRUFUVVJFRAIAAAAIZmVhdHVyZWQAAAAACERFTElTVEVEAgAAAAhkZWxpc3RlZAEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABAAAAA2tleQQAAAADbnVtBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABQAAAANudW0BAAAAC2dldFN0ckJ5S2V5AAAAAQAAAANrZXkEAAAAA3N0cgQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQUAAAAETk9OR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tBQAAAAR1c2VyBQAAAAR2b3RlCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAAPZ2V0S2V5Vm90ZUNvdW50AAAAAgUAAAAEaXRlbQUAAAAEdm90ZQUAAAAMbmV3Vm90ZUNvdW50CQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAAQZ2V0S2V5SXRlbVN0YXR1cwAAAAEFAAAABGl0ZW0DCQAAZwAAAAIFAAAADG5ld1ZvdGVDb3VudAUAAAAGUVVPUlVNBQAAAAR2b3RlBQAAAAZSRVZFQUwFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V50MNg/w==", "chainId": 84, "height": 558343, "spentComplexity": 0 } View: original | compacted Prev: 752eT2Co8GFow7ozvXL4xyUAWij8Y86tdqKofbUUvmQ1 Next: 65HSqoTVHZQzszVjhYDhdptkffVSi2e9h5cexDBLTzCc Diff:
Old | New | Differences | |
---|---|---|---|
11 | 11 | ||
12 | 12 | let e = "reveal" | |
13 | 13 | ||
14 | - | func f (g) = { | |
15 | - | let h = { | |
16 | - | let i = getInteger(this, g) | |
17 | - | if ($isInstanceOf(i, "Int")) | |
14 | + | let f = "featured" | |
15 | + | ||
16 | + | let g = "delisted" | |
17 | + | ||
18 | + | func h (i) = { | |
19 | + | let j = { | |
20 | + | let k = getInteger(this, i) | |
21 | + | if ($isInstanceOf(k, "Int")) | |
18 | 22 | then { | |
19 | - | let | |
20 | - | | |
23 | + | let l = k | |
24 | + | l | |
21 | 25 | } | |
22 | 26 | else 0 | |
23 | 27 | } | |
24 | - | | |
28 | + | j | |
25 | 29 | } | |
26 | 30 | ||
27 | 31 | ||
28 | - | func | |
29 | - | let | |
30 | - | let | |
31 | - | if ($isInstanceOf( | |
32 | + | func m (i) = { | |
33 | + | let n = { | |
34 | + | let k = getString(this, i) | |
35 | + | if ($isInstanceOf(k, "String")) | |
32 | 36 | then { | |
33 | - | let | |
34 | - | | |
37 | + | let l = k | |
38 | + | l | |
35 | 39 | } | |
36 | 40 | else a | |
37 | 41 | } | |
38 | - | | |
42 | + | n | |
39 | 43 | } | |
40 | 44 | ||
41 | 45 | ||
42 | - | func | |
46 | + | func o (p) = (p + "_price") | |
43 | 47 | ||
44 | 48 | ||
45 | - | func | |
49 | + | func q (p) = h(o(p)) | |
46 | 50 | ||
47 | 51 | ||
48 | - | func | |
52 | + | func r (s,p) = ((p + "_user") + "_cnt") | |
49 | 53 | ||
50 | 54 | ||
51 | - | func | |
55 | + | func t (s,p) = h(r(s, p)) | |
52 | 56 | ||
53 | 57 | ||
54 | - | func | |
58 | + | func u (v,w) = ("item_" + toBase58String(sha256(toBytes((v + w))))) | |
55 | 59 | ||
56 | 60 | ||
57 | - | func | |
61 | + | func x (p) = (p + "_data") | |
58 | 62 | ||
59 | 63 | ||
60 | - | func | |
64 | + | func y (p) = (p + "_owner") | |
61 | 65 | ||
62 | 66 | ||
63 | - | func | |
67 | + | func z (p) = m(y(p)) | |
64 | 68 | ||
65 | 69 | ||
66 | - | func | |
70 | + | func A (B) = (B + "_balance") | |
67 | 71 | ||
68 | 72 | ||
69 | - | func | |
73 | + | func C (B) = h(A(B)) | |
70 | 74 | ||
71 | 75 | ||
72 | - | func | |
76 | + | func D (p,s) = (((p + "_") + s) + "_commit") | |
73 | 77 | ||
74 | 78 | ||
75 | - | func | |
79 | + | func E (p,s) = m(D(p, s)) | |
76 | 80 | ||
77 | 81 | ||
78 | - | func | |
82 | + | func F (p) = (p + "_comcnt") | |
79 | 83 | ||
80 | 84 | ||
81 | - | func | |
85 | + | func G (p) = h(F(p)) | |
82 | 86 | ||
83 | 87 | ||
84 | - | func | |
88 | + | func H (p,s) = (((p + "_") + s) + "_reveal") | |
85 | 89 | ||
86 | 90 | ||
87 | - | func | |
91 | + | func I (p,s) = m(H(p, s)) | |
88 | 92 | ||
89 | 93 | ||
90 | - | func | |
94 | + | func J (p) = (p + "_status") | |
91 | 95 | ||
92 | 96 | ||
93 | - | func | |
97 | + | func K (p) = m(J(p)) | |
94 | 98 | ||
95 | 99 | ||
96 | - | func | |
100 | + | func L (p,M) = ((p + "_res:") + M) | |
97 | 101 | ||
98 | 102 | ||
99 | - | func | |
103 | + | func N (p,M) = h(L(p, M)) | |
100 | 104 | ||
101 | 105 | ||
102 | - | @Callable( | |
103 | - | func addItem ( | |
104 | - | let | |
105 | - | let | |
106 | - | if ((0 >= | |
106 | + | @Callable(O) | |
107 | + | func addItem (w,P,Q) = { | |
108 | + | let R = toBase58String(O.caller.bytes) | |
109 | + | let p = u(R, w) | |
110 | + | if ((0 >= P)) | |
107 | 111 | then throw("Purchase amount cannot be less that item price") | |
108 | - | else if (( | |
112 | + | else if ((z(p) != a)) | |
109 | 113 | then throw("This item already exist") | |
110 | - | else WriteSet([DataEntry( | |
114 | + | else WriteSet([DataEntry(y(p), R), DataEntry(o(p), P), DataEntry(x(p), Q)]) | |
111 | 115 | } | |
112 | 116 | ||
113 | 117 | ||
114 | 118 | ||
115 | - | @Callable( | |
116 | - | func purchase ( | |
117 | - | let | |
118 | - | if (isDefined( | |
119 | + | @Callable(O) | |
120 | + | func purchase (p) = { | |
121 | + | let S = extract(O.payment) | |
122 | + | if (isDefined(S.assetId)) | |
119 | 123 | then throw("Waves token only at this moment") | |
120 | 124 | else { | |
121 | - | let | |
122 | - | let | |
123 | - | let | |
124 | - | if (( | |
125 | + | let T = toBase58String(O.caller.bytes) | |
126 | + | let P = q(p) | |
127 | + | let R = z(p) | |
128 | + | if ((P > S.amount)) | |
125 | 129 | then throw("Purchase amount can not be less than item price") | |
126 | - | else if (( | |
130 | + | else if ((S.amount > P)) | |
127 | 131 | then throw("Purchase amount can not be higher than item price") | |
128 | - | else if (( | |
132 | + | else if ((R == a)) | |
129 | 133 | then throw("Supplier does not exist") | |
130 | - | else WriteSet([DataEntry( | |
134 | + | else WriteSet([DataEntry(r(T, p), (t(T, p) + 1)), DataEntry(A(R), (C(R) + S.amount))]) | |
131 | 135 | } | |
132 | 136 | } | |
133 | 137 | ||
134 | 138 | ||
135 | 139 | ||
136 | - | @Callable( | |
140 | + | @Callable(O) | |
137 | 141 | func withdraw () = { | |
138 | - | let | |
139 | - | let | |
140 | - | if ((0 >= | |
142 | + | let R = toBase58String(O.caller.bytes) | |
143 | + | let U = C(R) | |
144 | + | if ((0 >= U)) | |
141 | 145 | then throw("Insufficient Balance") | |
142 | - | else ScriptResult(WriteSet([DataEntry( | |
146 | + | else ScriptResult(WriteSet([DataEntry(A(R), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(R), U, unit)])) | |
143 | 147 | } | |
144 | 148 | ||
145 | 149 | ||
146 | 150 | ||
147 | - | @Callable( | |
148 | - | func voteCommit ( | |
149 | - | let | |
150 | - | let | |
151 | - | let | |
152 | - | if (( | |
151 | + | @Callable(O) | |
152 | + | func voteCommit (p,V) = { | |
153 | + | let s = toBase58String(O.caller.bytes) | |
154 | + | let W = G(p) | |
155 | + | let X = K(p) | |
156 | + | if ((W >= b)) | |
153 | 157 | then throw("Reached max numbers of voters") | |
154 | - | else if (( | |
158 | + | else if ((E(p, s) != a)) | |
155 | 159 | then throw("User has already participated") | |
156 | - | else if (( | |
160 | + | else if ((y(p) == a)) | |
157 | 161 | then throw("Item does not exist") | |
158 | - | else if (if (( | |
159 | - | then ( | |
162 | + | else if (if ((X != a)) | |
163 | + | then (X != d) | |
160 | 164 | else false) | |
161 | 165 | then throw("Voting is not possible") | |
162 | - | else WriteSet([DataEntry( | |
166 | + | else WriteSet([DataEntry(D(p, s), V), DataEntry(F(p), (W + 1)), DataEntry(J(p), if ((W == b)) | |
163 | 167 | then e | |
164 | 168 | else d)]) | |
165 | 169 | } | |
166 | 170 | ||
167 | 171 | ||
168 | - | @Verifier(W) | |
169 | - | func X () = sigVerify(W.bodyBytes, W.proofs[0], W.senderPublicKey) | |
172 | + | ||
173 | + | @Callable(O) | |
174 | + | func voteReveal (p,M,Y) = { | |
175 | + | let s = toBase58String(O.caller.bytes) | |
176 | + | let X = K(p) | |
177 | + | let Z = (N(p, M) + 1) | |
178 | + | if ((toBase64String(sha256(toBytes((M + Y)))) != E(p, s))) | |
179 | + | then throw("reveal data is not valid") | |
180 | + | else if ((b > G(p))) | |
181 | + | then throw("Max number of votes hasn't been reached yet") | |
182 | + | else if ((I(p, s) != a)) | |
183 | + | then throw("user has already participated") | |
184 | + | else if (if ((X != d)) | |
185 | + | then (X != e) | |
186 | + | else false) | |
187 | + | then throw("wrong status") | |
188 | + | else if (if ((M != f)) | |
189 | + | then (M != g) | |
190 | + | else false) | |
191 | + | then throw("wrong vote") | |
192 | + | else if (if ((M != f)) | |
193 | + | then true | |
194 | + | else (M != g)) | |
195 | + | then throw("Vote has finished") | |
196 | + | else WriteSet([DataEntry(H(p, s), M), DataEntry(L(p, M), Z), DataEntry(J(p), if ((Z >= c)) | |
197 | + | then M | |
198 | + | else e)]) | |
199 | + | } | |
200 | + | ||
201 | + | ||
202 | + | @Verifier(aa) | |
203 | + | func ab () = sigVerify(aa.bodyBytes, aa.proofs[0], aa.senderPublicKey) | |
170 | 204 |
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 | 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 | - | func f (g) = { | |
15 | - | let h = { | |
16 | - | let i = getInteger(this, g) | |
17 | - | if ($isInstanceOf(i, "Int")) | |
14 | + | let f = "featured" | |
15 | + | ||
16 | + | let g = "delisted" | |
17 | + | ||
18 | + | func h (i) = { | |
19 | + | let j = { | |
20 | + | let k = getInteger(this, i) | |
21 | + | if ($isInstanceOf(k, "Int")) | |
18 | 22 | then { | |
19 | - | let | |
20 | - | | |
23 | + | let l = k | |
24 | + | l | |
21 | 25 | } | |
22 | 26 | else 0 | |
23 | 27 | } | |
24 | - | | |
28 | + | j | |
25 | 29 | } | |
26 | 30 | ||
27 | 31 | ||
28 | - | func | |
29 | - | let | |
30 | - | let | |
31 | - | if ($isInstanceOf( | |
32 | + | func m (i) = { | |
33 | + | let n = { | |
34 | + | let k = getString(this, i) | |
35 | + | if ($isInstanceOf(k, "String")) | |
32 | 36 | then { | |
33 | - | let | |
34 | - | | |
37 | + | let l = k | |
38 | + | l | |
35 | 39 | } | |
36 | 40 | else a | |
37 | 41 | } | |
38 | - | | |
42 | + | n | |
39 | 43 | } | |
40 | 44 | ||
41 | 45 | ||
42 | - | func | |
46 | + | func o (p) = (p + "_price") | |
43 | 47 | ||
44 | 48 | ||
45 | - | func | |
49 | + | func q (p) = h(o(p)) | |
46 | 50 | ||
47 | 51 | ||
48 | - | func | |
52 | + | func r (s,p) = ((p + "_user") + "_cnt") | |
49 | 53 | ||
50 | 54 | ||
51 | - | func | |
55 | + | func t (s,p) = h(r(s, p)) | |
52 | 56 | ||
53 | 57 | ||
54 | - | func | |
58 | + | func u (v,w) = ("item_" + toBase58String(sha256(toBytes((v + w))))) | |
55 | 59 | ||
56 | 60 | ||
57 | - | func | |
61 | + | func x (p) = (p + "_data") | |
58 | 62 | ||
59 | 63 | ||
60 | - | func | |
64 | + | func y (p) = (p + "_owner") | |
61 | 65 | ||
62 | 66 | ||
63 | - | func | |
67 | + | func z (p) = m(y(p)) | |
64 | 68 | ||
65 | 69 | ||
66 | - | func | |
70 | + | func A (B) = (B + "_balance") | |
67 | 71 | ||
68 | 72 | ||
69 | - | func | |
73 | + | func C (B) = h(A(B)) | |
70 | 74 | ||
71 | 75 | ||
72 | - | func | |
76 | + | func D (p,s) = (((p + "_") + s) + "_commit") | |
73 | 77 | ||
74 | 78 | ||
75 | - | func | |
79 | + | func E (p,s) = m(D(p, s)) | |
76 | 80 | ||
77 | 81 | ||
78 | - | func | |
82 | + | func F (p) = (p + "_comcnt") | |
79 | 83 | ||
80 | 84 | ||
81 | - | func | |
85 | + | func G (p) = h(F(p)) | |
82 | 86 | ||
83 | 87 | ||
84 | - | func | |
88 | + | func H (p,s) = (((p + "_") + s) + "_reveal") | |
85 | 89 | ||
86 | 90 | ||
87 | - | func | |
91 | + | func I (p,s) = m(H(p, s)) | |
88 | 92 | ||
89 | 93 | ||
90 | - | func | |
94 | + | func J (p) = (p + "_status") | |
91 | 95 | ||
92 | 96 | ||
93 | - | func | |
97 | + | func K (p) = m(J(p)) | |
94 | 98 | ||
95 | 99 | ||
96 | - | func | |
100 | + | func L (p,M) = ((p + "_res:") + M) | |
97 | 101 | ||
98 | 102 | ||
99 | - | func | |
103 | + | func N (p,M) = h(L(p, M)) | |
100 | 104 | ||
101 | 105 | ||
102 | - | @Callable( | |
103 | - | func addItem ( | |
104 | - | let | |
105 | - | let | |
106 | - | if ((0 >= | |
106 | + | @Callable(O) | |
107 | + | func addItem (w,P,Q) = { | |
108 | + | let R = toBase58String(O.caller.bytes) | |
109 | + | let p = u(R, w) | |
110 | + | if ((0 >= P)) | |
107 | 111 | then throw("Purchase amount cannot be less that item price") | |
108 | - | else if (( | |
112 | + | else if ((z(p) != a)) | |
109 | 113 | then throw("This item already exist") | |
110 | - | else WriteSet([DataEntry( | |
114 | + | else WriteSet([DataEntry(y(p), R), DataEntry(o(p), P), DataEntry(x(p), Q)]) | |
111 | 115 | } | |
112 | 116 | ||
113 | 117 | ||
114 | 118 | ||
115 | - | @Callable( | |
116 | - | func purchase ( | |
117 | - | let | |
118 | - | if (isDefined( | |
119 | + | @Callable(O) | |
120 | + | func purchase (p) = { | |
121 | + | let S = extract(O.payment) | |
122 | + | if (isDefined(S.assetId)) | |
119 | 123 | then throw("Waves token only at this moment") | |
120 | 124 | else { | |
121 | - | let | |
122 | - | let | |
123 | - | let | |
124 | - | if (( | |
125 | + | let T = toBase58String(O.caller.bytes) | |
126 | + | let P = q(p) | |
127 | + | let R = z(p) | |
128 | + | if ((P > S.amount)) | |
125 | 129 | then throw("Purchase amount can not be less than item price") | |
126 | - | else if (( | |
130 | + | else if ((S.amount > P)) | |
127 | 131 | then throw("Purchase amount can not be higher than item price") | |
128 | - | else if (( | |
132 | + | else if ((R == a)) | |
129 | 133 | then throw("Supplier does not exist") | |
130 | - | else WriteSet([DataEntry( | |
134 | + | else WriteSet([DataEntry(r(T, p), (t(T, p) + 1)), DataEntry(A(R), (C(R) + S.amount))]) | |
131 | 135 | } | |
132 | 136 | } | |
133 | 137 | ||
134 | 138 | ||
135 | 139 | ||
136 | - | @Callable( | |
140 | + | @Callable(O) | |
137 | 141 | func withdraw () = { | |
138 | - | let | |
139 | - | let | |
140 | - | if ((0 >= | |
142 | + | let R = toBase58String(O.caller.bytes) | |
143 | + | let U = C(R) | |
144 | + | if ((0 >= U)) | |
141 | 145 | then throw("Insufficient Balance") | |
142 | - | else ScriptResult(WriteSet([DataEntry( | |
146 | + | else ScriptResult(WriteSet([DataEntry(A(R), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(R), U, unit)])) | |
143 | 147 | } | |
144 | 148 | ||
145 | 149 | ||
146 | 150 | ||
147 | - | @Callable( | |
148 | - | func voteCommit ( | |
149 | - | let | |
150 | - | let | |
151 | - | let | |
152 | - | if (( | |
151 | + | @Callable(O) | |
152 | + | func voteCommit (p,V) = { | |
153 | + | let s = toBase58String(O.caller.bytes) | |
154 | + | let W = G(p) | |
155 | + | let X = K(p) | |
156 | + | if ((W >= b)) | |
153 | 157 | then throw("Reached max numbers of voters") | |
154 | - | else if (( | |
158 | + | else if ((E(p, s) != a)) | |
155 | 159 | then throw("User has already participated") | |
156 | - | else if (( | |
160 | + | else if ((y(p) == a)) | |
157 | 161 | then throw("Item does not exist") | |
158 | - | else if (if (( | |
159 | - | then ( | |
162 | + | else if (if ((X != a)) | |
163 | + | then (X != d) | |
160 | 164 | else false) | |
161 | 165 | then throw("Voting is not possible") | |
162 | - | else WriteSet([DataEntry( | |
166 | + | else WriteSet([DataEntry(D(p, s), V), DataEntry(F(p), (W + 1)), DataEntry(J(p), if ((W == b)) | |
163 | 167 | then e | |
164 | 168 | else d)]) | |
165 | 169 | } | |
166 | 170 | ||
167 | 171 | ||
168 | - | @Verifier(W) | |
169 | - | func X () = sigVerify(W.bodyBytes, W.proofs[0], W.senderPublicKey) | |
172 | + | ||
173 | + | @Callable(O) | |
174 | + | func voteReveal (p,M,Y) = { | |
175 | + | let s = toBase58String(O.caller.bytes) | |
176 | + | let X = K(p) | |
177 | + | let Z = (N(p, M) + 1) | |
178 | + | if ((toBase64String(sha256(toBytes((M + Y)))) != E(p, s))) | |
179 | + | then throw("reveal data is not valid") | |
180 | + | else if ((b > G(p))) | |
181 | + | then throw("Max number of votes hasn't been reached yet") | |
182 | + | else if ((I(p, s) != a)) | |
183 | + | then throw("user has already participated") | |
184 | + | else if (if ((X != d)) | |
185 | + | then (X != e) | |
186 | + | else false) | |
187 | + | then throw("wrong status") | |
188 | + | else if (if ((M != f)) | |
189 | + | then (M != g) | |
190 | + | else false) | |
191 | + | then throw("wrong vote") | |
192 | + | else if (if ((M != f)) | |
193 | + | then true | |
194 | + | else (M != g)) | |
195 | + | then throw("Vote has finished") | |
196 | + | else WriteSet([DataEntry(H(p, s), M), DataEntry(L(p, M), Z), DataEntry(J(p), if ((Z >= c)) | |
197 | + | then M | |
198 | + | else e)]) | |
199 | + | } | |
200 | + | ||
201 | + | ||
202 | + | @Verifier(aa) | |
203 | + | func ab () = sigVerify(aa.bodyBytes, aa.proofs[0], aa.senderPublicKey) | |
170 | 204 |
github/deemru/w8io/169f3d6 76.08 ms ◑