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