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:AAIDAAAAAAAAAFIIARIGCgQICAEEEgcKBQgBCAEBEgYKBAgBAQgSAwoBCBIICgYICAEIAQESBQoDCAEBEgQKAggIEgUKAwgIARIFCgMIAQESBgoECAEIARIDCgEIAAAALQAAAAAHYWRkcmVzcwIAAAAjM04xUk01WDJQZFMxdkgzdm16UnJkelFEakFVak1xazJSYkoAAAAADmtleUV2ZW50UHJlZml4AgAAAAJlXwAAAAASa2V5RXZlbnREYXRhUHJlZml4AgAAAAVkYXRhXwAAAAAZa2V5RXZlbnRUaWNrZXRQcmljZVByZWZpeAIAAAAMdGlja2V0UHJpY2VfAAAAABJrZXlFdmVudERhdGVQcmVmaXgCAAAABWRhdGVfAAAAABZrZXlFdmVudEF0dGVuZGVlUHJlZml4AgAAAAJhXwAAAAAYa2V5UHJvZHVjZXJCYWxhbmNlUHJlZml4AgAAAAhiYWxhbmNlXwAAAAAaa2V5RXZlbnRBbW91bnRUaWNrZXRQcmVmaXgCAAAADXRpY2tldEFtb3VudF8AAAAAFmtleUV2ZW50Q2FuY2VsZWRQcmVmaXgCAAAACWNhbmNlbGVkXwAAAAA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AAGcAAAACAAAAAAAAAAAABQAAAAdiYWxhbmNlCQAAAgAAAAECAAAAFEluc3VmZmljaWVudCBiYWxhbmNlAwkBAAAAFWdldEV2ZW50Q2FuY2VsZWRWYWx1ZQAAAAEFAAAABWV2ZW50CQAAAgAAAAECAAAAF0V2ZW50IGhhcyBiZWVuIGNhbmNlbGVkCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAAEmdldEV2ZW50QmFsYW5jZUtleQAAAAIFAAAADWNhbGxlckFkZHJlc3MFAAAABWV2ZW50AAAAAAAAAAAABQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABBQAAAA1jYWxsZXJBZGRyZXNzCQAAZQAAAAIFAAAAB2JhbGFuY2UJAABpAAAAAgkAAGgAAAACBQAAAAdiYWxhbmNlBQAAAApjb21taXNzaW9uAAAAAAAAAABkBQAAAAR1bml0CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQUAAAAHYWRkcmVzcwkAAGkAAAACCQAAaAAAAAIFAAAAB2JhbGFuY2UFAAAACmNvbW1pc3Npb24AAAAAAAAAAGQFAAAABHVuaXQFAAAAA25pbAAAAAC2XUb0", "chainId": 84, "height": 955527, "spentComplexity": 0 } View: original | compacted Prev: DT1vkmjYxjzvjQdNvDHmxxn7GTRXPqwCAYC7yYwrNpNd Next: J2gAiRevrxDKfiDRcRKca3L8rYphgdSuDzeoAo7cejdD Diff:
OldNewDifferences
2626 let keyEventTicketDescriptionPrefix = "ticketDescription_"
2727
2828 let keyEventTicketsPrefix = "tickets_"
29+
30+let keyEventTrusteePrefix = "trustee_"
2931
3032 let NONE = "none"
3133
100102 func getEventTicketsKey (event) = (keyEventTicketsPrefix + event)
101103
102104
105+func getEventTrusteeKey (event,trusteeKey) = (((keyEventTrusteePrefix + toString(trusteeKey)) + "_") + event)
106+
107+
103108 func getEventValueById (item) = getStrByKey(item)
104109
105110
134139
135140
136141 func getEventTicketsValue (event) = getNumberByKey(getEventTicketsKey(event))
142+
143+
144+func getEventTrusteeValue (event,trusteeKey) = getStrByKey(getEventTrusteeKey(event, trusteeKey))
137145
138146
139147 @Callable(i)
213221
214222
215223 @Callable(i)
216-func checkin (event,attendeeAddress,amount,id,ticketId) = {
224+func checkin (event,attendeeAddress,amount,id,ticketId,trusteeKey) = {
217225 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)
219229 then throw("Event does not exist, or you don't have the credentials to perform this action")
220230 else if ((amount > getEventAttendeeValue(attendeeAddress, id, ticketId, event)))
221231 then throw("You don't have enough tickets.")
246256 if ((getEventValueById(event) != producerAddress))
247257 then throw("Event does not exist, or you don't have the credentials to perform this action")
248258 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)])
249269 }
250270
251271
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let address = "3N1RM5X2PdS1vH3vmzRrdzQDjAUjMqk2RbJ"
55
66 let keyEventPrefix = "e_"
77
88 let keyEventDataPrefix = "data_"
99
1010 let keyEventTicketPricePrefix = "ticketPrice_"
1111
1212 let keyEventDatePrefix = "date_"
1313
1414 let keyEventAttendeePrefix = "a_"
1515
1616 let keyProducerBalancePrefix = "balance_"
1717
1818 let keyEventAmountTicketPrefix = "ticketAmount_"
1919
2020 let keyEventCanceledPrefix = "canceled_"
2121
2222 let keyEventTicketMaxPrefix = "ticketMax_"
2323
2424 let keyEventRequiresIdPrefix = "requiresId_"
2525
2626 let keyEventTicketDescriptionPrefix = "ticketDescription_"
2727
2828 let keyEventTicketsPrefix = "tickets_"
29+
30+let keyEventTrusteePrefix = "trustee_"
2931
3032 let NONE = "none"
3133
3234 let commission = 5
3335
3436 func getNumberByKey (key) = {
3537 let num = match getInteger(this, key) {
3638 case a: Int =>
3739 a
3840 case _ =>
3941 0
4042 }
4143 num
4244 }
4345
4446
4547 func getStrByKey (key) = {
4648 let str = match getString(this, key) {
4749 case a: String =>
4850 a
4951 case _ =>
5052 NONE
5153 }
5254 str
5355 }
5456
5557
5658 func getBoolByKey (key) = {
5759 let bool = match getBoolean(this, key) {
5860 case a: Boolean =>
5961 a
6062 case _ =>
6163 false
6264 }
6365 bool
6466 }
6567
6668
6769 func getEventKey (producer,title) = (keyEventPrefix + toBase58String(sha256(toBytes((producer + title)))))
6870
6971
7072 func getEventDataKey (event) = (keyEventDataPrefix + event)
7173
7274
7375 func getEventTicketPriceKey (event,ticketId) = (((keyEventTicketPricePrefix + toString(ticketId)) + "_") + event)
7476
7577
7678 func getEventDateKey (event) = (keyEventDatePrefix + event)
7779
7880
7981 func getEventAttendeeKey (user,id,ticketId,event) = (((((keyEventAttendeePrefix + toBase58String(sha256(toBytes((user + id))))) + "_") + toString(ticketId)) + "_") + event)
8082
8183
8284 func getEventBalanceKey (account,event) = (((keyProducerBalancePrefix + account) + "_") + event)
8385
8486
8587 func getEventTicketAmountKey (event,ticketId) = (((keyEventAmountTicketPrefix + toString(ticketId)) + "_") + event)
8688
8789
8890 func getEventCanceledKey (event) = (keyEventCanceledPrefix + event)
8991
9092
9193 func getEventRequiresIdKey (event) = (keyEventRequiresIdPrefix + event)
9294
9395
9496 func getEventTicketMaxKey (event,ticketId) = (((keyEventTicketMaxPrefix + toString(ticketId)) + "_") + event)
9597
9698
9799 func getEventTicketDescriptionKey (event,ticketId) = (((keyEventTicketDescriptionPrefix + toString(ticketId)) + "_") + event)
98100
99101
100102 func getEventTicketsKey (event) = (keyEventTicketsPrefix + event)
101103
102104
105+func getEventTrusteeKey (event,trusteeKey) = (((keyEventTrusteePrefix + toString(trusteeKey)) + "_") + event)
106+
107+
103108 func getEventValueById (item) = getStrByKey(item)
104109
105110
106111 func getEventValue (producer,title) = getStrByKey(getEventKey(producer, title))
107112
108113
109114 func getEventTicketPriceValue (event,ticketId) = getNumberByKey(getEventTicketPriceKey(event, ticketId))
110115
111116
112117 func getEventDateValue (event) = getNumberByKey(getEventDateKey(event))
113118
114119
115120 func getEventAttendeeValue (user,id,ticketId,event) = getNumberByKey(getEventAttendeeKey(user, id, ticketId, event))
116121
117122
118123 func getEventBalanceValue (account,event) = getNumberByKey(getEventBalanceKey(account, event))
119124
120125
121126 func getEventTicketAmountValue (event,ticketId) = getNumberByKey(getEventTicketAmountKey(event, ticketId))
122127
123128
124129 func getEventCanceledValue (event) = getBoolByKey(getEventCanceledKey(event))
125130
126131
127132 func getEventRequiresIdValue (event) = getBoolByKey(getEventRequiresIdKey(event))
128133
129134
130135 func getEventTicketMaxValue (event,ticketId) = getNumberByKey(getEventTicketMaxKey(event, ticketId))
131136
132137
133138 func getEventTicketDescriptionValue (event,ticketId) = getStrByKey(getEventTicketDescriptionKey(event, ticketId))
134139
135140
136141 func getEventTicketsValue (event) = getNumberByKey(getEventTicketsKey(event))
142+
143+
144+func getEventTrusteeValue (event,trusteeKey) = getStrByKey(getEventTrusteeKey(event, trusteeKey))
137145
138146
139147 @Callable(i)
140148 func createEvent (title,data,date,requiresId) = {
141149 let producerAddress = toBase58String(i.caller.bytes)
142150 let event = getEventKey(producerAddress, title)
143151 if ((getEventValue(producerAddress, title) != NONE))
144152 then throw("The event already exist")
145153 else if ((lastBlock.timestamp > date))
146154 then throw("Date cannot be in the past")
147155 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)])
148156 }
149157
150158
151159
152160 @Callable(i)
153161 func createEventTicket (event,price,description,amountTickets,maxAmount) = {
154162 let callerAddress = toBase58String(i.caller.bytes)
155163 let producerAddress = getEventValueById(event)
156164 let ticketId = getEventTicketsValue(event)
157165 if ((producerAddress != callerAddress))
158166 then throw("Event does not exist, or you don't have the credentials to perform this action")
159167 else if (((lastBlock.timestamp + 15000000) > getEventDateValue(event)))
160168 then throw("This event has already happened")
161169 else if (getEventCanceledValue(event))
162170 then throw("This event was canceled")
163171 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))])
164172 }
165173
166174
167175
168176 @Callable(i)
169177 func purchase (event,ticketId,amount,id) = {
170178 let pmt = extract(i.payment)
171179 let userAddress = toBase58String(i.caller.bytes)
172180 let price = getEventTicketPriceValue(event, ticketId)
173181 let producerAddress = getEventValueById(event)
174182 let ticketsLeft = getEventTicketAmountValue(event, ticketId)
175183 let totalPrice = (amount * price)
176184 if (isDefined(pmt.assetId))
177185 then throw("can use WAVES only at the moment")
178186 else if ((producerAddress == NONE))
179187 then throw("Event does not exist")
180188 else if ((totalPrice > pmt.amount))
181189 then throw(((("You did not send enough money. You sent: " + toString(pmt.amount)) + ". Expected: ") + toString(totalPrice)))
182190 else if ((pmt.amount > totalPrice))
183191 then throw(((("You send too much money. You sent: " + toString(pmt.amount)) + ". Total price: ") + toString(totalPrice)))
184192 else if ((0 > (ticketsLeft - amount)))
185193 then throw("Not enough tickets left")
186194 else if (((lastBlock.timestamp + 15000000) > getEventDateValue(event)))
187195 then throw("This event has already happened")
188196 else if (getEventCanceledValue(event))
189197 then throw("This event was canceled")
190198 else if (if (getEventRequiresIdValue(event))
191199 then (id == "")
192200 else false)
193201 then throw("This event requires that you register with a personal ID")
194202 else if (if ((getEventTicketMaxValue(event, ticketId) > 0))
195203 then ((getEventAttendeeValue(userAddress, id, ticketId, event) + amount) > getEventTicketMaxValue(event, ticketId))
196204 else false)
197205 then throw("Amount of Tickets exceeds maximum amount per attendee")
198206 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)]))
199207 }
200208
201209
202210
203211 @Callable(i)
204212 func cancelEvent (event) = {
205213 let callerAddress = toBase58String(i.caller.bytes)
206214 if ((getEventValueById(event) != callerAddress))
207215 then throw("Event does not exist, or you don't have the credentials to perform this action")
208216 else if (((lastBlock.timestamp + 15000000) > getEventDateValue(event)))
209217 then throw("This event has already happened")
210218 else WriteSet([DataEntry(getEventCanceledKey(event), true)])
211219 }
212220
213221
214222
215223 @Callable(i)
216-func checkin (event,attendeeAddress,amount,id,ticketId) = {
224+func checkin (event,attendeeAddress,amount,id,ticketId,trusteeKey) = {
217225 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)
219229 then throw("Event does not exist, or you don't have the credentials to perform this action")
220230 else if ((amount > getEventAttendeeValue(attendeeAddress, id, ticketId, event)))
221231 then throw("You don't have enough tickets.")
222232 else if (getEventCanceledValue(event))
223233 then throw("This event was canceled. You can redeem your ticket using refundTicket function")
224234 else WriteSet([DataEntry(getEventAttendeeKey(attendeeAddress, id, ticketId, event), (getEventAttendeeValue(attendeeAddress, id, ticketId, event) - amount))])
225235 }
226236
227237
228238
229239 @Callable(i)
230240 func editEventTickets (event,ticketId,newAmount) = {
231241 let callerAddress = toBase58String(i.caller.bytes)
232242 if ((getEventValueById(event) != callerAddress))
233243 then throw("Event does not exist, or you don't have the credentials to perform this action")
234244 else if (((lastBlock.timestamp + 15000000) > getEventDateValue(event)))
235245 then throw("This event has already happened")
236246 else if (getEventCanceledValue(event))
237247 then throw("This event was already canceled")
238248 else WriteSet([DataEntry(getEventTicketAmountKey(event, ticketId), newAmount)])
239249 }
240250
241251
242252
243253 @Callable(i)
244254 func editEventProducer (event,newProducer) = {
245255 let producerAddress = toBase58String(i.caller.bytes)
246256 if ((getEventValueById(event) != producerAddress))
247257 then throw("Event does not exist, or you don't have the credentials to perform this action")
248258 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)])
249269 }
250270
251271
252272
253273 @Callable(i)
254274 func editEventData (event,data,date) = {
255275 let producerAddress = toBase58String(i.caller.bytes)
256276 if ((getEventValueById(event) != producerAddress))
257277 then throw("Event does not exist, or you don't have the credentials to perform this action")
258278 else if ((lastBlock.timestamp > date))
259279 then throw("Date cannot be in the past")
260280 else if ((getEventDateValue(event) > date))
261281 then throw("New date cannot be earlier that the original date")
262282 else WriteSet([DataEntry(getEventDataKey(event), data), DataEntry(getEventDateKey(event), date)])
263283 }
264284
265285
266286
267287 @Callable(i)
268288 func refundTicket (event,amount,id,ticketId) = {
269289 let attendeeAddress = toBase58String(i.caller.bytes)
270290 let attendeeValue = getEventAttendeeValue(attendeeAddress, id, ticketId, event)
271291 if ((getEventValueById(event) == NONE))
272292 then throw("The event does not exist")
273293 else if ((amount > attendeeValue))
274294 then throw("You don't have enough registered tickets with this address")
275295 else if (((lastBlock.timestamp + 15000000) > getEventDateValue(event)))
276296 then throw("This event has already happened")
277297 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)]))
278298 }
279299
280300
281301
282302 @Callable(i)
283303 func withdraw (event) = {
284304 let callerAddress = toBase58String(i.caller.bytes)
285305 let balance = getEventBalanceValue(callerAddress, event)
286306 if ((getEventValueById(event) != callerAddress))
287307 then throw("Event does not exist, or you don't have the credentials to perform this action")
288308 else if ((0 >= balance))
289309 then throw("Insufficient balance")
290310 else if (getEventCanceledValue(event))
291311 then throw("Event has been canceled")
292312 else ScriptResult(WriteSet([DataEntry(getEventBalanceKey(callerAddress, event), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(callerAddress), (balance - ((balance * commission) / 100)), unit), ScriptTransfer(addressFromStringValue(address), ((balance * commission) / 100), unit)]))
293313 }
294314
295315

github/deemru/w8io/169f3d6 
62.63 ms