tx · N6HWQwhxADhAAsekrL8yauRrcuxYmeX2pSCu2FfqDTA 3MzKq9FC8GAeYxYMGZqPZzrXmRwyyK9eRtU: -0.01400000 Waves 2020.04.02 16:42 [936605] smart account 3MzKq9FC8GAeYxYMGZqPZzrXmRwyyK9eRtU > SELF 0.00000000 Waves
{ "type": 13, "id": "N6HWQwhxADhAAsekrL8yauRrcuxYmeX2pSCu2FfqDTA", "fee": 1400000, "feeAssetId": null, "timestamp": 1585834942658, "version": 1, "sender": "3MzKq9FC8GAeYxYMGZqPZzrXmRwyyK9eRtU", "senderPublicKey": "GXTgD3DifeMCqpyW2oL4fX2vdw49UtqWEesdZpaEuEFB", "proofs": [ "UyW6z12qyuyquSQy8Cx6egMSKfz4Czh18dH59cMmHjnKTuao1UPC4pCD44jezeGRMmyUVL6EoVHW6EUvCdg4yEK" ], "script": "base64:AAIDAAAAAAAAAD4IARIGCgQICAEEEggKBggBAQgBARIGCgQIAQEIEgMKAQgSBwoFCAgBCAESBQoDCAEBEgYKBAgBCAESAwoBCAAAACoAAAAAB2FkZHJlc3MCAAAAIzNNektxOUZDOEdBZVl4WU1HWnFQWnpyWG1Sd3l5SzllUnRVAAAAAA5rZXlFdmVudFByZWZpeAIAAAACZV8AAAAAEmtleUV2ZW50RGF0YVByZWZpeAIAAAAFZGF0YV8AAAAAE2tleUV2ZW50UHJpY2VQcmVmaXgCAAAABnByaWNlXwAAAAASa2V5RXZlbnREYXRlUHJlZml4AgAAAAVkYXRlXwAAAAAWa2V5RXZlbnRBdHRlbmRlZVByZWZpeAIAAAACYV8AAAAAGGtleVByb2R1Y2VyQmFsYW5jZVByZWZpeAIAAAAIYmFsYW5jZV8AAAAAGmtleUV2ZW50QW1vdW50VGlja2V0UHJlZml4AgAAAA5hbW91bnRUaWNrZXRzXwAAAAAWa2V5RXZlbnRDYW5jZWxlZFByZWZpeAIAAAAJY2FuY2VsZWRfAAAAABhrZXlFdmVudE1heFRpY2tldHNQcmVmaXgCAAAABG1heF8AAAA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HYmFsYW5jZQUAAAAKY29tbWlzc2lvbgAAAAAAAAAAZAUAAAAEdW5pdAUAAAADbmlsAAAAAM/zX04=", "chainId": 84, "height": 936605, "spentComplexity": 0 } View: original | compacted Prev: 7e5kbaWoC53nzsaAzvo6h1k4Ns157s1jbtXbxauJG8Zf Next: FnFfpLJmGgcNWPSed4wNaW3gmBhqPCFdc5AUkoQE8fn7 Diff:
Old | New | Differences | |
---|---|---|---|
249 | 249 | @Callable(ae) | |
250 | 250 | func refundTicket (C,ao,I,E) = { | |
251 | 251 | let at = toBase58String(ae.caller.bytes) | |
252 | + | let av = W(at, I, E, C) | |
252 | 253 | if ((R(C) == n)) | |
253 | 254 | then throw("The event does not exist") | |
254 | - | else if ((ao > | |
255 | + | else if ((ao > av)) | |
255 | 256 | then throw("You don't have enough registered tickets with this address") | |
256 | 257 | else if (((lastBlock.timestamp + 15000000) > V(C))) | |
257 | 258 | then throw("This event has already happened") | |
258 | - | else ScriptResult(WriteSet([DataEntry(G(at, I, E, C), ( | |
259 | + | else ScriptResult(WriteSet([DataEntry(G(at, I, E, C), (av - ao))]), TransferSet([ScriptTransfer(addressFromStringValue(at), (ao * av), unit)])) | |
259 | 260 | } | |
260 | 261 | ||
261 | 262 | ||
263 | 264 | @Callable(ae) | |
264 | 265 | func withdraw (C) = { | |
265 | 266 | let an = toBase58String(ae.caller.bytes) | |
266 | - | let | |
267 | + | let aw = X(an, C) | |
267 | 268 | if ((R(C) != an)) | |
268 | 269 | then throw("Event does not exist, or you don't have the credentials to perform this action") | |
269 | - | else if ((0 >= | |
270 | + | else if ((0 >= aw)) | |
270 | 271 | then throw("Insufficient balance") | |
271 | 272 | else if (Z(C)) | |
272 | 273 | then throw("Event has been canceled") | |
273 | - | else ScriptResult(WriteSet([DataEntry(J(an, C), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(an), ( | |
274 | + | else ScriptResult(WriteSet([DataEntry(J(an, C), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(an), (aw - ((aw * o) / 100)), unit), ScriptTransfer(addressFromStringValue(a), ((aw * o) / 100), unit)])) | |
274 | 275 | } | |
275 | 276 | ||
276 | 277 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "3MzKq9FC8GAeYxYMGZqPZzrXmRwyyK9eRtU" | |
5 | 5 | ||
6 | 6 | let b = "e_" | |
7 | 7 | ||
8 | 8 | let c = "data_" | |
9 | 9 | ||
10 | 10 | let d = "price_" | |
11 | 11 | ||
12 | 12 | let e = "date_" | |
13 | 13 | ||
14 | 14 | let f = "a_" | |
15 | 15 | ||
16 | 16 | let g = "balance_" | |
17 | 17 | ||
18 | 18 | let h = "amountTickets_" | |
19 | 19 | ||
20 | 20 | let i = "canceled_" | |
21 | 21 | ||
22 | 22 | let j = "max_" | |
23 | 23 | ||
24 | 24 | let k = "requiresId_" | |
25 | 25 | ||
26 | 26 | let l = "ticketDescription_" | |
27 | 27 | ||
28 | 28 | let m = "tickets_" | |
29 | 29 | ||
30 | 30 | let n = "none" | |
31 | 31 | ||
32 | 32 | let o = 5 | |
33 | 33 | ||
34 | 34 | func p (q) = { | |
35 | 35 | let r = { | |
36 | 36 | let s = getInteger(this, q) | |
37 | 37 | if ($isInstanceOf(s, "Int")) | |
38 | 38 | then { | |
39 | 39 | let t = s | |
40 | 40 | t | |
41 | 41 | } | |
42 | 42 | else 0 | |
43 | 43 | } | |
44 | 44 | r | |
45 | 45 | } | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func u (q) = { | |
49 | 49 | let v = { | |
50 | 50 | let s = getString(this, q) | |
51 | 51 | if ($isInstanceOf(s, "String")) | |
52 | 52 | then { | |
53 | 53 | let t = s | |
54 | 54 | t | |
55 | 55 | } | |
56 | 56 | else n | |
57 | 57 | } | |
58 | 58 | v | |
59 | 59 | } | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func w (q) = { | |
63 | 63 | let x = { | |
64 | 64 | let s = getBoolean(this, q) | |
65 | 65 | if ($isInstanceOf(s, "Boolean")) | |
66 | 66 | then { | |
67 | 67 | let t = s | |
68 | 68 | t | |
69 | 69 | } | |
70 | 70 | else false | |
71 | 71 | } | |
72 | 72 | x | |
73 | 73 | } | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func y (z,A) = (b + toBase58String(sha256(toBytes((z + A))))) | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func B (C) = (c + C) | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func D (C,E) = (((d + toString(E)) + "_") + C) | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func F (C) = (e + C) | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func G (H,I,E,C) = (((((f + toBase58String(sha256(toBytes((H + I))))) + "_") + toString(E)) + "_") + C) | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func J (K,C) = (((g + K) + "_") + C) | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func L (C,E) = (((h + toString(E)) + "_") + C) | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func M (C) = (i + C) | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func N (C) = (k + C) | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | func O (C,E) = (((j + toString(E)) + "_") + C) | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | func P (C,E) = (((l + toString(E)) + "_") + C) | |
107 | 107 | ||
108 | 108 | ||
109 | 109 | func Q (C) = (m + C) | |
110 | 110 | ||
111 | 111 | ||
112 | 112 | func R (S) = u(S) | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | func T (z,A) = u(y(z, A)) | |
116 | 116 | ||
117 | 117 | ||
118 | 118 | func U (C,E) = p(D(C, E)) | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | func V (C) = p(F(C)) | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | func W (H,I,E,C) = p(G(H, I, E, C)) | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | func X (K,C) = p(J(K, C)) | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | func Y (C,E) = p(L(C, E)) | |
131 | 131 | ||
132 | 132 | ||
133 | 133 | func Z (C) = w(M(C)) | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | func aa (C) = w(N(C)) | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | func ab (C,E) = p(O(C, E)) | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func ac (C,E) = u(P(C, E)) | |
143 | 143 | ||
144 | 144 | ||
145 | 145 | func ad (C) = p(Q(C)) | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | @Callable(ae) | |
149 | 149 | func createEvent (A,af,ag,ah) = { | |
150 | 150 | let ai = toBase58String(ae.caller.bytes) | |
151 | 151 | let C = y(ai, A) | |
152 | 152 | if ((T(ai, A) != n)) | |
153 | 153 | then throw("The event already exist") | |
154 | 154 | else if ((lastBlock.timestamp > ag)) | |
155 | 155 | then throw("Date cannot be in the past") | |
156 | 156 | else WriteSet([DataEntry(y(ai, A), ai), DataEntry(B(C), af), DataEntry(F(C), ag), DataEntry(N(C), ah), DataEntry(Q(C), 0)]) | |
157 | 157 | } | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | ||
161 | 161 | @Callable(ae) | |
162 | 162 | func createEventTicket (C,E,aj,ak,al,am) = { | |
163 | 163 | let an = toBase58String(ae.caller.bytes) | |
164 | 164 | let ai = R(C) | |
165 | 165 | if ((ai != an)) | |
166 | 166 | then throw("Event does not exist, or you don't have the credentials to perform this action") | |
167 | 167 | else if (((lastBlock.timestamp + 15000000) > V(C))) | |
168 | 168 | then throw("This event has already happened") | |
169 | 169 | else if (Z(C)) | |
170 | 170 | then throw("This event was canceled") | |
171 | 171 | else WriteSet([DataEntry(D(C, E), aj), DataEntry(L(C, E), al), DataEntry(O(C, E), am), DataEntry(P(C, E), ak), DataEntry(Q(C), (ad(C) + 1))]) | |
172 | 172 | } | |
173 | 173 | ||
174 | 174 | ||
175 | 175 | ||
176 | 176 | @Callable(ae) | |
177 | 177 | func purchase (C,E,ao,I) = { | |
178 | 178 | let ap = extract(ae.payment) | |
179 | 179 | let aq = toBase58String(ae.caller.bytes) | |
180 | 180 | let aj = U(C, E) | |
181 | 181 | let ai = R(C) | |
182 | 182 | let ar = Y(C, E) | |
183 | 183 | let as = "" | |
184 | 184 | if (isDefined(ap.assetId)) | |
185 | 185 | then throw("can use WAVES only at the moment") | |
186 | 186 | else if ((ai == n)) | |
187 | 187 | then throw("Event does not exist") | |
188 | 188 | else if (((aj * ao) > ap.amount)) | |
189 | 189 | then throw(((("You did not send enough money. You sent: " + toString(ap.amount)) + ". Expected: ") + toString((ao * aj)))) | |
190 | 190 | else if ((ap.amount > (aj * ao))) | |
191 | 191 | then throw(((("You send too much money. You sent: " + toString(ap.amount)) + ". Total price: ") + toString((ao * aj)))) | |
192 | 192 | else if ((0 > (ar - ao))) | |
193 | 193 | then throw("Not enough tickets left") | |
194 | 194 | else if (((lastBlock.timestamp + 15000000) > V(C))) | |
195 | 195 | then throw("This event has already happened") | |
196 | 196 | else if (Z(C)) | |
197 | 197 | then throw("This event was canceled") | |
198 | 198 | else if (if (aa(C)) | |
199 | 199 | then (I == "") | |
200 | 200 | else false) | |
201 | 201 | then throw("This event requires that you register with a personal ID") | |
202 | 202 | else if ((ab(C, E) > (W(aq, I, E, C) + ao))) | |
203 | 203 | then throw("Amount of Tickets exceeds maximum amount per attendee") | |
204 | 204 | else ScriptResult(WriteSet([DataEntry(G(aq, I, E, C), (W(aq, I, E, C) + ao)), DataEntry(J(ai, C), (X(ai, C) + ap.amount)), DataEntry(L(C, E), (ar - ao))]), TransferSet([ScriptTransfer(addressFromStringValue(a), ap.amount, unit)])) | |
205 | 205 | } | |
206 | 206 | ||
207 | 207 | ||
208 | 208 | ||
209 | 209 | @Callable(ae) | |
210 | 210 | func cancelEvent (C) = { | |
211 | 211 | let an = toBase58String(ae.caller.bytes) | |
212 | 212 | if ((R(C) != an)) | |
213 | 213 | then throw("Event does not exist, or you don't have the credentials to perform this action") | |
214 | 214 | else if (((lastBlock.timestamp + 15000000) > V(C))) | |
215 | 215 | then throw("This event has already happened") | |
216 | 216 | else WriteSet([DataEntry(M(C), true)]) | |
217 | 217 | } | |
218 | 218 | ||
219 | 219 | ||
220 | 220 | ||
221 | 221 | @Callable(ae) | |
222 | 222 | func checkin (C,at,ao,I,E) = { | |
223 | 223 | let an = toBase58String(ae.caller.bytes) | |
224 | 224 | if ((R(C) != an)) | |
225 | 225 | then throw("Event does not exist, or you don't have the credentials to perform this action") | |
226 | 226 | else if ((ao > W(at, I, E, C))) | |
227 | 227 | then throw("You don't have enough tickets.") | |
228 | 228 | else if (Z(C)) | |
229 | 229 | then throw("This event was canceled. You can redeem your ticket using refundTicket function") | |
230 | 230 | else WriteSet([DataEntry(G(at, I, E, C), (W(at, I, E, C) - ao))]) | |
231 | 231 | } | |
232 | 232 | ||
233 | 233 | ||
234 | 234 | ||
235 | 235 | @Callable(ae) | |
236 | 236 | func editEventTickets (C,E,au) = { | |
237 | 237 | let an = toBase58String(ae.caller.bytes) | |
238 | 238 | if ((R(C) != an)) | |
239 | 239 | then throw("Event does not exist, or you don't have the credentials to perform this action") | |
240 | 240 | else if (((lastBlock.timestamp + 15000000) > V(C))) | |
241 | 241 | then throw("This event has already happened") | |
242 | 242 | else if (Z(C)) | |
243 | 243 | then throw("This event was already canceled") | |
244 | 244 | else WriteSet([DataEntry(L(C, E), au)]) | |
245 | 245 | } | |
246 | 246 | ||
247 | 247 | ||
248 | 248 | ||
249 | 249 | @Callable(ae) | |
250 | 250 | func refundTicket (C,ao,I,E) = { | |
251 | 251 | let at = toBase58String(ae.caller.bytes) | |
252 | + | let av = W(at, I, E, C) | |
252 | 253 | if ((R(C) == n)) | |
253 | 254 | then throw("The event does not exist") | |
254 | - | else if ((ao > | |
255 | + | else if ((ao > av)) | |
255 | 256 | then throw("You don't have enough registered tickets with this address") | |
256 | 257 | else if (((lastBlock.timestamp + 15000000) > V(C))) | |
257 | 258 | then throw("This event has already happened") | |
258 | - | else ScriptResult(WriteSet([DataEntry(G(at, I, E, C), ( | |
259 | + | else ScriptResult(WriteSet([DataEntry(G(at, I, E, C), (av - ao))]), TransferSet([ScriptTransfer(addressFromStringValue(at), (ao * av), unit)])) | |
259 | 260 | } | |
260 | 261 | ||
261 | 262 | ||
262 | 263 | ||
263 | 264 | @Callable(ae) | |
264 | 265 | func withdraw (C) = { | |
265 | 266 | let an = toBase58String(ae.caller.bytes) | |
266 | - | let | |
267 | + | let aw = X(an, C) | |
267 | 268 | if ((R(C) != an)) | |
268 | 269 | then throw("Event does not exist, or you don't have the credentials to perform this action") | |
269 | - | else if ((0 >= | |
270 | + | else if ((0 >= aw)) | |
270 | 271 | then throw("Insufficient balance") | |
271 | 272 | else if (Z(C)) | |
272 | 273 | then throw("Event has been canceled") | |
273 | - | else ScriptResult(WriteSet([DataEntry(J(an, C), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(an), ( | |
274 | + | else ScriptResult(WriteSet([DataEntry(J(an, C), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(an), (aw - ((aw * o) / 100)), unit), ScriptTransfer(addressFromStringValue(a), ((aw * o) / 100), unit)])) | |
274 | 275 | } | |
275 | 276 | ||
276 | 277 |
github/deemru/w8io/169f3d6 43.81 ms ◑