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