tx · 6PcjLi8qNModL1GxSR5AFHnyaELQ16G6qKiBHKxQHeRr

3NA8MoNPikwC3J5qFE4bJNyb234chSY61sV:  -0.01600000 Waves

2023.02.03 05:57 [2432868] smart account 3NA8MoNPikwC3J5qFE4bJNyb234chSY61sV > SELF 0.00000000 Waves

{ "type": 13, "id": "6PcjLi8qNModL1GxSR5AFHnyaELQ16G6qKiBHKxQHeRr", "fee": 1600000, "feeAssetId": null, "timestamp": 1675391887351, "version": 2, "chainId": 84, "sender": "3NA8MoNPikwC3J5qFE4bJNyb234chSY61sV", "senderPublicKey": "9DhkQ7ZkQPRhQPKPcvpn8J9G9kBWYmZaLGNFxUzf1UJd", "proofs": [ "3mBA6443611hYthoPdkf3Pmr4tnngv7PjD6wUASb4RDHjYtf4gjmZUKWKvvM9oRFFRoUeRRmqJMsBFE7mo3iDJVW" ], "script": "base64:BgI5CAISBAoCCAgSBAoCBAgSBAoCAQgSBQoDCAEIEgMKAQgSAwoBCBIDCgEIEgUKAwgICBIGCgQICAgIOgAHVkVSU0lPTgIFMS4xLjUBCWdldFN0ckJ5SwEDa2V5CQELdmFsdWVPckVsc2UCCQCdCAIFBHRoaXMFA2tleQIAAAh1bml0VGVzdAcACW9yYWNsZUZlZQkBBXZhbHVlAQkApggBCQEJZ2V0U3RyQnlLAQIPY29uZl9vcmFjbGVfZmVlAAhzaWduRGFwcAkBBXZhbHVlAQkApggBCQEJZ2V0U3RyQnlLAQIRY29uZl9zaWdud2ViX2RhcHAAC2ZlZVJlY2VpdmVyCQEJZ2V0U3RyQnlLAQIRY29uZl9mZWVfcmVjZWl2ZXIADGFydHdvcmtzRGFwcAkBBXZhbHVlAQkApggBCQEJZ2V0U3RyQnlLAQISY29uZl9hcnR3b3Jrc19kYXBwAAh1c2VyRGFwcAMFCHVuaXRUZXN0CQEFdmFsdWUBCQCmCAECIzNNdDRSR01FeWpTV1lBb2NUUHFkNTV3ZEhRUUIzUFUyVUNtCQEFdmFsdWUBCQCmCAEJAQlnZXR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EKZ2V0QmlkRGF0YQEFBmJpZEtleQQKYmlkRGF0YUFycggFDSR0MDE5ODY0MTk5MTkCXzEEB2Fzc2V0SWQIBQ0kdDAxOTg2NDE5OTE5Al8yBAdiaWREYXRhCAUNJHQwMTk4NjQxOTkxOQJfMwkAzAgCCQELRGVsZXRlRW50cnkBCQCsAgIFBmJpZEtleQIFX09QRU4JAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICBQZiaWRLZXkCCl9DQU5DRUxMRUQJAKwCAgkArAICCQCsAgIJAKwCAgUHYmlkRGF0YQILX0NBTkNFTExFRF8JAKQDAQUEZGF0ZQIBXwUCaWQJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwkBB0FkZHJlc3MBCQDZBAEFBmNhbGxlcgkBDXBhcnNlSW50VmFsdWUBCQCRAwIFCmJpZERhdGFBcnIAAQUHYXNzZXRJZAUDbmlsAHGTnag=", "height": 2432868, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5C5mUVEzribAiGDfrMADLN6wszVS2pmM4SS8ewhz2Tp1 Next: none Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let VERSION = "1.0.0"
4+let VERSION = "1.1.5"
55
66 func getStrByK (key) = valueOrElse(getString(this, key), "")
77
88
9-func getIntByK (key) = valueOrElse(getInteger(this, key), 0)
9+let unitTest = false
1010
11+let oracleFee = value(addressFromString(getStrByK("conf_oracle_fee")))
12+
13+let signDapp = value(addressFromString(getStrByK("conf_signweb_dapp")))
1114
1215 let feeReceiver = getStrByK("conf_fee_receiver")
1316
14-let eventsDapp = value(addressFromString(getStrByK("conf_events_dapp")))
17+let artworksDapp = value(addressFromString(getStrByK("conf_artworks_dapp")))
1518
16-let userDapp = value(addressFromString(getStrByK("conf_users_dapp")))
19+let userDapp = if (unitTest)
20+ then value(addressFromString("3Mt4RGMEyjSWYAocTPqd55wdHQQB3PU2UCm"))
21+ else value(addressFromString(getStrByK("conf_users_dapp")))
1722
18-let signCut = getIntByK("conf_signcut")
23+let whitelistDapp = value(addressFromString(getStrByK("conf_whitelist_dapp")))
1924
2025 let signAssetId = fromBase58String(getStrByK("conf_accepted_asset_SIGN"))
2126
27+let usdnAssetId = fromBase58String(getStrByK("conf_accepted_asset_USDN"))
28+
29+let usdtAssetId = fromBase58String(getStrByK("conf_accepted_asset_USDT"))
30+
31+let wavesAssetId = base58''
32+
2233 let chris = getStrByK("conf_admin_1")
34+
35+let signCut = 3
2336
2437 let userSuspended = "SUSPENDED"
2538
26-let eventIllegal = "ILLEGAL"
39+let userRemoved = "REMOVED"
2740
28-let eventSuspended = "SUSPENDED"
41+let artIllegal = "ILLEGAL"
42+
43+let artSuspended = "SUSPENDED"
2944
3045 let dappRunningKey = "conf_dapp_is_running"
3146
4055 func getUserStrByK (key) = valueOrElse(getString(userDapp, key), "Error")
4156
4257
43-func getEventStrByK (key) = valueOrElse(getString(eventsDapp, key), "")
58+func getArtworkRoyalties (key) = valueOrElse(getInteger(artworksDapp, key), 1000)
59+
60+
61+func getArtStrByK (key) = valueOrElse(getString(artworksDapp, key), "")
62+
63+
64+func getIntByK (key) = valueOrElse(getInteger(this, key), 0)
4465
4566
4667 func keyUserStatus (addr) = ("user_status_" + addr)
4768
4869
49-func keyFlag (organizerAddr,eventId) = ((("event_flag_" + eventId) + "_") + organizerAddr)
70+func keyArtworkRoyalties (caller,artId) = ((("art_royalties_" + artId) + "_") + caller)
71+
72+
73+func keySignID (artistAddr,artId) = ((("art_signid_" + artId) + "_") + artistAddr)
74+
75+
76+func keyFlag (artistAddr,artId) = ((("art_flag_" + artId) + "_") + artistAddr)
5077
5178
5279 func keyNFTData (id) = ("nft_" + id)
5380
5481
55-func getSaleKey (caller,ticketId,eventId,organizerAddr,nftId) = ((((((((("sale2nd_info_" + caller) + "_") + ticketId) + "_") + eventId) + "_") + organizerAddr) + "_") + nftId)
82+func getSaleKey (caller,nftId,artId,creatorAddr) = ((((((("sale2nd_info_" + caller) + "_") + nftId) + "_") + artId) + "_") + creatorAddr)
5683
5784
58-func getBidKey (offerOwner,ticketId,saleOwner,offerId,nftId) = ((((((((("offer2nd_" + offerOwner) + "_") + ticketId) + "_") + saleOwner) + "_") + offerId) + "_") + nftId)
85+func getBidKey (offerOwner,nftId,saleOwner,offerId) = ((((((("offer2nd_" + offerOwner) + "_") + nftId) + "_") + saleOwner) + "_") + offerId)
86+
87+
88+func getIntByKFromOracle (key) = valueOrErrorMessage(getInteger(oracleFee, key), "Integer undefine or 0 in oracle")
89+
90+
91+let currentCertificationPrice = getIntByKFromOracle(("certification_fee_" + toBase58String(signAssetId)))
92+
93+func keyArtistAgentAddr (artistAddr) = ("artist_agent_" + artistAddr)
94+
95+
96+func keySecondaryShareAgent (artistAddr) = ("artist_agent_secondary_" + artistAddr)
97+
98+
99+func keyArtistPublicAgentAddr (artistAddr) = ("artist_public_agent_" + artistAddr)
100+
101+
102+func keySecondarySharePublicAgent (artistAddr) = ("artist_public_agent_secondary_" + artistAddr)
59103
60104
61105 func idCallerDate (i) = if (!(dappRunning))
77121 else false)
78122 then (assetDetails.reissuable == false)
79123 else false)
80- then (assetDetails.issuer == eventsDapp)
124+ then (assetDetails.issuer == artworksDapp)
81125 else false
82126
83127
84-func isSignEventNFT (id) = {
128+func isSignArtNFT (id) = {
85129 let assetDetails = value(assetInfo(id))
86130 assetIsValid(assetDetails)
87131 }
88132
89133
90-func acceptedAssetIds (assetId) = if ((assetId != toBase58String(signAssetId)))
134+func acceptedAssetIds (assetId) = if (if (if (if (if ((assetId != toBase58String(signAssetId)))
135+ then (assetId != toBase58String(wavesAssetId))
136+ else false)
137+ then (assetId != "WAVES")
138+ else false)
139+ then (assetId != toBase58String(usdnAssetId))
140+ else false)
141+ then (assetId != toBase58String(usdtAssetId))
142+ else false)
91143 then false
92144 else true
93145
94146
95-func getBidAssetId (assetId) = fromBase58String(assetId)
147+func getBidAssetId (assetId) = if ((assetId == "WAVES"))
148+ then unit
149+ else fromBase58String(assetId)
96150
97151
98-func getSaleOwnerAndStatus (ticketId) = {
99- let saleOwner = getStrByK(("current_owner_on_dapp_" + ticketId))
152+func getSaleOwnerAndStatus (nftid) = {
153+ let saleOwner = getStrByK(("current_owner_on_dapp_" + nftid))
100154 if ((size(saleOwner) == 0))
101- then throw("Ticket not found")
155+ then throw("NFT not found")
102156 else {
103- let saleStatus = getStrByK(((("sale2nd_status_" + saleOwner) + "_") + ticketId))
157+ let saleStatus = getStrByK(((("sale2nd_status_" + saleOwner) + "_") + nftid))
104158 if ((saleStatus != "OPEN"))
105- then throw("Ticket not for sale")
159+ then throw("NFT not for sale")
106160 else saleOwner
107161 }
108162 }
120174 }
121175
122176
123-func eventIsValid (eventStatus) = if ((eventStatus != eventIllegal))
124- then (eventStatus != eventSuspended)
177+func artIsValid (artStatus) = if ((artStatus != artIllegal))
178+ then (artStatus != artSuspended)
125179 else false
126180
127181
128-func checkEventStatus (addr,id) = {
129- let eventStatus = getEventStrByK(keyFlag(addr, id))
130- if (eventIsValid(eventStatus))
182+func checkArtStatus (addr,id) = {
183+ let artStatus = getArtStrByK(keyFlag(addr, id))
184+ if (artIsValid(artStatus))
131185 then true
132- else throw(("Original event flagged as " + eventStatus))
186+ else throw(("Original Artwork flagged as " + artStatus))
133187 }
134188
135189
136-func checkOrganizerStatus (addr) = {
137- let organizerStatus = getUserStrByK(keyUserStatus(addr))
138- if (containsElement([userSuspended], organizerStatus))
139- then throw(("Original organizer " + organizerStatus))
190+func checkArtistStatus (addr) = {
191+ let artistStatus = getUserStrByK(keyUserStatus(addr))
192+ if (containsElement([userSuspended, userRemoved], artistStatus))
193+ then throw(("Original Artist " + artistStatus))
140194 else true
141195 }
142196
143197
144198 func checkNFTInfo (assetId) = {
145- let nftData = split(getEventStrByK(keyNFTData(assetId)), "_")
146- if (if (!(checkEventStatus(nftData[6], nftData[5])))
147- then !(checkOrganizerStatus(nftData[6]))
199+ let nftData = split(getArtStrByK(keyNFTData(assetId)), "_")
200+ let artSignID = getArtStrByK(keySignID(nftData[6], nftData[5]))
201+ if (if (!(checkArtStatus(nftData[6], nftData[5])))
202+ then !(checkArtistStatus(nftData[6]))
148203 else false)
149- then $Tuple4(false, nftData[6], nftData[7], nftData[5])
150- else $Tuple4(true, nftData[6], nftData[7], nftData[5])
204+ then $Tuple4(false, nftData[5], nftData[6], artSignID)
205+ else $Tuple4(true, nftData[5], nftData[6], artSignID)
151206 }
152207
153208
154-func checkEVENTExist (eventId,organizerAddr) = if (if (!(checkEventStatus(organizerAddr, eventId)))
155- then !(checkOrganizerStatus(organizerAddr))
156- else false)
157- then false
158- else true
209+func checkARTExist (artId,creatorAddr) = {
210+ let artSignID = getArtStrByK(keySignID(creatorAddr, artId))
211+ if ((size(artSignID) == 0))
212+ then throw("Artwork not found on SIGN Art")
213+ else if (if (!(checkArtStatus(creatorAddr, artId)))
214+ then !(checkArtistStatus(creatorAddr))
215+ else false)
216+ then false
217+ else true
218+ }
159219
160220
161-func setTransfers (amount,assetId,nftId,organizerAddr,saleOwner,caller,eventId,ticketId) = {
162- let organizerCut = getIntByK(((((("ticket_royalties_" + eventId) + "_") + organizerAddr) + "_") + ticketId))
221+func setTransfers (amount,assetId,nftid,creatorAddr,saleOwner,caller,artId) = {
222+ let creatorCut = getArtworkRoyalties(keyArtworkRoyalties(creatorAddr, artId))
223+ let agent = valueOrElse(getString(userDapp, keyArtistAgentAddr(creatorAddr)), feeReceiver)
224+ let agentShare = valueOrElse(getInteger(userDapp, keySecondaryShareAgent(creatorAddr)), 0)
225+ let publicAgent = valueOrElse(getString(userDapp, keyArtistPublicAgentAddr(creatorAddr)), feeReceiver)
226+ let publicAgentShare = valueOrElse(getInteger(userDapp, keySecondarySharePublicAgent(creatorAddr)), 0)
163227 let amountForSign = fraction(amount, signCut, 100)
164- let amountForOrganizer = fraction(amount, organizerCut, 100)
165- let amountForOwner = (amount - (amountForSign + amountForOrganizer))
166- let commissions = [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)]
167- let organizerFee = ScriptTransfer(Address(fromBase58String(organizerAddr)), amountForOrganizer, assetId)
228+ let amountForCreator = fraction(amount, creatorCut, 10000)
229+ let amountForOwner = (amount - (amountForSign + amountForCreator))
230+ let amountForAgent = if (if ((agent != feeReceiver))
231+ then (agentShare > 0)
232+ else false)
233+ then fraction(amount, agentShare, 100)
234+ else 0
235+ let amountForPublicAgent = if (if ((publicAgent != feeReceiver))
236+ then (publicAgentShare > 0)
237+ else false)
238+ then fraction(amount, publicAgentShare, 100)
239+ else 0
240+ let commissions = if ((amountForAgent != 0))
241+ then [ScriptTransfer(Address(fromBase58String(feeReceiver)), (amountForSign - amountForAgent), assetId), ScriptTransfer(Address(fromBase58String(agent)), amountForAgent, assetId)]
242+ else [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)]
243+ let creatorFee = if ((amountForPublicAgent != 0))
244+ then [ScriptTransfer(Address(fromBase58String(publicAgent)), amountForPublicAgent, assetId), ScriptTransfer(Address(fromBase58String(creatorAddr)), (amountForCreator - amountForPublicAgent), assetId)]
245+ else [ScriptTransfer(Address(fromBase58String(creatorAddr)), amountForCreator, assetId)]
168246 let ownerFee = ScriptTransfer(Address(fromBase58String(saleOwner)), amountForOwner, assetId)
169- let collectorNFT = ScriptTransfer(Address(fromBase58String(caller)), 1, fromBase58String(nftId))
170- $Tuple4(commissions, organizerFee, ownerFee, collectorNFT)
247+ let collectorNFT = ScriptTransfer(Address(fromBase58String(caller)), 1, fromBase58String(nftid))
248+ $Tuple4(commissions, creatorFee, ownerFee, collectorNFT)
249+ }
250+
251+
252+func validateMinSell (assetId,price) = {
253+ let minSellWaves = if (unitTest)
254+ then 10
255+ else getIntByKFromOracle("waves_min_sell")
256+ let minSellUsdn = 1000000
257+ let minSellSign = if (unitTest)
258+ then 1
259+ else (currentCertificationPrice * 2)
260+ if (if (if (if (if (if ((assetId == toBase58String(usdnAssetId)))
261+ then (minSellUsdn > price)
262+ else false)
263+ then (price != 0)
264+ else false)
265+ then true
266+ else if (if ((assetId == toBase58String(usdtAssetId)))
267+ then (minSellUsdn > price)
268+ else false)
269+ then (price != 0)
270+ else false)
271+ then true
272+ else if (if ((assetId == toBase58String(signAssetId)))
273+ then (minSellSign > price)
274+ else false)
275+ then (price != 0)
276+ else false)
277+ then true
278+ else if (if (if ((assetId == toBase58String(wavesAssetId)))
279+ then true
280+ else (assetId == "WAVES"))
281+ then (minSellWaves > price)
282+ else false)
283+ then (price != 0)
284+ else false)
285+ then false
286+ else true
171287 }
172288
173289
174290 func provideBaseData (i,nftId) = {
175- let $t059405979 = idCallerDate(i)
176- let id = $t059405979._1
177- let caller = $t059405979._2
178- let date = $t059405979._3
179- let $t059826054 = checkNFTInfo(nftId)
180- let isValidNFT = $t059826054._1
181- let eventId = $t059826054._2
182- let organizerAddr = $t059826054._3
183- let ticketId = $t059826054._4
184- $Tuple7(id, caller, date, isValidNFT, eventId, organizerAddr, ticketId)
291+ let $t01063110671 = idCallerDate(i)
292+ let id = $t01063110671._1
293+ let caller = $t01063110671._2
294+ let date = $t01063110671._3
295+ let $t01067410743 = checkNFTInfo(nftId)
296+ let isValidNFT = $t01067410743._1
297+ let artId = $t01067410743._2
298+ let creatorAddr = $t01067410743._3
299+ let artSignID = $t01067410743._4
300+ $Tuple7(id, caller, date, isValidNFT, artId, creatorAddr, artSignID)
185301 }
186302
187303
215331
216332
217333 @Callable(i)
218-func sellNFT (price) = {
219- let $t071077143 = isPayment(i)
220- let payment = $t071077143._1
221- let amount = $t071077143._2
334+func sellNFT (price,asset) = {
335+ let $t01180811844 = isPayment(i)
336+ let payment = $t01180811844._1
337+ let amount = $t01180811844._2
222338 if ((amount != 1))
223- then throw("No Ticket attached")
339+ then throw("No NFT attached")
224340 else {
225341 let nftId = if (if (isDefined(payment.assetId))
226- then isSignEventNFT(value(payment.assetId))
342+ then isSignArtNFT(value(payment.assetId))
227343 else false)
228344 then toBase58String(value(payment.assetId))
229- else throw("Only SIGN Event NFT accepted.")
230- let $t073847479 = provideBaseData(i, nftId)
231- let id = $t073847479._1
232- let caller = $t073847479._2
233- let date = $t073847479._3
234- let isValidNFT = $t073847479._4
235- let eventId = $t073847479._5
236- let organizerAddr = $t073847479._6
237- let ticketId = $t073847479._7
238- if (!(isValidNFT))
239- then throw("Not a valid ticket")
240- else [StringEntry((getSaleKey(caller, ticketId, eventId, organizerAddr, nftId) + "_OPEN"), ((((((((((((((toString(date) + "_") + toString(price)) + "_") + toBase58String(signAssetId)) + "_") + nftId) + "_") + ticketId) + "_") + eventId) + "_") + organizerAddr) + "_") + id)), StringEntry(((("sale2nd_status_" + caller) + "_") + nftId), "OPEN"), StringEntry(("current_owner_on_dapp_" + nftId), caller)]
345+ else throw("Only SIGN Art NFT accepted.")
346+ let $t01207812171 = provideBaseData(i, nftId)
347+ let id = $t01207812171._1
348+ let caller = $t01207812171._2
349+ let date = $t01207812171._3
350+ let isValidNFT = $t01207812171._4
351+ let artId = $t01207812171._5
352+ let creatorAddr = $t01207812171._6
353+ let artSignID = $t01207812171._7
354+ if ((size(artSignID) == 0))
355+ then throw("Artwork not found on SIGN Art")
356+ else if (!(isValidNFT))
357+ then throw("Not a valid nft")
358+ else if (!(acceptedAssetIds(asset)))
359+ then throw("Only SIGN, USDN, USDT or WAVES accepted")
360+ else if (!(validateMinSell(asset, price)))
361+ then throw("Wrong minimum sell price")
362+ else [StringEntry((getSaleKey(caller, nftId, artId, creatorAddr) + "_OPEN"), ((((((((((((toString(date) + "_") + toString(price)) + "_") + asset) + "_") + nftId) + "_") + artId) + "_") + creatorAddr) + "_") + id)), StringEntry(((("sale2nd_status_" + caller) + "_") + nftId), "OPEN"), StringEntry(("current_owner_on_dapp_" + nftId), caller)]
241363 }
242364 }
243365
244366
245367
246368 @Callable(i)
247-func updateSalePrice (nftId,price) = {
248- let $t080178112 = provideBaseData(i, nftId)
249- let id = $t080178112._1
250- let caller = $t080178112._2
251- let date = $t080178112._3
252- let isValidNFT = $t080178112._4
253- let eventId = $t080178112._5
254- let organizerAddr = $t080178112._6
255- let ticketId = $t080178112._7
256- if (!(isValidNFT))
257- then throw("Not a valid ticket")
258- else {
259- let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId))
260- if ((saleOwner != caller))
261- then throw("You don't own this ticket")
262- else {
263- let saleStatus = getStrByK(((("sale2nd_status_" + caller) + "_") + nftId))
264- if ((saleStatus != "OPEN"))
265- then throw("Sale not active")
266- else {
267- let saleKey = getSaleKey(caller, ticketId, eventId, organizerAddr, nftId)
268- let saleInfo = split(getStrByK((saleKey + "_OPEN")), "_")
269-[StringEntry((saleKey + "_OPEN"), ((((((((((((((saleInfo[0] + "_") + toString(price)) + "_") + toBase58String(signAssetId)) + "_") + saleInfo[3]) + "_") + saleInfo[4]) + "_") + saleInfo[5]) + "_") + saleInfo[6]) + "_") + saleInfo[7]))]
270- }
271- }
272- }
369+func updateSalePrice (nftId,price,asset) = {
370+ let $t01305113144 = provideBaseData(i, nftId)
371+ let id = $t01305113144._1
372+ let caller = $t01305113144._2
373+ let date = $t01305113144._3
374+ let isValidNFT = $t01305113144._4
375+ let artId = $t01305113144._5
376+ let creatorAddr = $t01305113144._6
377+ let artSignID = $t01305113144._7
378+ if ((size(artSignID) == 0))
379+ then throw("Artwork not found on SIGN Art, cancel your sale.")
380+ else if (!(isValidNFT))
381+ then throw("Not a valid nft")
382+ else {
383+ let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId))
384+ if ((saleOwner != caller))
385+ then throw("You don't own this NFT")
386+ else {
387+ let saleStatus = getStrByK(((("sale2nd_status_" + caller) + "_") + nftId))
388+ if ((saleStatus != "OPEN"))
389+ then throw("Sale not active")
390+ else if (!(acceptedAssetIds(asset)))
391+ then throw("Only SIGN, USDN, USDT or WAVES accepted")
392+ else if (!(validateMinSell(asset, price)))
393+ then throw("Wrong minimum sell price")
394+ else {
395+ let saleKey = getSaleKey(caller, nftId, artId, creatorAddr)
396+ let saleInfo = split(getStrByK((saleKey + "_OPEN")), "_")
397+[StringEntry((saleKey + "_OPEN"), ((((((((((((saleInfo[0] + "_") + toString(price)) + "_") + asset) + "_") + saleInfo[3]) + "_") + saleInfo[4]) + "_") + saleInfo[5]) + "_") + saleInfo[6]))]
398+ }
399+ }
400+ }
273401 }
274402
275403
276404
277405 @Callable(i)
278406 func cancelSale (nftId) = {
279- let $t090459288 = provideBaseData(i, nftId)
280- let id = $t090459288._1
281- let caller = $t090459288._2
282- let date = $t090459288._3
283- let isValidNFT = $t090459288._4
284- let eventId = $t090459288._5
285- let organizerAddr = $t090459288._6
286- let ticketId = $t090459288._7
407+ let $t01429214533 = provideBaseData(i, nftId)
408+ let id = $t01429214533._1
409+ let caller = $t01429214533._2
410+ let date = $t01429214533._3
411+ let isValidNFT = $t01429214533._4
412+ let artId = $t01429214533._5
413+ let creatorAddr = $t01429214533._6
414+ let artSignID = $t01429214533._7
287415 let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId))
288416 if ((saleOwner != caller))
289- then throw("You don't own this ticket")
417+ then throw("You don't own this NFT")
290418 else {
291419 let saleStatus = getStrByK(((("sale2nd_status_" + caller) + "_") + nftId))
292420 if ((saleStatus != "OPEN"))
293421 then throw("Sale not active")
294422 else {
295- let saleKey = getSaleKey(caller, ticketId, eventId, organizerAddr, nftId)
423+ let saleKey = getSaleKey(caller, nftId, artId, creatorAddr)
296424 let saleInfo = getStrByK((saleKey + "_OPEN"))
297425 [DeleteEntry((saleKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + caller) + "_") + nftId)), DeleteEntry(("current_owner_on_dapp_" + nftId)), StringEntry((((saleKey + "_") + id) + "_CANCELLED"), ((((saleInfo + "_CANCELLED_") + toString(date)) + "_") + id)), ScriptTransfer(Address(fromBase58String(caller)), 1, fromBase58String(nftId))]
298426 }
303431
304432 @Callable(i)
305433 func buyNFT (nftId) = {
306- let $t01013510259 = provideBaseData(i, nftId)
307- let id = $t01013510259._1
308- let caller = $t01013510259._2
309- let date = $t01013510259._3
310- let isValidNFT = $t01013510259._4
311- let eventId = $t01013510259._5
312- let organizerAddr = $t01013510259._6
313- let ticketId = $t01013510259._7
434+ let $t01536415457 = provideBaseData(i, nftId)
435+ let id = $t01536415457._1
436+ let caller = $t01536415457._2
437+ let date = $t01536415457._3
438+ let isValidNFT = $t01536415457._4
439+ let artId = $t01536415457._5
440+ let creatorAddr = $t01536415457._6
441+ let artSignID = $t01536415457._7
442+ if ((size(artSignID) == 0))
443+ then throw("Artwork not found on SIGN Art, cancel your sale.")
444+ else if (!(isValidNFT))
445+ then throw("Not a valid nft")
446+ else {
447+ let saleOwner = getSaleOwnerAndStatus(nftId)
448+ let saleKey = getSaleKey(saleOwner, nftId, artId, creatorAddr)
449+ let saleInfo = getStrByK((saleKey + "_OPEN"))
450+ if ((size(saleInfo) == 0))
451+ then throw("Sale Not found!")
452+ else {
453+ let saleInfoArray = split(saleInfo, "_")
454+ if ((parseInt(saleInfoArray[1]) == 0))
455+ then throw("Offer only")
456+ else {
457+ let $t01595415990 = isPayment(i)
458+ let payment = $t01595415990._1
459+ let amount = $t01595415990._2
460+ let paymentAssetStr = if (isDefined(payment.assetId))
461+ then toBase58String(value(payment.assetId))
462+ else ""
463+ if (if ((saleInfoArray[1] != toString(amount)))
464+ then true
465+ else (saleInfoArray[2] != paymentAssetStr))
466+ then throw("Payment infos don't match.")
467+ else {
468+ let $t01649616635 = setTransfers(amount, payment.assetId, nftId, creatorAddr, saleOwner, caller, artId)
469+ let commissions = $t01649616635._1
470+ let creatorFee = $t01649616635._2
471+ let ownerFee = $t01649616635._3
472+ let collectorNFT = $t01649616635._4
473+ (([DeleteEntry((saleKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + saleOwner) + "_") + nftId)), DeleteEntry(("current_owner_on_dapp_" + nftId)), StringEntry((((saleKey + "_") + id) + "_CLOSED"), ((((((saleInfo + "_CLOSED_") + toString(date)) + "_") + id) + "_") + caller)), updateNumSales(), ownerFee, collectorNFT] ++ creatorFee) ++ commissions)
474+ }
475+ }
476+ }
477+ }
478+ }
479+
480+
481+
482+@Callable(i)
483+func setOffer (nftId) = {
484+ let $t01704617143 = provideBaseData(i, nftId)
485+ let id = $t01704617143._1
486+ let offerOwner = $t01704617143._2
487+ let date = $t01704617143._3
488+ let isValidNFT = $t01704617143._4
489+ let artId = $t01704617143._5
490+ let creatorAddr = $t01704617143._6
491+ let artSignID = $t01704617143._7
314492 if (!(isValidNFT))
315- then throw("Not a valid ticket")
493+ then throw("Not a valid nft")
494+ else {
495+ let $t01720417240 = isPayment(i)
496+ let payment = $t01720417240._1
497+ let amount = $t01720417240._2
498+ let assetId = if (!(isDefined(payment.assetId)))
499+ then "WAVES"
500+ else toBase58String(value(payment.assetId))
501+ if (!(acceptedAssetIds(assetId)))
502+ then throw("asset not accepted")
503+ else if ((amount == 0))
504+ then throw("Offer of 0 not allowed")
505+ else if (!(validateMinSell(assetId, amount)))
506+ then throw("Wrong minimum sell price")
507+ else {
508+ let saleOwner = getSaleOwnerAndStatus(nftId)
509+[StringEntry((getBidKey(offerOwner, nftId, saleOwner, id) + "_OPEN"), ((((((((((((((toString(date) + "_") + toString(amount)) + "_") + assetId) + "_") + nftId) + "_") + artId) + "_") + creatorAddr) + "_") + offerOwner) + "_") + id))]
510+ }
511+ }
512+ }
513+
514+
515+
516+@Callable(i)
517+func acceptOffer (nftId,offerId,offerOwner) = {
518+ let $t01804218135 = provideBaseData(i, nftId)
519+ let id = $t01804218135._1
520+ let caller = $t01804218135._2
521+ let date = $t01804218135._3
522+ let isValidNFT = $t01804218135._4
523+ let artId = $t01804218135._5
524+ let creatorAddr = $t01804218135._6
525+ let artSignID = $t01804218135._7
526+ if (!(isValidNFT))
527+ then throw("Not a valid nft")
316528 else {
317529 let saleOwner = getSaleOwnerAndStatus(nftId)
318- let saleKey = getSaleKey(saleOwner, ticketId, eventId, organizerAddr, nftId)
319- let saleInfo = getStrByK((saleKey + "_OPEN"))
320- if ((size(saleInfo) == 0))
321- then throw("Sale Not found!")
530+ if ((caller != saleOwner))
531+ then throw("Only sale owner can accept offer")
322532 else {
323- let saleInfoArray = split(saleInfo, "_")
324- if ((parseInt(saleInfoArray[1]) == 0))
325- then throw("Offer only")
533+ let bidKey = getBidKey(offerOwner, nftId, saleOwner, offerId)
534+ let $t01838918444 = getBidData(bidKey)
535+ let bidDataArr = $t01838918444._1
536+ let assetId = $t01838918444._2
537+ let bidData = $t01838918444._3
538+ let saleKey = getSaleKey(saleOwner, nftId, artId, creatorAddr)
539+ let saleInfo = getStrByK((saleKey + "_OPEN"))
540+ if ((size(saleInfo) == 0))
541+ then throw("Sale Not found!")
326542 else {
327- let $t01067410710 = isPayment(i)
328- let payment = $t01067410710._1
329- let amount = $t01067410710._2
330- let paymentAssetStr = toBase58String(value(payment.assetId))
331- if (if ((saleInfoArray[1] != toString(amount)))
332- then true
333- else (saleInfoArray[2] != paymentAssetStr))
334- then throw("Payment infos don't match.")
335- else {
336- let $t01091111064 = setTransfers(amount, payment.assetId, nftId, organizerAddr, saleOwner, caller, eventId, ticketId)
337- let commissions = $t01091111064._1
338- let creatorFee = $t01091111064._2
339- let ownerFee = $t01091111064._3
340- let collectorNFT = $t01091111064._4
341- ([DeleteEntry((saleKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + saleOwner) + "_") + nftId)), DeleteEntry(("current_owner_on_dapp_" + nftId)), StringEntry((((saleKey + "_") + id) + "_CLOSED"), ((((((saleInfo + "_CLOSED_") + toString(date)) + "_") + id) + "_") + caller)), updateNumSales(), creatorFee, ownerFee, collectorNFT] ++ commissions)
342- }
543+ let amount = value(parseInt(bidDataArr[1]))
544+ let $t01868018818 = setTransfers(amount, assetId, nftId, creatorAddr, saleOwner, bidDataArr[6], artId)
545+ let commissions = $t01868018818._1
546+ let creatorFee = $t01868018818._2
547+ let ownerFee = $t01868018818._3
548+ let collectorNFT = $t01868018818._4
549+ let assetIdStr = if (isDefined(assetId))
550+ then toBase58String(value(assetId))
551+ else "WAVES"
552+ (([DeleteEntry((saleKey + "_OPEN")), DeleteEntry((bidKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + saleOwner) + "_") + nftId)), DeleteEntry(("current_owner_on_dapp_" + nftId)), StringEntry((bidKey + "_CLOSED"), ((((bidData + "_CLOSED_") + toString(date)) + "_") + id)), StringEntry((((saleKey + "_") + id) + "_CLOSED"), ((((((((((saleInfo + "_CLOSED-OFFER_") + toString(date)) + "_") + id) + "_") + offerOwner) + "_") + toString(amount)) + "_") + assetIdStr)), updateNumSales(), ownerFee, collectorNFT] ++ creatorFee) ++ commissions)
343553 }
344554 }
345555 }
348558
349559
350560 @Callable(i)
351-func setOffer (nftId) = {
352- let $t01147511574 = provideBaseData(i, nftId)
353- let id = $t01147511574._1
354- let offerOwner = $t01147511574._2
355- let date = $t01147511574._3
356- let isValidNFT = $t01147511574._4
357- let eventId = $t01147511574._5
358- let organizerAddr = $t01147511574._6
359- let ticketId = $t01147511574._7
360- if (!(isValidNFT))
361- then throw("Not a valid ticket")
362- else {
363- let $t01163811674 = isPayment(i)
364- let payment = $t01163811674._1
365- let amount = $t01163811674._2
366- let assetId = toBase58String(value(payment.assetId))
367- if (!(acceptedAssetIds(assetId)))
368- then throw("asset not accepted")
369- else if ((amount == 0))
370- then throw("Offer of 0 not allowed")
371- else {
372- let saleOwner = getSaleOwnerAndStatus(nftId)
373-[StringEntry((getBidKey(offerOwner, ticketId, saleOwner, id, nftId) + "_OPEN"), ((((((((((((((toString(date) + "_") + toString(amount)) + "_") + assetId) + "_") + nftId) + "_") + eventId) + "_") + organizerAddr) + "_") + offerOwner) + "_") + id))]
374- }
375- }
376- }
377-
378-
379-
380-@Callable(i)
381-func acceptOffer (nftId,offerId,offerOwner) = {
382- let $t01235312448 = provideBaseData(i, nftId)
383- let id = $t01235312448._1
384- let caller = $t01235312448._2
385- let date = $t01235312448._3
386- let isValidNFT = $t01235312448._4
387- let eventId = $t01235312448._5
388- let organizerAddr = $t01235312448._6
389- let ticketId = $t01235312448._7
390- if (!(isValidNFT))
391- then throw("Not a valid ticket")
392- else {
393- let saleOwner = getSaleOwnerAndStatus(nftId)
394- if ((caller != saleOwner))
395- then throw("Only sale owner can accept offer")
396- else {
397- let bidKey = getBidKey(offerOwner, ticketId, saleOwner, offerId, nftId)
398- let $t01271412769 = getBidData(bidKey)
399- let bidDataArr = $t01271412769._1
400- let assetId = $t01271412769._2
401- let bidData = $t01271412769._3
402- let saleKey = getSaleKey(saleOwner, ticketId, eventId, organizerAddr, nftId)
403- let saleInfo = getStrByK((saleKey + "_OPEN"))
404- if ((size(saleInfo) == 0))
405- then throw("Sale Not found!")
406- else {
407- let amount = value(parseInt(bidDataArr[1]))
408- let $t01301813170 = setTransfers(amount, assetId, nftId, organizerAddr, saleOwner, bidDataArr[6], eventId, ticketId)
409- let commissions = $t01301813170._1
410- let creatorFee = $t01301813170._2
411- let ownerFee = $t01301813170._3
412- let collectorNFT = $t01301813170._4
413- let assetIdStr = toBase58String(value(assetId))
414- ([DeleteEntry((saleKey + "_OPEN")), DeleteEntry((bidKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + saleOwner) + "_") + nftId)), DeleteEntry(("current_owner_on_dapp_" + nftId)), StringEntry((bidKey + "_CLOSED"), ((((bidData + "_CLOSED_") + toString(date)) + "_") + id)), StringEntry((((saleKey + "_") + id) + "_CLOSED"), ((((((((((saleInfo + "_CLOSED-OFFER_") + toString(date)) + "_") + id) + "_") + offerOwner) + "_") + toString(amount)) + "_") + assetIdStr)), updateNumSales(), creatorFee, ownerFee, collectorNFT] ++ commissions)
415- }
416- }
417- }
418- }
419-
420-
421-
422-@Callable(i)
423-func cancelOffer (nftId,offerId,offerOwner,saleOwner,ticketId) = {
424- let $t01394614018 = idCallerDate(i)
425- let id = $t01394614018._1
426- let caller = $t01394614018._2
427- let date = $t01394614018._3
561+func cancelOffer (nftId,offerId,offerOwner,saleOwner) = {
562+ let $t01961819692 = idCallerDate(i)
563+ let id = $t01961819692._1
564+ let caller = $t01961819692._2
565+ let date = $t01961819692._3
428566 if (if ((caller != offerOwner))
429567 then (caller != saleOwner)
430568 else false)
431569 then throw("You cannot cancel this offer.")
432570 else {
433- let bidKey = getBidKey(offerOwner, ticketId, saleOwner, offerId, nftId)
434- let $t01419914254 = getBidData(bidKey)
435- let bidDataArr = $t01419914254._1
436- let assetId = $t01419914254._2
437- let bidData = $t01419914254._3
571+ let bidKey = getBidKey(offerOwner, nftId, saleOwner, offerId)
572+ let $t01986419919 = getBidData(bidKey)
573+ let bidDataArr = $t01986419919._1
574+ let assetId = $t01986419919._2
575+ let bidData = $t01986419919._3
438576 [DeleteEntry((bidKey + "_OPEN")), StringEntry((bidKey + "_CANCELLED"), ((((bidData + "_CANCELLED_") + toString(date)) + "_") + id)), ScriptTransfer(Address(fromBase58String(caller)), parseIntValue(bidDataArr[1]), assetId)]
439577 }
440578 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let VERSION = "1.0.0"
4+let VERSION = "1.1.5"
55
66 func getStrByK (key) = valueOrElse(getString(this, key), "")
77
88
9-func getIntByK (key) = valueOrElse(getInteger(this, key), 0)
9+let unitTest = false
1010
11+let oracleFee = value(addressFromString(getStrByK("conf_oracle_fee")))
12+
13+let signDapp = value(addressFromString(getStrByK("conf_signweb_dapp")))
1114
1215 let feeReceiver = getStrByK("conf_fee_receiver")
1316
14-let eventsDapp = value(addressFromString(getStrByK("conf_events_dapp")))
17+let artworksDapp = value(addressFromString(getStrByK("conf_artworks_dapp")))
1518
16-let userDapp = value(addressFromString(getStrByK("conf_users_dapp")))
19+let userDapp = if (unitTest)
20+ then value(addressFromString("3Mt4RGMEyjSWYAocTPqd55wdHQQB3PU2UCm"))
21+ else value(addressFromString(getStrByK("conf_users_dapp")))
1722
18-let signCut = getIntByK("conf_signcut")
23+let whitelistDapp = value(addressFromString(getStrByK("conf_whitelist_dapp")))
1924
2025 let signAssetId = fromBase58String(getStrByK("conf_accepted_asset_SIGN"))
2126
27+let usdnAssetId = fromBase58String(getStrByK("conf_accepted_asset_USDN"))
28+
29+let usdtAssetId = fromBase58String(getStrByK("conf_accepted_asset_USDT"))
30+
31+let wavesAssetId = base58''
32+
2233 let chris = getStrByK("conf_admin_1")
34+
35+let signCut = 3
2336
2437 let userSuspended = "SUSPENDED"
2538
26-let eventIllegal = "ILLEGAL"
39+let userRemoved = "REMOVED"
2740
28-let eventSuspended = "SUSPENDED"
41+let artIllegal = "ILLEGAL"
42+
43+let artSuspended = "SUSPENDED"
2944
3045 let dappRunningKey = "conf_dapp_is_running"
3146
3247 let maintenanceMSGKey = "conf_maintenance_msg"
3348
3449 let dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true)
3550
3651 let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "")
3752
3853 let numSalesK = "num_sales"
3954
4055 func getUserStrByK (key) = valueOrElse(getString(userDapp, key), "Error")
4156
4257
43-func getEventStrByK (key) = valueOrElse(getString(eventsDapp, key), "")
58+func getArtworkRoyalties (key) = valueOrElse(getInteger(artworksDapp, key), 1000)
59+
60+
61+func getArtStrByK (key) = valueOrElse(getString(artworksDapp, key), "")
62+
63+
64+func getIntByK (key) = valueOrElse(getInteger(this, key), 0)
4465
4566
4667 func keyUserStatus (addr) = ("user_status_" + addr)
4768
4869
49-func keyFlag (organizerAddr,eventId) = ((("event_flag_" + eventId) + "_") + organizerAddr)
70+func keyArtworkRoyalties (caller,artId) = ((("art_royalties_" + artId) + "_") + caller)
71+
72+
73+func keySignID (artistAddr,artId) = ((("art_signid_" + artId) + "_") + artistAddr)
74+
75+
76+func keyFlag (artistAddr,artId) = ((("art_flag_" + artId) + "_") + artistAddr)
5077
5178
5279 func keyNFTData (id) = ("nft_" + id)
5380
5481
55-func getSaleKey (caller,ticketId,eventId,organizerAddr,nftId) = ((((((((("sale2nd_info_" + caller) + "_") + ticketId) + "_") + eventId) + "_") + organizerAddr) + "_") + nftId)
82+func getSaleKey (caller,nftId,artId,creatorAddr) = ((((((("sale2nd_info_" + caller) + "_") + nftId) + "_") + artId) + "_") + creatorAddr)
5683
5784
58-func getBidKey (offerOwner,ticketId,saleOwner,offerId,nftId) = ((((((((("offer2nd_" + offerOwner) + "_") + ticketId) + "_") + saleOwner) + "_") + offerId) + "_") + nftId)
85+func getBidKey (offerOwner,nftId,saleOwner,offerId) = ((((((("offer2nd_" + offerOwner) + "_") + nftId) + "_") + saleOwner) + "_") + offerId)
86+
87+
88+func getIntByKFromOracle (key) = valueOrErrorMessage(getInteger(oracleFee, key), "Integer undefine or 0 in oracle")
89+
90+
91+let currentCertificationPrice = getIntByKFromOracle(("certification_fee_" + toBase58String(signAssetId)))
92+
93+func keyArtistAgentAddr (artistAddr) = ("artist_agent_" + artistAddr)
94+
95+
96+func keySecondaryShareAgent (artistAddr) = ("artist_agent_secondary_" + artistAddr)
97+
98+
99+func keyArtistPublicAgentAddr (artistAddr) = ("artist_public_agent_" + artistAddr)
100+
101+
102+func keySecondarySharePublicAgent (artistAddr) = ("artist_public_agent_secondary_" + artistAddr)
59103
60104
61105 func idCallerDate (i) = if (!(dappRunning))
62106 then throw(maintenanceMSG)
63107 else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp)
64108
65109
66110 func isPayment (i) = if ((size(i.payments) == 0))
67111 then throw("No payment attached")
68112 else {
69113 let payment = value(i.payments[0])
70114 let amount = value(payment.amount)
71115 $Tuple2(payment, amount)
72116 }
73117
74118
75119 func assetIsValid (assetDetails) = if (if (if ((assetDetails.quantity == 1))
76120 then (assetDetails.decimals == 0)
77121 else false)
78122 then (assetDetails.reissuable == false)
79123 else false)
80- then (assetDetails.issuer == eventsDapp)
124+ then (assetDetails.issuer == artworksDapp)
81125 else false
82126
83127
84-func isSignEventNFT (id) = {
128+func isSignArtNFT (id) = {
85129 let assetDetails = value(assetInfo(id))
86130 assetIsValid(assetDetails)
87131 }
88132
89133
90-func acceptedAssetIds (assetId) = if ((assetId != toBase58String(signAssetId)))
134+func acceptedAssetIds (assetId) = if (if (if (if (if ((assetId != toBase58String(signAssetId)))
135+ then (assetId != toBase58String(wavesAssetId))
136+ else false)
137+ then (assetId != "WAVES")
138+ else false)
139+ then (assetId != toBase58String(usdnAssetId))
140+ else false)
141+ then (assetId != toBase58String(usdtAssetId))
142+ else false)
91143 then false
92144 else true
93145
94146
95-func getBidAssetId (assetId) = fromBase58String(assetId)
147+func getBidAssetId (assetId) = if ((assetId == "WAVES"))
148+ then unit
149+ else fromBase58String(assetId)
96150
97151
98-func getSaleOwnerAndStatus (ticketId) = {
99- let saleOwner = getStrByK(("current_owner_on_dapp_" + ticketId))
152+func getSaleOwnerAndStatus (nftid) = {
153+ let saleOwner = getStrByK(("current_owner_on_dapp_" + nftid))
100154 if ((size(saleOwner) == 0))
101- then throw("Ticket not found")
155+ then throw("NFT not found")
102156 else {
103- let saleStatus = getStrByK(((("sale2nd_status_" + saleOwner) + "_") + ticketId))
157+ let saleStatus = getStrByK(((("sale2nd_status_" + saleOwner) + "_") + nftid))
104158 if ((saleStatus != "OPEN"))
105- then throw("Ticket not for sale")
159+ then throw("NFT not for sale")
106160 else saleOwner
107161 }
108162 }
109163
110164
111165 func getBidData (key) = {
112166 let bidData = getStrByK((key + "_OPEN"))
113167 if ((bidData == ""))
114168 then throw("Offer not found")
115169 else {
116170 let bidDataArr = split(bidData, "_")
117171 let assetId = getBidAssetId(bidDataArr[2])
118172 $Tuple3(bidDataArr, assetId, bidData)
119173 }
120174 }
121175
122176
123-func eventIsValid (eventStatus) = if ((eventStatus != eventIllegal))
124- then (eventStatus != eventSuspended)
177+func artIsValid (artStatus) = if ((artStatus != artIllegal))
178+ then (artStatus != artSuspended)
125179 else false
126180
127181
128-func checkEventStatus (addr,id) = {
129- let eventStatus = getEventStrByK(keyFlag(addr, id))
130- if (eventIsValid(eventStatus))
182+func checkArtStatus (addr,id) = {
183+ let artStatus = getArtStrByK(keyFlag(addr, id))
184+ if (artIsValid(artStatus))
131185 then true
132- else throw(("Original event flagged as " + eventStatus))
186+ else throw(("Original Artwork flagged as " + artStatus))
133187 }
134188
135189
136-func checkOrganizerStatus (addr) = {
137- let organizerStatus = getUserStrByK(keyUserStatus(addr))
138- if (containsElement([userSuspended], organizerStatus))
139- then throw(("Original organizer " + organizerStatus))
190+func checkArtistStatus (addr) = {
191+ let artistStatus = getUserStrByK(keyUserStatus(addr))
192+ if (containsElement([userSuspended, userRemoved], artistStatus))
193+ then throw(("Original Artist " + artistStatus))
140194 else true
141195 }
142196
143197
144198 func checkNFTInfo (assetId) = {
145- let nftData = split(getEventStrByK(keyNFTData(assetId)), "_")
146- if (if (!(checkEventStatus(nftData[6], nftData[5])))
147- then !(checkOrganizerStatus(nftData[6]))
199+ let nftData = split(getArtStrByK(keyNFTData(assetId)), "_")
200+ let artSignID = getArtStrByK(keySignID(nftData[6], nftData[5]))
201+ if (if (!(checkArtStatus(nftData[6], nftData[5])))
202+ then !(checkArtistStatus(nftData[6]))
148203 else false)
149- then $Tuple4(false, nftData[6], nftData[7], nftData[5])
150- else $Tuple4(true, nftData[6], nftData[7], nftData[5])
204+ then $Tuple4(false, nftData[5], nftData[6], artSignID)
205+ else $Tuple4(true, nftData[5], nftData[6], artSignID)
151206 }
152207
153208
154-func checkEVENTExist (eventId,organizerAddr) = if (if (!(checkEventStatus(organizerAddr, eventId)))
155- then !(checkOrganizerStatus(organizerAddr))
156- else false)
157- then false
158- else true
209+func checkARTExist (artId,creatorAddr) = {
210+ let artSignID = getArtStrByK(keySignID(creatorAddr, artId))
211+ if ((size(artSignID) == 0))
212+ then throw("Artwork not found on SIGN Art")
213+ else if (if (!(checkArtStatus(creatorAddr, artId)))
214+ then !(checkArtistStatus(creatorAddr))
215+ else false)
216+ then false
217+ else true
218+ }
159219
160220
161-func setTransfers (amount,assetId,nftId,organizerAddr,saleOwner,caller,eventId,ticketId) = {
162- let organizerCut = getIntByK(((((("ticket_royalties_" + eventId) + "_") + organizerAddr) + "_") + ticketId))
221+func setTransfers (amount,assetId,nftid,creatorAddr,saleOwner,caller,artId) = {
222+ let creatorCut = getArtworkRoyalties(keyArtworkRoyalties(creatorAddr, artId))
223+ let agent = valueOrElse(getString(userDapp, keyArtistAgentAddr(creatorAddr)), feeReceiver)
224+ let agentShare = valueOrElse(getInteger(userDapp, keySecondaryShareAgent(creatorAddr)), 0)
225+ let publicAgent = valueOrElse(getString(userDapp, keyArtistPublicAgentAddr(creatorAddr)), feeReceiver)
226+ let publicAgentShare = valueOrElse(getInteger(userDapp, keySecondarySharePublicAgent(creatorAddr)), 0)
163227 let amountForSign = fraction(amount, signCut, 100)
164- let amountForOrganizer = fraction(amount, organizerCut, 100)
165- let amountForOwner = (amount - (amountForSign + amountForOrganizer))
166- let commissions = [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)]
167- let organizerFee = ScriptTransfer(Address(fromBase58String(organizerAddr)), amountForOrganizer, assetId)
228+ let amountForCreator = fraction(amount, creatorCut, 10000)
229+ let amountForOwner = (amount - (amountForSign + amountForCreator))
230+ let amountForAgent = if (if ((agent != feeReceiver))
231+ then (agentShare > 0)
232+ else false)
233+ then fraction(amount, agentShare, 100)
234+ else 0
235+ let amountForPublicAgent = if (if ((publicAgent != feeReceiver))
236+ then (publicAgentShare > 0)
237+ else false)
238+ then fraction(amount, publicAgentShare, 100)
239+ else 0
240+ let commissions = if ((amountForAgent != 0))
241+ then [ScriptTransfer(Address(fromBase58String(feeReceiver)), (amountForSign - amountForAgent), assetId), ScriptTransfer(Address(fromBase58String(agent)), amountForAgent, assetId)]
242+ else [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)]
243+ let creatorFee = if ((amountForPublicAgent != 0))
244+ then [ScriptTransfer(Address(fromBase58String(publicAgent)), amountForPublicAgent, assetId), ScriptTransfer(Address(fromBase58String(creatorAddr)), (amountForCreator - amountForPublicAgent), assetId)]
245+ else [ScriptTransfer(Address(fromBase58String(creatorAddr)), amountForCreator, assetId)]
168246 let ownerFee = ScriptTransfer(Address(fromBase58String(saleOwner)), amountForOwner, assetId)
169- let collectorNFT = ScriptTransfer(Address(fromBase58String(caller)), 1, fromBase58String(nftId))
170- $Tuple4(commissions, organizerFee, ownerFee, collectorNFT)
247+ let collectorNFT = ScriptTransfer(Address(fromBase58String(caller)), 1, fromBase58String(nftid))
248+ $Tuple4(commissions, creatorFee, ownerFee, collectorNFT)
249+ }
250+
251+
252+func validateMinSell (assetId,price) = {
253+ let minSellWaves = if (unitTest)
254+ then 10
255+ else getIntByKFromOracle("waves_min_sell")
256+ let minSellUsdn = 1000000
257+ let minSellSign = if (unitTest)
258+ then 1
259+ else (currentCertificationPrice * 2)
260+ if (if (if (if (if (if ((assetId == toBase58String(usdnAssetId)))
261+ then (minSellUsdn > price)
262+ else false)
263+ then (price != 0)
264+ else false)
265+ then true
266+ else if (if ((assetId == toBase58String(usdtAssetId)))
267+ then (minSellUsdn > price)
268+ else false)
269+ then (price != 0)
270+ else false)
271+ then true
272+ else if (if ((assetId == toBase58String(signAssetId)))
273+ then (minSellSign > price)
274+ else false)
275+ then (price != 0)
276+ else false)
277+ then true
278+ else if (if (if ((assetId == toBase58String(wavesAssetId)))
279+ then true
280+ else (assetId == "WAVES"))
281+ then (minSellWaves > price)
282+ else false)
283+ then (price != 0)
284+ else false)
285+ then false
286+ else true
171287 }
172288
173289
174290 func provideBaseData (i,nftId) = {
175- let $t059405979 = idCallerDate(i)
176- let id = $t059405979._1
177- let caller = $t059405979._2
178- let date = $t059405979._3
179- let $t059826054 = checkNFTInfo(nftId)
180- let isValidNFT = $t059826054._1
181- let eventId = $t059826054._2
182- let organizerAddr = $t059826054._3
183- let ticketId = $t059826054._4
184- $Tuple7(id, caller, date, isValidNFT, eventId, organizerAddr, ticketId)
291+ let $t01063110671 = idCallerDate(i)
292+ let id = $t01063110671._1
293+ let caller = $t01063110671._2
294+ let date = $t01063110671._3
295+ let $t01067410743 = checkNFTInfo(nftId)
296+ let isValidNFT = $t01067410743._1
297+ let artId = $t01067410743._2
298+ let creatorAddr = $t01067410743._3
299+ let artSignID = $t01067410743._4
300+ $Tuple7(id, caller, date, isValidNFT, artId, creatorAddr, artSignID)
185301 }
186302
187303
188304 func updateNumSales () = {
189305 let numSales = getIntByK(numSalesK)
190306 IntegerEntry(numSalesK, (numSales + 1))
191307 }
192308
193309
194310 @Callable(invoke)
195311 func setConf (key,val) = {
196312 let caller = toString(invoke.caller)
197313 if (containsElement([chris, toString(this)], caller))
198314 then if (contains(key, "conf_"))
199315 then [StringEntry(key, val)]
200316 else throw("Entries starting with conf_ only")
201317 else throw("You are not allowed to change this")
202318 }
203319
204320
205321
206322 @Callable(invoke)
207323 func appRunning (isLive,message) = {
208324 let caller = toString(invoke.caller)
209325 let id = toBase58String(invoke.transactionId)
210326 if (containsElement([chris, toString(this)], caller))
211327 then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)]
212328 else throw("You are not allowed to change this")
213329 }
214330
215331
216332
217333 @Callable(i)
218-func sellNFT (price) = {
219- let $t071077143 = isPayment(i)
220- let payment = $t071077143._1
221- let amount = $t071077143._2
334+func sellNFT (price,asset) = {
335+ let $t01180811844 = isPayment(i)
336+ let payment = $t01180811844._1
337+ let amount = $t01180811844._2
222338 if ((amount != 1))
223- then throw("No Ticket attached")
339+ then throw("No NFT attached")
224340 else {
225341 let nftId = if (if (isDefined(payment.assetId))
226- then isSignEventNFT(value(payment.assetId))
342+ then isSignArtNFT(value(payment.assetId))
227343 else false)
228344 then toBase58String(value(payment.assetId))
229- else throw("Only SIGN Event NFT accepted.")
230- let $t073847479 = provideBaseData(i, nftId)
231- let id = $t073847479._1
232- let caller = $t073847479._2
233- let date = $t073847479._3
234- let isValidNFT = $t073847479._4
235- let eventId = $t073847479._5
236- let organizerAddr = $t073847479._6
237- let ticketId = $t073847479._7
238- if (!(isValidNFT))
239- then throw("Not a valid ticket")
240- else [StringEntry((getSaleKey(caller, ticketId, eventId, organizerAddr, nftId) + "_OPEN"), ((((((((((((((toString(date) + "_") + toString(price)) + "_") + toBase58String(signAssetId)) + "_") + nftId) + "_") + ticketId) + "_") + eventId) + "_") + organizerAddr) + "_") + id)), StringEntry(((("sale2nd_status_" + caller) + "_") + nftId), "OPEN"), StringEntry(("current_owner_on_dapp_" + nftId), caller)]
345+ else throw("Only SIGN Art NFT accepted.")
346+ let $t01207812171 = provideBaseData(i, nftId)
347+ let id = $t01207812171._1
348+ let caller = $t01207812171._2
349+ let date = $t01207812171._3
350+ let isValidNFT = $t01207812171._4
351+ let artId = $t01207812171._5
352+ let creatorAddr = $t01207812171._6
353+ let artSignID = $t01207812171._7
354+ if ((size(artSignID) == 0))
355+ then throw("Artwork not found on SIGN Art")
356+ else if (!(isValidNFT))
357+ then throw("Not a valid nft")
358+ else if (!(acceptedAssetIds(asset)))
359+ then throw("Only SIGN, USDN, USDT or WAVES accepted")
360+ else if (!(validateMinSell(asset, price)))
361+ then throw("Wrong minimum sell price")
362+ else [StringEntry((getSaleKey(caller, nftId, artId, creatorAddr) + "_OPEN"), ((((((((((((toString(date) + "_") + toString(price)) + "_") + asset) + "_") + nftId) + "_") + artId) + "_") + creatorAddr) + "_") + id)), StringEntry(((("sale2nd_status_" + caller) + "_") + nftId), "OPEN"), StringEntry(("current_owner_on_dapp_" + nftId), caller)]
241363 }
242364 }
243365
244366
245367
246368 @Callable(i)
247-func updateSalePrice (nftId,price) = {
248- let $t080178112 = provideBaseData(i, nftId)
249- let id = $t080178112._1
250- let caller = $t080178112._2
251- let date = $t080178112._3
252- let isValidNFT = $t080178112._4
253- let eventId = $t080178112._5
254- let organizerAddr = $t080178112._6
255- let ticketId = $t080178112._7
256- if (!(isValidNFT))
257- then throw("Not a valid ticket")
258- else {
259- let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId))
260- if ((saleOwner != caller))
261- then throw("You don't own this ticket")
262- else {
263- let saleStatus = getStrByK(((("sale2nd_status_" + caller) + "_") + nftId))
264- if ((saleStatus != "OPEN"))
265- then throw("Sale not active")
266- else {
267- let saleKey = getSaleKey(caller, ticketId, eventId, organizerAddr, nftId)
268- let saleInfo = split(getStrByK((saleKey + "_OPEN")), "_")
269-[StringEntry((saleKey + "_OPEN"), ((((((((((((((saleInfo[0] + "_") + toString(price)) + "_") + toBase58String(signAssetId)) + "_") + saleInfo[3]) + "_") + saleInfo[4]) + "_") + saleInfo[5]) + "_") + saleInfo[6]) + "_") + saleInfo[7]))]
270- }
271- }
272- }
369+func updateSalePrice (nftId,price,asset) = {
370+ let $t01305113144 = provideBaseData(i, nftId)
371+ let id = $t01305113144._1
372+ let caller = $t01305113144._2
373+ let date = $t01305113144._3
374+ let isValidNFT = $t01305113144._4
375+ let artId = $t01305113144._5
376+ let creatorAddr = $t01305113144._6
377+ let artSignID = $t01305113144._7
378+ if ((size(artSignID) == 0))
379+ then throw("Artwork not found on SIGN Art, cancel your sale.")
380+ else if (!(isValidNFT))
381+ then throw("Not a valid nft")
382+ else {
383+ let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId))
384+ if ((saleOwner != caller))
385+ then throw("You don't own this NFT")
386+ else {
387+ let saleStatus = getStrByK(((("sale2nd_status_" + caller) + "_") + nftId))
388+ if ((saleStatus != "OPEN"))
389+ then throw("Sale not active")
390+ else if (!(acceptedAssetIds(asset)))
391+ then throw("Only SIGN, USDN, USDT or WAVES accepted")
392+ else if (!(validateMinSell(asset, price)))
393+ then throw("Wrong minimum sell price")
394+ else {
395+ let saleKey = getSaleKey(caller, nftId, artId, creatorAddr)
396+ let saleInfo = split(getStrByK((saleKey + "_OPEN")), "_")
397+[StringEntry((saleKey + "_OPEN"), ((((((((((((saleInfo[0] + "_") + toString(price)) + "_") + asset) + "_") + saleInfo[3]) + "_") + saleInfo[4]) + "_") + saleInfo[5]) + "_") + saleInfo[6]))]
398+ }
399+ }
400+ }
273401 }
274402
275403
276404
277405 @Callable(i)
278406 func cancelSale (nftId) = {
279- let $t090459288 = provideBaseData(i, nftId)
280- let id = $t090459288._1
281- let caller = $t090459288._2
282- let date = $t090459288._3
283- let isValidNFT = $t090459288._4
284- let eventId = $t090459288._5
285- let organizerAddr = $t090459288._6
286- let ticketId = $t090459288._7
407+ let $t01429214533 = provideBaseData(i, nftId)
408+ let id = $t01429214533._1
409+ let caller = $t01429214533._2
410+ let date = $t01429214533._3
411+ let isValidNFT = $t01429214533._4
412+ let artId = $t01429214533._5
413+ let creatorAddr = $t01429214533._6
414+ let artSignID = $t01429214533._7
287415 let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId))
288416 if ((saleOwner != caller))
289- then throw("You don't own this ticket")
417+ then throw("You don't own this NFT")
290418 else {
291419 let saleStatus = getStrByK(((("sale2nd_status_" + caller) + "_") + nftId))
292420 if ((saleStatus != "OPEN"))
293421 then throw("Sale not active")
294422 else {
295- let saleKey = getSaleKey(caller, ticketId, eventId, organizerAddr, nftId)
423+ let saleKey = getSaleKey(caller, nftId, artId, creatorAddr)
296424 let saleInfo = getStrByK((saleKey + "_OPEN"))
297425 [DeleteEntry((saleKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + caller) + "_") + nftId)), DeleteEntry(("current_owner_on_dapp_" + nftId)), StringEntry((((saleKey + "_") + id) + "_CANCELLED"), ((((saleInfo + "_CANCELLED_") + toString(date)) + "_") + id)), ScriptTransfer(Address(fromBase58String(caller)), 1, fromBase58String(nftId))]
298426 }
299427 }
300428 }
301429
302430
303431
304432 @Callable(i)
305433 func buyNFT (nftId) = {
306- let $t01013510259 = provideBaseData(i, nftId)
307- let id = $t01013510259._1
308- let caller = $t01013510259._2
309- let date = $t01013510259._3
310- let isValidNFT = $t01013510259._4
311- let eventId = $t01013510259._5
312- let organizerAddr = $t01013510259._6
313- let ticketId = $t01013510259._7
434+ let $t01536415457 = provideBaseData(i, nftId)
435+ let id = $t01536415457._1
436+ let caller = $t01536415457._2
437+ let date = $t01536415457._3
438+ let isValidNFT = $t01536415457._4
439+ let artId = $t01536415457._5
440+ let creatorAddr = $t01536415457._6
441+ let artSignID = $t01536415457._7
442+ if ((size(artSignID) == 0))
443+ then throw("Artwork not found on SIGN Art, cancel your sale.")
444+ else if (!(isValidNFT))
445+ then throw("Not a valid nft")
446+ else {
447+ let saleOwner = getSaleOwnerAndStatus(nftId)
448+ let saleKey = getSaleKey(saleOwner, nftId, artId, creatorAddr)
449+ let saleInfo = getStrByK((saleKey + "_OPEN"))
450+ if ((size(saleInfo) == 0))
451+ then throw("Sale Not found!")
452+ else {
453+ let saleInfoArray = split(saleInfo, "_")
454+ if ((parseInt(saleInfoArray[1]) == 0))
455+ then throw("Offer only")
456+ else {
457+ let $t01595415990 = isPayment(i)
458+ let payment = $t01595415990._1
459+ let amount = $t01595415990._2
460+ let paymentAssetStr = if (isDefined(payment.assetId))
461+ then toBase58String(value(payment.assetId))
462+ else ""
463+ if (if ((saleInfoArray[1] != toString(amount)))
464+ then true
465+ else (saleInfoArray[2] != paymentAssetStr))
466+ then throw("Payment infos don't match.")
467+ else {
468+ let $t01649616635 = setTransfers(amount, payment.assetId, nftId, creatorAddr, saleOwner, caller, artId)
469+ let commissions = $t01649616635._1
470+ let creatorFee = $t01649616635._2
471+ let ownerFee = $t01649616635._3
472+ let collectorNFT = $t01649616635._4
473+ (([DeleteEntry((saleKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + saleOwner) + "_") + nftId)), DeleteEntry(("current_owner_on_dapp_" + nftId)), StringEntry((((saleKey + "_") + id) + "_CLOSED"), ((((((saleInfo + "_CLOSED_") + toString(date)) + "_") + id) + "_") + caller)), updateNumSales(), ownerFee, collectorNFT] ++ creatorFee) ++ commissions)
474+ }
475+ }
476+ }
477+ }
478+ }
479+
480+
481+
482+@Callable(i)
483+func setOffer (nftId) = {
484+ let $t01704617143 = provideBaseData(i, nftId)
485+ let id = $t01704617143._1
486+ let offerOwner = $t01704617143._2
487+ let date = $t01704617143._3
488+ let isValidNFT = $t01704617143._4
489+ let artId = $t01704617143._5
490+ let creatorAddr = $t01704617143._6
491+ let artSignID = $t01704617143._7
314492 if (!(isValidNFT))
315- then throw("Not a valid ticket")
493+ then throw("Not a valid nft")
494+ else {
495+ let $t01720417240 = isPayment(i)
496+ let payment = $t01720417240._1
497+ let amount = $t01720417240._2
498+ let assetId = if (!(isDefined(payment.assetId)))
499+ then "WAVES"
500+ else toBase58String(value(payment.assetId))
501+ if (!(acceptedAssetIds(assetId)))
502+ then throw("asset not accepted")
503+ else if ((amount == 0))
504+ then throw("Offer of 0 not allowed")
505+ else if (!(validateMinSell(assetId, amount)))
506+ then throw("Wrong minimum sell price")
507+ else {
508+ let saleOwner = getSaleOwnerAndStatus(nftId)
509+[StringEntry((getBidKey(offerOwner, nftId, saleOwner, id) + "_OPEN"), ((((((((((((((toString(date) + "_") + toString(amount)) + "_") + assetId) + "_") + nftId) + "_") + artId) + "_") + creatorAddr) + "_") + offerOwner) + "_") + id))]
510+ }
511+ }
512+ }
513+
514+
515+
516+@Callable(i)
517+func acceptOffer (nftId,offerId,offerOwner) = {
518+ let $t01804218135 = provideBaseData(i, nftId)
519+ let id = $t01804218135._1
520+ let caller = $t01804218135._2
521+ let date = $t01804218135._3
522+ let isValidNFT = $t01804218135._4
523+ let artId = $t01804218135._5
524+ let creatorAddr = $t01804218135._6
525+ let artSignID = $t01804218135._7
526+ if (!(isValidNFT))
527+ then throw("Not a valid nft")
316528 else {
317529 let saleOwner = getSaleOwnerAndStatus(nftId)
318- let saleKey = getSaleKey(saleOwner, ticketId, eventId, organizerAddr, nftId)
319- let saleInfo = getStrByK((saleKey + "_OPEN"))
320- if ((size(saleInfo) == 0))
321- then throw("Sale Not found!")
530+ if ((caller != saleOwner))
531+ then throw("Only sale owner can accept offer")
322532 else {
323- let saleInfoArray = split(saleInfo, "_")
324- if ((parseInt(saleInfoArray[1]) == 0))
325- then throw("Offer only")
533+ let bidKey = getBidKey(offerOwner, nftId, saleOwner, offerId)
534+ let $t01838918444 = getBidData(bidKey)
535+ let bidDataArr = $t01838918444._1
536+ let assetId = $t01838918444._2
537+ let bidData = $t01838918444._3
538+ let saleKey = getSaleKey(saleOwner, nftId, artId, creatorAddr)
539+ let saleInfo = getStrByK((saleKey + "_OPEN"))
540+ if ((size(saleInfo) == 0))
541+ then throw("Sale Not found!")
326542 else {
327- let $t01067410710 = isPayment(i)
328- let payment = $t01067410710._1
329- let amount = $t01067410710._2
330- let paymentAssetStr = toBase58String(value(payment.assetId))
331- if (if ((saleInfoArray[1] != toString(amount)))
332- then true
333- else (saleInfoArray[2] != paymentAssetStr))
334- then throw("Payment infos don't match.")
335- else {
336- let $t01091111064 = setTransfers(amount, payment.assetId, nftId, organizerAddr, saleOwner, caller, eventId, ticketId)
337- let commissions = $t01091111064._1
338- let creatorFee = $t01091111064._2
339- let ownerFee = $t01091111064._3
340- let collectorNFT = $t01091111064._4
341- ([DeleteEntry((saleKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + saleOwner) + "_") + nftId)), DeleteEntry(("current_owner_on_dapp_" + nftId)), StringEntry((((saleKey + "_") + id) + "_CLOSED"), ((((((saleInfo + "_CLOSED_") + toString(date)) + "_") + id) + "_") + caller)), updateNumSales(), creatorFee, ownerFee, collectorNFT] ++ commissions)
342- }
543+ let amount = value(parseInt(bidDataArr[1]))
544+ let $t01868018818 = setTransfers(amount, assetId, nftId, creatorAddr, saleOwner, bidDataArr[6], artId)
545+ let commissions = $t01868018818._1
546+ let creatorFee = $t01868018818._2
547+ let ownerFee = $t01868018818._3
548+ let collectorNFT = $t01868018818._4
549+ let assetIdStr = if (isDefined(assetId))
550+ then toBase58String(value(assetId))
551+ else "WAVES"
552+ (([DeleteEntry((saleKey + "_OPEN")), DeleteEntry((bidKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + saleOwner) + "_") + nftId)), DeleteEntry(("current_owner_on_dapp_" + nftId)), StringEntry((bidKey + "_CLOSED"), ((((bidData + "_CLOSED_") + toString(date)) + "_") + id)), StringEntry((((saleKey + "_") + id) + "_CLOSED"), ((((((((((saleInfo + "_CLOSED-OFFER_") + toString(date)) + "_") + id) + "_") + offerOwner) + "_") + toString(amount)) + "_") + assetIdStr)), updateNumSales(), ownerFee, collectorNFT] ++ creatorFee) ++ commissions)
343553 }
344554 }
345555 }
346556 }
347557
348558
349559
350560 @Callable(i)
351-func setOffer (nftId) = {
352- let $t01147511574 = provideBaseData(i, nftId)
353- let id = $t01147511574._1
354- let offerOwner = $t01147511574._2
355- let date = $t01147511574._3
356- let isValidNFT = $t01147511574._4
357- let eventId = $t01147511574._5
358- let organizerAddr = $t01147511574._6
359- let ticketId = $t01147511574._7
360- if (!(isValidNFT))
361- then throw("Not a valid ticket")
362- else {
363- let $t01163811674 = isPayment(i)
364- let payment = $t01163811674._1
365- let amount = $t01163811674._2
366- let assetId = toBase58String(value(payment.assetId))
367- if (!(acceptedAssetIds(assetId)))
368- then throw("asset not accepted")
369- else if ((amount == 0))
370- then throw("Offer of 0 not allowed")
371- else {
372- let saleOwner = getSaleOwnerAndStatus(nftId)
373-[StringEntry((getBidKey(offerOwner, ticketId, saleOwner, id, nftId) + "_OPEN"), ((((((((((((((toString(date) + "_") + toString(amount)) + "_") + assetId) + "_") + nftId) + "_") + eventId) + "_") + organizerAddr) + "_") + offerOwner) + "_") + id))]
374- }
375- }
376- }
377-
378-
379-
380-@Callable(i)
381-func acceptOffer (nftId,offerId,offerOwner) = {
382- let $t01235312448 = provideBaseData(i, nftId)
383- let id = $t01235312448._1
384- let caller = $t01235312448._2
385- let date = $t01235312448._3
386- let isValidNFT = $t01235312448._4
387- let eventId = $t01235312448._5
388- let organizerAddr = $t01235312448._6
389- let ticketId = $t01235312448._7
390- if (!(isValidNFT))
391- then throw("Not a valid ticket")
392- else {
393- let saleOwner = getSaleOwnerAndStatus(nftId)
394- if ((caller != saleOwner))
395- then throw("Only sale owner can accept offer")
396- else {
397- let bidKey = getBidKey(offerOwner, ticketId, saleOwner, offerId, nftId)
398- let $t01271412769 = getBidData(bidKey)
399- let bidDataArr = $t01271412769._1
400- let assetId = $t01271412769._2
401- let bidData = $t01271412769._3
402- let saleKey = getSaleKey(saleOwner, ticketId, eventId, organizerAddr, nftId)
403- let saleInfo = getStrByK((saleKey + "_OPEN"))
404- if ((size(saleInfo) == 0))
405- then throw("Sale Not found!")
406- else {
407- let amount = value(parseInt(bidDataArr[1]))
408- let $t01301813170 = setTransfers(amount, assetId, nftId, organizerAddr, saleOwner, bidDataArr[6], eventId, ticketId)
409- let commissions = $t01301813170._1
410- let creatorFee = $t01301813170._2
411- let ownerFee = $t01301813170._3
412- let collectorNFT = $t01301813170._4
413- let assetIdStr = toBase58String(value(assetId))
414- ([DeleteEntry((saleKey + "_OPEN")), DeleteEntry((bidKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + saleOwner) + "_") + nftId)), DeleteEntry(("current_owner_on_dapp_" + nftId)), StringEntry((bidKey + "_CLOSED"), ((((bidData + "_CLOSED_") + toString(date)) + "_") + id)), StringEntry((((saleKey + "_") + id) + "_CLOSED"), ((((((((((saleInfo + "_CLOSED-OFFER_") + toString(date)) + "_") + id) + "_") + offerOwner) + "_") + toString(amount)) + "_") + assetIdStr)), updateNumSales(), creatorFee, ownerFee, collectorNFT] ++ commissions)
415- }
416- }
417- }
418- }
419-
420-
421-
422-@Callable(i)
423-func cancelOffer (nftId,offerId,offerOwner,saleOwner,ticketId) = {
424- let $t01394614018 = idCallerDate(i)
425- let id = $t01394614018._1
426- let caller = $t01394614018._2
427- let date = $t01394614018._3
561+func cancelOffer (nftId,offerId,offerOwner,saleOwner) = {
562+ let $t01961819692 = idCallerDate(i)
563+ let id = $t01961819692._1
564+ let caller = $t01961819692._2
565+ let date = $t01961819692._3
428566 if (if ((caller != offerOwner))
429567 then (caller != saleOwner)
430568 else false)
431569 then throw("You cannot cancel this offer.")
432570 else {
433- let bidKey = getBidKey(offerOwner, ticketId, saleOwner, offerId, nftId)
434- let $t01419914254 = getBidData(bidKey)
435- let bidDataArr = $t01419914254._1
436- let assetId = $t01419914254._2
437- let bidData = $t01419914254._3
571+ let bidKey = getBidKey(offerOwner, nftId, saleOwner, offerId)
572+ let $t01986419919 = getBidData(bidKey)
573+ let bidDataArr = $t01986419919._1
574+ let assetId = $t01986419919._2
575+ let bidData = $t01986419919._3
438576 [DeleteEntry((bidKey + "_OPEN")), StringEntry((bidKey + "_CANCELLED"), ((((bidData + "_CANCELLED_") + toString(date)) + "_") + id)), ScriptTransfer(Address(fromBase58String(caller)), parseIntValue(bidDataArr[1]), assetId)]
439577 }
440578 }
441579
442580

github/deemru/w8io/169f3d6 
101.27 ms