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