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