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