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:AAIEAAAAAAAAAEEIAhIOCgwICAgICAgBCAgICAgSDQoLCAgICAgBCAgICAgSBQoDCAgIEgQKAggIEgYKBAgBAQgSBAoCCAgSAwoBCAAAAD8AAAAACHVuaXRUZXN0BwAAAAAJb3JhY2xlRmVlCQEAAAAFdmFsdWUAAAABCQAEJgAAAAECAAAAIzNOMnM1UnRhSFBCZW5Dc3gyRUNjb0ZSYllIeDNub1poWFcxAAAAAAhzaWduRGFwcAkBAAAABXZhbHVlAAAAAQkABCYAAAABAgAAACMzTkMyOGhTaXZybXNUVVhhWUQxeDZMMzYySjRacFVub1RkQgAAAAALZmVlUmVjZWl2ZXICAAAAIzNOMUU2dFhkZFJvVmFSZlE5ZFEzdmc1TGFXMmZzZDhIS3ViAAAAAAh1c2VyRGFwcAMFAAAACHVuaXRUZXN0CQEAAAAFdmFsdWUAAAABCQAEJgAAAAECAAAAIzNNdDRSR01FeWpTV1lBb2NUUHFkNTV3ZEhRUUIzUFUyVUNtCQEAAAAFdmFsdWUAAAABCQAEJgAAAAECAAAAIzNNd0RaYWdvWUVpTmZRTGMzMWNHcFlvYUU1N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AAVhcnRJZAUAAAAKc2VsbFN0YXR1cwkABEwAAAACBQAAAAhpc3N1ZU5GVAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAAHQWRkcmVzcwAAAAEJAAJZAAAAAQUAAAAGaXNzdWVyBQAAABBhbW91bnRGb3JDcmVhdG9yBQAAAAdhc3NldElkCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAAAdBZGRyZXNzAAAAAQkAAlkAAAABBQAAAAtmZWVSZWNlaXZlcgUAAAANYW1vdW50Rm9yU2lnbgUAAAAHYXNzZXRJZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAAGaW52b2tlAAAABmNhbGxlcgAAAAAAAAAAAQUAAAAFaWRORlQFAAAAA25pbAAAAAFpAQAAAAtkZWxldGVFbnRyeQAAAAEAAAAFZW50cnkEAAAABmNhbGxlcgkABCUAAAABCQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABCAUAAAABaQAAAA9jYWxsZXJQdWJsaWNLZXkDCQAAAAAAAAIFAAAABmNhbGxlcgUAAAAFY2hyaXMJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQUAAAAFZW50cnkFAAAAA25pbAkAAAIAAAABAgAAAAJubwAAAAANor4O", "height": 1371790, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2tuuSoS9eFHCMqh9zhj9k9YpcLknNx7FcWHLSPQSAWfk Next: 7fKG7vgPsYDfKNmWV8BVAzzrUFzJXvZUif2G6jT5JFZY Diff:
Old | New | Differences | |
---|---|---|---|
88 | 88 | func keyUserStatus (caller) = ("user_status_" + caller) | |
89 | 89 | ||
90 | 90 | ||
91 | - | func | |
91 | + | func keyArtDate (caller,artId) = ((("art_date_" + artId) + "_") + caller) | |
92 | 92 | ||
93 | 93 | ||
94 | - | func | |
94 | + | func keyArtName (caller,artId) = ((("art_name_" + artId) + "_") + caller) | |
95 | 95 | ||
96 | 96 | ||
97 | - | func | |
97 | + | func keyArtDesc (caller,artId) = ((("art_desc_" + artId) + "_") + caller) | |
98 | 98 | ||
99 | 99 | ||
100 | - | func | |
100 | + | func keyArtDisplayCid (caller,artId) = ((("art_display_cid_" + artId) + "_") + caller) | |
101 | 101 | ||
102 | 102 | ||
103 | - | func | |
103 | + | func keyArtExportHash (caller,artId) = ((("art_export_hash_" + artId) + "_") + caller) | |
104 | 104 | ||
105 | 105 | ||
106 | - | func | |
106 | + | func keyArtExportCid (caller,artId) = ((("art_export_cid_" + artId) + "_") + caller) | |
107 | 107 | ||
108 | 108 | ||
109 | - | func | |
109 | + | func keyArtMaxMint (caller,artId) = ((("art_maxmint_" + artId) + "_") + caller) | |
110 | 110 | ||
111 | 111 | ||
112 | - | func | |
112 | + | func keyArtSignID (caller,artId) = ((("art_signid_" + artId) + "_") + caller) | |
113 | 113 | ||
114 | 114 | ||
115 | - | func | |
115 | + | func keyArtIssued (caller,artId) = ((("art_issued_" + artId) + "_") + caller) | |
116 | 116 | ||
117 | 117 | ||
118 | - | func | |
118 | + | func keyArtOnSale (caller,artId) = ((("art_onsale_" + artId) + "_") + caller) | |
119 | 119 | ||
120 | 120 | ||
121 | - | func | |
121 | + | func keyArtLicenceHash (caller,artId) = ((("art_licence_hash_" + artId) + "_") + caller) | |
122 | 122 | ||
123 | 123 | ||
124 | - | func | |
124 | + | func keyArtLicenceCid (caller,artId) = ((("art_licence_cid_" + artId) + "_") + caller) | |
125 | 125 | ||
126 | 126 | ||
127 | - | func | |
127 | + | func keyArtTags (caller,artId) = ((("art_tags_" + artId) + "_") + caller) | |
128 | 128 | ||
129 | 129 | ||
130 | - | func | |
130 | + | func keyArtType (caller,artId) = ((("art_type_" + artId) + "_") + caller) | |
131 | 131 | ||
132 | 132 | ||
133 | - | func | |
133 | + | func keyArtPrice (caller,artId) = ((("art_price_" + artId) + "_") + caller) | |
134 | 134 | ||
135 | 135 | ||
136 | - | func | |
136 | + | func keyArtAssetIdAccepted (caller,artId) = ((("art_assetAccepted_" + artId) + "_") + caller) | |
137 | 137 | ||
138 | 138 | ||
139 | - | func | |
139 | + | func keyArtFlag (caller,artId) = ((("art_flag_" + artId) + "_") + caller) | |
140 | 140 | ||
141 | 141 | ||
142 | - | func | |
142 | + | func keyArtHashByTxidAddr (caller,txid) = ((("get_hashbytxidaddr_" + txid) + "_") + caller) | |
143 | 143 | ||
144 | 144 | ||
145 | - | func | |
145 | + | func keyArtOwnerByHash (sha256Hash) = ("get_owner_by_hash_" + sha256Hash) | |
146 | 146 | ||
147 | 147 | ||
148 | - | func | |
148 | + | func keyArtArtidBySignid (caller,signId) = ((("get_artidbysignid_" + signId) + "_") + caller) | |
149 | 149 | ||
150 | 150 | ||
151 | - | func | |
151 | + | func keyArtTxidByHashOwner (sha256Hash,caller) = ("get_txid_by_hash_owner_" + toBase58String(sha256_16Kb(toBytes((sha256Hash + caller))))) | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func validateAllCID (cidDisplay,cidExport,cidLicence) = if (!(validateCID(cidDisplay))) | |
223 | 223 | } | |
224 | 224 | ||
225 | 225 | ||
226 | - | func | |
226 | + | func validatePayment (invoke) = if ((size(invoke.payments) == 0)) | |
227 | 227 | then throw("No payment attached") | |
228 | 228 | else { | |
229 | - | let payment = value( | |
229 | + | let payment = value(invoke.payments[0]) | |
230 | 230 | 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) | |
232 | 240 | } | |
233 | 241 | ||
234 | 242 | ||
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)) { | |
252 | 244 | case b: Int => | |
253 | 245 | if ((b != 0)) | |
254 | 246 | then true | |
258 | 250 | } | |
259 | 251 | ||
260 | 252 | ||
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) | |
265 | 256 | let assetId = if (!(isDefined(payment.assetId))) | |
266 | 257 | then unit | |
267 | 258 | else if (if ((size(priceAssetId) > 0)) | |
279 | 270 | } | |
280 | 271 | ||
281 | 272 | ||
282 | - | func acceptedAssetIds (assetId) = | |
273 | + | func acceptedAssetIds (assetId) = if (if (if ((assetId != toBase58String(signAssetId))) | |
283 | 274 | then (assetId != toBase58String(wavesAssetId)) | |
284 | - | else false) | |
285 | - | then (assetId != "WAVES") | |
286 | 275 | else false) | |
287 | 276 | then (assetId != toBase58String(usdnAssetId)) | |
288 | 277 | else false) | |
320 | 309 | } | |
321 | 310 | ||
322 | 311 | ||
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)) | |
341 | 314 | 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 | + | } | |
470 | 353 | ||
471 | 354 | ||
472 | 355 | ||
473 | - | @Callable( | |
356 | + | @Callable(invoke) | |
474 | 357 | func updateArtwork (txid,name,description,tags,type,maxmint,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence) = if (!(dappRunning)) | |
475 | 358 | then throw(maintenanceMSG) | |
476 | 359 | 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 | |
481 | 365 | let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, maxmint) | |
482 | 366 | if ((validateArtwork != "")) | |
483 | 367 | then throw("Something went wrong!") | |
484 | 368 | else { | |
485 | - | let entryExist = getStringByKey( | |
369 | + | let entryExist = getStringByKey(keyArtName(caller, txid)) | |
486 | 370 | if ((entryExist == "")) | |
487 | 371 | then throw("Entry not found") | |
488 | 372 | else { | |
489 | - | let flag = getStringByKey( | |
373 | + | let flag = getStringByKey(keyArtFlag(caller, txid)) | |
490 | 374 | if ((flag == "ILLEGAL")) | |
491 | 375 | then throw("Cannot update ILLEGAL artwork") | |
492 | 376 | else if (!(isArtMinted(caller, txid))) | |
493 | - | then [StringEntry( | |
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)] | |
494 | 378 | else throw("Already minted") | |
495 | 379 | } | |
496 | 380 | } | |
498 | 382 | ||
499 | 383 | ||
500 | 384 | ||
501 | - | @Callable( | |
385 | + | @Callable(invoke) | |
502 | 386 | 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) | |
506 | 389 | if (containsElement([chris, joep, toString(this)], caller)) | |
507 | 390 | then if ((flag == "CONSENT")) | |
508 | - | then [StringEntry( | |
391 | + | then [StringEntry(keyArtFlag(addr, artId), flag)] | |
509 | 392 | 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)) | |
514 | 399 | else throw("You are not allowed") | |
515 | 400 | } | |
516 | 401 | ||
517 | 402 | ||
518 | 403 | ||
519 | - | @Callable( | |
404 | + | @Callable(invoke) | |
520 | 405 | 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)) | |
525 | 409 | then addr | |
526 | 410 | else caller | |
527 | - | let entryExist = | |
411 | + | let entryExist = getStringByKey(keyArtName(addressToUse, artId)) | |
528 | 412 | if ((entryExist == "")) | |
529 | 413 | then throw("No art matching for this address") | |
530 | 414 | else { | |
531 | - | let sha256Hash = getStringByKey( | |
415 | + | let sha256Hash = getStringByKey(keyArtHashByTxidAddr(addressToUse, artId)) | |
532 | 416 | if ((sha256Hash == "")) | |
533 | 417 | then throw("No art hash matching for this address") | |
534 | 418 | else { | |
535 | - | let signID = getStringByKey( | |
419 | + | let signID = getStringByKey(keyArtSignID(addressToUse, artId)) | |
536 | 420 | if ((signID == "")) | |
537 | 421 | then throw("No SIGN ID matching") | |
538 | 422 | else { | |
539 | - | let dataToDelete = [DeleteEntry( | |
540 | - | if (!(isArtMinted( | |
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))) | |
541 | 425 | then if (!(dappRunning)) | |
542 | 426 | then throw(maintenanceMSG) | |
543 | 427 | else dataToDelete | |
551 | 435 | ||
552 | 436 | ||
553 | 437 | ||
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) | |
590 | 471 | 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 | + | } | |
599 | 490 | ||
600 | 491 | ||
601 | 492 | ||
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") | |
623 | 504 | 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 | + | } | |
629 | 561 | } | |
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 | + | } | |
671 | 563 | ||
672 | 564 | ||
673 | 565 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let unitTest = false | |
5 | 5 | ||
6 | 6 | let oracleFee = value(addressFromString("3N2s5RtaHPBenCsx2ECcoFRbYHx3noZhXW1")) | |
7 | 7 | ||
8 | 8 | let signDapp = value(addressFromString("3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB")) | |
9 | 9 | ||
10 | 10 | let feeReceiver = "3N1E6tXddRoVaRfQ9dQ3vg5LaW2fsd8HKub" | |
11 | 11 | ||
12 | 12 | let userDapp = if (unitTest) | |
13 | 13 | then value(addressFromString("3Mt4RGMEyjSWYAocTPqd55wdHQQB3PU2UCm")) | |
14 | 14 | else value(addressFromString("3MwDZagoYEiNfQLc31cGpYoaE54MGMwoFrZ")) | |
15 | 15 | ||
16 | 16 | let whitelistDapp = value(addressFromString("3N6BaV1dCB4zg43goNNHaCtvR13BcyJ5Gsq")) | |
17 | 17 | ||
18 | 18 | let signAssetId = base58'Gf9t8FA4H3ssoZPCwrg3KwUFCci8zuUFP9ssRsUY3s6a' | |
19 | 19 | ||
20 | 20 | let usdnAssetId = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT' | |
21 | 21 | ||
22 | 22 | let wavesAssetId = base58'' | |
23 | 23 | ||
24 | 24 | let chris = "3MsG6jPNCrVJUtYB7XJBxS7utWsXAf4n9Vp" | |
25 | 25 | ||
26 | 26 | let joep = "3Mzm4VLwsN9uZwbTMzPj3XuxV6kEfAR8UDN" | |
27 | 27 | ||
28 | 28 | let signCut = 7 | |
29 | 29 | ||
30 | 30 | let usdnWaveCut = 10 | |
31 | 31 | ||
32 | 32 | let defaultLicence = "bafybeifuyo4pqu54ismqgtb6e4h6kkvgx7zg4u3zibh2r7y6mb64i7bzza/licence.pdf" | |
33 | 33 | ||
34 | 34 | let defaultHashLicence = "a87758c354e30a9e78fb84fa3a0010a5090ab20df0be11ad45b5720cc187e639" | |
35 | 35 | ||
36 | 36 | let dappRunning = valueOrElse(getBoolean(userDapp, "conf_dapp_is_running"), true) | |
37 | 37 | ||
38 | 38 | let maintenanceMSG = valueOrElse(getString(userDapp, "conf_maintenance_msg"), "") | |
39 | 39 | ||
40 | 40 | let userSuspended = "SUSPENDED" | |
41 | 41 | ||
42 | 42 | let userRemoved = "REMOVED" | |
43 | 43 | ||
44 | 44 | let userUnregistered = "UNREGISTERED" | |
45 | 45 | ||
46 | 46 | let userAllowed = "ALLOWED" | |
47 | 47 | ||
48 | 48 | func getStringByKeyFromUsers (key) = valueOrElse(getString(userDapp, key), "") | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func getStringByKey (key) = valueOrElse(getString(this, key), "") | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func getIntegerByKeyFromOracle (key) = valueOrErrorMessage(getInteger(oracleFee, key), "Integer undefine or 0 in oracle") | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 0) | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func checkWhitelist (key) = valueOrElse(getInteger(whitelistDapp, key), 0) | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func getBooleanByKey (key) = valueOrElse(getBoolean(this, key), false) | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func checkSignCertificate (signID,Owner,sha256Hash) = match getString(signDapp, ((("data_fc_" + signID) + "_") + Owner)) { | |
67 | 67 | case a: String => | |
68 | 68 | if (contains(a, sha256Hash)) | |
69 | 69 | then true | |
70 | 70 | else false | |
71 | 71 | case _ => | |
72 | 72 | false | |
73 | 73 | } | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func validateCID (cid) = if (contains(cid, "/")) | |
77 | 77 | then if (if ((76 > size(cid))) | |
78 | 78 | then (size(split(cid, "/")[0]) == 59) | |
79 | 79 | else false) | |
80 | 80 | then (16 > size(split(cid, "/")[1])) | |
81 | 81 | else false | |
82 | 82 | else false | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func validateHash (hash) = (size(hash) == 64) | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func keyUserStatus (caller) = ("user_status_" + caller) | |
89 | 89 | ||
90 | 90 | ||
91 | - | func | |
91 | + | func keyArtDate (caller,artId) = ((("art_date_" + artId) + "_") + caller) | |
92 | 92 | ||
93 | 93 | ||
94 | - | func | |
94 | + | func keyArtName (caller,artId) = ((("art_name_" + artId) + "_") + caller) | |
95 | 95 | ||
96 | 96 | ||
97 | - | func | |
97 | + | func keyArtDesc (caller,artId) = ((("art_desc_" + artId) + "_") + caller) | |
98 | 98 | ||
99 | 99 | ||
100 | - | func | |
100 | + | func keyArtDisplayCid (caller,artId) = ((("art_display_cid_" + artId) + "_") + caller) | |
101 | 101 | ||
102 | 102 | ||
103 | - | func | |
103 | + | func keyArtExportHash (caller,artId) = ((("art_export_hash_" + artId) + "_") + caller) | |
104 | 104 | ||
105 | 105 | ||
106 | - | func | |
106 | + | func keyArtExportCid (caller,artId) = ((("art_export_cid_" + artId) + "_") + caller) | |
107 | 107 | ||
108 | 108 | ||
109 | - | func | |
109 | + | func keyArtMaxMint (caller,artId) = ((("art_maxmint_" + artId) + "_") + caller) | |
110 | 110 | ||
111 | 111 | ||
112 | - | func | |
112 | + | func keyArtSignID (caller,artId) = ((("art_signid_" + artId) + "_") + caller) | |
113 | 113 | ||
114 | 114 | ||
115 | - | func | |
115 | + | func keyArtIssued (caller,artId) = ((("art_issued_" + artId) + "_") + caller) | |
116 | 116 | ||
117 | 117 | ||
118 | - | func | |
118 | + | func keyArtOnSale (caller,artId) = ((("art_onsale_" + artId) + "_") + caller) | |
119 | 119 | ||
120 | 120 | ||
121 | - | func | |
121 | + | func keyArtLicenceHash (caller,artId) = ((("art_licence_hash_" + artId) + "_") + caller) | |
122 | 122 | ||
123 | 123 | ||
124 | - | func | |
124 | + | func keyArtLicenceCid (caller,artId) = ((("art_licence_cid_" + artId) + "_") + caller) | |
125 | 125 | ||
126 | 126 | ||
127 | - | func | |
127 | + | func keyArtTags (caller,artId) = ((("art_tags_" + artId) + "_") + caller) | |
128 | 128 | ||
129 | 129 | ||
130 | - | func | |
130 | + | func keyArtType (caller,artId) = ((("art_type_" + artId) + "_") + caller) | |
131 | 131 | ||
132 | 132 | ||
133 | - | func | |
133 | + | func keyArtPrice (caller,artId) = ((("art_price_" + artId) + "_") + caller) | |
134 | 134 | ||
135 | 135 | ||
136 | - | func | |
136 | + | func keyArtAssetIdAccepted (caller,artId) = ((("art_assetAccepted_" + artId) + "_") + caller) | |
137 | 137 | ||
138 | 138 | ||
139 | - | func | |
139 | + | func keyArtFlag (caller,artId) = ((("art_flag_" + artId) + "_") + caller) | |
140 | 140 | ||
141 | 141 | ||
142 | - | func | |
142 | + | func keyArtHashByTxidAddr (caller,txid) = ((("get_hashbytxidaddr_" + txid) + "_") + caller) | |
143 | 143 | ||
144 | 144 | ||
145 | - | func | |
145 | + | func keyArtOwnerByHash (sha256Hash) = ("get_owner_by_hash_" + sha256Hash) | |
146 | 146 | ||
147 | 147 | ||
148 | - | func | |
148 | + | func keyArtArtidBySignid (caller,signId) = ((("get_artidbysignid_" + signId) + "_") + caller) | |
149 | 149 | ||
150 | 150 | ||
151 | - | func | |
151 | + | func keyArtTxidByHashOwner (sha256Hash,caller) = ("get_txid_by_hash_owner_" + toBase58String(sha256_16Kb(toBytes((sha256Hash + caller))))) | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func validateAllCID (cidDisplay,cidExport,cidLicence) = if (!(validateCID(cidDisplay))) | |
155 | 155 | then throw("Wrong Display CID") | |
156 | 156 | else if (!(validateCID(cidExport))) | |
157 | 157 | then throw("Wrong Export CID") | |
158 | 158 | else if (if ((cidLicence != "")) | |
159 | 159 | then !(validateCID(cidLicence)) | |
160 | 160 | else false) | |
161 | 161 | then throw("Wrong Licence CID") | |
162 | 162 | else true | |
163 | 163 | ||
164 | 164 | ||
165 | 165 | func validateAllHash (sha256Export,sha256Licence) = if (!(validateHash(sha256Export))) | |
166 | 166 | then throw("Export Hash 64 char. max") | |
167 | 167 | else if (!(validateHash(sha256Licence))) | |
168 | 168 | then throw("Licence Hash 64 char. max") | |
169 | 169 | else true | |
170 | 170 | ||
171 | 171 | ||
172 | 172 | func validateString (str,max) = if ((size(str) == 0)) | |
173 | 173 | then throw("Field cannot be is empty") | |
174 | 174 | else if ((size(str) > max)) | |
175 | 175 | then throw((str + " is too long")) | |
176 | 176 | else true | |
177 | 177 | ||
178 | 178 | ||
179 | 179 | func validateUser (caller) = { | |
180 | 180 | let userStatus = valueOrElse(getString(userDapp, keyUserStatus(caller)), userUnregistered) | |
181 | 181 | if (if ((userStatus == userUnregistered)) | |
182 | 182 | then true | |
183 | 183 | else (userStatus == userAllowed)) | |
184 | 184 | then "Register this account first with \"Account\" tab" | |
185 | 185 | else if ((userStatus == userSuspended)) | |
186 | 186 | then "Account suspended" | |
187 | 187 | else if ((userStatus == userRemoved)) | |
188 | 188 | then "Account removed" | |
189 | 189 | else "" | |
190 | 190 | } | |
191 | 191 | ||
192 | 192 | ||
193 | 193 | func setLIcence (cidLicence,sha256Licence) = { | |
194 | 194 | let cid = if ((size(cidLicence) == 0)) | |
195 | 195 | then defaultLicence | |
196 | 196 | else cidLicence | |
197 | 197 | let hash = if ((size(sha256Licence) == 0)) | |
198 | 198 | then defaultHashLicence | |
199 | 199 | else sha256Licence | |
200 | 200 | $Tuple2(cid, hash) | |
201 | 201 | } | |
202 | 202 | ||
203 | 203 | ||
204 | 204 | func validateArtworkData (caller,cidDisplay,cidExport,licenceCID,sha256Export,licenceHash,name,description,tags,maxmint) = { | |
205 | 205 | let checkUser = validateUser(caller) | |
206 | 206 | if ((checkUser != "")) | |
207 | 207 | then throw(checkUser) | |
208 | 208 | else if ((size(cidDisplay) == 0)) | |
209 | 209 | then throw("Display CID cannot be empty") | |
210 | 210 | else if (!(validateAllCID(cidDisplay, cidExport, licenceCID))) | |
211 | 211 | then throw("Problem with CID") | |
212 | 212 | else if (!(validateAllHash(sha256Export, licenceHash))) | |
213 | 213 | then throw("Problem with Hashes") | |
214 | 214 | else if (!(validateString(name, 100))) | |
215 | 215 | then throw("100 Char. max name") | |
216 | 216 | else if (!(validateString(description, 1000))) | |
217 | 217 | then throw("1000 Char. max description") | |
218 | 218 | else if ((size(split(tags, ",")) > 5)) | |
219 | 219 | then throw("5 tags max.") | |
220 | 220 | else if ((maxmint > 10)) | |
221 | 221 | then throw("10 editions max per artwork") | |
222 | 222 | else "" | |
223 | 223 | } | |
224 | 224 | ||
225 | 225 | ||
226 | - | func | |
226 | + | func validatePayment (invoke) = if ((size(invoke.payments) == 0)) | |
227 | 227 | then throw("No payment attached") | |
228 | 228 | else { | |
229 | - | let payment = value( | |
229 | + | let payment = value(invoke.payments[0]) | |
230 | 230 | 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) | |
232 | 240 | } | |
233 | 241 | ||
234 | 242 | ||
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)) { | |
252 | 244 | case b: Int => | |
253 | 245 | if ((b != 0)) | |
254 | 246 | then true | |
255 | 247 | else false | |
256 | 248 | case _ => | |
257 | 249 | false | |
258 | 250 | } | |
259 | 251 | ||
260 | 252 | ||
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) | |
265 | 256 | let assetId = if (!(isDefined(payment.assetId))) | |
266 | 257 | then unit | |
267 | 258 | else if (if ((size(priceAssetId) > 0)) | |
268 | 259 | then (toBase58String(value(payment.assetId)) == priceAssetId) | |
269 | 260 | else false) | |
270 | 261 | then payment.assetId | |
271 | 262 | else throw("Wrong asset id") | |
272 | 263 | if (if ((assetId == unit)) | |
273 | 264 | then (priceAssetId != "") | |
274 | 265 | else false) | |
275 | 266 | then throw("Wrong asset id") | |
276 | 267 | else if ((artworkPrice != amount)) | |
277 | 268 | then throw("Payment don't match") | |
278 | 269 | else $Tuple2(amount, assetId) | |
279 | 270 | } | |
280 | 271 | ||
281 | 272 | ||
282 | - | func acceptedAssetIds (assetId) = | |
273 | + | func acceptedAssetIds (assetId) = if (if (if ((assetId != toBase58String(signAssetId))) | |
283 | 274 | then (assetId != toBase58String(wavesAssetId)) | |
284 | - | else false) | |
285 | - | then (assetId != "WAVES") | |
286 | 275 | else false) | |
287 | 276 | then (assetId != toBase58String(usdnAssetId)) | |
288 | 277 | else false) | |
289 | 278 | then throw("Only SIGN, USDN or WAVES accepted") | |
290 | 279 | else true | |
291 | 280 | ||
292 | 281 | ||
293 | 282 | func validateMinSell (assetId,price) = { | |
294 | 283 | let minSellWaves = if (unitTest) | |
295 | 284 | then 1 | |
296 | 285 | else getIntegerByKeyFromOracle("waves_min_sell") | |
297 | 286 | let minSellUsdn = 1000000 | |
298 | 287 | let minSellSign = if (unitTest) | |
299 | 288 | then 1 | |
300 | 289 | else (getIntegerByKeyFromOracle(("certification_fee_" + toBase58String(signAssetId))) * 2) | |
301 | 290 | if (if (if (if (if ((assetId == toBase58String(usdnAssetId))) | |
302 | 291 | then (minSellUsdn > price) | |
303 | 292 | else false) | |
304 | 293 | then (price != 0) | |
305 | 294 | else false) | |
306 | 295 | then true | |
307 | 296 | else if (if ((assetId == toBase58String(signAssetId))) | |
308 | 297 | then (minSellSign > price) | |
309 | 298 | else false) | |
310 | 299 | then (price != 0) | |
311 | 300 | else false) | |
312 | 301 | then true | |
313 | 302 | else if (if ((assetId == toBase58String(wavesAssetId))) | |
314 | 303 | then (minSellWaves > price) | |
315 | 304 | else false) | |
316 | 305 | then (price != 0) | |
317 | 306 | else false) | |
318 | 307 | then throw("Wrong minimum sell price") | |
319 | 308 | else true | |
320 | 309 | } | |
321 | 310 | ||
322 | 311 | ||
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)) | |
341 | 314 | 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 | + | } | |
470 | 353 | ||
471 | 354 | ||
472 | 355 | ||
473 | - | @Callable( | |
356 | + | @Callable(invoke) | |
474 | 357 | func updateArtwork (txid,name,description,tags,type,maxmint,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence) = if (!(dappRunning)) | |
475 | 358 | then throw(maintenanceMSG) | |
476 | 359 | 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 | |
481 | 365 | let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, maxmint) | |
482 | 366 | if ((validateArtwork != "")) | |
483 | 367 | then throw("Something went wrong!") | |
484 | 368 | else { | |
485 | - | let entryExist = getStringByKey( | |
369 | + | let entryExist = getStringByKey(keyArtName(caller, txid)) | |
486 | 370 | if ((entryExist == "")) | |
487 | 371 | then throw("Entry not found") | |
488 | 372 | else { | |
489 | - | let flag = getStringByKey( | |
373 | + | let flag = getStringByKey(keyArtFlag(caller, txid)) | |
490 | 374 | if ((flag == "ILLEGAL")) | |
491 | 375 | then throw("Cannot update ILLEGAL artwork") | |
492 | 376 | else if (!(isArtMinted(caller, txid))) | |
493 | - | then [StringEntry( | |
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)] | |
494 | 378 | else throw("Already minted") | |
495 | 379 | } | |
496 | 380 | } | |
497 | 381 | } | |
498 | 382 | ||
499 | 383 | ||
500 | 384 | ||
501 | - | @Callable( | |
385 | + | @Callable(invoke) | |
502 | 386 | 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) | |
506 | 389 | if (containsElement([chris, joep, toString(this)], caller)) | |
507 | 390 | then if ((flag == "CONSENT")) | |
508 | - | then [StringEntry( | |
391 | + | then [StringEntry(keyArtFlag(addr, artId), flag)] | |
509 | 392 | 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)) | |
514 | 399 | else throw("You are not allowed") | |
515 | 400 | } | |
516 | 401 | ||
517 | 402 | ||
518 | 403 | ||
519 | - | @Callable( | |
404 | + | @Callable(invoke) | |
520 | 405 | 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)) | |
525 | 409 | then addr | |
526 | 410 | else caller | |
527 | - | let entryExist = | |
411 | + | let entryExist = getStringByKey(keyArtName(addressToUse, artId)) | |
528 | 412 | if ((entryExist == "")) | |
529 | 413 | then throw("No art matching for this address") | |
530 | 414 | else { | |
531 | - | let sha256Hash = getStringByKey( | |
415 | + | let sha256Hash = getStringByKey(keyArtHashByTxidAddr(addressToUse, artId)) | |
532 | 416 | if ((sha256Hash == "")) | |
533 | 417 | then throw("No art hash matching for this address") | |
534 | 418 | else { | |
535 | - | let signID = getStringByKey( | |
419 | + | let signID = getStringByKey(keyArtSignID(addressToUse, artId)) | |
536 | 420 | if ((signID == "")) | |
537 | 421 | then throw("No SIGN ID matching") | |
538 | 422 | else { | |
539 | - | let dataToDelete = [DeleteEntry( | |
540 | - | if (!(isArtMinted( | |
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))) | |
541 | 425 | then if (!(dappRunning)) | |
542 | 426 | then throw(maintenanceMSG) | |
543 | 427 | else dataToDelete | |
544 | 428 | else if (containsElement([chris, toString(this)], caller)) | |
545 | 429 | then dataToDelete | |
546 | 430 | else throw("Art already minted, you cannot delete it") | |
547 | 431 | } | |
548 | 432 | } | |
549 | 433 | } | |
550 | 434 | } | |
551 | 435 | ||
552 | 436 | ||
553 | 437 | ||
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) | |
590 | 471 | 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 | + | } | |
599 | 490 | ||
600 | 491 | ||
601 | 492 | ||
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") | |
623 | 504 | 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 | + | } | |
629 | 561 | } | |
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 | + | } | |
671 | 563 | ||
672 | 564 | ||
673 | 565 | ||
674 | 566 | @Callable(i) | |
675 | 567 | func deleteEntry (entry) = { | |
676 | 568 | let caller = toString(addressFromPublicKey(i.callerPublicKey)) | |
677 | 569 | if ((caller == chris)) | |
678 | 570 | then [DeleteEntry(entry)] | |
679 | 571 | else throw("no") | |
680 | 572 | } | |
681 | 573 | ||
682 | 574 |
github/deemru/w8io/026f985 104.76 ms ◑