tx · 4GvnSkhd1JcKoAc6v2i26zPRdyNRrVS33bZR66o4hEMJ 3N1RM5X2PdS1vH3vmzRrdzQDjAUjMqk2RbJ: -0.01400000 Waves 2020.04.17 15:14 [958467] smart account 3N1RM5X2PdS1vH3vmzRrdzQDjAUjMqk2RbJ > SELF 0.00000000 Waves
{ "type": 13, "id": "4GvnSkhd1JcKoAc6v2i26zPRdyNRrVS33bZR66o4hEMJ", "fee": 1400000, "feeAssetId": null, "timestamp": 1587125751982, "version": 1, "sender": "3N1RM5X2PdS1vH3vmzRrdzQDjAUjMqk2RbJ", "senderPublicKey": "5xkQSCjfQmc7gqQcXZtkcWTzv4TmPAWcc81im9ngfwK9", "proofs": [ "5WNBawf1tzZ6LaFMBYGgz98F7ddy9bL4GQKbbCPbCAV64TppyE2HwPN3P9GaHFuQejYyzgtNP2xecKkgZFHjRs3n" ], "script": "base64:AAIDAAAAAAAAAFIIARIGCgQICAEEEgcKBQgBCAEBEgYKBAgBAQgSAwoBCBIICgYICAEIAQESBQoDCAEBEgQKAggIEgUKAwgIARIFCgMIAQESBgoECAEIARIDCgEIAAAALQAAAAAHYWRkcmVzcwIAAAAjM04xUk01WDJQZFMxdkgzdm16UnJkelFEakFVak1xazJSYkoAAAAADmtleUV2ZW50UHJlZml4AgAAAAJlXwAAAAASa2V5RXZlbnREYXRhUHJlZml4AgAAAAVkYXRhXwAAAAAZa2V5RXZlbnRUaWNrZXRQcmljZVByZWZpeAIAAAAMdGlja2V0UHJpY2VfAAAAABJrZXlFdmVudERhdGVQcmVmaXgCAAAABWRhdGVfAAAAABZrZXlFdmVudEF0dGVuZGVlUHJlZml4AgAAAAJhXwAAAAAYa2V5UHJvZHVjZXJCYWxhbmNlUHJlZml4AgAAAAhiYWxhbmNlXwAAAAAaa2V5RXZlbnRBbW91bnRUaWNrZXRQcmVmaXgCAAAADXRpY2tldEFtb3VudF8AAAAAFmtleUV2ZW50Q2FuY2VsZWRQcmVmaXgCAAAACWNhbmNlbGVkXwAAAA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YWRkcmVzc0Zyb21TdHJpbmcpAAAAAQUAAAAHYWRkcmVzcwkAAGkAAAACCQAAaAAAAAIFAAAAB2JhbGFuY2UFAAAACmNvbW1pc3Npb24AAAAAAAAAAGQFAAAABHVuaXQFAAAAA25pbAAAAAA31vX+", "chainId": 84, "height": 958467, "spentComplexity": 0 } View: original | compacted Prev: E9YJ1dw9CAidsCpsrLaABE3zMMMsJmnDetUsvSpQjD3k Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let address = "3N1RM5X2PdS1vH3vmzRrdzQDjAUjMqk2RbJ" | |
5 | 5 | ||
6 | 6 | let keyEventPrefix = "e_" | |
7 | 7 | ||
8 | 8 | let keyEventDataPrefix = "data_" | |
9 | 9 | ||
10 | 10 | let keyEventTicketPricePrefix = "ticketPrice_" | |
11 | 11 | ||
12 | 12 | let keyEventDatePrefix = "date_" | |
13 | 13 | ||
14 | 14 | let keyEventAttendeePrefix = "a_" | |
15 | 15 | ||
16 | 16 | let keyProducerBalancePrefix = "balance_" | |
17 | 17 | ||
18 | 18 | let keyEventAmountTicketPrefix = "ticketAmount_" | |
19 | 19 | ||
20 | 20 | let keyEventCanceledPrefix = "canceled_" | |
21 | 21 | ||
22 | 22 | let keyEventTicketMaxPrefix = "ticketMax_" | |
23 | 23 | ||
24 | 24 | let keyEventRequiresIdPrefix = "requiresId_" | |
25 | 25 | ||
26 | 26 | let keyEventTicketDescriptionPrefix = "ticketDescription_" | |
27 | 27 | ||
28 | 28 | let keyEventTicketsPrefix = "tickets_" | |
29 | 29 | ||
30 | 30 | let keyEventTrusteePrefix = "trustee_" | |
31 | 31 | ||
32 | 32 | let NONE = "none" | |
33 | 33 | ||
34 | 34 | let commission = 5 | |
35 | 35 | ||
36 | 36 | func getNumberByKey (key) = { | |
37 | 37 | let num = match getInteger(this, key) { | |
38 | 38 | case a: Int => | |
39 | 39 | a | |
40 | 40 | case _ => | |
41 | 41 | 0 | |
42 | 42 | } | |
43 | 43 | num | |
44 | 44 | } | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | func getStrByKey (key) = { | |
48 | 48 | let str = match getString(this, key) { | |
49 | 49 | case a: String => | |
50 | 50 | a | |
51 | 51 | case _ => | |
52 | 52 | NONE | |
53 | 53 | } | |
54 | 54 | str | |
55 | 55 | } | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func getBoolByKey (key) = { | |
59 | 59 | let bool = match getBoolean(this, key) { | |
60 | 60 | case a: Boolean => | |
61 | 61 | a | |
62 | 62 | case _ => | |
63 | 63 | false | |
64 | 64 | } | |
65 | 65 | bool | |
66 | 66 | } | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func getEventKey (producer,title) = (keyEventPrefix + toBase58String(sha256(toBytes((producer + title))))) | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func getEventDataKey (event) = (keyEventDataPrefix + event) | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func getEventTicketPriceKey (event,ticketId) = (((keyEventTicketPricePrefix + toString(ticketId)) + "_") + event) | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func getEventDateKey (event) = (keyEventDatePrefix + event) | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func getEventAttendeeKey (user,id,ticketId,event) = (((((keyEventAttendeePrefix + toBase58String(sha256(toBytes((user + id))))) + "_") + toString(ticketId)) + "_") + event) | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func getEventBalanceKey (account,event) = (((keyProducerBalancePrefix + account) + "_") + event) | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func getEventTicketAmountKey (event,ticketId) = (((keyEventAmountTicketPrefix + toString(ticketId)) + "_") + event) | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func getEventCanceledKey (event) = (keyEventCanceledPrefix + event) | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func getEventRequiresIdKey (event) = (keyEventRequiresIdPrefix + event) | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func getEventTicketMaxKey (event,ticketId) = (((keyEventTicketMaxPrefix + toString(ticketId)) + "_") + event) | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func getEventTicketDescriptionKey (event,ticketId) = (((keyEventTicketDescriptionPrefix + toString(ticketId)) + "_") + event) | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func getEventTicketsKey (event) = (keyEventTicketsPrefix + event) | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func getEventTrusteeKey (event,trusteeKey) = (((keyEventTrusteePrefix + toString(trusteeKey)) + "_") + event) | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func getEventValueById (item) = getStrByKey(item) | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func getEventValue (producer,title) = getStrByKey(getEventKey(producer, title)) | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func getEventTicketPriceValue (event,ticketId) = getNumberByKey(getEventTicketPriceKey(event, ticketId)) | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func getEventDateValue (event) = getNumberByKey(getEventDateKey(event)) | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func getEventAttendeeValue (user,id,ticketId,event) = getNumberByKey(getEventAttendeeKey(user, id, ticketId, event)) | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func getEventBalanceValue (account,event) = getNumberByKey(getEventBalanceKey(account, event)) | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func getEventTicketAmountValue (event,ticketId) = getNumberByKey(getEventTicketAmountKey(event, ticketId)) | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func getEventCanceledValue (event) = getBoolByKey(getEventCanceledKey(event)) | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func getEventRequiresIdValue (event) = getBoolByKey(getEventRequiresIdKey(event)) | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func getEventTicketMaxValue (event,ticketId) = getNumberByKey(getEventTicketMaxKey(event, ticketId)) | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | func getEventTicketDescriptionValue (event,ticketId) = getStrByKey(getEventTicketDescriptionKey(event, ticketId)) | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | func getEventTicketsValue (event) = getNumberByKey(getEventTicketsKey(event)) | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | func getEventTrusteeValue (event,trusteeKey) = getStrByKey(getEventTrusteeKey(event, trusteeKey)) | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | @Callable(i) | |
148 | 148 | func createEvent (title,data,date,requiresId) = { | |
149 | 149 | let producerAddress = toBase58String(i.caller.bytes) | |
150 | 150 | let event = getEventKey(producerAddress, title) | |
151 | 151 | if ((getEventValue(producerAddress, title) != NONE)) | |
152 | 152 | then throw("The event already exist") | |
153 | 153 | else if ((lastBlock.timestamp > date)) | |
154 | 154 | then throw("Date cannot be in the past") | |
155 | 155 | else WriteSet([DataEntry(getEventKey(producerAddress, title), producerAddress), DataEntry(getEventDataKey(event), data), DataEntry(getEventDateKey(event), date), DataEntry(getEventRequiresIdKey(event), requiresId), DataEntry(getEventTicketsKey(event), 0), DataEntry(getEventCanceledKey(event), false), DataEntry(getEventTrusteeKey(event, 0), producerAddress)]) | |
156 | 156 | } | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | ||
160 | 160 | @Callable(i) | |
161 | 161 | func createEventTicket (event,price,description,amountTickets,maxAmount) = { | |
162 | 162 | let callerAddress = toBase58String(i.caller.bytes) | |
163 | 163 | let producerAddress = getEventValueById(event) | |
164 | 164 | let ticketId = getEventTicketsValue(event) | |
165 | 165 | if ((producerAddress != callerAddress)) | |
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) > getEventDateValue(event))) | |
168 | 168 | then throw("This event has already happened") | |
169 | 169 | else if (getEventCanceledValue(event)) | |
170 | 170 | then throw("This event was canceled") | |
171 | 171 | else WriteSet([DataEntry(getEventTicketPriceKey(event, ticketId), price), DataEntry(getEventTicketAmountKey(event, ticketId), amountTickets), DataEntry(getEventTicketMaxKey(event, ticketId), maxAmount), DataEntry(getEventTicketDescriptionKey(event, ticketId), description), DataEntry(getEventTicketsKey(event), (getEventTicketsValue(event) + 1))]) | |
172 | 172 | } | |
173 | 173 | ||
174 | 174 | ||
175 | 175 | ||
176 | 176 | @Callable(i) | |
177 | 177 | func purchase (event,ticketId,amount,id) = { | |
178 | 178 | let pmt = extract(i.payment) | |
179 | 179 | let userAddress = toBase58String(i.caller.bytes) | |
180 | 180 | let price = getEventTicketPriceValue(event, ticketId) | |
181 | 181 | let producerAddress = getEventValueById(event) | |
182 | 182 | let ticketsLeft = getEventTicketAmountValue(event, ticketId) | |
183 | 183 | let totalPrice = (amount * price) | |
184 | 184 | if (isDefined(pmt.assetId)) | |
185 | 185 | then throw("can use WAVES only at the moment") | |
186 | 186 | else if ((producerAddress == NONE)) | |
187 | 187 | then throw("Event does not exist") | |
188 | 188 | else if ((totalPrice > pmt.amount)) | |
189 | 189 | then throw(((("You did not send enough money. You sent: " + toString(pmt.amount)) + ". Expected: ") + toString(totalPrice))) | |
190 | 190 | else if ((pmt.amount > totalPrice)) | |
191 | 191 | then throw(((("You send too much money. You sent: " + toString(pmt.amount)) + ". Total price: ") + toString(totalPrice))) | |
192 | 192 | else if ((0 > (ticketsLeft - amount))) | |
193 | 193 | then throw("Not enough tickets left") | |
194 | 194 | else if (((lastBlock.timestamp + 15000000) > getEventDateValue(event))) | |
195 | 195 | then throw("This event has already happened") | |
196 | 196 | else if (getEventCanceledValue(event)) | |
197 | 197 | then throw("This event was canceled") | |
198 | 198 | else if (if (getEventRequiresIdValue(event)) | |
199 | 199 | then (id == "") | |
200 | 200 | else false) | |
201 | 201 | then throw("This event requires that you register with a personal ID") | |
202 | 202 | else if (if ((getEventTicketMaxValue(event, ticketId) > 0)) | |
203 | 203 | then ((getEventAttendeeValue(userAddress, id, ticketId, event) + amount) > getEventTicketMaxValue(event, ticketId)) | |
204 | 204 | else false) | |
205 | 205 | then throw("Amount of Tickets exceeds maximum amount per attendee") | |
206 | 206 | else ScriptResult(WriteSet([DataEntry(getEventAttendeeKey(userAddress, id, ticketId, event), (getEventAttendeeValue(userAddress, id, ticketId, event) + amount)), DataEntry(getEventBalanceKey(producerAddress, event), (getEventBalanceValue(producerAddress, event) + pmt.amount)), DataEntry(getEventTicketAmountKey(event, ticketId), (ticketsLeft - amount))]), TransferSet([ScriptTransfer(addressFromStringValue(address), pmt.amount, unit)])) | |
207 | 207 | } | |
208 | 208 | ||
209 | 209 | ||
210 | 210 | ||
211 | 211 | @Callable(i) | |
212 | 212 | func cancelEvent (event) = { | |
213 | 213 | let callerAddress = toBase58String(i.caller.bytes) | |
214 | 214 | if ((getEventValueById(event) != callerAddress)) | |
215 | 215 | then throw("Event does not exist, or you don't have the credentials to perform this action") | |
216 | 216 | else if (((lastBlock.timestamp + 15000000) > getEventDateValue(event))) | |
217 | 217 | then throw("This event has already happened") | |
218 | 218 | else WriteSet([DataEntry(getEventCanceledKey(event), true)]) | |
219 | 219 | } | |
220 | 220 | ||
221 | 221 | ||
222 | 222 | ||
223 | 223 | @Callable(i) | |
224 | 224 | func checkin (event,attendeeAddress,amount,id,ticketId,trusteeKey) = { | |
225 | 225 | let callerAddress = toBase58String(i.caller.bytes) | |
226 | 226 | if (if ((getEventValueById(event) != callerAddress)) | |
227 | 227 | then (getEventTrusteeValue(event, trusteeKey) != callerAddress) | |
228 | 228 | else false) | |
229 | 229 | then throw("Event does not exist, or you don't have the credentials to perform this action") | |
230 | 230 | else if ((amount > getEventAttendeeValue(attendeeAddress, id, ticketId, event))) | |
231 | 231 | then throw("You don't have enough tickets.") | |
232 | 232 | else if (getEventCanceledValue(event)) | |
233 | 233 | then throw("This event was canceled. You can redeem your ticket using refundTicket function") | |
234 | 234 | else WriteSet([DataEntry(getEventAttendeeKey(attendeeAddress, id, ticketId, event), (getEventAttendeeValue(attendeeAddress, id, ticketId, event) - amount))]) | |
235 | 235 | } | |
236 | 236 | ||
237 | 237 | ||
238 | 238 | ||
239 | 239 | @Callable(i) | |
240 | 240 | func editEventTickets (event,ticketId,newAmount) = { | |
241 | 241 | let callerAddress = toBase58String(i.caller.bytes) | |
242 | 242 | if ((getEventValueById(event) != callerAddress)) | |
243 | 243 | then throw("Event does not exist, or you don't have the credentials to perform this action") | |
244 | 244 | else if (((lastBlock.timestamp + 15000000) > getEventDateValue(event))) | |
245 | 245 | then throw("This event has already happened") | |
246 | 246 | else if (getEventCanceledValue(event)) | |
247 | 247 | then throw("This event was already canceled") | |
248 | 248 | else WriteSet([DataEntry(getEventTicketAmountKey(event, ticketId), newAmount)]) | |
249 | 249 | } | |
250 | 250 | ||
251 | 251 | ||
252 | 252 | ||
253 | 253 | @Callable(i) | |
254 | 254 | func editEventProducer (event,newProducer) = { | |
255 | 255 | let producerAddress = toBase58String(i.caller.bytes) | |
256 | 256 | if ((getEventValueById(event) != producerAddress)) | |
257 | 257 | then throw("Event does not exist, or you don't have the credentials to perform this action") | |
258 | 258 | else WriteSet([DataEntry(event, newProducer)]) | |
259 | 259 | } | |
260 | 260 | ||
261 | 261 | ||
262 | 262 | ||
263 | 263 | @Callable(i) | |
264 | 264 | func editEventTrustee (event,trusteeAddress,trusteeKey) = { | |
265 | 265 | let producerAddress = toBase58String(i.caller.bytes) | |
266 | 266 | if ((getEventValueById(event) != producerAddress)) | |
267 | 267 | then throw("Event does not exist, or you don't have the credentials to perform this action") | |
268 | 268 | else WriteSet([DataEntry(getEventTrusteeKey(event, trusteeKey), trusteeAddress)]) | |
269 | 269 | } | |
270 | 270 | ||
271 | 271 | ||
272 | 272 | ||
273 | 273 | @Callable(i) | |
274 | 274 | func editEventData (event,data,date) = { | |
275 | 275 | let producerAddress = toBase58String(i.caller.bytes) | |
276 | 276 | if ((getEventValueById(event) != producerAddress)) | |
277 | 277 | then throw("Event does not exist, or you don't have the credentials to perform this action") | |
278 | 278 | else if ((lastBlock.timestamp > date)) | |
279 | 279 | then throw("Date cannot be in the past") | |
280 | 280 | else if ((getEventDateValue(event) > date)) | |
281 | 281 | then throw("New date cannot be earlier that the original date") | |
282 | 282 | else WriteSet([DataEntry(getEventDataKey(event), data), DataEntry(getEventDateKey(event), date)]) | |
283 | 283 | } | |
284 | 284 | ||
285 | 285 | ||
286 | 286 | ||
287 | 287 | @Callable(i) | |
288 | 288 | func refundTicket (event,amount,id,ticketId) = { | |
289 | 289 | let attendeeAddress = toBase58String(i.caller.bytes) | |
290 | 290 | let attendeeValue = getEventAttendeeValue(attendeeAddress, id, ticketId, event) | |
291 | 291 | if ((getEventValueById(event) == NONE)) | |
292 | 292 | then throw("The event does not exist") | |
293 | 293 | else if ((amount > attendeeValue)) | |
294 | 294 | then throw("You don't have enough registered tickets with this address") | |
295 | 295 | else if (((lastBlock.timestamp + 10000000) > getEventDateValue(event))) | |
296 | 296 | then throw("This event has already happened") | |
297 | 297 | else ScriptResult(WriteSet([DataEntry(getEventAttendeeKey(attendeeAddress, id, ticketId, event), (attendeeValue - amount)), DataEntry(getEventTicketAmountKey(event, ticketId), (getEventTicketAmountValue(event, ticketId) + amount))]), TransferSet([ScriptTransfer(addressFromStringValue(attendeeAddress), (amount * attendeeValue), unit)])) | |
298 | 298 | } | |
299 | 299 | ||
300 | 300 | ||
301 | 301 | ||
302 | 302 | @Callable(i) | |
303 | 303 | func withdraw (event) = { | |
304 | 304 | let callerAddress = toBase58String(i.caller.bytes) | |
305 | 305 | let balance = getEventBalanceValue(callerAddress, event) | |
306 | 306 | if ((getEventValueById(event) != callerAddress)) | |
307 | 307 | then throw("Event does not exist, or you don't have the credentials to perform this action") | |
308 | 308 | else if ((0 >= balance)) | |
309 | 309 | then throw("Insufficient balance") | |
310 | 310 | else if ((getEventDateValue(event) > (lastBlock.timestamp - 1000000))) | |
311 | 311 | then throw("Event has not yet taken place. Withdraw funds when event takes place.") | |
312 | 312 | else if (getEventCanceledValue(event)) | |
313 | 313 | then throw("Event has been canceled") | |
314 | 314 | else ScriptResult(WriteSet([DataEntry(getEventBalanceKey(callerAddress, event), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(callerAddress), (balance - ((balance * commission) / 100)), unit), ScriptTransfer(addressFromStringValue(address), ((balance * commission) / 100), unit)])) | |
315 | 315 | } | |
316 | 316 | ||
317 | 317 |
github/deemru/w8io/169f3d6 46.11 ms ◑