tx · Dj15fd9gAnkGga7XL8m6gMr7dmYBL9AamZqEoa1dHjPM 3N1RM5X2PdS1vH3vmzRrdzQDjAUjMqk2RbJ: -0.01400000 Waves 2020.04.03 21:26 [938346] smart account 3N1RM5X2PdS1vH3vmzRrdzQDjAUjMqk2RbJ > SELF 0.00000000 Waves
{ "type": 13, "id": "Dj15fd9gAnkGga7XL8m6gMr7dmYBL9AamZqEoa1dHjPM", "fee": 1400000, "feeAssetId": null, "timestamp": 1585938401113, "version": 1, "sender": "3N1RM5X2PdS1vH3vmzRrdzQDjAUjMqk2RbJ", "senderPublicKey": "5xkQSCjfQmc7gqQcXZtkcWTzv4TmPAWcc81im9ngfwK9", "proofs": [ "75Bvw3cUFBoruZvwZdiuSqm5RREbRcf8JMqryXoi5EDUHYZW8GtDUqChJmiR5ahZQLrJkZ1pC8ds1xEq7iYvP5v" ], "script": "base64:AAIDAAAAAAAAAD0IARIGCgQICAEEEgcKBQgBCAEBEgYKBAgBAQgSAwoBCBIHCgUICAEIARIFCgMIAQESBgoECAEIARIDCgEIAAAAKgAAAAAHYWRkcmVzcwIAAAAjM04xUk01WDJQZFMxdkgzdm16UnJkelFEakFVak1xazJSYkoAAAAADmtleUV2ZW50UHJlZml4AgAAAAJlXwAAAAASa2V5RXZlbnREYXRhUHJlZml4AgAAAAVkYXRhXwAAAAAZa2V5RXZlbnRUaWNrZXRQcmljZVByZWZpeAIAAAAMdGlja2V0UHJpY2VfAAAAABJrZXlFdmVudERhdGVQcmVmaXgCAAAABWRhdGVfAAAAABZrZXlFdmVudEF0dGVuZGVlUHJlZml4AgAAAAJhXwAAAAAYa2V5UHJvZHVjZXJCYWxhbmNlUHJlZml4AgAAAAhiYWxhbmNlXwAAAAAaa2V5RXZlbnRBbW91bnRUaWNrZXRQcmVmaXgCAAAADXRpY2tldEFtb3VudF8AAAAAFmtleUV2ZW50Q2FuY2VsZWRQcmVmaXgCAAAACWNhbmNlbGVkXwAAAAAXa2V5RXZlbnRUaWNrZXRNYX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AABORXZlbnQgZG9lcyBub3QgZXhpc3QsIG9yIHlvdSBkb24ndCBoYXZlIHRoZSBjcmVkZW50aWFscyB0byBwZXJmb3JtIHRoaXMgYWN0aW9uAwkAAGcAAAACAAAAAAAAAAAABQAAAAdiYWxhbmNlCQAAAgAAAAECAAAAFEluc3VmZmljaWVudCBiYWxhbmNlAwkBAAAAFWdldEV2ZW50Q2FuY2VsZWRWYWx1ZQAAAAEFAAAABWV2ZW50CQAAAgAAAAECAAAAF0V2ZW50IGhhcyBiZWVuIGNhbmNlbGVkCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAAEmdldEV2ZW50QmFsYW5jZUtleQAAAAIFAAAADWNhbGxlckFkZHJlc3MFAAAABWV2ZW50AAAAAAAAAAAABQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABBQAAAA1jYWxsZXJBZGRyZXNzCQAAZQAAAAIFAAAAB2JhbGFuY2UJAABpAAAAAgkAAGgAAAACBQAAAAdiYWxhbmNlBQAAAApjb21taXNzaW9uAAAAAAAAAABkBQAAAAR1bml0CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQUAAAAHYWRkcmVzcwkAAGkAAAACCQAAaAAAAAIFAAAAB2JhbGFuY2UFAAAACmNvbW1pc3Npb24AAAAAAAAAAGQFAAAABHVuaXQFAAAAA25pbAAAAAAm65gd", "chainId": 84, "height": 938346, "spentComplexity": 0 } View: original | compacted Prev: 7VAt1fpN3FLjhNFVPDtHgeDfYgSUqDYmDUkPG7ydZDxQ Next: dqzgd8gseAfbV712X4DB5DNfiQ6ygtfqTS4Lp6z8KjX Diff:
Old | New | Differences | |
---|---|---|---|
172 | 172 | let price = getEventTicketPriceValue(event, ticketId) | |
173 | 173 | let producerAddress = getEventValueById(event) | |
174 | 174 | let ticketsLeft = getEventTicketAmountValue(event, ticketId) | |
175 | - | let attendeeKey = "" | |
176 | 175 | let totalPrice = (amount * price) | |
177 | 176 | if (isDefined(pmt.assetId)) | |
178 | 177 | then throw("can use WAVES only at the moment") | |
194 | 193 | then throw("This event requires that you register with a personal ID") | |
195 | 194 | else if ((getEventTicketMaxValue(event, ticketId) > (getEventAttendeeValue(userAddress, id, ticketId, event) + amount))) | |
196 | 195 | then throw("Amount of Tickets exceeds maximum amount per attendee") | |
197 | - | else TransferSet([ScriptTransfer(addressFromStringValue(address), pmt.amount, unit)]) | |
196 | + | 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)])) | |
198 | 197 | } | |
199 | 198 | ||
200 | 199 |
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 | 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 | - | let attendeeKey = "" | |
176 | 175 | let totalPrice = (amount * price) | |
177 | 176 | if (isDefined(pmt.assetId)) | |
178 | 177 | then throw("can use WAVES only at the moment") | |
179 | 178 | else if ((producerAddress == NONE)) | |
180 | 179 | then throw("Event does not exist") | |
181 | 180 | else if ((totalPrice > pmt.amount)) | |
182 | 181 | then throw("You did not send enough money.") | |
183 | 182 | else if ((pmt.amount > totalPrice)) | |
184 | 183 | then throw("You send too much money.") | |
185 | 184 | else if ((0 > (ticketsLeft - amount))) | |
186 | 185 | then throw("Not enough tickets left") | |
187 | 186 | else if (((lastBlock.timestamp + 15000000) > getEventDateValue(event))) | |
188 | 187 | then throw("This event has already happened") | |
189 | 188 | else if (getEventCanceledValue(event)) | |
190 | 189 | then throw("This event was canceled") | |
191 | 190 | else if (if (getEventRequiresIdValue(event)) | |
192 | 191 | then (id == "") | |
193 | 192 | else false) | |
194 | 193 | then throw("This event requires that you register with a personal ID") | |
195 | 194 | else if ((getEventTicketMaxValue(event, ticketId) > (getEventAttendeeValue(userAddress, id, ticketId, event) + amount))) | |
196 | 195 | then throw("Amount of Tickets exceeds maximum amount per attendee") | |
197 | - | else TransferSet([ScriptTransfer(addressFromStringValue(address), pmt.amount, unit)]) | |
196 | + | 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)])) | |
198 | 197 | } | |
199 | 198 | ||
200 | 199 | ||
201 | 200 | ||
202 | 201 | @Callable(i) | |
203 | 202 | func cancelEvent (event) = { | |
204 | 203 | let callerAddress = toBase58String(i.caller.bytes) | |
205 | 204 | if ((getEventValueById(event) != callerAddress)) | |
206 | 205 | then throw("Event does not exist, or you don't have the credentials to perform this action") | |
207 | 206 | else if (((lastBlock.timestamp + 15000000) > getEventDateValue(event))) | |
208 | 207 | then throw("This event has already happened") | |
209 | 208 | else WriteSet([DataEntry(getEventCanceledKey(event), true)]) | |
210 | 209 | } | |
211 | 210 | ||
212 | 211 | ||
213 | 212 | ||
214 | 213 | @Callable(i) | |
215 | 214 | func checkin (event,attendeeAddress,amount,id,ticketId) = { | |
216 | 215 | let callerAddress = toBase58String(i.caller.bytes) | |
217 | 216 | if ((getEventValueById(event) != callerAddress)) | |
218 | 217 | then throw("Event does not exist, or you don't have the credentials to perform this action") | |
219 | 218 | else if ((amount > getEventAttendeeValue(attendeeAddress, id, ticketId, event))) | |
220 | 219 | then throw("You don't have enough tickets.") | |
221 | 220 | else if (getEventCanceledValue(event)) | |
222 | 221 | then throw("This event was canceled. You can redeem your ticket using refundTicket function") | |
223 | 222 | else WriteSet([DataEntry(getEventAttendeeKey(attendeeAddress, id, ticketId, event), (getEventAttendeeValue(attendeeAddress, id, ticketId, event) - amount))]) | |
224 | 223 | } | |
225 | 224 | ||
226 | 225 | ||
227 | 226 | ||
228 | 227 | @Callable(i) | |
229 | 228 | func editEventTickets (event,ticketId,newAmount) = { | |
230 | 229 | let callerAddress = toBase58String(i.caller.bytes) | |
231 | 230 | if ((getEventValueById(event) != callerAddress)) | |
232 | 231 | then throw("Event does not exist, or you don't have the credentials to perform this action") | |
233 | 232 | else if (((lastBlock.timestamp + 15000000) > getEventDateValue(event))) | |
234 | 233 | then throw("This event has already happened") | |
235 | 234 | else if (getEventCanceledValue(event)) | |
236 | 235 | then throw("This event was already canceled") | |
237 | 236 | else WriteSet([DataEntry(getEventTicketAmountKey(event, ticketId), newAmount)]) | |
238 | 237 | } | |
239 | 238 | ||
240 | 239 | ||
241 | 240 | ||
242 | 241 | @Callable(i) | |
243 | 242 | func refundTicket (event,amount,id,ticketId) = { | |
244 | 243 | let attendeeAddress = toBase58String(i.caller.bytes) | |
245 | 244 | let attendeeValue = getEventAttendeeValue(attendeeAddress, id, ticketId, event) | |
246 | 245 | if ((getEventValueById(event) == NONE)) | |
247 | 246 | then throw("The event does not exist") | |
248 | 247 | else if ((amount > attendeeValue)) | |
249 | 248 | then throw("You don't have enough registered tickets with this address") | |
250 | 249 | else if (((lastBlock.timestamp + 15000000) > getEventDateValue(event))) | |
251 | 250 | then throw("This event has already happened") | |
252 | 251 | else ScriptResult(WriteSet([DataEntry(getEventAttendeeKey(attendeeAddress, id, ticketId, event), (attendeeValue - amount))]), TransferSet([ScriptTransfer(addressFromStringValue(attendeeAddress), (amount * attendeeValue), unit)])) | |
253 | 252 | } | |
254 | 253 | ||
255 | 254 | ||
256 | 255 | ||
257 | 256 | @Callable(i) | |
258 | 257 | func withdraw (event) = { | |
259 | 258 | let callerAddress = toBase58String(i.caller.bytes) | |
260 | 259 | let balance = getEventBalanceValue(callerAddress, event) | |
261 | 260 | if ((getEventValueById(event) != callerAddress)) | |
262 | 261 | then throw("Event does not exist, or you don't have the credentials to perform this action") | |
263 | 262 | else if ((0 >= balance)) | |
264 | 263 | then throw("Insufficient balance") | |
265 | 264 | else if (getEventCanceledValue(event)) | |
266 | 265 | then throw("Event has been canceled") | |
267 | 266 | 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 | 267 | } | |
269 | 268 | ||
270 | 269 |
github/deemru/w8io/169f3d6 62.75 ms ◑