tx · 3t6nwNCUtoKAnLsmFiEFAaR4VXsNf3GbBh75aNBj28i5

3MtHYn3dDpoVUf6FNzwXU8k1cqH3KMxgNFP:  -0.01400000 Waves

2021.12.27 05:41 [1852075] smart account 3MtHYn3dDpoVUf6FNzwXU8k1cqH3KMxgNFP > SELF 0.00000000 Waves

{ "type": 13, "id": "3t6nwNCUtoKAnLsmFiEFAaR4VXsNf3GbBh75aNBj28i5", "fee": 1400000, "feeAssetId": null, "timestamp": 1640572935328, "version": 2, "chainId": 84, "sender": "3MtHYn3dDpoVUf6FNzwXU8k1cqH3KMxgNFP", "senderPublicKey": "CERNwqnHFnGf66rmS4s5mpWEPxv5RMqg2rSKPJCCgTbQ", "proofs": [ "fKtaLArom8VxjtLYM7MCWNHGhEPXPvtwhonti1GuXfptZxgnwq6mzMTWKruvX2nTfjTsuaTWpQSPhTX2BNc95Qt" ], "script": "base64:AAIFAAAAAAAAABwIAhIMCgoICAEBAQEYCAgIEgMKAQgSBQoDCAgIAAAAGQAAAAASc3lzdGVtQXNzZXRJZEJ5dGVzAQAAACBl2/7IbWHpVuwmUYs5w8vx8CJaoK7/XpSEcwFpn5187QAAAAAbZmFjdG9yeUNvbnRyYWN0QWRkcmVzc0J5dGVzAQAAABoBVKSIz4/LrUrKgYcmdcl3OfutIPleSLVTRQAAAAAiY3JlYXRlRXZlbnRNaW5pbWFsU2VydmljZUZlZUFtb3VudAAAAAAAAAAACgAAAAAgZWRpdEV2ZW50TWluaW1hbFNlcnZpY2VGZWVBbW91bnQAAAAAAAAAABQAAAAAEGtleURhdGFTZXBhcmF0b3ICAAAAAToAAAAAEnZhbHVlRGF0YVNlcGFyYXRvcgIAAAACX18BAAAAEnVuc2FmZUdldEFzc2V0QnlJZAAAAAEAAAAHYXNzZXRJZAQAAAAHJG1hdGNoMAkAA+wAAAABBQAAAAdhc3NldElkAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAVBc3NldAQAAAAFYXNzZXQFAAAAByRtYXRjaDAFAAA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RTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tledfA9Kg=", "height": 1852075, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BYeDwbUtqHoSEJiGELua9fcbtxzLq4PHc6rQGsNkjeW8 Next: 3zk2Wuz5T6cJzBPxtXF52Jfq6jSnT6B14SpXR2V87M7G Diff:
OldNewDifferences
6363 func generateEventDataKey (eventId) = makeString(["event", eventId, "data"], keyDataSeparator)
6464
6565
66-func serializeEventData (creatorAddress,title,description,startHeight,ticketPrice,tags,durationOrUnit,pictureOrUnit,linkOrUnit,locationOrUnit,ticketCountOrUnit) = {
67- let duration = match durationOrUnit {
68- case duration: Int =>
69- toString(duration)
70- case _ =>
71- ""
72- }
66+func serializeEventData (creatorAddress,title,description,startHeight,duration,ticketPrice,ticketCount,tags,pictureOrUnit,linkOrUnit,locationOrUnit) = {
7367 let picture = match pictureOrUnit {
7468 case picture: String =>
7569 picture
8882 case _ =>
8983 ""
9084 }
91- let ticketCount = match ticketCountOrUnit {
92- case ticketCount: Int =>
93- toString(ticketCount)
94- case _ =>
95- ""
96- }
97- makeString([toString(creatorAddress), title, description, toString(startHeight), toString(ticketPrice), makeString(tags, ","), duration, picture, link, location, ticketCount], valueDataSeparator)
85+ makeString([toString(creatorAddress), title, description, toString(startHeight), toString(duration), toString(ticketPrice), toString(ticketCount), makeString(tags, ","), picture, link, location], valueDataSeparator)
9886 }
9987
10088
10492 let title = eventData[1]
10593 let description = eventData[2]
10694 let startHeight = parseIntValue(eventData[3])
107- let ticketPrice = parseIntValue(eventData[4])
108- let tags = split(eventData[5], ",")
109- let durationOrUnit = parseInt(eventData[6])
110- let pictureOrUnit = if ((eventData[7] == ""))
111- then unit
112- else eventData[7]
113- let linkOrUnit = if ((eventData[8] == ""))
95+ let duration = parseInt(eventData[4])
96+ let ticketPrice = parseIntValue(eventData[5])
97+ let ticketCount = parseIntValue(eventData[6])
98+ let tags = split(eventData[7], ",")
99+ let pictureOrUnit = if ((eventData[8] == ""))
114100 then unit
115101 else eventData[8]
116- let locationOrUnit = if ((eventData[9] == ""))
102+ let linkOrUnit = if ((eventData[9] == ""))
117103 then unit
118104 else eventData[9]
119- let ticketCountOrUnit = parseInt(eventData[10])
120- $Tuple11(creatorAddress, title, description, startHeight, ticketPrice, tags, durationOrUnit, pictureOrUnit, linkOrUnit, locationOrUnit, ticketCountOrUnit)
105+ let locationOrUnit = if ((eventData[10] == ""))
106+ then unit
107+ else eventData[10]
108+ $Tuple11(creatorAddress, title, description, startHeight, duration, ticketPrice, ticketCount, tags, pictureOrUnit, linkOrUnit, locationOrUnit)
121109 }
122110
123111
195183
196184
197185 @Callable(i)
198-func createEvent (title,description,startHeight,ticketPrice,tags,durationInSecs,picture,link,location,ticketCount) = {
186+func createEvent (title,description,startHeight,durationInSecs,ticketPrice,ticketCount,tags,picture,link,location) = {
199187 let systemAsset = unsafeGetAssetById(systemAssetIdBytes)
200188 if ((1 > size(i.payments)))
201189 then throw("You have to send service fee as payment")
208196 let newEventId = generateEventId(i.caller, newEventIdx)
209197 if ((startHeight > height))
210198 then throw("Event start height has to be from the future")
211- else if ((0 > ticketPrice))
212- then throw("Ticket price has to be zero or positive number")
213- else {
214- let eventDuration = match durationInSecs {
215- case d: Int =>
216- if ((1 > d))
217- then throw("Event duration has to be positive number")
218- else d
219- case _ =>
220- unit
221- }
222- let eventTicketCount = match ticketCount {
223- case tc: Int =>
224- if ((1 > tc))
225- then throw("Event ticket count has to be positive number")
226- else tc
227- case _ =>
228- unit
229- }
230-[IntegerEntry(lastEventIdxKey(i.caller), newEventIdx), StringEntry(generateEventDataKey(newEventId), serializeEventData(i.caller, title, description, startHeight, ticketPrice, tags, eventDuration, picture, link, location, eventTicketCount))]
231- }
199+ else if ((1 > durationInSecs))
200+ then throw("Event duration has to be positive number")
201+ else if ((0 > ticketPrice))
202+ then throw("Ticket price has to be zero or positive number")
203+ else if ((1 > ticketCount))
204+ then throw("Ticket count has to be positive number")
205+ else [IntegerEntry(lastEventIdxKey(i.caller), newEventIdx), StringEntry(generateEventDataKey(newEventId), serializeEventData(i.caller, title, description, startHeight, durationInSecs, ticketPrice, ticketCount, tags, picture, link, location))]
232206 }
233207 }
234208 }
254228 case _ =>
255229 0
256230 }
257- let ticketCountOrUnit = eventData._11
258- if (if (isDefined(ticketCountOrUnit))
259- then (boughtTicketCount >= value(ticketCountOrUnit))
260- else false)
231+ let ticketCount = eventData._7
232+ if ((boughtTicketCount >= ticketCount))
261233 then throw("All the tickets are sold out")
262234 else {
263235 let userTicketKey = generateTicketKey(eventId, i.caller)
264236 if (isDefined(getString(userTicketKey)))
265237 then throw("You already have a ticket")
266238 else {
267- let eventTicketPrice = eventData._5
239+ let eventTicketPrice = eventData._6
268240 if ((eventTicketPrice > ticketPayment.amount))
269241 then throw(("Attached ticket payment amount is less then event ticket price " + toString(eventTicketPrice)))
270242 else [IntegerEntry(boughtTicketCountKey, (boughtTicketCount + 1)), StringEntry(userTicketKey, serializeTicketData(i.transactionId, ticketPayment.amount, unit, unit))]
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let systemAssetIdBytes = base58'7rck4P88F6QZEjJdU5uN56xCudCSAPYhoQJ4PJ9Wrnkc'
55
66 let factoryContractAddressBytes = base58'3N4v4VAHbK5das4wB5QGripYbQFJ3PaB75e'
77
88 let createEventMinimalServiceFeeAmount = 10
99
1010 let editEventMinimalServiceFeeAmount = 20
1111
1212 let keyDataSeparator = ":"
1313
1414 let valueDataSeparator = "__"
1515
1616 func unsafeGetAssetById (assetId) = match assetInfo(assetId) {
1717 case asset: Asset =>
1818 asset
1919 case _ =>
2020 throw("Specified asset does not exist")
2121 }
2222
2323
2424 func validateAssetId (sourceAssetIdOrUnit,requiredAssetId) = {
2525 let sourceAssetId = if (isDefined(sourceAssetIdOrUnit))
2626 then toBase58String(value(sourceAssetIdOrUnit))
2727 else "WAVES"
2828 if ((sourceAssetId != requiredAssetId))
2929 then false
3030 else true
3131 }
3232
3333
3434 func checkServiceFeePayment (operationTag,serviceFeePayment,requiredServiceFeeAmount) = {
3535 let systemAssetId = toBase58String(systemAssetIdBytes)
3636 if (!(validateAssetId(serviceFeePayment.assetId, systemAssetId)))
3737 then throw(((operationTag + " requires service fee payment in the system asset ") + systemAssetId))
3838 else if (if ((requiredServiceFeeAmount > serviceFeePayment.amount))
3939 then true
4040 else (serviceFeePayment.amount > requiredServiceFeeAmount))
4141 then throw((("Attached service fee payment amount is not equal to required service fee (" + toString(requiredServiceFeeAmount)) + ")"))
4242 else unit
4343 }
4444
4545
4646 func lastEventIdxKey (addr) = makeString([toString(addr), "last_event_idx"], keyDataSeparator)
4747
4848
4949 func lastEventRequestIdx (addr) = match getInteger(this, lastEventIdxKey(addr)) {
5050 case i: Int =>
5151 i
5252 case _ =>
5353 1
5454 }
5555
5656
5757 func generateNewEventIdx (addr) = (lastEventRequestIdx(addr) + 1)
5858
5959
6060 func generateEventId (addr,idx) = makeString([toString(addr), toString(idx)], keyDataSeparator)
6161
6262
6363 func generateEventDataKey (eventId) = makeString(["event", eventId, "data"], keyDataSeparator)
6464
6565
66-func serializeEventData (creatorAddress,title,description,startHeight,ticketPrice,tags,durationOrUnit,pictureOrUnit,linkOrUnit,locationOrUnit,ticketCountOrUnit) = {
67- let duration = match durationOrUnit {
68- case duration: Int =>
69- toString(duration)
70- case _ =>
71- ""
72- }
66+func serializeEventData (creatorAddress,title,description,startHeight,duration,ticketPrice,ticketCount,tags,pictureOrUnit,linkOrUnit,locationOrUnit) = {
7367 let picture = match pictureOrUnit {
7468 case picture: String =>
7569 picture
7670 case _ =>
7771 ""
7872 }
7973 let link = match linkOrUnit {
8074 case link: String =>
8175 link
8276 case _ =>
8377 ""
8478 }
8579 let location = match locationOrUnit {
8680 case location: String =>
8781 location
8882 case _ =>
8983 ""
9084 }
91- let ticketCount = match ticketCountOrUnit {
92- case ticketCount: Int =>
93- toString(ticketCount)
94- case _ =>
95- ""
96- }
97- makeString([toString(creatorAddress), title, description, toString(startHeight), toString(ticketPrice), makeString(tags, ","), duration, picture, link, location, ticketCount], valueDataSeparator)
85+ makeString([toString(creatorAddress), title, description, toString(startHeight), toString(duration), toString(ticketPrice), toString(ticketCount), makeString(tags, ","), picture, link, location], valueDataSeparator)
9886 }
9987
10088
10189 func deserializeEventData (value) = {
10290 let eventData = split(value, valueDataSeparator)
10391 let creatorAddress = addressFromString(eventData[0])
10492 let title = eventData[1]
10593 let description = eventData[2]
10694 let startHeight = parseIntValue(eventData[3])
107- let ticketPrice = parseIntValue(eventData[4])
108- let tags = split(eventData[5], ",")
109- let durationOrUnit = parseInt(eventData[6])
110- let pictureOrUnit = if ((eventData[7] == ""))
111- then unit
112- else eventData[7]
113- let linkOrUnit = if ((eventData[8] == ""))
95+ let duration = parseInt(eventData[4])
96+ let ticketPrice = parseIntValue(eventData[5])
97+ let ticketCount = parseIntValue(eventData[6])
98+ let tags = split(eventData[7], ",")
99+ let pictureOrUnit = if ((eventData[8] == ""))
114100 then unit
115101 else eventData[8]
116- let locationOrUnit = if ((eventData[9] == ""))
102+ let linkOrUnit = if ((eventData[9] == ""))
117103 then unit
118104 else eventData[9]
119- let ticketCountOrUnit = parseInt(eventData[10])
120- $Tuple11(creatorAddress, title, description, startHeight, ticketPrice, tags, durationOrUnit, pictureOrUnit, linkOrUnit, locationOrUnit, ticketCountOrUnit)
105+ let locationOrUnit = if ((eventData[10] == ""))
106+ then unit
107+ else eventData[10]
108+ $Tuple11(creatorAddress, title, description, startHeight, duration, ticketPrice, ticketCount, tags, pictureOrUnit, linkOrUnit, locationOrUnit)
121109 }
122110
123111
124112 func unsafeGetEventData (eventId) = {
125113 let eventDataKey = generateEventDataKey(eventId)
126114 let eventData = match getString(eventDataKey) {
127115 case s: String =>
128116 s
129117 case _ =>
130118 throw("Specified event not found")
131119 }
132120 deserializeEventData(eventData)
133121 }
134122
135123
136124 func generateBoughtTicketCountKey (eventId) = makeString(["event", eventId, "ticket_count"], keyDataSeparator)
137125
138126
139127 func generateTicketKey (eventId,userAddress) = makeString(["ticket", eventId, toString(userAddress)], keyDataSeparator)
140128
141129
142130 func generateTicketDataKey (ticketId) = makeString(["ticket", ticketId, "data"], valueDataSeparator)
143131
144132
145133 func serializeTicketData (buyTxId,buyPrice,swapTxId,bitographId) = makeString([toBase58String(buyTxId), toString(buyPrice), if (isDefined(swapTxId))
146134 then toBase58String(value(swapTxId))
147135 else "", if (isDefined(bitographId))
148136 then toBase58String(value(bitographId))
149137 else ""], valueDataSeparator)
150138
151139
152140 func deserializeTicketData (value) = {
153141 let ticketData = split(value, valueDataSeparator)
154142 let buyTxId = fromBase58String(ticketData[0])
155143 let buyPrice = parseIntValue(ticketData[1])
156144 let swapTxIdOrUnit = match ticketData[2] {
157145 case s: String =>
158146 fromBase58String(s)
159147 case _ =>
160148 unit
161149 }
162150 let bitographIdOrUnit = match ticketData[3] {
163151 case s: String =>
164152 fromBase58String(s)
165153 case _ =>
166154 unit
167155 }
168156 $Tuple4(buyTxId, buyPrice, swapTxIdOrUnit, bitographIdOrUnit)
169157 }
170158
171159
172160 func unsafeGetTicketData (ticketId) = {
173161 let ticketDataKey = generateTicketDataKey(ticketId)
174162 let ticketData = match getString(ticketDataKey) {
175163 case s: String =>
176164 s
177165 case _ =>
178166 throw("Specified ticket not found")
179167 }
180168 deserializeTicketData(ticketData)
181169 }
182170
183171
184172 func unsafeExtractTicketOwner (ticketId) = {
185173 let keyData = split(ticketId, keyDataSeparator)
186174 addressFromStringValue(keyData[3])
187175 }
188176
189177
190178 func isNFT (asset) = if (if ((asset.decimals == 0))
191179 then true
192180 else (asset.quantity == 1))
193181 then true
194182 else !(asset.reissuable)
195183
196184
197185 @Callable(i)
198-func createEvent (title,description,startHeight,ticketPrice,tags,durationInSecs,picture,link,location,ticketCount) = {
186+func createEvent (title,description,startHeight,durationInSecs,ticketPrice,ticketCount,tags,picture,link,location) = {
199187 let systemAsset = unsafeGetAssetById(systemAssetIdBytes)
200188 if ((1 > size(i.payments)))
201189 then throw("You have to send service fee as payment")
202190 else {
203191 let serviceFeePayment = i.payments[1]
204192 if (isDefined(checkServiceFeePayment("Create event", serviceFeePayment, createEventMinimalServiceFeeAmount)))
205193 then throw("Reached unreachable state")
206194 else {
207195 let newEventIdx = generateNewEventIdx(i.caller)
208196 let newEventId = generateEventId(i.caller, newEventIdx)
209197 if ((startHeight > height))
210198 then throw("Event start height has to be from the future")
211- else if ((0 > ticketPrice))
212- then throw("Ticket price has to be zero or positive number")
213- else {
214- let eventDuration = match durationInSecs {
215- case d: Int =>
216- if ((1 > d))
217- then throw("Event duration has to be positive number")
218- else d
219- case _ =>
220- unit
221- }
222- let eventTicketCount = match ticketCount {
223- case tc: Int =>
224- if ((1 > tc))
225- then throw("Event ticket count has to be positive number")
226- else tc
227- case _ =>
228- unit
229- }
230-[IntegerEntry(lastEventIdxKey(i.caller), newEventIdx), StringEntry(generateEventDataKey(newEventId), serializeEventData(i.caller, title, description, startHeight, ticketPrice, tags, eventDuration, picture, link, location, eventTicketCount))]
231- }
199+ else if ((1 > durationInSecs))
200+ then throw("Event duration has to be positive number")
201+ else if ((0 > ticketPrice))
202+ then throw("Ticket price has to be zero or positive number")
203+ else if ((1 > ticketCount))
204+ then throw("Ticket count has to be positive number")
205+ else [IntegerEntry(lastEventIdxKey(i.caller), newEventIdx), StringEntry(generateEventDataKey(newEventId), serializeEventData(i.caller, title, description, startHeight, durationInSecs, ticketPrice, ticketCount, tags, picture, link, location))]
232206 }
233207 }
234208 }
235209
236210
237211
238212 @Callable(i)
239213 func buyTicket (eventId) = {
240214 let systemAsset = unsafeGetAssetById(systemAssetIdBytes)
241215 if ((1 > size(i.payments)))
242216 then throw("You have to attach the ticket payment")
243217 else {
244218 let ticketPayment = i.payments[0]
245219 let systemAssetId = toBase58String(systemAsset.id)
246220 if (!(validateAssetId(ticketPayment.assetId, systemAssetId)))
247221 then throw(("Ticket payment has to be in system asset " + systemAssetId))
248222 else {
249223 let eventData = unsafeGetEventData(eventId)
250224 let boughtTicketCountKey = generateBoughtTicketCountKey(eventId)
251225 let boughtTicketCount = match getInteger(boughtTicketCountKey) {
252226 case count: Int =>
253227 count
254228 case _ =>
255229 0
256230 }
257- let ticketCountOrUnit = eventData._11
258- if (if (isDefined(ticketCountOrUnit))
259- then (boughtTicketCount >= value(ticketCountOrUnit))
260- else false)
231+ let ticketCount = eventData._7
232+ if ((boughtTicketCount >= ticketCount))
261233 then throw("All the tickets are sold out")
262234 else {
263235 let userTicketKey = generateTicketKey(eventId, i.caller)
264236 if (isDefined(getString(userTicketKey)))
265237 then throw("You already have a ticket")
266238 else {
267- let eventTicketPrice = eventData._5
239+ let eventTicketPrice = eventData._6
268240 if ((eventTicketPrice > ticketPayment.amount))
269241 then throw(("Attached ticket payment amount is less then event ticket price " + toString(eventTicketPrice)))
270242 else [IntegerEntry(boughtTicketCountKey, (boughtTicketCount + 1)), StringEntry(userTicketKey, serializeTicketData(i.transactionId, ticketPayment.amount, unit, unit))]
271243 }
272244 }
273245 }
274246 }
275247 }
276248
277249
278250
279251 @Callable(i)
280252 func giveBitographForTicket (ticketId,bitographName,bitographMetadata) = if (!(isDefined(getString(ticketId))))
281253 then throw("Ticket does not exists")
282254 else {
283255 let ticketData = unsafeGetTicketData(ticketId)
284256 let bitographIdOrUnit = ticketData._4
285257 if (isDefined(bitographIdOrUnit))
286258 then throw((("There is bitograph " + toBase58String(value(bitographIdOrUnit))) + " that has already been given for the ticket"))
287259 else {
288260 let ticketOwner = unsafeExtractTicketOwner(ticketId)
289261 let createBitographResult = invoke(Address(factoryContractAddressBytes), "createBitograph", [bitographName, bitographMetadata], nil)
290262 if ((createBitographResult == createBitographResult))
291263 then {
292264 let bitographAssetId = match createBitographResult {
293265 case r: ByteVector =>
294266 r
295267 case _ =>
296268 throw("Error occurred while creating a bitograph")
297269 }
298270 [ScriptTransfer(ticketOwner, 1, bitographAssetId), StringEntry(ticketId, serializeTicketData(ticketData._1, ticketData._2, i.transactionId, bitographAssetId))]
299271 }
300272 else throw("Strict value is not equal to itself.")
301273 }
302274 }
303275
304276
305277 @Verifier(tx)
306278 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
307279

github/deemru/w8io/026f985 
51.33 ms