tx · HuArHuEcWy6Mim6Jn1QLWNPEr6HFVyWQHNsqookFduKX

3NBquYd5fTq8HRDkagrtNLQ3HmWd7wcZoeL:  -0.01400000 Waves

2021.01.27 13:24 [1371790] smart account 3NBquYd5fTq8HRDkagrtNLQ3HmWd7wcZoeL > SELF 0.00000000 Waves

{ "type": 13, "id": "HuArHuEcWy6Mim6Jn1QLWNPEr6HFVyWQHNsqookFduKX", "fee": 1400000, "feeAssetId": null, "timestamp": 1611743068815, "version": 2, "chainId": 84, "sender": "3NBquYd5fTq8HRDkagrtNLQ3HmWd7wcZoeL", "senderPublicKey": "7irc2VpK5czoyVdwrCuQqr2JU9ZaZnEZn8RPChnfi3yL", "proofs": [ "2dAAcbMGC33An9Eben9DRnTLwMSgE86Gav3SsasdaP1mopzL3zt54NgDVSKYqoHc4b22hFAgw2jjri4RMfmpu6pQ" ], "script": "base64:AAIEAAAAAAAAAEEIAhIOCgwICAgICAgBCAgICAgSDQoLCAgICAgBCAgICAgSBQoDCAgIEgQKAggIEgYKBAgBAQgSBAoCCAgSAwoBCAAAAD8AAAAACHVuaXRUZXN0BwAAAAAJb3JhY2xlRmVlCQEAAAAFdmFsdWUAAAABCQAEJgAAAAECAAAAIzNOMnM1UnRhSFBCZW5Dc3gyRUNjb0ZSYllIeDNub1poWFcxAAAAAAhzaWduRGFwcAkBAAAABXZhbHVlAAAAAQkABCYAAAABAgAAACMzTkMyOGhTaXZybXNUVVhhWUQxeDZMMzYySjRacFVub1RkQgAAAAALZmVlUmVjZWl2ZXICAAAAIzNOMUU2dFhkZFJvVmFSZlE5ZFEzdmc1TGFXMmZzZDhIS3ViAAAAAAh1c2VyRGFwcAMFAAAACHVuaXRUZXN0CQEAAAAFdmFsdWUAAAABCQAEJgAAAAECAAAAIzNNdDRSR01FeWpTV1lBb2NUUHFkNTV3ZEhRUUIzUFUyVUNtCQEAAAAFdmFsdWUAAAABCQAEJgAAAAECAAAAIzNNd0RaYWdvWUVpTmZRTGMzMWNHcFlvYUU1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AAAVhcnRJZAUAAAAKc2VsbFN0YXR1cwkABEwAAAACBQAAAAhpc3N1ZU5GVAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAAHQWRkcmVzcwAAAAEJAAJZAAAAAQUAAAAGaXNzdWVyBQAAABBhbW91bnRGb3JDcmVhdG9yBQAAAAdhc3NldElkCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAAAdBZGRyZXNzAAAAAQkAAlkAAAABBQAAAAtmZWVSZWNlaXZlcgUAAAANYW1vdW50Rm9yU2lnbgUAAAAHYXNzZXRJZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAAGaW52b2tlAAAABmNhbGxlcgAAAAAAAAAAAQUAAAAFaWRORlQFAAAAA25pbAAAAAFpAQAAAAtkZWxldGVFbnRyeQAAAAEAAAAFZW50cnkEAAAABmNhbGxlcgkABCUAAAABCQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABCAUAAAABaQAAAA9jYWxsZXJQdWJsaWNLZXkDCQAAAAAAAAIFAAAABmNhbGxlcgUAAAAFY2hyaXMJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQUAAAAFZW50cnkFAAAAA25pbAkAAAIAAAABAgAAAAJubwAAAAANor4O", "height": 1371790, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2tuuSoS9eFHCMqh9zhj9k9YpcLknNx7FcWHLSPQSAWfk Next: 7fKG7vgPsYDfKNmWV8BVAzzrUFzJXvZUif2G6jT5JFZY Diff:
OldNewDifferences
8888 func keyUserStatus (caller) = ("user_status_" + caller)
8989
9090
91-func keyDate (caller,artId) = ((("art_date_" + artId) + "_") + caller)
91+func keyArtDate (caller,artId) = ((("art_date_" + artId) + "_") + caller)
9292
9393
94-func keyName (caller,artId) = ((("art_name_" + artId) + "_") + caller)
94+func keyArtName (caller,artId) = ((("art_name_" + artId) + "_") + caller)
9595
9696
97-func keyDesc (caller,artId) = ((("art_desc_" + artId) + "_") + caller)
97+func keyArtDesc (caller,artId) = ((("art_desc_" + artId) + "_") + caller)
9898
9999
100-func keyDisplayCid (caller,artId) = ((("art_display_cid_" + artId) + "_") + caller)
100+func keyArtDisplayCid (caller,artId) = ((("art_display_cid_" + artId) + "_") + caller)
101101
102102
103-func keyExportHash (caller,artId) = ((("art_export_hash_" + artId) + "_") + caller)
103+func keyArtExportHash (caller,artId) = ((("art_export_hash_" + artId) + "_") + caller)
104104
105105
106-func keyExportCid (caller,artId) = ((("art_export_cid_" + artId) + "_") + caller)
106+func keyArtExportCid (caller,artId) = ((("art_export_cid_" + artId) + "_") + caller)
107107
108108
109-func keyMaxMint (caller,artId) = ((("art_maxmint_" + artId) + "_") + caller)
109+func keyArtMaxMint (caller,artId) = ((("art_maxmint_" + artId) + "_") + caller)
110110
111111
112-func keySignID (caller,artId) = ((("art_signid_" + artId) + "_") + caller)
112+func keyArtSignID (caller,artId) = ((("art_signid_" + artId) + "_") + caller)
113113
114114
115-func keyIssued (caller,artId) = ((("art_issued_" + artId) + "_") + caller)
115+func keyArtIssued (caller,artId) = ((("art_issued_" + artId) + "_") + caller)
116116
117117
118-func keyOnSale (caller,artId) = ((("art_onsale_" + artId) + "_") + caller)
118+func keyArtOnSale (caller,artId) = ((("art_onsale_" + artId) + "_") + caller)
119119
120120
121-func keyLicenceHash (caller,artId) = ((("art_licence_hash_" + artId) + "_") + caller)
121+func keyArtLicenceHash (caller,artId) = ((("art_licence_hash_" + artId) + "_") + caller)
122122
123123
124-func keyLicenceCid (caller,artId) = ((("art_licence_cid_" + artId) + "_") + caller)
124+func keyArtLicenceCid (caller,artId) = ((("art_licence_cid_" + artId) + "_") + caller)
125125
126126
127-func keyTags (caller,artId) = ((("art_tags_" + artId) + "_") + caller)
127+func keyArtTags (caller,artId) = ((("art_tags_" + artId) + "_") + caller)
128128
129129
130-func keyType (caller,artId) = ((("art_type_" + artId) + "_") + caller)
130+func keyArtType (caller,artId) = ((("art_type_" + artId) + "_") + caller)
131131
132132
133-func keyPrice (caller,artId) = ((("art_price_" + artId) + "_") + caller)
133+func keyArtPrice (caller,artId) = ((("art_price_" + artId) + "_") + caller)
134134
135135
136-func keyAssetIdAccepted (caller,artId) = ((("art_assetAccepted_" + artId) + "_") + caller)
136+func keyArtAssetIdAccepted (caller,artId) = ((("art_assetAccepted_" + artId) + "_") + caller)
137137
138138
139-func keyFlag (caller,artId) = ((("art_flag_" + artId) + "_") + caller)
139+func keyArtFlag (caller,artId) = ((("art_flag_" + artId) + "_") + caller)
140140
141141
142-func keyHashByTxidAddr (caller,txid) = ((("get_hashbytxidaddr_" + txid) + "_") + caller)
142+func keyArtHashByTxidAddr (caller,txid) = ((("get_hashbytxidaddr_" + txid) + "_") + caller)
143143
144144
145-func keyOwnerByHash (sha256Hash) = ("get_owner_by_hash_" + sha256Hash)
145+func keyArtOwnerByHash (sha256Hash) = ("get_owner_by_hash_" + sha256Hash)
146146
147147
148-func keyidBySignid (caller,signId) = ((("get_artidbysignid_" + signId) + "_") + caller)
148+func keyArtArtidBySignid (caller,signId) = ((("get_artidbysignid_" + signId) + "_") + caller)
149149
150150
151-func keyTxidByHashOwner (sha256Hash,caller) = ("get_txid_by_hash_owner_" + toBase58String(sha256_16Kb(toBytes((sha256Hash + caller)))))
151+func keyArtTxidByHashOwner (sha256Hash,caller) = ("get_txid_by_hash_owner_" + toBase58String(sha256_16Kb(toBytes((sha256Hash + caller)))))
152152
153153
154154 func validateAllCID (cidDisplay,cidExport,cidLicence) = if (!(validateCID(cidDisplay)))
223223 }
224224
225225
226-func isPayment (i) = if ((size(i.payments) == 0))
226+func validatePayment (invoke) = if ((size(invoke.payments) == 0))
227227 then throw("No payment attached")
228228 else {
229- let payment = value(i.payments[0])
229+ let payment = value(invoke.payments[0])
230230 let amount = value(payment.amount)
231- $Tuple2(payment, amount)
231+ let assetId = if (if (isDefined(payment.assetId))
232+ then (payment.assetId == signAssetId)
233+ else false)
234+ then payment.assetId
235+ else throw("Only SIGN token accepted as transaction fee")
236+ let currentCertificationPrice = getIntegerByKeyFromOracle(("certification_fee_" + toBase58String(signAssetId)))
237+ if ((amount != currentCertificationPrice))
238+ then throw(("Payment amount should be " + toString(currentCertificationPrice)))
239+ else $Tuple2(amount, assetId)
232240 }
233241
234242
235-func validatePayment (i) = {
236- let $t089038939 = isPayment(i)
237- let payment = $t089038939._1
238- let amount = $t089038939._2
239- let assetId = if (if (isDefined(payment.assetId))
240- then (payment.assetId == signAssetId)
241- else false)
242- then payment.assetId
243- else throw("Only SIGN token accepted as transaction fee")
244- let currentCertificationPrice = getIntegerByKeyFromOracle(("certification_fee_" + toBase58String(signAssetId)))
245- if ((amount != currentCertificationPrice))
246- then throw(("Payment amount should be " + toString(currentCertificationPrice)))
247- else $Tuple2(amount, assetId)
248- }
249-
250-
251-func isArtMinted (addrToUse,artId) = match getInteger(this, keyIssued(addrToUse, artId)) {
243+func isArtMinted (addressToUse,artId) = match getInteger(this, keyArtIssued(addressToUse, artId)) {
252244 case b: Int =>
253245 if ((b != 0))
254246 then true
258250 }
259251
260252
261-func validatePriceAssetId (i,priceAssetId,artworkPrice) = {
262- let $t096399675 = isPayment(i)
263- let payment = $t096399675._1
264- let amount = $t096399675._2
253+func validatePriceAssetId (invoke,priceAssetId,artworkPrice) = {
254+ let payment = value(invoke.payments[0])
255+ let amount = value(payment.amount)
265256 let assetId = if (!(isDefined(payment.assetId)))
266257 then unit
267258 else if (if ((size(priceAssetId) > 0))
279270 }
280271
281272
282-func acceptedAssetIds (assetId) = if (if (if (if ((assetId != toBase58String(signAssetId)))
273+func acceptedAssetIds (assetId) = if (if (if ((assetId != toBase58String(signAssetId)))
283274 then (assetId != toBase58String(wavesAssetId))
284- else false)
285- then (assetId != "WAVES")
286275 else false)
287276 then (assetId != toBase58String(usdnAssetId))
288277 else false)
320309 }
321310
322311
323-func getPriceAssetIdFromBid (bidDataKey) = {
324- let bidData = getStringByKey((bidDataKey + "_OPEN"))
325- if ((bidData == ""))
326- then throw("Bid not found")
327- else {
328- let bidDataArr = split(bidData, "_")
329- let bidAmount = parseIntValue(bidDataArr[1])
330- let bidAssetId = if ((bidDataArr[0] == "WAVES"))
331- then unit
332- else fromBase58String(bidDataArr[0])
333- if ((0 >= bidAmount))
334- then throw("Wrong amount")
335- else $Tuple2(bidAmount, bidAssetId)
336- }
337- }
338-
339-
340-func idCallerDate (i) = if (!(dappRunning))
312+@Callable(invoke)
313+func addArtwork (sha256Hash,signID,name,description,tags,type,maxmint,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence) = if (!(dappRunning))
341314 then throw(maintenanceMSG)
342- else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp)
343-
344-
345-func buyMint (i,artId,issuer,bidId,bidOwner) = {
346- let $t01177611814 = idCallerDate(i)
347- let id = $t01177611814._1
348- let caller = $t01177611814._2
349- let date = $t01177611814._3
350- let totalNFT = getIntegerByKey("total_nft_issued")
351- let signID = getStringByKey(keySignID(issuer, artId))
352- let artworkName = getStringByKey(keyName(issuer, artId))
353- if ((artworkName == ""))
354- then throw("Art doesn't exist")
355- else {
356- let isOnSale = getBooleanByKey(keyOnSale(issuer, artId))
357- let amountSold = getIntegerByKey(keyIssued(issuer, artId))
358- let artworkPrice = getIntegerByKey(keyPrice(issuer, artId))
359- let priceAssetId = getStringByKey(keyAssetIdAccepted(issuer, artId))
360- let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId))
361- let isBid = if (if (if ((caller == issuer))
362- then (bidOwner != "")
363- else false)
364- then (bidId != "")
365- else false)
366- then true
367- else false
368- let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId)
369- if (if (if ((0 >= artworkPrice))
370- then true
371- else !(isOnSale))
372- then true
373- else (0 >= maxCanSell))
374- then throw("Art not for sale")
375- else {
376- let $t01266112790 = if (isBid)
377- then getPriceAssetIdFromBid(bidDataKey)
378- else validatePriceAssetId(i, priceAssetId, artworkPrice)
379- let amount = $t01266112790._1
380- let assetId = $t01266112790._2
381- let isWhitelisted = checkWhitelist(issuer)
382- let cut = if ((isWhitelisted > height))
383- then 0
384- else if ((priceAssetId == toBase58String(signAssetId)))
385- then signCut
386- else usdnWaveCut
387- let amountForSign = fraction(amount, cut, 100)
388- let amountForCreator = (amount - amountForSign)
389- if ((amountSold == maxCanSell))
390- then throw("Art sold out")
391- else {
392- let newAmountSold = (amountSold + 1)
393- let issueMeta = ((((((((((("Creator: " + issuer) + ",
394- ArtID: ") + artId) + ",
395- SignID: ") + signID) + ",
396- Artwork name: ") + artworkName) + ",
397- Issue: ") + toString(newAmountSold)) + "/") + toString(maxCanSell))
398- let issueNFT = Issue(("SA_" + toString((totalNFT + 1))), issueMeta, 1, 0, false)
399- let idNFT = calculateAssetId(issueNFT)
400- let sellStatus = if ((newAmountSold == maxCanSell))
401- then false
402- else true
403- let receiveNFT = if (if (if ((caller == issuer))
404- then (bidOwner != "")
405- else false)
406- then (bidId != "")
407- else false)
408- then addressFromStringValue(bidOwner)
409- else i.caller
410- let buyRes = [IntegerEntry(keyIssued(issuer, artId), newAmountSold), StringEntry(("nft_" + toBase58String(idNFT)), ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer)), IntegerEntry("total_nft_issued", (totalNFT + 1)), BooleanEntry(keyOnSale(issuer, artId), sellStatus), issueNFT, ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId), ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId), ScriptTransfer(receiveNFT, 1, idNFT)]
411- let assetIdBid = if (!(isDefined(assetId)))
412- then "WAVES"
413- else toBase58String(value(assetId))
414- let getBidData = getStringByKey((bidDataKey + "_OPEN"))
415- let bidDelOld = DeleteEntry((bidDataKey + "_OPEN"))
416- let bidUpdate = StringEntry((bidDataKey + "_CLOSED"), ((getBidData + "_") + toString(date)))
417- let soldValue = if (!(isBid))
418- then ((((((((((caller + "_") + toString(date)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + toBase58String(idNFT))
419- else ((((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + assetIdBid) + "_") + toBase58String(idNFT))
420- let soldData = StringEntry(((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer), soldValue)
421- if (isBid)
422- then [soldData, bidUpdate, bidDelOld] :: buyRes
423- else soldData :: buyRes
424- }
425- }
426- }
427- }
428-
429-
430-@Callable(i)
431-func addArtwork (sha256Hash,signID,name,description,tags,type,maxmint,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence) = {
432- let $t01581615857 = idCallerDate(i)
433- let artId = $t01581615857._1
434- let caller = $t01581615857._2
435- let date = $t01581615857._3
436- if (!(validateHash(sha256Hash)))
437- then throw("Hash should be 64 characters maximum")
438- else {
439- let $t01595816027 = setLIcence(cidLicence, sha256Licence)
440- let licenceCID = $t01595816027._1
441- let licenceHash = $t01595816027._2
442- let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, maxmint)
443- if ((validateArtwork != ""))
444- then throw("Something went wrong!")
445- else {
446- let $t01625516297 = validatePayment(i)
447- let amount = $t01625516297._1
448- let assetId = $t01625516297._2
449- if (!(isDefined(amount)))
450- then throw("Something went wrong")
451- else {
452- let entryExist = getStringByKey(keyTxidByHashOwner(sha256Hash, caller))
453- if ((entryExist != ""))
454- then throw("You already added it")
455- else {
456- let hashExist = getStringByKey(keyOwnerByHash(sha256Hash))
457- if ((hashExist != ""))
458- then throw("Hash already registered")
459- else {
460- let isSignCertified = checkSignCertificate(signID, caller, sha256Hash)
461- if (!(isSignCertified))
462- then throw("Sign Certificate not found for this address.")
463- else [StringEntry(keyOwnerByHash(sha256Hash), caller), StringEntry(keyTxidByHashOwner(sha256Hash, caller), artId), IntegerEntry(keyDate(caller, artId), date), StringEntry(keyName(caller, artId), name), StringEntry(keyDesc(caller, artId), description), StringEntry(keyDisplayCid(caller, artId), cidDisplay), StringEntry(keyExportCid(caller, artId), cidExport), StringEntry(keyExportHash(caller, artId), sha256Export), StringEntry(keyLicenceHash(caller, artId), licenceHash), StringEntry(keyLicenceCid(caller, artId), licenceCID), StringEntry(keyType(caller, artId), type), StringEntry(keyTags(caller, artId), tags), IntegerEntry(keyMaxMint(caller, artId), maxmint), StringEntry(keySignID(caller, artId), signID), IntegerEntry(keyIssued(caller, artId), 0), BooleanEntry(keyOnSale(caller, artId), false), StringEntry(keyidBySignid(caller, signID), artId), StringEntry(keyHashByTxidAddr(caller, artId), sha256Hash), ScriptTransfer(Address(fromBase58String(feeReceiver)), amount, assetId)]
464- }
465- }
466- }
467- }
468- }
469- }
315+ else {
316+ let artId = toBase58String(invoke.transactionId)
317+ let timestamp = lastBlock.timestamp
318+ let caller = toBase58String(invoke.caller.bytes)
319+ if (!(validateHash(sha256Hash)))
320+ then throw("Hash should be 64 characters maximum")
321+ else {
322+ let $t01151411583 = setLIcence(cidLicence, sha256Licence)
323+ let licenceCID = $t01151411583._1
324+ let licenceHash = $t01151411583._2
325+ let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, maxmint)
326+ if ((validateArtwork != ""))
327+ then throw("Something went wrong!")
328+ else {
329+ let $t01181111858 = validatePayment(invoke)
330+ let amount = $t01181111858._1
331+ let assetId = $t01181111858._2
332+ if (!(isDefined(amount)))
333+ then throw("Something went wrong")
334+ else {
335+ let entryExist = getStringByKey(keyArtTxidByHashOwner(sha256Hash, caller))
336+ if ((entryExist != ""))
337+ then throw("You already added it")
338+ else {
339+ let hashExist = getStringByKey(keyArtOwnerByHash(sha256Hash))
340+ if ((hashExist != ""))
341+ then throw("Hash already registered")
342+ else {
343+ let isSignCertified = checkSignCertificate(signID, caller, sha256Hash)
344+ if (!(isSignCertified))
345+ then throw("Sign Certificate not found for this address.")
346+ else [StringEntry(keyArtOwnerByHash(sha256Hash), caller), StringEntry(keyArtTxidByHashOwner(sha256Hash, caller), artId), IntegerEntry(keyArtDate(caller, artId), timestamp), StringEntry(keyArtName(caller, artId), name), StringEntry(keyArtDesc(caller, artId), description), StringEntry(keyArtDisplayCid(caller, artId), cidDisplay), StringEntry(keyArtExportCid(caller, artId), cidExport), StringEntry(keyArtExportHash(caller, artId), sha256Export), StringEntry(keyArtLicenceHash(caller, artId), licenceHash), StringEntry(keyArtLicenceCid(caller, artId), licenceCID), StringEntry(keyArtType(caller, artId), type), StringEntry(keyArtTags(caller, artId), tags), IntegerEntry(keyArtMaxMint(caller, artId), maxmint), StringEntry(keyArtSignID(caller, artId), signID), IntegerEntry(keyArtIssued(caller, artId), 0), BooleanEntry(keyArtOnSale(caller, artId), false), StringEntry(keyArtArtidBySignid(caller, signID), artId), StringEntry(keyArtHashByTxidAddr(caller, artId), sha256Hash), ScriptTransfer(Address(fromBase58String(feeReceiver)), amount, assetId)]
347+ }
348+ }
349+ }
350+ }
351+ }
352+ }
470353
471354
472355
473-@Callable(i)
356+@Callable(invoke)
474357 func updateArtwork (txid,name,description,tags,type,maxmint,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence) = if (!(dappRunning))
475358 then throw(maintenanceMSG)
476359 else {
477- let caller = toBase58String(i.caller.bytes)
478- let $t01901819087 = setLIcence(cidLicence, sha256Licence)
479- let licenceCID = $t01901819087._1
480- let licenceHash = $t01901819087._2
360+ let updateId = toBase58String(invoke.transactionId)
361+ let caller = toBase58String(invoke.caller.bytes)
362+ let $t01471314782 = setLIcence(cidLicence, sha256Licence)
363+ let licenceCID = $t01471314782._1
364+ let licenceHash = $t01471314782._2
481365 let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, maxmint)
482366 if ((validateArtwork != ""))
483367 then throw("Something went wrong!")
484368 else {
485- let entryExist = getStringByKey(keyName(caller, txid))
369+ let entryExist = getStringByKey(keyArtName(caller, txid))
486370 if ((entryExist == ""))
487371 then throw("Entry not found")
488372 else {
489- let flag = getStringByKey(keyFlag(caller, txid))
373+ let flag = getStringByKey(keyArtFlag(caller, txid))
490374 if ((flag == "ILLEGAL"))
491375 then throw("Cannot update ILLEGAL artwork")
492376 else if (!(isArtMinted(caller, txid)))
493- then [StringEntry(keyName(caller, txid), name), StringEntry(keyDesc(caller, txid), description), StringEntry(keyDisplayCid(caller, txid), cidDisplay), StringEntry(keyExportCid(caller, txid), cidExport), StringEntry(keyExportHash(caller, txid), sha256Export), StringEntry(keyLicenceCid(caller, txid), licenceCID), StringEntry(keyLicenceHash(caller, txid), licenceHash), IntegerEntry(keyMaxMint(caller, txid), maxmint), StringEntry(keyTags(caller, txid), tags), StringEntry(keyType(caller, txid), type)]
377+ then [StringEntry(keyArtName(caller, txid), name), StringEntry(keyArtDesc(caller, txid), description), StringEntry(keyArtDisplayCid(caller, txid), cidDisplay), StringEntry(keyArtExportCid(caller, txid), cidExport), StringEntry(keyArtExportHash(caller, txid), sha256Export), StringEntry(keyArtLicenceCid(caller, txid), licenceCID), StringEntry(keyArtLicenceHash(caller, txid), licenceHash), IntegerEntry(keyArtMaxMint(caller, txid), maxmint), StringEntry(keyArtTags(caller, txid), tags), StringEntry(keyArtType(caller, txid), type)]
494378 else throw("Already minted")
495379 }
496380 }
498382
499383
500384
501-@Callable(i)
385+@Callable(invoke)
502386 func flagArtwork (artId,addr,flag) = {
503- let $t02056020593 = idCallerDate(i)
504- let id = $t02056020593._1
505- let caller = $t02056020593._2
387+ let caller = toString(addressFromPublicKey(invoke.callerPublicKey))
388+ let id = toBase58String(invoke.transactionId)
506389 if (containsElement([chris, joep, toString(this)], caller))
507390 then if ((flag == "CONSENT"))
508- then [StringEntry(keyFlag(addr, artId), flag)]
391+ then [StringEntry(keyArtFlag(addr, artId), flag)]
509392 else if ((flag == ""))
510- then [StringEntry(keyFlag(addr, artId), flag)]
511- else if ((flag == "ILLEGAL"))
512- then [StringEntry(keyFlag(addr, artId), flag), StringEntry(keyName(addr, artId), "ILLEGAL CONTENT"), StringEntry(keyDesc(addr, artId), "ILLEGAL CONTENT"), StringEntry(keyDisplayCid(addr, artId), ""), StringEntry(keyExportCid(addr, artId), ""), StringEntry(keyLicenceCid(addr, artId), "")]
513- else throw(("Unknow status " + flag))
393+ then [StringEntry(keyArtFlag(addr, artId), flag)]
394+ else if ((flag == "CHANGE_REQUIRED"))
395+ then [StringEntry(keyArtFlag(addr, artId), flag)]
396+ else if ((flag == "ILLEGAL"))
397+ then [StringEntry(keyArtFlag(addr, artId), flag), StringEntry(keyArtName(addr, artId), "ILLEGAL CONTENT"), StringEntry(keyArtDesc(addr, artId), "ILLEGAL CONTENT"), StringEntry(keyArtDisplayCid(addr, artId), ""), StringEntry(keyArtExportCid(addr, artId), ""), StringEntry(keyArtLicenceCid(addr, artId), "")]
398+ else throw(("Unknow status " + flag))
514399 else throw("You are not allowed")
515400 }
516401
517402
518403
519-@Callable(i)
404+@Callable(invoke)
520405 func deleteArtwork (artId,addr) = {
521- let $t02144121474 = idCallerDate(i)
522- let id = $t02144121474._1
523- let caller = $t02144121474._2
524- let addrToUse = if (containsElement([chris, joep, toString(this)], caller))
406+ let caller = toString(addressFromPublicKey(invoke.callerPublicKey))
407+ let id = toBase58String(invoke.transactionId)
408+ let addressToUse = if (containsElement([chris, joep, toString(this)], caller))
525409 then addr
526410 else caller
527- let entryExist = valueOrErrorMessage(getStringByKey(keyName(addrToUse, artId)), "No art matching for this address")
411+ let entryExist = getStringByKey(keyArtName(addressToUse, artId))
528412 if ((entryExist == ""))
529413 then throw("No art matching for this address")
530414 else {
531- let sha256Hash = getStringByKey(keyHashByTxidAddr(addrToUse, artId))
415+ let sha256Hash = getStringByKey(keyArtHashByTxidAddr(addressToUse, artId))
532416 if ((sha256Hash == ""))
533417 then throw("No art hash matching for this address")
534418 else {
535- let signID = getStringByKey(keySignID(addrToUse, artId))
419+ let signID = getStringByKey(keyArtSignID(addressToUse, artId))
536420 if ((signID == ""))
537421 then throw("No SIGN ID matching")
538422 else {
539- let dataToDelete = [DeleteEntry(keyDate(addrToUse, artId)), DeleteEntry(keyName(addrToUse, artId)), DeleteEntry(keyDesc(addrToUse, artId)), DeleteEntry(keyDisplayCid(addrToUse, artId)), DeleteEntry(keyExportCid(addrToUse, artId)), DeleteEntry(keyExportHash(addrToUse, artId)), DeleteEntry(keyLicenceHash(addrToUse, artId)), DeleteEntry(keyLicenceCid(addrToUse, artId)), DeleteEntry(keyType(addrToUse, artId)), DeleteEntry(keyTags(addrToUse, artId)), DeleteEntry(keyMaxMint(addrToUse, artId)), DeleteEntry(keySignID(addrToUse, artId)), DeleteEntry(keyIssued(addrToUse, artId)), DeleteEntry(keyOnSale(addrToUse, artId)), DeleteEntry(keyFlag(addr, artId)), DeleteEntry(keyPrice(addr, artId)), DeleteEntry(keyAssetIdAccepted(addr, artId)), DeleteEntry(keyOwnerByHash(sha256Hash)), DeleteEntry(keyidBySignid(addrToUse, signID)), DeleteEntry(keyTxidByHashOwner(sha256Hash, addrToUse))]
540- if (!(isArtMinted(addrToUse, artId)))
423+ let dataToDelete = [DeleteEntry(keyArtDate(addressToUse, artId)), DeleteEntry(keyArtName(addressToUse, artId)), DeleteEntry(keyArtDesc(addressToUse, artId)), DeleteEntry(keyArtDisplayCid(addressToUse, artId)), DeleteEntry(keyArtExportCid(addressToUse, artId)), DeleteEntry(keyArtExportHash(addressToUse, artId)), DeleteEntry(keyArtLicenceHash(addressToUse, artId)), DeleteEntry(keyArtLicenceCid(addressToUse, artId)), DeleteEntry(keyArtType(addressToUse, artId)), DeleteEntry(keyArtTags(addressToUse, artId)), DeleteEntry(keyArtMaxMint(addressToUse, artId)), DeleteEntry(keyArtSignID(addressToUse, artId)), DeleteEntry(keyArtIssued(addressToUse, artId)), DeleteEntry(keyArtOnSale(addressToUse, artId)), DeleteEntry(keyArtFlag(addr, artId)), DeleteEntry(keyArtPrice(addr, artId)), DeleteEntry(keyArtAssetIdAccepted(addr, artId)), DeleteEntry(keyArtOwnerByHash(sha256Hash)), DeleteEntry(keyArtArtidBySignid(addressToUse, signID)), DeleteEntry(keyArtTxidByHashOwner(sha256Hash, addressToUse))]
424+ if (!(isArtMinted(addressToUse, artId)))
541425 then if (!(dappRunning))
542426 then throw(maintenanceMSG)
543427 else dataToDelete
551435
552436
553437
554-@Callable(i)
555-func sellArtwork (artId,price,maxMint,assetId) = {
556- let $t02384023873 = idCallerDate(i)
557- let id = $t02384023873._1
558- let caller = $t02384023873._2
559- let artworkName = getStringByKey(keyName(caller, artId))
560- if ((artworkName == ""))
561- then throw("This art doesn't match your account")
562- else {
563- let exportCID = getStringByKey(keyExportCid(caller, artId))
564- if ((size(split(exportCID, "/")[0]) != 59))
565- then throw("You cannot sell art with no export file")
566- else if (!(acceptedAssetIds(assetId)))
567- then throw("Something went wrong!")
568- else if (!(validateMinSell(assetId, price)))
569- then throw("Something went wrong!")
570- else {
571- let checkUser = validateUser(caller)
572- if ((checkUser != ""))
573- then throw(checkUser)
574- else {
575- let amountSold = getIntegerByKey(keyIssued(caller, artId))
576- let maxCanSell = getIntegerByKey(keyMaxMint(caller, artId))
577- if ((maxMint > 10))
578- then throw("10 editions max per artwork")
579- else if (if ((amountSold != 0))
580- then (amountSold == maxCanSell)
581- else false)
582- then throw("Max edition reached.")
583- else if (if ((amountSold > 0))
584- then (maxCanSell != maxMint)
585- else false)
586- then throw("Cannot change maximum issuable anymore")
587- else {
588- let sellStatus = if (if ((price > 0))
589- then (maxMint > 0)
438+@Callable(invoke)
439+func sellArtwork (artId,price,maxMint,assetId) = if (!(dappRunning))
440+ then throw(maintenanceMSG)
441+ else {
442+ let id = toBase58String(invoke.transactionId)
443+ let caller = toBase58String(invoke.caller.bytes)
444+ let sellDate = lastBlock.timestamp
445+ let artworkName = getStringByKey(keyArtName(caller, artId))
446+ if ((artworkName == ""))
447+ then throw("This art doesn't match match your account")
448+ else {
449+ let exportCID = getStringByKey(keyArtExportCid(caller, artId))
450+ if ((size(split(exportCID, "/")[0]) != 59))
451+ then throw("You cannot sell art with no export file")
452+ else {
453+ let exportHash = getStringByKey(keyArtExportHash(caller, artId))
454+ if ((size(exportHash) != 64))
455+ then throw("You cannot sell art with no export hash")
456+ else if (!(acceptedAssetIds(assetId)))
457+ then throw("Something went wrong!")
458+ else if (!(validateMinSell(assetId, price)))
459+ then throw("Something went wrong!")
460+ else {
461+ let checkUser = validateUser(caller)
462+ if ((checkUser != ""))
463+ then throw(checkUser)
464+ else {
465+ let amountSold = getIntegerByKey(keyArtIssued(caller, artId))
466+ let maxCanSell = getIntegerByKey(keyArtMaxMint(caller, artId))
467+ if ((maxMint > 10))
468+ then throw("10 editions max per artwork")
469+ else if (if ((amountSold != 0))
470+ then (amountSold == maxCanSell)
590471 else false)
591- then true
592- else false
593-[BooleanEntry(keyOnSale(caller, artId), sellStatus), IntegerEntry(keyPrice(caller, artId), price), IntegerEntry(keyMaxMint(caller, artId), maxMint), StringEntry(keyAssetIdAccepted(caller, artId), assetId)]
594- }
595- }
596- }
597- }
598- }
472+ then throw("Max edition reached.")
473+ else if (if ((amountSold > 0))
474+ then (maxCanSell != maxMint)
475+ else false)
476+ then throw("Cannot change maximum issuable anymore")
477+ else {
478+ let sellStatus = if (if ((price > 0))
479+ then (maxMint > 0)
480+ else false)
481+ then true
482+ else false
483+[BooleanEntry(keyArtOnSale(caller, artId), sellStatus), IntegerEntry(keyArtPrice(caller, artId), price), IntegerEntry(keyArtMaxMint(caller, artId), maxMint), StringEntry(keyArtAssetIdAccepted(caller, artId), assetId)]
484+ }
485+ }
486+ }
487+ }
488+ }
489+ }
599490
600491
601492
602-@Callable(i)
603-func buyArtwork (artId,issuer) = buyMint(i, artId, issuer, "", "")
604-
605-
606-
607-@Callable(i)
608-func setBid (artId,issuer) = {
609- let $t02566925707 = idCallerDate(i)
610- let id = $t02566925707._1
611- let caller = $t02566925707._2
612- let date = $t02566925707._3
613- let $t02571225748 = isPayment(i)
614- let payment = $t02571225748._1
615- let amount = $t02571225748._2
616- let assetId = if (!(isDefined(payment.assetId)))
617- then "WAVES"
618- else toBase58String(value(payment.assetId))
619- if (!(acceptedAssetIds(assetId)))
620- then throw("Something went wrong!")
621- else if (!(validateMinSell(assetId, amount)))
622- then throw("Something went wrong!")
493+@Callable(invoke)
494+func buyArtwork (artId,issuer) = if (!(dappRunning))
495+ then throw(maintenanceMSG)
496+ else {
497+ let id = toBase58String(invoke.transactionId)
498+ let caller = toBase58String(invoke.caller.bytes)
499+ let totalNFT = getIntegerByKey("total_nft_issued")
500+ let signID = getStringByKey(keyArtSignID(issuer, artId))
501+ let artworkName = getStringByKey(keyArtName(issuer, artId))
502+ if ((artworkName == ""))
503+ then throw("Art doesn't exist")
623504 else {
624- let amountSold = getIntegerByKey(keyIssued(issuer, artId))
625- let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId))
626- if ((amountSold >= maxCanSell))
627- then throw("Sold out, you cannot bid")
628- else [StringEntry((((((((("bid_" + artId) + "_") + issuer) + "_") + caller) + "_") + id) + "_OPEN"), ((((assetId + "_") + toString(amount)) + "_") + toString(date)))]
505+ let displayCID = getStringByKey(keyArtDisplayCid(issuer, artId))
506+ let exportCID = getStringByKey(keyArtExportCid(issuer, artId))
507+ let exportHash = getStringByKey(keyArtExportHash(issuer, artId))
508+ let licenceCID = getStringByKey(keyArtLicenceCid(issuer, artId))
509+ let licenceHash = getStringByKey(keyArtLicenceHash(issuer, artId))
510+ let description = take(getStringByKey(keyArtDesc(issuer, artId)), 50)
511+ let isOnSale = getBooleanByKey(keyArtOnSale(issuer, artId))
512+ let amountSold = getIntegerByKey(keyArtIssued(issuer, artId))
513+ let artworkPrice = getIntegerByKey(keyArtPrice(issuer, artId))
514+ let priceAssetId = getStringByKey(keyArtAssetIdAccepted(issuer, artId))
515+ let sourceHash = getStringByKey(keyArtHashByTxidAddr(issuer, artId))
516+ let maxCanSell = getIntegerByKey(keyArtMaxMint(issuer, artId))
517+ if (if (if ((0 >= artworkPrice))
518+ then true
519+ else !(isOnSale))
520+ then true
521+ else (0 >= maxCanSell))
522+ then throw("Art not for sale")
523+ else {
524+ let $t02317523255 = validatePriceAssetId(invoke, priceAssetId, artworkPrice)
525+ let amount = $t02317523255._1
526+ let assetId = $t02317523255._2
527+ let isWhitelisted = checkWhitelist(issuer)
528+ let cut = if ((isWhitelisted > height))
529+ then 0
530+ else if ((priceAssetId == toBase58String(signAssetId)))
531+ then signCut
532+ else usdnWaveCut
533+ let amountForSign = fraction(amount, cut, 100)
534+ let amountForCreator = (amount - amountForSign)
535+ if ((amountSold == maxCanSell))
536+ then throw("Art sold out")
537+ else {
538+ let newAmountSold = (amountSold + 1)
539+ let entryDate = lastBlock.timestamp
540+ let issueMeta = ((((((((((((((((((((((((((("Creator: " + issuer) + ",
541+ ArtID: ") + artId) + ",
542+ SignID: ") + signID) + ",
543+ Artwork name: ") + artworkName) + ",
544+ Artwork description: ") + description) + ",
545+ Issue: ") + toString(newAmountSold)) + "/") + toString(maxCanSell)) + ",
546+ Max issuable: ") + toString(maxCanSell)) + ",
547+ Source hash: ") + sourceHash) + ",
548+ Display cid: ") + displayCID) + ",
549+ Export cid: ") + exportCID) + ",
550+ Export hash: ") + exportHash) + ",
551+ Licence cid: ") + licenceCID) + ",
552+ Licence hash: ") + licenceHash)
553+ let issueNFT = Issue(("SA_" + toString((totalNFT + 1))), issueMeta, 1, 0, false)
554+ let idNFT = calculateAssetId(issueNFT)
555+ let sellStatus = if ((newAmountSold == maxCanSell))
556+ then false
557+ else true
558+[IntegerEntry(keyArtIssued(issuer, artId), newAmountSold), StringEntry(("nft_" + toBase58String(idNFT)), ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer)), StringEntry(((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer), ((((((((((caller + "_") + toString(entryDate)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + toBase58String(idNFT))), IntegerEntry("total_nft_issued", (totalNFT + 1)), BooleanEntry(keyArtOnSale(issuer, artId), sellStatus), issueNFT, ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId), ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId), ScriptTransfer(invoke.caller, 1, idNFT)]
559+ }
560+ }
629561 }
630- }
631-
632-
633-
634-@Callable(i)
635-func acceptBid (artId,issuer,bidId,bidOwner) = {
636- let caller = toBase58String(i.caller.bytes)
637- if ((caller != issuer))
638- then throw("You cannot do this action")
639- else buyMint(i, artId, issuer, bidId, bidOwner)
640- }
641-
642-
643-
644-@Callable(i)
645-func cancelBid (artId,issuer,bidId,bidOwner) = {
646- let $t02683126869 = idCallerDate(i)
647- let id = $t02683126869._1
648- let caller = $t02683126869._2
649- let date = $t02683126869._3
650- if (if ((caller != bidOwner))
651- then (caller != issuer)
652- else false)
653- then throw("You cannot do this action")
654- else {
655- let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId)
656- let bidData = getStringByKey((bidDataKey + "_OPEN"))
657- if ((bidData == ""))
658- then throw("Bid not found")
659- else {
660- let bidDataArr = split(bidData, "_")
661- let assetId = if ((bidDataArr[0] == "WAVES"))
662- then unit
663- else fromBase58String(bidDataArr[0])
664- let bidStatus = if ((caller == bidOwner))
665- then "CANCELED"
666- else "REJECTED"
667-[DeleteEntry((bidDataKey + "_OPEN")), StringEntry(((bidDataKey + "_") + bidStatus), ((bidData + "_") + toString(date))), ScriptTransfer(Address(fromBase58String(bidOwner)), parseIntValue(bidDataArr[1]), assetId)]
668- }
669- }
670- }
562+ }
671563
672564
673565
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let unitTest = false
55
66 let oracleFee = value(addressFromString("3N2s5RtaHPBenCsx2ECcoFRbYHx3noZhXW1"))
77
88 let signDapp = value(addressFromString("3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB"))
99
1010 let feeReceiver = "3N1E6tXddRoVaRfQ9dQ3vg5LaW2fsd8HKub"
1111
1212 let userDapp = if (unitTest)
1313 then value(addressFromString("3Mt4RGMEyjSWYAocTPqd55wdHQQB3PU2UCm"))
1414 else value(addressFromString("3MwDZagoYEiNfQLc31cGpYoaE54MGMwoFrZ"))
1515
1616 let whitelistDapp = value(addressFromString("3N6BaV1dCB4zg43goNNHaCtvR13BcyJ5Gsq"))
1717
1818 let signAssetId = base58'Gf9t8FA4H3ssoZPCwrg3KwUFCci8zuUFP9ssRsUY3s6a'
1919
2020 let usdnAssetId = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'
2121
2222 let wavesAssetId = base58''
2323
2424 let chris = "3MsG6jPNCrVJUtYB7XJBxS7utWsXAf4n9Vp"
2525
2626 let joep = "3Mzm4VLwsN9uZwbTMzPj3XuxV6kEfAR8UDN"
2727
2828 let signCut = 7
2929
3030 let usdnWaveCut = 10
3131
3232 let defaultLicence = "bafybeifuyo4pqu54ismqgtb6e4h6kkvgx7zg4u3zibh2r7y6mb64i7bzza/licence.pdf"
3333
3434 let defaultHashLicence = "a87758c354e30a9e78fb84fa3a0010a5090ab20df0be11ad45b5720cc187e639"
3535
3636 let dappRunning = valueOrElse(getBoolean(userDapp, "conf_dapp_is_running"), true)
3737
3838 let maintenanceMSG = valueOrElse(getString(userDapp, "conf_maintenance_msg"), "")
3939
4040 let userSuspended = "SUSPENDED"
4141
4242 let userRemoved = "REMOVED"
4343
4444 let userUnregistered = "UNREGISTERED"
4545
4646 let userAllowed = "ALLOWED"
4747
4848 func getStringByKeyFromUsers (key) = valueOrElse(getString(userDapp, key), "")
4949
5050
5151 func getStringByKey (key) = valueOrElse(getString(this, key), "")
5252
5353
5454 func getIntegerByKeyFromOracle (key) = valueOrErrorMessage(getInteger(oracleFee, key), "Integer undefine or 0 in oracle")
5555
5656
5757 func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 0)
5858
5959
6060 func checkWhitelist (key) = valueOrElse(getInteger(whitelistDapp, key), 0)
6161
6262
6363 func getBooleanByKey (key) = valueOrElse(getBoolean(this, key), false)
6464
6565
6666 func checkSignCertificate (signID,Owner,sha256Hash) = match getString(signDapp, ((("data_fc_" + signID) + "_") + Owner)) {
6767 case a: String =>
6868 if (contains(a, sha256Hash))
6969 then true
7070 else false
7171 case _ =>
7272 false
7373 }
7474
7575
7676 func validateCID (cid) = if (contains(cid, "/"))
7777 then if (if ((76 > size(cid)))
7878 then (size(split(cid, "/")[0]) == 59)
7979 else false)
8080 then (16 > size(split(cid, "/")[1]))
8181 else false
8282 else false
8383
8484
8585 func validateHash (hash) = (size(hash) == 64)
8686
8787
8888 func keyUserStatus (caller) = ("user_status_" + caller)
8989
9090
91-func keyDate (caller,artId) = ((("art_date_" + artId) + "_") + caller)
91+func keyArtDate (caller,artId) = ((("art_date_" + artId) + "_") + caller)
9292
9393
94-func keyName (caller,artId) = ((("art_name_" + artId) + "_") + caller)
94+func keyArtName (caller,artId) = ((("art_name_" + artId) + "_") + caller)
9595
9696
97-func keyDesc (caller,artId) = ((("art_desc_" + artId) + "_") + caller)
97+func keyArtDesc (caller,artId) = ((("art_desc_" + artId) + "_") + caller)
9898
9999
100-func keyDisplayCid (caller,artId) = ((("art_display_cid_" + artId) + "_") + caller)
100+func keyArtDisplayCid (caller,artId) = ((("art_display_cid_" + artId) + "_") + caller)
101101
102102
103-func keyExportHash (caller,artId) = ((("art_export_hash_" + artId) + "_") + caller)
103+func keyArtExportHash (caller,artId) = ((("art_export_hash_" + artId) + "_") + caller)
104104
105105
106-func keyExportCid (caller,artId) = ((("art_export_cid_" + artId) + "_") + caller)
106+func keyArtExportCid (caller,artId) = ((("art_export_cid_" + artId) + "_") + caller)
107107
108108
109-func keyMaxMint (caller,artId) = ((("art_maxmint_" + artId) + "_") + caller)
109+func keyArtMaxMint (caller,artId) = ((("art_maxmint_" + artId) + "_") + caller)
110110
111111
112-func keySignID (caller,artId) = ((("art_signid_" + artId) + "_") + caller)
112+func keyArtSignID (caller,artId) = ((("art_signid_" + artId) + "_") + caller)
113113
114114
115-func keyIssued (caller,artId) = ((("art_issued_" + artId) + "_") + caller)
115+func keyArtIssued (caller,artId) = ((("art_issued_" + artId) + "_") + caller)
116116
117117
118-func keyOnSale (caller,artId) = ((("art_onsale_" + artId) + "_") + caller)
118+func keyArtOnSale (caller,artId) = ((("art_onsale_" + artId) + "_") + caller)
119119
120120
121-func keyLicenceHash (caller,artId) = ((("art_licence_hash_" + artId) + "_") + caller)
121+func keyArtLicenceHash (caller,artId) = ((("art_licence_hash_" + artId) + "_") + caller)
122122
123123
124-func keyLicenceCid (caller,artId) = ((("art_licence_cid_" + artId) + "_") + caller)
124+func keyArtLicenceCid (caller,artId) = ((("art_licence_cid_" + artId) + "_") + caller)
125125
126126
127-func keyTags (caller,artId) = ((("art_tags_" + artId) + "_") + caller)
127+func keyArtTags (caller,artId) = ((("art_tags_" + artId) + "_") + caller)
128128
129129
130-func keyType (caller,artId) = ((("art_type_" + artId) + "_") + caller)
130+func keyArtType (caller,artId) = ((("art_type_" + artId) + "_") + caller)
131131
132132
133-func keyPrice (caller,artId) = ((("art_price_" + artId) + "_") + caller)
133+func keyArtPrice (caller,artId) = ((("art_price_" + artId) + "_") + caller)
134134
135135
136-func keyAssetIdAccepted (caller,artId) = ((("art_assetAccepted_" + artId) + "_") + caller)
136+func keyArtAssetIdAccepted (caller,artId) = ((("art_assetAccepted_" + artId) + "_") + caller)
137137
138138
139-func keyFlag (caller,artId) = ((("art_flag_" + artId) + "_") + caller)
139+func keyArtFlag (caller,artId) = ((("art_flag_" + artId) + "_") + caller)
140140
141141
142-func keyHashByTxidAddr (caller,txid) = ((("get_hashbytxidaddr_" + txid) + "_") + caller)
142+func keyArtHashByTxidAddr (caller,txid) = ((("get_hashbytxidaddr_" + txid) + "_") + caller)
143143
144144
145-func keyOwnerByHash (sha256Hash) = ("get_owner_by_hash_" + sha256Hash)
145+func keyArtOwnerByHash (sha256Hash) = ("get_owner_by_hash_" + sha256Hash)
146146
147147
148-func keyidBySignid (caller,signId) = ((("get_artidbysignid_" + signId) + "_") + caller)
148+func keyArtArtidBySignid (caller,signId) = ((("get_artidbysignid_" + signId) + "_") + caller)
149149
150150
151-func keyTxidByHashOwner (sha256Hash,caller) = ("get_txid_by_hash_owner_" + toBase58String(sha256_16Kb(toBytes((sha256Hash + caller)))))
151+func keyArtTxidByHashOwner (sha256Hash,caller) = ("get_txid_by_hash_owner_" + toBase58String(sha256_16Kb(toBytes((sha256Hash + caller)))))
152152
153153
154154 func validateAllCID (cidDisplay,cidExport,cidLicence) = if (!(validateCID(cidDisplay)))
155155 then throw("Wrong Display CID")
156156 else if (!(validateCID(cidExport)))
157157 then throw("Wrong Export CID")
158158 else if (if ((cidLicence != ""))
159159 then !(validateCID(cidLicence))
160160 else false)
161161 then throw("Wrong Licence CID")
162162 else true
163163
164164
165165 func validateAllHash (sha256Export,sha256Licence) = if (!(validateHash(sha256Export)))
166166 then throw("Export Hash 64 char. max")
167167 else if (!(validateHash(sha256Licence)))
168168 then throw("Licence Hash 64 char. max")
169169 else true
170170
171171
172172 func validateString (str,max) = if ((size(str) == 0))
173173 then throw("Field cannot be is empty")
174174 else if ((size(str) > max))
175175 then throw((str + " is too long"))
176176 else true
177177
178178
179179 func validateUser (caller) = {
180180 let userStatus = valueOrElse(getString(userDapp, keyUserStatus(caller)), userUnregistered)
181181 if (if ((userStatus == userUnregistered))
182182 then true
183183 else (userStatus == userAllowed))
184184 then "Register this account first with \"Account\" tab"
185185 else if ((userStatus == userSuspended))
186186 then "Account suspended"
187187 else if ((userStatus == userRemoved))
188188 then "Account removed"
189189 else ""
190190 }
191191
192192
193193 func setLIcence (cidLicence,sha256Licence) = {
194194 let cid = if ((size(cidLicence) == 0))
195195 then defaultLicence
196196 else cidLicence
197197 let hash = if ((size(sha256Licence) == 0))
198198 then defaultHashLicence
199199 else sha256Licence
200200 $Tuple2(cid, hash)
201201 }
202202
203203
204204 func validateArtworkData (caller,cidDisplay,cidExport,licenceCID,sha256Export,licenceHash,name,description,tags,maxmint) = {
205205 let checkUser = validateUser(caller)
206206 if ((checkUser != ""))
207207 then throw(checkUser)
208208 else if ((size(cidDisplay) == 0))
209209 then throw("Display CID cannot be empty")
210210 else if (!(validateAllCID(cidDisplay, cidExport, licenceCID)))
211211 then throw("Problem with CID")
212212 else if (!(validateAllHash(sha256Export, licenceHash)))
213213 then throw("Problem with Hashes")
214214 else if (!(validateString(name, 100)))
215215 then throw("100 Char. max name")
216216 else if (!(validateString(description, 1000)))
217217 then throw("1000 Char. max description")
218218 else if ((size(split(tags, ",")) > 5))
219219 then throw("5 tags max.")
220220 else if ((maxmint > 10))
221221 then throw("10 editions max per artwork")
222222 else ""
223223 }
224224
225225
226-func isPayment (i) = if ((size(i.payments) == 0))
226+func validatePayment (invoke) = if ((size(invoke.payments) == 0))
227227 then throw("No payment attached")
228228 else {
229- let payment = value(i.payments[0])
229+ let payment = value(invoke.payments[0])
230230 let amount = value(payment.amount)
231- $Tuple2(payment, amount)
231+ let assetId = if (if (isDefined(payment.assetId))
232+ then (payment.assetId == signAssetId)
233+ else false)
234+ then payment.assetId
235+ else throw("Only SIGN token accepted as transaction fee")
236+ let currentCertificationPrice = getIntegerByKeyFromOracle(("certification_fee_" + toBase58String(signAssetId)))
237+ if ((amount != currentCertificationPrice))
238+ then throw(("Payment amount should be " + toString(currentCertificationPrice)))
239+ else $Tuple2(amount, assetId)
232240 }
233241
234242
235-func validatePayment (i) = {
236- let $t089038939 = isPayment(i)
237- let payment = $t089038939._1
238- let amount = $t089038939._2
239- let assetId = if (if (isDefined(payment.assetId))
240- then (payment.assetId == signAssetId)
241- else false)
242- then payment.assetId
243- else throw("Only SIGN token accepted as transaction fee")
244- let currentCertificationPrice = getIntegerByKeyFromOracle(("certification_fee_" + toBase58String(signAssetId)))
245- if ((amount != currentCertificationPrice))
246- then throw(("Payment amount should be " + toString(currentCertificationPrice)))
247- else $Tuple2(amount, assetId)
248- }
249-
250-
251-func isArtMinted (addrToUse,artId) = match getInteger(this, keyIssued(addrToUse, artId)) {
243+func isArtMinted (addressToUse,artId) = match getInteger(this, keyArtIssued(addressToUse, artId)) {
252244 case b: Int =>
253245 if ((b != 0))
254246 then true
255247 else false
256248 case _ =>
257249 false
258250 }
259251
260252
261-func validatePriceAssetId (i,priceAssetId,artworkPrice) = {
262- let $t096399675 = isPayment(i)
263- let payment = $t096399675._1
264- let amount = $t096399675._2
253+func validatePriceAssetId (invoke,priceAssetId,artworkPrice) = {
254+ let payment = value(invoke.payments[0])
255+ let amount = value(payment.amount)
265256 let assetId = if (!(isDefined(payment.assetId)))
266257 then unit
267258 else if (if ((size(priceAssetId) > 0))
268259 then (toBase58String(value(payment.assetId)) == priceAssetId)
269260 else false)
270261 then payment.assetId
271262 else throw("Wrong asset id")
272263 if (if ((assetId == unit))
273264 then (priceAssetId != "")
274265 else false)
275266 then throw("Wrong asset id")
276267 else if ((artworkPrice != amount))
277268 then throw("Payment don't match")
278269 else $Tuple2(amount, assetId)
279270 }
280271
281272
282-func acceptedAssetIds (assetId) = if (if (if (if ((assetId != toBase58String(signAssetId)))
273+func acceptedAssetIds (assetId) = if (if (if ((assetId != toBase58String(signAssetId)))
283274 then (assetId != toBase58String(wavesAssetId))
284- else false)
285- then (assetId != "WAVES")
286275 else false)
287276 then (assetId != toBase58String(usdnAssetId))
288277 else false)
289278 then throw("Only SIGN, USDN or WAVES accepted")
290279 else true
291280
292281
293282 func validateMinSell (assetId,price) = {
294283 let minSellWaves = if (unitTest)
295284 then 1
296285 else getIntegerByKeyFromOracle("waves_min_sell")
297286 let minSellUsdn = 1000000
298287 let minSellSign = if (unitTest)
299288 then 1
300289 else (getIntegerByKeyFromOracle(("certification_fee_" + toBase58String(signAssetId))) * 2)
301290 if (if (if (if (if ((assetId == toBase58String(usdnAssetId)))
302291 then (minSellUsdn > price)
303292 else false)
304293 then (price != 0)
305294 else false)
306295 then true
307296 else if (if ((assetId == toBase58String(signAssetId)))
308297 then (minSellSign > price)
309298 else false)
310299 then (price != 0)
311300 else false)
312301 then true
313302 else if (if ((assetId == toBase58String(wavesAssetId)))
314303 then (minSellWaves > price)
315304 else false)
316305 then (price != 0)
317306 else false)
318307 then throw("Wrong minimum sell price")
319308 else true
320309 }
321310
322311
323-func getPriceAssetIdFromBid (bidDataKey) = {
324- let bidData = getStringByKey((bidDataKey + "_OPEN"))
325- if ((bidData == ""))
326- then throw("Bid not found")
327- else {
328- let bidDataArr = split(bidData, "_")
329- let bidAmount = parseIntValue(bidDataArr[1])
330- let bidAssetId = if ((bidDataArr[0] == "WAVES"))
331- then unit
332- else fromBase58String(bidDataArr[0])
333- if ((0 >= bidAmount))
334- then throw("Wrong amount")
335- else $Tuple2(bidAmount, bidAssetId)
336- }
337- }
338-
339-
340-func idCallerDate (i) = if (!(dappRunning))
312+@Callable(invoke)
313+func addArtwork (sha256Hash,signID,name,description,tags,type,maxmint,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence) = if (!(dappRunning))
341314 then throw(maintenanceMSG)
342- else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp)
343-
344-
345-func buyMint (i,artId,issuer,bidId,bidOwner) = {
346- let $t01177611814 = idCallerDate(i)
347- let id = $t01177611814._1
348- let caller = $t01177611814._2
349- let date = $t01177611814._3
350- let totalNFT = getIntegerByKey("total_nft_issued")
351- let signID = getStringByKey(keySignID(issuer, artId))
352- let artworkName = getStringByKey(keyName(issuer, artId))
353- if ((artworkName == ""))
354- then throw("Art doesn't exist")
355- else {
356- let isOnSale = getBooleanByKey(keyOnSale(issuer, artId))
357- let amountSold = getIntegerByKey(keyIssued(issuer, artId))
358- let artworkPrice = getIntegerByKey(keyPrice(issuer, artId))
359- let priceAssetId = getStringByKey(keyAssetIdAccepted(issuer, artId))
360- let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId))
361- let isBid = if (if (if ((caller == issuer))
362- then (bidOwner != "")
363- else false)
364- then (bidId != "")
365- else false)
366- then true
367- else false
368- let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId)
369- if (if (if ((0 >= artworkPrice))
370- then true
371- else !(isOnSale))
372- then true
373- else (0 >= maxCanSell))
374- then throw("Art not for sale")
375- else {
376- let $t01266112790 = if (isBid)
377- then getPriceAssetIdFromBid(bidDataKey)
378- else validatePriceAssetId(i, priceAssetId, artworkPrice)
379- let amount = $t01266112790._1
380- let assetId = $t01266112790._2
381- let isWhitelisted = checkWhitelist(issuer)
382- let cut = if ((isWhitelisted > height))
383- then 0
384- else if ((priceAssetId == toBase58String(signAssetId)))
385- then signCut
386- else usdnWaveCut
387- let amountForSign = fraction(amount, cut, 100)
388- let amountForCreator = (amount - amountForSign)
389- if ((amountSold == maxCanSell))
390- then throw("Art sold out")
391- else {
392- let newAmountSold = (amountSold + 1)
393- let issueMeta = ((((((((((("Creator: " + issuer) + ",
394- ArtID: ") + artId) + ",
395- SignID: ") + signID) + ",
396- Artwork name: ") + artworkName) + ",
397- Issue: ") + toString(newAmountSold)) + "/") + toString(maxCanSell))
398- let issueNFT = Issue(("SA_" + toString((totalNFT + 1))), issueMeta, 1, 0, false)
399- let idNFT = calculateAssetId(issueNFT)
400- let sellStatus = if ((newAmountSold == maxCanSell))
401- then false
402- else true
403- let receiveNFT = if (if (if ((caller == issuer))
404- then (bidOwner != "")
405- else false)
406- then (bidId != "")
407- else false)
408- then addressFromStringValue(bidOwner)
409- else i.caller
410- let buyRes = [IntegerEntry(keyIssued(issuer, artId), newAmountSold), StringEntry(("nft_" + toBase58String(idNFT)), ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer)), IntegerEntry("total_nft_issued", (totalNFT + 1)), BooleanEntry(keyOnSale(issuer, artId), sellStatus), issueNFT, ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId), ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId), ScriptTransfer(receiveNFT, 1, idNFT)]
411- let assetIdBid = if (!(isDefined(assetId)))
412- then "WAVES"
413- else toBase58String(value(assetId))
414- let getBidData = getStringByKey((bidDataKey + "_OPEN"))
415- let bidDelOld = DeleteEntry((bidDataKey + "_OPEN"))
416- let bidUpdate = StringEntry((bidDataKey + "_CLOSED"), ((getBidData + "_") + toString(date)))
417- let soldValue = if (!(isBid))
418- then ((((((((((caller + "_") + toString(date)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + toBase58String(idNFT))
419- else ((((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + assetIdBid) + "_") + toBase58String(idNFT))
420- let soldData = StringEntry(((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer), soldValue)
421- if (isBid)
422- then [soldData, bidUpdate, bidDelOld] :: buyRes
423- else soldData :: buyRes
424- }
425- }
426- }
427- }
428-
429-
430-@Callable(i)
431-func addArtwork (sha256Hash,signID,name,description,tags,type,maxmint,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence) = {
432- let $t01581615857 = idCallerDate(i)
433- let artId = $t01581615857._1
434- let caller = $t01581615857._2
435- let date = $t01581615857._3
436- if (!(validateHash(sha256Hash)))
437- then throw("Hash should be 64 characters maximum")
438- else {
439- let $t01595816027 = setLIcence(cidLicence, sha256Licence)
440- let licenceCID = $t01595816027._1
441- let licenceHash = $t01595816027._2
442- let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, maxmint)
443- if ((validateArtwork != ""))
444- then throw("Something went wrong!")
445- else {
446- let $t01625516297 = validatePayment(i)
447- let amount = $t01625516297._1
448- let assetId = $t01625516297._2
449- if (!(isDefined(amount)))
450- then throw("Something went wrong")
451- else {
452- let entryExist = getStringByKey(keyTxidByHashOwner(sha256Hash, caller))
453- if ((entryExist != ""))
454- then throw("You already added it")
455- else {
456- let hashExist = getStringByKey(keyOwnerByHash(sha256Hash))
457- if ((hashExist != ""))
458- then throw("Hash already registered")
459- else {
460- let isSignCertified = checkSignCertificate(signID, caller, sha256Hash)
461- if (!(isSignCertified))
462- then throw("Sign Certificate not found for this address.")
463- else [StringEntry(keyOwnerByHash(sha256Hash), caller), StringEntry(keyTxidByHashOwner(sha256Hash, caller), artId), IntegerEntry(keyDate(caller, artId), date), StringEntry(keyName(caller, artId), name), StringEntry(keyDesc(caller, artId), description), StringEntry(keyDisplayCid(caller, artId), cidDisplay), StringEntry(keyExportCid(caller, artId), cidExport), StringEntry(keyExportHash(caller, artId), sha256Export), StringEntry(keyLicenceHash(caller, artId), licenceHash), StringEntry(keyLicenceCid(caller, artId), licenceCID), StringEntry(keyType(caller, artId), type), StringEntry(keyTags(caller, artId), tags), IntegerEntry(keyMaxMint(caller, artId), maxmint), StringEntry(keySignID(caller, artId), signID), IntegerEntry(keyIssued(caller, artId), 0), BooleanEntry(keyOnSale(caller, artId), false), StringEntry(keyidBySignid(caller, signID), artId), StringEntry(keyHashByTxidAddr(caller, artId), sha256Hash), ScriptTransfer(Address(fromBase58String(feeReceiver)), amount, assetId)]
464- }
465- }
466- }
467- }
468- }
469- }
315+ else {
316+ let artId = toBase58String(invoke.transactionId)
317+ let timestamp = lastBlock.timestamp
318+ let caller = toBase58String(invoke.caller.bytes)
319+ if (!(validateHash(sha256Hash)))
320+ then throw("Hash should be 64 characters maximum")
321+ else {
322+ let $t01151411583 = setLIcence(cidLicence, sha256Licence)
323+ let licenceCID = $t01151411583._1
324+ let licenceHash = $t01151411583._2
325+ let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, maxmint)
326+ if ((validateArtwork != ""))
327+ then throw("Something went wrong!")
328+ else {
329+ let $t01181111858 = validatePayment(invoke)
330+ let amount = $t01181111858._1
331+ let assetId = $t01181111858._2
332+ if (!(isDefined(amount)))
333+ then throw("Something went wrong")
334+ else {
335+ let entryExist = getStringByKey(keyArtTxidByHashOwner(sha256Hash, caller))
336+ if ((entryExist != ""))
337+ then throw("You already added it")
338+ else {
339+ let hashExist = getStringByKey(keyArtOwnerByHash(sha256Hash))
340+ if ((hashExist != ""))
341+ then throw("Hash already registered")
342+ else {
343+ let isSignCertified = checkSignCertificate(signID, caller, sha256Hash)
344+ if (!(isSignCertified))
345+ then throw("Sign Certificate not found for this address.")
346+ else [StringEntry(keyArtOwnerByHash(sha256Hash), caller), StringEntry(keyArtTxidByHashOwner(sha256Hash, caller), artId), IntegerEntry(keyArtDate(caller, artId), timestamp), StringEntry(keyArtName(caller, artId), name), StringEntry(keyArtDesc(caller, artId), description), StringEntry(keyArtDisplayCid(caller, artId), cidDisplay), StringEntry(keyArtExportCid(caller, artId), cidExport), StringEntry(keyArtExportHash(caller, artId), sha256Export), StringEntry(keyArtLicenceHash(caller, artId), licenceHash), StringEntry(keyArtLicenceCid(caller, artId), licenceCID), StringEntry(keyArtType(caller, artId), type), StringEntry(keyArtTags(caller, artId), tags), IntegerEntry(keyArtMaxMint(caller, artId), maxmint), StringEntry(keyArtSignID(caller, artId), signID), IntegerEntry(keyArtIssued(caller, artId), 0), BooleanEntry(keyArtOnSale(caller, artId), false), StringEntry(keyArtArtidBySignid(caller, signID), artId), StringEntry(keyArtHashByTxidAddr(caller, artId), sha256Hash), ScriptTransfer(Address(fromBase58String(feeReceiver)), amount, assetId)]
347+ }
348+ }
349+ }
350+ }
351+ }
352+ }
470353
471354
472355
473-@Callable(i)
356+@Callable(invoke)
474357 func updateArtwork (txid,name,description,tags,type,maxmint,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence) = if (!(dappRunning))
475358 then throw(maintenanceMSG)
476359 else {
477- let caller = toBase58String(i.caller.bytes)
478- let $t01901819087 = setLIcence(cidLicence, sha256Licence)
479- let licenceCID = $t01901819087._1
480- let licenceHash = $t01901819087._2
360+ let updateId = toBase58String(invoke.transactionId)
361+ let caller = toBase58String(invoke.caller.bytes)
362+ let $t01471314782 = setLIcence(cidLicence, sha256Licence)
363+ let licenceCID = $t01471314782._1
364+ let licenceHash = $t01471314782._2
481365 let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, maxmint)
482366 if ((validateArtwork != ""))
483367 then throw("Something went wrong!")
484368 else {
485- let entryExist = getStringByKey(keyName(caller, txid))
369+ let entryExist = getStringByKey(keyArtName(caller, txid))
486370 if ((entryExist == ""))
487371 then throw("Entry not found")
488372 else {
489- let flag = getStringByKey(keyFlag(caller, txid))
373+ let flag = getStringByKey(keyArtFlag(caller, txid))
490374 if ((flag == "ILLEGAL"))
491375 then throw("Cannot update ILLEGAL artwork")
492376 else if (!(isArtMinted(caller, txid)))
493- then [StringEntry(keyName(caller, txid), name), StringEntry(keyDesc(caller, txid), description), StringEntry(keyDisplayCid(caller, txid), cidDisplay), StringEntry(keyExportCid(caller, txid), cidExport), StringEntry(keyExportHash(caller, txid), sha256Export), StringEntry(keyLicenceCid(caller, txid), licenceCID), StringEntry(keyLicenceHash(caller, txid), licenceHash), IntegerEntry(keyMaxMint(caller, txid), maxmint), StringEntry(keyTags(caller, txid), tags), StringEntry(keyType(caller, txid), type)]
377+ then [StringEntry(keyArtName(caller, txid), name), StringEntry(keyArtDesc(caller, txid), description), StringEntry(keyArtDisplayCid(caller, txid), cidDisplay), StringEntry(keyArtExportCid(caller, txid), cidExport), StringEntry(keyArtExportHash(caller, txid), sha256Export), StringEntry(keyArtLicenceCid(caller, txid), licenceCID), StringEntry(keyArtLicenceHash(caller, txid), licenceHash), IntegerEntry(keyArtMaxMint(caller, txid), maxmint), StringEntry(keyArtTags(caller, txid), tags), StringEntry(keyArtType(caller, txid), type)]
494378 else throw("Already minted")
495379 }
496380 }
497381 }
498382
499383
500384
501-@Callable(i)
385+@Callable(invoke)
502386 func flagArtwork (artId,addr,flag) = {
503- let $t02056020593 = idCallerDate(i)
504- let id = $t02056020593._1
505- let caller = $t02056020593._2
387+ let caller = toString(addressFromPublicKey(invoke.callerPublicKey))
388+ let id = toBase58String(invoke.transactionId)
506389 if (containsElement([chris, joep, toString(this)], caller))
507390 then if ((flag == "CONSENT"))
508- then [StringEntry(keyFlag(addr, artId), flag)]
391+ then [StringEntry(keyArtFlag(addr, artId), flag)]
509392 else if ((flag == ""))
510- then [StringEntry(keyFlag(addr, artId), flag)]
511- else if ((flag == "ILLEGAL"))
512- then [StringEntry(keyFlag(addr, artId), flag), StringEntry(keyName(addr, artId), "ILLEGAL CONTENT"), StringEntry(keyDesc(addr, artId), "ILLEGAL CONTENT"), StringEntry(keyDisplayCid(addr, artId), ""), StringEntry(keyExportCid(addr, artId), ""), StringEntry(keyLicenceCid(addr, artId), "")]
513- else throw(("Unknow status " + flag))
393+ then [StringEntry(keyArtFlag(addr, artId), flag)]
394+ else if ((flag == "CHANGE_REQUIRED"))
395+ then [StringEntry(keyArtFlag(addr, artId), flag)]
396+ else if ((flag == "ILLEGAL"))
397+ then [StringEntry(keyArtFlag(addr, artId), flag), StringEntry(keyArtName(addr, artId), "ILLEGAL CONTENT"), StringEntry(keyArtDesc(addr, artId), "ILLEGAL CONTENT"), StringEntry(keyArtDisplayCid(addr, artId), ""), StringEntry(keyArtExportCid(addr, artId), ""), StringEntry(keyArtLicenceCid(addr, artId), "")]
398+ else throw(("Unknow status " + flag))
514399 else throw("You are not allowed")
515400 }
516401
517402
518403
519-@Callable(i)
404+@Callable(invoke)
520405 func deleteArtwork (artId,addr) = {
521- let $t02144121474 = idCallerDate(i)
522- let id = $t02144121474._1
523- let caller = $t02144121474._2
524- let addrToUse = if (containsElement([chris, joep, toString(this)], caller))
406+ let caller = toString(addressFromPublicKey(invoke.callerPublicKey))
407+ let id = toBase58String(invoke.transactionId)
408+ let addressToUse = if (containsElement([chris, joep, toString(this)], caller))
525409 then addr
526410 else caller
527- let entryExist = valueOrErrorMessage(getStringByKey(keyName(addrToUse, artId)), "No art matching for this address")
411+ let entryExist = getStringByKey(keyArtName(addressToUse, artId))
528412 if ((entryExist == ""))
529413 then throw("No art matching for this address")
530414 else {
531- let sha256Hash = getStringByKey(keyHashByTxidAddr(addrToUse, artId))
415+ let sha256Hash = getStringByKey(keyArtHashByTxidAddr(addressToUse, artId))
532416 if ((sha256Hash == ""))
533417 then throw("No art hash matching for this address")
534418 else {
535- let signID = getStringByKey(keySignID(addrToUse, artId))
419+ let signID = getStringByKey(keyArtSignID(addressToUse, artId))
536420 if ((signID == ""))
537421 then throw("No SIGN ID matching")
538422 else {
539- let dataToDelete = [DeleteEntry(keyDate(addrToUse, artId)), DeleteEntry(keyName(addrToUse, artId)), DeleteEntry(keyDesc(addrToUse, artId)), DeleteEntry(keyDisplayCid(addrToUse, artId)), DeleteEntry(keyExportCid(addrToUse, artId)), DeleteEntry(keyExportHash(addrToUse, artId)), DeleteEntry(keyLicenceHash(addrToUse, artId)), DeleteEntry(keyLicenceCid(addrToUse, artId)), DeleteEntry(keyType(addrToUse, artId)), DeleteEntry(keyTags(addrToUse, artId)), DeleteEntry(keyMaxMint(addrToUse, artId)), DeleteEntry(keySignID(addrToUse, artId)), DeleteEntry(keyIssued(addrToUse, artId)), DeleteEntry(keyOnSale(addrToUse, artId)), DeleteEntry(keyFlag(addr, artId)), DeleteEntry(keyPrice(addr, artId)), DeleteEntry(keyAssetIdAccepted(addr, artId)), DeleteEntry(keyOwnerByHash(sha256Hash)), DeleteEntry(keyidBySignid(addrToUse, signID)), DeleteEntry(keyTxidByHashOwner(sha256Hash, addrToUse))]
540- if (!(isArtMinted(addrToUse, artId)))
423+ let dataToDelete = [DeleteEntry(keyArtDate(addressToUse, artId)), DeleteEntry(keyArtName(addressToUse, artId)), DeleteEntry(keyArtDesc(addressToUse, artId)), DeleteEntry(keyArtDisplayCid(addressToUse, artId)), DeleteEntry(keyArtExportCid(addressToUse, artId)), DeleteEntry(keyArtExportHash(addressToUse, artId)), DeleteEntry(keyArtLicenceHash(addressToUse, artId)), DeleteEntry(keyArtLicenceCid(addressToUse, artId)), DeleteEntry(keyArtType(addressToUse, artId)), DeleteEntry(keyArtTags(addressToUse, artId)), DeleteEntry(keyArtMaxMint(addressToUse, artId)), DeleteEntry(keyArtSignID(addressToUse, artId)), DeleteEntry(keyArtIssued(addressToUse, artId)), DeleteEntry(keyArtOnSale(addressToUse, artId)), DeleteEntry(keyArtFlag(addr, artId)), DeleteEntry(keyArtPrice(addr, artId)), DeleteEntry(keyArtAssetIdAccepted(addr, artId)), DeleteEntry(keyArtOwnerByHash(sha256Hash)), DeleteEntry(keyArtArtidBySignid(addressToUse, signID)), DeleteEntry(keyArtTxidByHashOwner(sha256Hash, addressToUse))]
424+ if (!(isArtMinted(addressToUse, artId)))
541425 then if (!(dappRunning))
542426 then throw(maintenanceMSG)
543427 else dataToDelete
544428 else if (containsElement([chris, toString(this)], caller))
545429 then dataToDelete
546430 else throw("Art already minted, you cannot delete it")
547431 }
548432 }
549433 }
550434 }
551435
552436
553437
554-@Callable(i)
555-func sellArtwork (artId,price,maxMint,assetId) = {
556- let $t02384023873 = idCallerDate(i)
557- let id = $t02384023873._1
558- let caller = $t02384023873._2
559- let artworkName = getStringByKey(keyName(caller, artId))
560- if ((artworkName == ""))
561- then throw("This art doesn't match your account")
562- else {
563- let exportCID = getStringByKey(keyExportCid(caller, artId))
564- if ((size(split(exportCID, "/")[0]) != 59))
565- then throw("You cannot sell art with no export file")
566- else if (!(acceptedAssetIds(assetId)))
567- then throw("Something went wrong!")
568- else if (!(validateMinSell(assetId, price)))
569- then throw("Something went wrong!")
570- else {
571- let checkUser = validateUser(caller)
572- if ((checkUser != ""))
573- then throw(checkUser)
574- else {
575- let amountSold = getIntegerByKey(keyIssued(caller, artId))
576- let maxCanSell = getIntegerByKey(keyMaxMint(caller, artId))
577- if ((maxMint > 10))
578- then throw("10 editions max per artwork")
579- else if (if ((amountSold != 0))
580- then (amountSold == maxCanSell)
581- else false)
582- then throw("Max edition reached.")
583- else if (if ((amountSold > 0))
584- then (maxCanSell != maxMint)
585- else false)
586- then throw("Cannot change maximum issuable anymore")
587- else {
588- let sellStatus = if (if ((price > 0))
589- then (maxMint > 0)
438+@Callable(invoke)
439+func sellArtwork (artId,price,maxMint,assetId) = if (!(dappRunning))
440+ then throw(maintenanceMSG)
441+ else {
442+ let id = toBase58String(invoke.transactionId)
443+ let caller = toBase58String(invoke.caller.bytes)
444+ let sellDate = lastBlock.timestamp
445+ let artworkName = getStringByKey(keyArtName(caller, artId))
446+ if ((artworkName == ""))
447+ then throw("This art doesn't match match your account")
448+ else {
449+ let exportCID = getStringByKey(keyArtExportCid(caller, artId))
450+ if ((size(split(exportCID, "/")[0]) != 59))
451+ then throw("You cannot sell art with no export file")
452+ else {
453+ let exportHash = getStringByKey(keyArtExportHash(caller, artId))
454+ if ((size(exportHash) != 64))
455+ then throw("You cannot sell art with no export hash")
456+ else if (!(acceptedAssetIds(assetId)))
457+ then throw("Something went wrong!")
458+ else if (!(validateMinSell(assetId, price)))
459+ then throw("Something went wrong!")
460+ else {
461+ let checkUser = validateUser(caller)
462+ if ((checkUser != ""))
463+ then throw(checkUser)
464+ else {
465+ let amountSold = getIntegerByKey(keyArtIssued(caller, artId))
466+ let maxCanSell = getIntegerByKey(keyArtMaxMint(caller, artId))
467+ if ((maxMint > 10))
468+ then throw("10 editions max per artwork")
469+ else if (if ((amountSold != 0))
470+ then (amountSold == maxCanSell)
590471 else false)
591- then true
592- else false
593-[BooleanEntry(keyOnSale(caller, artId), sellStatus), IntegerEntry(keyPrice(caller, artId), price), IntegerEntry(keyMaxMint(caller, artId), maxMint), StringEntry(keyAssetIdAccepted(caller, artId), assetId)]
594- }
595- }
596- }
597- }
598- }
472+ then throw("Max edition reached.")
473+ else if (if ((amountSold > 0))
474+ then (maxCanSell != maxMint)
475+ else false)
476+ then throw("Cannot change maximum issuable anymore")
477+ else {
478+ let sellStatus = if (if ((price > 0))
479+ then (maxMint > 0)
480+ else false)
481+ then true
482+ else false
483+[BooleanEntry(keyArtOnSale(caller, artId), sellStatus), IntegerEntry(keyArtPrice(caller, artId), price), IntegerEntry(keyArtMaxMint(caller, artId), maxMint), StringEntry(keyArtAssetIdAccepted(caller, artId), assetId)]
484+ }
485+ }
486+ }
487+ }
488+ }
489+ }
599490
600491
601492
602-@Callable(i)
603-func buyArtwork (artId,issuer) = buyMint(i, artId, issuer, "", "")
604-
605-
606-
607-@Callable(i)
608-func setBid (artId,issuer) = {
609- let $t02566925707 = idCallerDate(i)
610- let id = $t02566925707._1
611- let caller = $t02566925707._2
612- let date = $t02566925707._3
613- let $t02571225748 = isPayment(i)
614- let payment = $t02571225748._1
615- let amount = $t02571225748._2
616- let assetId = if (!(isDefined(payment.assetId)))
617- then "WAVES"
618- else toBase58String(value(payment.assetId))
619- if (!(acceptedAssetIds(assetId)))
620- then throw("Something went wrong!")
621- else if (!(validateMinSell(assetId, amount)))
622- then throw("Something went wrong!")
493+@Callable(invoke)
494+func buyArtwork (artId,issuer) = if (!(dappRunning))
495+ then throw(maintenanceMSG)
496+ else {
497+ let id = toBase58String(invoke.transactionId)
498+ let caller = toBase58String(invoke.caller.bytes)
499+ let totalNFT = getIntegerByKey("total_nft_issued")
500+ let signID = getStringByKey(keyArtSignID(issuer, artId))
501+ let artworkName = getStringByKey(keyArtName(issuer, artId))
502+ if ((artworkName == ""))
503+ then throw("Art doesn't exist")
623504 else {
624- let amountSold = getIntegerByKey(keyIssued(issuer, artId))
625- let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId))
626- if ((amountSold >= maxCanSell))
627- then throw("Sold out, you cannot bid")
628- else [StringEntry((((((((("bid_" + artId) + "_") + issuer) + "_") + caller) + "_") + id) + "_OPEN"), ((((assetId + "_") + toString(amount)) + "_") + toString(date)))]
505+ let displayCID = getStringByKey(keyArtDisplayCid(issuer, artId))
506+ let exportCID = getStringByKey(keyArtExportCid(issuer, artId))
507+ let exportHash = getStringByKey(keyArtExportHash(issuer, artId))
508+ let licenceCID = getStringByKey(keyArtLicenceCid(issuer, artId))
509+ let licenceHash = getStringByKey(keyArtLicenceHash(issuer, artId))
510+ let description = take(getStringByKey(keyArtDesc(issuer, artId)), 50)
511+ let isOnSale = getBooleanByKey(keyArtOnSale(issuer, artId))
512+ let amountSold = getIntegerByKey(keyArtIssued(issuer, artId))
513+ let artworkPrice = getIntegerByKey(keyArtPrice(issuer, artId))
514+ let priceAssetId = getStringByKey(keyArtAssetIdAccepted(issuer, artId))
515+ let sourceHash = getStringByKey(keyArtHashByTxidAddr(issuer, artId))
516+ let maxCanSell = getIntegerByKey(keyArtMaxMint(issuer, artId))
517+ if (if (if ((0 >= artworkPrice))
518+ then true
519+ else !(isOnSale))
520+ then true
521+ else (0 >= maxCanSell))
522+ then throw("Art not for sale")
523+ else {
524+ let $t02317523255 = validatePriceAssetId(invoke, priceAssetId, artworkPrice)
525+ let amount = $t02317523255._1
526+ let assetId = $t02317523255._2
527+ let isWhitelisted = checkWhitelist(issuer)
528+ let cut = if ((isWhitelisted > height))
529+ then 0
530+ else if ((priceAssetId == toBase58String(signAssetId)))
531+ then signCut
532+ else usdnWaveCut
533+ let amountForSign = fraction(amount, cut, 100)
534+ let amountForCreator = (amount - amountForSign)
535+ if ((amountSold == maxCanSell))
536+ then throw("Art sold out")
537+ else {
538+ let newAmountSold = (amountSold + 1)
539+ let entryDate = lastBlock.timestamp
540+ let issueMeta = ((((((((((((((((((((((((((("Creator: " + issuer) + ",
541+ ArtID: ") + artId) + ",
542+ SignID: ") + signID) + ",
543+ Artwork name: ") + artworkName) + ",
544+ Artwork description: ") + description) + ",
545+ Issue: ") + toString(newAmountSold)) + "/") + toString(maxCanSell)) + ",
546+ Max issuable: ") + toString(maxCanSell)) + ",
547+ Source hash: ") + sourceHash) + ",
548+ Display cid: ") + displayCID) + ",
549+ Export cid: ") + exportCID) + ",
550+ Export hash: ") + exportHash) + ",
551+ Licence cid: ") + licenceCID) + ",
552+ Licence hash: ") + licenceHash)
553+ let issueNFT = Issue(("SA_" + toString((totalNFT + 1))), issueMeta, 1, 0, false)
554+ let idNFT = calculateAssetId(issueNFT)
555+ let sellStatus = if ((newAmountSold == maxCanSell))
556+ then false
557+ else true
558+[IntegerEntry(keyArtIssued(issuer, artId), newAmountSold), StringEntry(("nft_" + toBase58String(idNFT)), ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer)), StringEntry(((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer), ((((((((((caller + "_") + toString(entryDate)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + toBase58String(idNFT))), IntegerEntry("total_nft_issued", (totalNFT + 1)), BooleanEntry(keyArtOnSale(issuer, artId), sellStatus), issueNFT, ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId), ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId), ScriptTransfer(invoke.caller, 1, idNFT)]
559+ }
560+ }
629561 }
630- }
631-
632-
633-
634-@Callable(i)
635-func acceptBid (artId,issuer,bidId,bidOwner) = {
636- let caller = toBase58String(i.caller.bytes)
637- if ((caller != issuer))
638- then throw("You cannot do this action")
639- else buyMint(i, artId, issuer, bidId, bidOwner)
640- }
641-
642-
643-
644-@Callable(i)
645-func cancelBid (artId,issuer,bidId,bidOwner) = {
646- let $t02683126869 = idCallerDate(i)
647- let id = $t02683126869._1
648- let caller = $t02683126869._2
649- let date = $t02683126869._3
650- if (if ((caller != bidOwner))
651- then (caller != issuer)
652- else false)
653- then throw("You cannot do this action")
654- else {
655- let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId)
656- let bidData = getStringByKey((bidDataKey + "_OPEN"))
657- if ((bidData == ""))
658- then throw("Bid not found")
659- else {
660- let bidDataArr = split(bidData, "_")
661- let assetId = if ((bidDataArr[0] == "WAVES"))
662- then unit
663- else fromBase58String(bidDataArr[0])
664- let bidStatus = if ((caller == bidOwner))
665- then "CANCELED"
666- else "REJECTED"
667-[DeleteEntry((bidDataKey + "_OPEN")), StringEntry(((bidDataKey + "_") + bidStatus), ((bidData + "_") + toString(date))), ScriptTransfer(Address(fromBase58String(bidOwner)), parseIntValue(bidDataArr[1]), assetId)]
668- }
669- }
670- }
562+ }
671563
672564
673565
674566 @Callable(i)
675567 func deleteEntry (entry) = {
676568 let caller = toString(addressFromPublicKey(i.callerPublicKey))
677569 if ((caller == chris))
678570 then [DeleteEntry(entry)]
679571 else throw("no")
680572 }
681573
682574

github/deemru/w8io/026f985 
104.76 ms