tx · DT1vkmjYxjzvjQdNvDHmxxn7GTRXPqwCAYC7yYwrNpNd

3N1RM5X2PdS1vH3vmzRrdzQDjAUjMqk2RbJ:  -0.01400000 Waves

2020.04.11 13:40 [949608] smart account 3N1RM5X2PdS1vH3vmzRrdzQDjAUjMqk2RbJ > SELF 0.00000000 Waves

{ "type": 13, "id": "DT1vkmjYxjzvjQdNvDHmxxn7GTRXPqwCAYC7yYwrNpNd", "fee": 1400000, "feeAssetId": null, "timestamp": 1586601630959, "version": 1, "sender": "3N1RM5X2PdS1vH3vmzRrdzQDjAUjMqk2RbJ", "senderPublicKey": "5xkQSCjfQmc7gqQcXZtkcWTzv4TmPAWcc81im9ngfwK9", "proofs": [ "Tw54CWc7p3MVPPVgugWvFfvczcY8RksTfCeQ1iy7t4c1dtDK6dKiyHznUFmm1kUe69SctHQzXeyZZVQSAYZGDwa" ], "script": "base64:AAIDAAAAAAAAAEoIARIGCgQICAEEEgcKBQgBCAEBEgYKBAgBAQgSAwoBCBIHCgUICAEIARIFCgMIAQESBAoCCAgSBQoDCAEBEgYKBAgBCAESAwoBCAAAACoAAAAAB2FkZHJlc3MCAAAAIzNOMVJNNVgyUGRTMXZIM3ZtelJyZHpRRGpBVWpNcWsyUmJKAAAAAA5rZXlFdmVudFByZWZpeAIAAAACZV8AAAAAEmtleUV2ZW50RGF0YVByZWZpeAIAAAAFZGF0YV8AAAAAGWtleUV2ZW50VGlja2V0UHJpY2VQcmVmaXgCAAAADHRpY2tldFByaWNlXwAAAAASa2V5RXZlbnREYXRlUHJlZml4AgAAAAVkYXRlXwAAAAAWa2V5RXZlbnRBdHRlbmRlZVByZWZpeAIAAAACYV8AAAAAGGtleVByb2R1Y2VyQmFsYW5jZVByZWZpeAIAAAAIYmFsYW5jZV8AAAAAGmtleUV2ZW50QW1vdW50VGlja2V0UHJlZml4AgAAAA10aWNrZXRBbW91bnRfAAAAABZrZXlFdmVudENhbmNlbGVkUHJlZml4AgAAAAljYW5jZWxlZF8AAAAAF2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AAAAAAAABQAAAAdiYWxhbmNlCQAAAgAAAAECAAAAFEluc3VmZmljaWVudCBiYWxhbmNlAwkBAAAAFWdldEV2ZW50Q2FuY2VsZWRWYWx1ZQAAAAEFAAAABWV2ZW50CQAAAgAAAAECAAAAF0V2ZW50IGhhcyBiZWVuIGNhbmNlbGVkCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAAEmdldEV2ZW50QmFsYW5jZUtleQAAAAIFAAAADWNhbGxlckFkZHJlc3MFAAAABWV2ZW50AAAAAAAAAAAABQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABBQAAAA1jYWxsZXJBZGRyZXNzCQAAZQAAAAIFAAAAB2JhbGFuY2UJAABpAAAAAgkAAGgAAAACBQAAAAdiYWxhbmNlBQAAAApjb21taXNzaW9uAAAAAAAAAABkBQAAAAR1bml0CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQUAAAAHYWRkcmVzcwkAAGkAAAACCQAAaAAAAAIFAAAAB2JhbGFuY2UFAAAACmNvbW1pc3Npb24AAAAAAAAAAGQFAAAABHVuaXQFAAAAA25pbAAAAABNli2q", "chainId": 84, "height": 949608, "spentComplexity": 0 } View: original | compacted Prev: 8EqZVdGta1TGLN8JwVJxv8PDhfCesBViuoWhKwhJfrjm Next: BuKwqTJdQ8417PNkNMfJb39gFhLMQ3kHYJxNZzQQtSRa Diff:
OldNewDifferences
191191 then (id == "")
192192 else false)
193193 then throw("This event requires that you register with a personal ID")
194- else if (((getEventAttendeeValue(userAddress, id, ticketId, event) + amount) > getEventTicketMaxValue(event, ticketId)))
194+ else if (if ((getEventTicketMaxValue(event, ticketId) > 0))
195+ then ((getEventAttendeeValue(userAddress, id, ticketId, event) + amount) > getEventTicketMaxValue(event, ticketId))
196+ else false)
195197 then throw("Amount of Tickets exceeds maximum amount per attendee")
196198 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)]))
197199 }
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_"
2929
3030 let NONE = "none"
3131
3232 let commission = 5
3333
3434 func getNumberByKey (key) = {
3535 let num = match getInteger(this, key) {
3636 case a: Int =>
3737 a
3838 case _ =>
3939 0
4040 }
4141 num
4242 }
4343
4444
4545 func getStrByKey (key) = {
4646 let str = match getString(this, key) {
4747 case a: String =>
4848 a
4949 case _ =>
5050 NONE
5151 }
5252 str
5353 }
5454
5555
5656 func getBoolByKey (key) = {
5757 let bool = match getBoolean(this, key) {
5858 case a: Boolean =>
5959 a
6060 case _ =>
6161 false
6262 }
6363 bool
6464 }
6565
6666
6767 func getEventKey (producer,title) = (keyEventPrefix + toBase58String(sha256(toBytes((producer + title)))))
6868
6969
7070 func getEventDataKey (event) = (keyEventDataPrefix + event)
7171
7272
7373 func getEventTicketPriceKey (event,ticketId) = (((keyEventTicketPricePrefix + toString(ticketId)) + "_") + event)
7474
7575
7676 func getEventDateKey (event) = (keyEventDatePrefix + event)
7777
7878
7979 func getEventAttendeeKey (user,id,ticketId,event) = (((((keyEventAttendeePrefix + toBase58String(sha256(toBytes((user + id))))) + "_") + toString(ticketId)) + "_") + event)
8080
8181
8282 func getEventBalanceKey (account,event) = (((keyProducerBalancePrefix + account) + "_") + event)
8383
8484
8585 func getEventTicketAmountKey (event,ticketId) = (((keyEventAmountTicketPrefix + toString(ticketId)) + "_") + event)
8686
8787
8888 func getEventCanceledKey (event) = (keyEventCanceledPrefix + event)
8989
9090
9191 func getEventRequiresIdKey (event) = (keyEventRequiresIdPrefix + event)
9292
9393
9494 func getEventTicketMaxKey (event,ticketId) = (((keyEventTicketMaxPrefix + toString(ticketId)) + "_") + event)
9595
9696
9797 func getEventTicketDescriptionKey (event,ticketId) = (((keyEventTicketDescriptionPrefix + toString(ticketId)) + "_") + event)
9898
9999
100100 func getEventTicketsKey (event) = (keyEventTicketsPrefix + event)
101101
102102
103103 func getEventValueById (item) = getStrByKey(item)
104104
105105
106106 func getEventValue (producer,title) = getStrByKey(getEventKey(producer, title))
107107
108108
109109 func getEventTicketPriceValue (event,ticketId) = getNumberByKey(getEventTicketPriceKey(event, ticketId))
110110
111111
112112 func getEventDateValue (event) = getNumberByKey(getEventDateKey(event))
113113
114114
115115 func getEventAttendeeValue (user,id,ticketId,event) = getNumberByKey(getEventAttendeeKey(user, id, ticketId, event))
116116
117117
118118 func getEventBalanceValue (account,event) = getNumberByKey(getEventBalanceKey(account, event))
119119
120120
121121 func getEventTicketAmountValue (event,ticketId) = getNumberByKey(getEventTicketAmountKey(event, ticketId))
122122
123123
124124 func getEventCanceledValue (event) = getBoolByKey(getEventCanceledKey(event))
125125
126126
127127 func getEventRequiresIdValue (event) = getBoolByKey(getEventRequiresIdKey(event))
128128
129129
130130 func getEventTicketMaxValue (event,ticketId) = getNumberByKey(getEventTicketMaxKey(event, ticketId))
131131
132132
133133 func getEventTicketDescriptionValue (event,ticketId) = getStrByKey(getEventTicketDescriptionKey(event, ticketId))
134134
135135
136136 func getEventTicketsValue (event) = getNumberByKey(getEventTicketsKey(event))
137137
138138
139139 @Callable(i)
140140 func createEvent (title,data,date,requiresId) = {
141141 let producerAddress = toBase58String(i.caller.bytes)
142142 let event = getEventKey(producerAddress, title)
143143 if ((getEventValue(producerAddress, title) != NONE))
144144 then throw("The event already exist")
145145 else if ((lastBlock.timestamp > date))
146146 then throw("Date cannot be in the past")
147147 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)])
148148 }
149149
150150
151151
152152 @Callable(i)
153153 func createEventTicket (event,price,description,amountTickets,maxAmount) = {
154154 let callerAddress = toBase58String(i.caller.bytes)
155155 let producerAddress = getEventValueById(event)
156156 let ticketId = getEventTicketsValue(event)
157157 if ((producerAddress != callerAddress))
158158 then throw("Event does not exist, or you don't have the credentials to perform this action")
159159 else if (((lastBlock.timestamp + 15000000) > getEventDateValue(event)))
160160 then throw("This event has already happened")
161161 else if (getEventCanceledValue(event))
162162 then throw("This event was canceled")
163163 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))])
164164 }
165165
166166
167167
168168 @Callable(i)
169169 func purchase (event,ticketId,amount,id) = {
170170 let pmt = extract(i.payment)
171171 let userAddress = toBase58String(i.caller.bytes)
172172 let price = getEventTicketPriceValue(event, ticketId)
173173 let producerAddress = getEventValueById(event)
174174 let ticketsLeft = getEventTicketAmountValue(event, ticketId)
175175 let totalPrice = (amount * price)
176176 if (isDefined(pmt.assetId))
177177 then throw("can use WAVES only at the moment")
178178 else if ((producerAddress == NONE))
179179 then throw("Event does not exist")
180180 else if ((totalPrice > pmt.amount))
181181 then throw(((("You did not send enough money. You sent: " + toString(pmt.amount)) + ". Expected: ") + toString(totalPrice)))
182182 else if ((pmt.amount > totalPrice))
183183 then throw(((("You send too much money. You sent: " + toString(pmt.amount)) + ". Total price: ") + toString(totalPrice)))
184184 else if ((0 > (ticketsLeft - amount)))
185185 then throw("Not enough tickets left")
186186 else if (((lastBlock.timestamp + 15000000) > getEventDateValue(event)))
187187 then throw("This event has already happened")
188188 else if (getEventCanceledValue(event))
189189 then throw("This event was canceled")
190190 else if (if (getEventRequiresIdValue(event))
191191 then (id == "")
192192 else false)
193193 then throw("This event requires that you register with a personal ID")
194- else if (((getEventAttendeeValue(userAddress, id, ticketId, event) + amount) > getEventTicketMaxValue(event, ticketId)))
194+ else if (if ((getEventTicketMaxValue(event, ticketId) > 0))
195+ then ((getEventAttendeeValue(userAddress, id, ticketId, event) + amount) > getEventTicketMaxValue(event, ticketId))
196+ else false)
195197 then throw("Amount of Tickets exceeds maximum amount per attendee")
196198 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)]))
197199 }
198200
199201
200202
201203 @Callable(i)
202204 func cancelEvent (event) = {
203205 let callerAddress = toBase58String(i.caller.bytes)
204206 if ((getEventValueById(event) != callerAddress))
205207 then throw("Event does not exist, or you don't have the credentials to perform this action")
206208 else if (((lastBlock.timestamp + 15000000) > getEventDateValue(event)))
207209 then throw("This event has already happened")
208210 else WriteSet([DataEntry(getEventCanceledKey(event), true)])
209211 }
210212
211213
212214
213215 @Callable(i)
214216 func checkin (event,attendeeAddress,amount,id,ticketId) = {
215217 let callerAddress = toBase58String(i.caller.bytes)
216218 if ((getEventValueById(event) != callerAddress))
217219 then throw("Event does not exist, or you don't have the credentials to perform this action")
218220 else if ((amount > getEventAttendeeValue(attendeeAddress, id, ticketId, event)))
219221 then throw("You don't have enough tickets.")
220222 else if (getEventCanceledValue(event))
221223 then throw("This event was canceled. You can redeem your ticket using refundTicket function")
222224 else WriteSet([DataEntry(getEventAttendeeKey(attendeeAddress, id, ticketId, event), (getEventAttendeeValue(attendeeAddress, id, ticketId, event) - amount))])
223225 }
224226
225227
226228
227229 @Callable(i)
228230 func editEventTickets (event,ticketId,newAmount) = {
229231 let callerAddress = toBase58String(i.caller.bytes)
230232 if ((getEventValueById(event) != callerAddress))
231233 then throw("Event does not exist, or you don't have the credentials to perform this action")
232234 else if (((lastBlock.timestamp + 15000000) > getEventDateValue(event)))
233235 then throw("This event has already happened")
234236 else if (getEventCanceledValue(event))
235237 then throw("This event was already canceled")
236238 else WriteSet([DataEntry(getEventTicketAmountKey(event, ticketId), newAmount)])
237239 }
238240
239241
240242
241243 @Callable(i)
242244 func editEventProducer (event,newProducer) = {
243245 let producerAddress = toBase58String(i.caller.bytes)
244246 if ((getEventValueById(event) != producerAddress))
245247 then throw("Event does not exist, or you don't have the credentials to perform this action")
246248 else WriteSet([DataEntry(event, newProducer)])
247249 }
248250
249251
250252
251253 @Callable(i)
252254 func editEventData (event,data,date) = {
253255 let producerAddress = toBase58String(i.caller.bytes)
254256 if ((getEventValueById(event) != producerAddress))
255257 then throw("Event does not exist, or you don't have the credentials to perform this action")
256258 else if ((lastBlock.timestamp > date))
257259 then throw("Date cannot be in the past")
258260 else if ((getEventDateValue(event) > date))
259261 then throw("New date cannot be earlier that the original date")
260262 else WriteSet([DataEntry(getEventDataKey(event), data), DataEntry(getEventDateKey(event), date)])
261263 }
262264
263265
264266
265267 @Callable(i)
266268 func refundTicket (event,amount,id,ticketId) = {
267269 let attendeeAddress = toBase58String(i.caller.bytes)
268270 let attendeeValue = getEventAttendeeValue(attendeeAddress, id, ticketId, event)
269271 if ((getEventValueById(event) == NONE))
270272 then throw("The event does not exist")
271273 else if ((amount > attendeeValue))
272274 then throw("You don't have enough registered tickets with this address")
273275 else if (((lastBlock.timestamp + 15000000) > getEventDateValue(event)))
274276 then throw("This event has already happened")
275277 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)]))
276278 }
277279
278280
279281
280282 @Callable(i)
281283 func withdraw (event) = {
282284 let callerAddress = toBase58String(i.caller.bytes)
283285 let balance = getEventBalanceValue(callerAddress, event)
284286 if ((getEventValueById(event) != callerAddress))
285287 then throw("Event does not exist, or you don't have the credentials to perform this action")
286288 else if ((0 >= balance))
287289 then throw("Insufficient balance")
288290 else if (getEventCanceledValue(event))
289291 then throw("Event has been canceled")
290292 else ScriptResult(WriteSet([DataEntry(getEventBalanceKey(callerAddress, event), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(callerAddress), (balance - ((balance * commission) / 100)), unit), ScriptTransfer(addressFromStringValue(address), ((balance * commission) / 100), unit)]))
291293 }
292294
293295

github/deemru/w8io/169f3d6 
118.52 ms