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