tx · 3b8EK6QdA3wvsyzRcUHwXuu341SWRCW3Ehmh6u4Lix7o 3N2Tdcx5fzxJAKP5hMp9W35Cp1EFzfiJ1zG: -0.01400000 Waves 2020.10.15 13:56 [1221583] smart account 3N2Tdcx5fzxJAKP5hMp9W35Cp1EFzfiJ1zG > SELF 0.00000000 Waves
{ "type": 13, "id": "3b8EK6QdA3wvsyzRcUHwXuu341SWRCW3Ehmh6u4Lix7o", "fee": 1400000, "feeAssetId": null, "timestamp": 1602759420275, "version": 2, "chainId": 84, "sender": "3N2Tdcx5fzxJAKP5hMp9W35Cp1EFzfiJ1zG", "senderPublicKey": "9SULUbW7L2jV2nv8v48Kdzox4cZ8jEfg778yJHJpgVwM", "proofs": [ "4otrJRqexFewKSB3LTwCDgzpZZgQcj33RgoCsBD35cHEBkqCjamA9MNEEVhizRwkW9V41zyWmfMKukn3BLrz4FRx" ], "script": "base64:AAIEAAAAAAAAAFoIAhIGCgQICAgIEgMKAQgSBgoECAgICBIECgIICBIDCgEIEg4KDAgICAgICAEICAgICBINCgsICAgICAEICAgICBIECgIICBIGCgQIAQEIEgQKAggIEgMKAQgAAAA6AAAAAA9zdG9yYWdlVmVyaWZpZXIJAQAAAAV2YWx1ZQAAAAEJAAQmAAAAAQIAAAAjM04yczVSdGFIUEJlbkNzeDJFQ2NvRlJiWUh4M25vWmhYVzEAAAAADHNpZ25WZXJpZmllcgkBAAAABXZhbHVlAAAAAQkABCYAAAABAgAAACMzTkMyOGhTaXZybXNUVVhhWUQxeDZMMzYySjRacFVub1RkQgAAAAALZmVlUmVjZWl2ZXICAAAAIzNOMUU2dFhkZFJvVmFSZlE5ZFEzdmc1TGFXMmZzZDhIS3ViAAAAAAtzaWduQXNzZXRJZAEAAAAg6KVqvMp3QvJwYTI1Sk9Fg7m5HuWZZxfDcerZC6EEresAAAAAC3VzZG5Bc3NldElkAQAAACAP8hwSrOTEPJrsRhqrJaiw7LoHK0bMbYhy8LXikkkBtAAAAAAMd2F2ZXNBc3NldEl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AQkBAAAADGtleVVzZXJUaHVtYgAAAAEFAAAAB2FkZHJlc3MJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkBAAAADWtleVVzZXJTdGF0dXMAAAABBQAAAAdhZGRyZXNzBQAAAAt1c2VyUmVtb3ZlZAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAAA5sYXN0X2ludm9rZV9pZAUAAAACaWQFAAAAA25pbAkAAAIAAAABAgAAABNZb3UgYXJlIG5vdCBhbGxvd2VkAAAAAJD3cOI=", "height": 1221583, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HdEyAaGRNuY2Wixqq3D7um2AkTyxToZHmGie4tXScPBy Next: CxHg64HGcYtsbZ9MTpLG2yaupKsd14esi2545sDP313B Diff:
Old | New | Differences | |
---|---|---|---|
79 | 79 | } | |
80 | 80 | ||
81 | 81 | ||
82 | - | func validateNFTs (accumulator,id) = { | |
83 | - | let assetDetails = value(assetInfo(fromBase58String(id))) | |
84 | - | if (if (if ((assetDetails.quantity != 1)) | |
85 | - | then true | |
86 | - | else (assetDetails.decimals != 0)) | |
87 | - | then true | |
88 | - | else (assetDetails.reissuable != false)) | |
89 | - | then (accumulator + 0) | |
90 | - | else (accumulator + 1) | |
91 | - | } | |
92 | - | ||
93 | - | ||
94 | 82 | func validateCID (cid) = if (if ((75 > size(cid))) | |
95 | 83 | then (60 > size(split(cid, "/")[0])) | |
96 | 84 | else false) | |
99 | 87 | ||
100 | 88 | ||
101 | 89 | func validateHash (hash) = (65 > size(hash)) | |
102 | - | ||
103 | - | ||
104 | - | func verifyStatus (addr) = match getString(this, ("user_status_" + addr)) { | |
105 | - | case b: String => | |
106 | - | b | |
107 | - | case _ => | |
108 | - | throw("Something went wrong.") | |
109 | - | } | |
110 | 90 | ||
111 | 91 | ||
112 | 92 | func keyUserAddr (callerAddr) = ("user_" + callerAddr) | |
188 | 168 | ||
189 | 169 | ||
190 | 170 | func keyArtTxidByHashOwner (sha256Hash,callerAddr) = ("get_txid_by_hash_owner_" + toBase58String(sha256_16Kb(toBytes((sha256Hash + callerAddr))))) | |
171 | + | ||
172 | + | ||
173 | + | func validateAllCID (cidDisplay,cidExport,cidLicence) = if (if ((cidDisplay != "")) | |
174 | + | then !(validateCID(cidDisplay)) | |
175 | + | else false) | |
176 | + | then throw("Wrong Display CID length") | |
177 | + | else if (if ((cidExport != "")) | |
178 | + | then !(validateCID(cidExport)) | |
179 | + | else false) | |
180 | + | then throw("Wrong Export CID length") | |
181 | + | else if (if ((cidLicence != "")) | |
182 | + | then !(validateCID(cidLicence)) | |
183 | + | else false) | |
184 | + | then throw("Wrong Licence CID length") | |
185 | + | else true | |
186 | + | ||
187 | + | ||
188 | + | func validateAllHash (sha256Export,sha256Licence) = if (if ((sha256Export != "")) | |
189 | + | then !(validateHash(sha256Export)) | |
190 | + | else false) | |
191 | + | then throw("Export Hash should be 64 characters maximum") | |
192 | + | else if (if ((sha256Licence != "")) | |
193 | + | then !(validateHash(sha256Licence)) | |
194 | + | else false) | |
195 | + | then throw("Licence Hash should be 64 characters maximum") | |
196 | + | else true | |
197 | + | ||
198 | + | ||
199 | + | func validateString (str,max) = if ((size(str) == 0)) | |
200 | + | then throw("Field cannot be is empty") | |
201 | + | else if ((size(str) > max)) | |
202 | + | then throw((str + " is too long")) | |
203 | + | else true | |
191 | 204 | ||
192 | 205 | ||
193 | 206 | @Callable(i) | |
312 | 325 | func addArtwork (sha256Hash,signID,name,description,tags,type,maxmint,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence) = { | |
313 | 326 | let artId = toBase58String(invoke.transactionId) | |
314 | 327 | let callerAddress = toBase58String(invoke.caller.bytes) | |
315 | - | if (if ((cidDisplay != "")) | |
316 | - | then !(validateCID(cidDisplay)) | |
317 | - | else false) | |
318 | - | then throw("Wrong Display CID length") | |
319 | - | else if (if ((cidExport != "")) | |
320 | - | then !(validateCID(cidExport)) | |
321 | - | else false) | |
322 | - | then throw("Wrong Export CID length") | |
323 | - | else if (if ((cidLicence != "")) | |
324 | - | then !(validateCID(cidLicence)) | |
325 | - | else false) | |
326 | - | then throw("Wrong Licence CID length") | |
327 | - | else if (!(validateHash(sha256Hash))) | |
328 | - | then throw("Source Hash should be 64 characters maximum") | |
329 | - | else if (if ((sha256Export != "")) | |
330 | - | then !(validateHash(sha256Export)) | |
331 | - | else false) | |
332 | - | then throw("Export Hash should be 64 characters maximum") | |
333 | - | else if (if ((sha256Licence != "")) | |
334 | - | then !(validateHash(sha256Licence)) | |
328 | + | if (!(validateAllCID(cidDisplay, cidExport, cidLicence))) | |
329 | + | then throw("Problem with CID") | |
330 | + | else if (!(validateHash(sha256Hash))) | |
331 | + | then throw("Hash should be 64 characters maximum") | |
332 | + | else if (!(validateAllHash(sha256Export, sha256Licence))) | |
333 | + | then throw("Problem with Hashes") | |
334 | + | else if ((size(invoke.payments) == 0)) | |
335 | + | then throw("No payment attached") | |
336 | + | else { | |
337 | + | let payment = value(invoke.payments[0]) | |
338 | + | let amount = value(payment.amount) | |
339 | + | let assetId = if (if (isDefined(payment.assetId)) | |
340 | + | then (payment.assetId == signAssetId) | |
335 | 341 | else false) | |
336 | - | then throw("Licence Hash should be 64 characters maximum") | |
337 | - | else if ((size(invoke.payments) == 0)) | |
338 | - | then throw("No payment attached") | |
339 | - | else { | |
340 | - | let payment = value(invoke.payments[0]) | |
341 | - | let amount = value(payment.amount) | |
342 | - | let assetId = if (if (isDefined(payment.assetId)) | |
343 | - | then (payment.assetId == signAssetId) | |
344 | - | else false) | |
345 | - | then payment.assetId | |
346 | - | else throw("Only SIGN token accepted at the moment") | |
347 | - | let currentCertificationPrice = match getInteger(storageVerifier, ("certification_fee_" + toBase58String(signAssetId))) { | |
348 | - | case price: Int => | |
349 | - | price | |
350 | - | case _ => | |
351 | - | throw("Price undefined in oracle") | |
352 | - | } | |
353 | - | if ((amount != currentCertificationPrice)) | |
354 | - | then throw(("Payment amount should be " + toString(currentCertificationPrice))) | |
355 | - | else { | |
356 | - | let entryExist = getStringByKey(keyArtTxidByHashOwner(sha256Hash, callerAddress)) | |
357 | - | if ((entryExist != "")) | |
358 | - | then throw("You already added this artwork on Sign Art") | |
359 | - | else { | |
360 | - | let hashExist = getStringByKey(keyArtOwnerByHash(sha256Hash)) | |
361 | - | if ((hashExist != "")) | |
362 | - | then throw("This artwork hash is already registered on Sign Art") | |
363 | - | else { | |
364 | - | let isSignCertified = checkSignCertificate(signID, callerAddress, sha256Hash) | |
365 | - | if (!(isSignCertified)) | |
366 | - | then throw("Sign Certificate not found on Sign-web.app smart contract for this address.") | |
367 | - | else if ((size(cidDisplay) == 0)) | |
368 | - | then throw("Display CID cannot be empty") | |
369 | - | else if ((size(name) == 0)) | |
370 | - | then throw("Title cannot be empty") | |
371 | - | else if ((size(name) > 100)) | |
372 | - | then throw("100 Characters maximum for the name") | |
373 | - | else if ((size(description) > 1000)) | |
374 | - | then throw("1000 Characters maximum for the description") | |
375 | - | else if ((size(description) == 0)) | |
376 | - | then throw("Description cannot be empty") | |
377 | - | else { | |
378 | - | let tagsList = split(tags, ",") | |
379 | - | if ((size(tagsList) > 5)) | |
380 | - | then throw("Tags should be maximum 5 single word separated by space.") | |
381 | - | else { | |
382 | - | let userIsRegistered = match getString(this, ("user_status_" + callerAddress)) { | |
383 | - | case s: String => | |
384 | - | s | |
385 | - | case _ => | |
386 | - | userUnregistered | |
387 | - | } | |
388 | - | let timestamp = lastBlock.timestamp | |
389 | - | if (if (isDefined(userIsRegistered)) | |
390 | - | then (userIsRegistered == userUnregistered) | |
391 | - | else false) | |
392 | - | then throw("Please register this account first with \"User infos\" tab") | |
393 | - | else if ((userIsRegistered == userSuspended)) | |
394 | - | then throw("Your account is suspended") | |
395 | - | else if ((userIsRegistered == userRemoved)) | |
396 | - | then throw("Your account have been removed") | |
397 | - | else if ((maxmint > 10)) | |
398 | - | then throw("Maximum 10 editions per artwork") | |
399 | - | else if ((size(sha256Hash) != 64)) | |
400 | - | then throw("Hash should be sha256 string composed of 64 char.") | |
401 | - | else [StringEntry(keyArtOwnerByHash(sha256Hash), callerAddress), StringEntry(keyArtTxidByHashOwner(sha256Hash, callerAddress), artId), IntegerEntry(keyArtDate(callerAddress, artId), timestamp), StringEntry(keyArtName(callerAddress, artId), name), StringEntry(keyArtDesc(callerAddress, artId), description), StringEntry(keyArtDisplayCid(callerAddress, artId), cidDisplay), StringEntry(keyArtExportCid(callerAddress, artId), cidExport), StringEntry(keyArtExportHash(callerAddress, artId), sha256Export), StringEntry(keyArtLicenceHash(callerAddress, artId), sha256Licence), StringEntry(keyArtLicenceCid(callerAddress, artId), cidLicence), StringEntry(keyArtType(callerAddress, artId), type), StringEntry(keyArtTags(callerAddress, artId), tags), IntegerEntry(keyArtMaxMint(callerAddress, artId), maxmint), StringEntry(keyArtSignID(callerAddress, artId), signID), IntegerEntry(keyArtIssued(callerAddress, artId), 0), BooleanEntry(keyArtOnSale(callerAddress, artId), false), StringEntry(keyArtArtidBySignid(callerAddress, signID), artId), StringEntry("last_invoke_id", artId), StringEntry(keyArtHashByTxidAddr(callerAddress, artId), sha256Hash), ScriptTransfer(Address(fromBase58String(feeReceiver)), amount, assetId)] | |
402 | - | } | |
403 | - | } | |
404 | - | } | |
405 | - | } | |
406 | - | } | |
407 | - | } | |
342 | + | then payment.assetId | |
343 | + | else throw("Only SIGN token accepted at the moment") | |
344 | + | let currentCertificationPrice = match getInteger(storageVerifier, ("certification_fee_" + toBase58String(signAssetId))) { | |
345 | + | case price: Int => | |
346 | + | price | |
347 | + | case _ => | |
348 | + | throw("Price undefined in oracle") | |
349 | + | } | |
350 | + | if ((amount != currentCertificationPrice)) | |
351 | + | then throw(("Payment amount should be " + toString(currentCertificationPrice))) | |
352 | + | else { | |
353 | + | let entryExist = getStringByKey(keyArtTxidByHashOwner(sha256Hash, callerAddress)) | |
354 | + | if ((entryExist != "")) | |
355 | + | then throw("You already added this artwork on Sign Art") | |
356 | + | else { | |
357 | + | let hashExist = getStringByKey(keyArtOwnerByHash(sha256Hash)) | |
358 | + | if ((hashExist != "")) | |
359 | + | then throw("This artwork hash is already registered on Sign Art") | |
360 | + | else { | |
361 | + | let isSignCertified = checkSignCertificate(signID, callerAddress, sha256Hash) | |
362 | + | if (!(isSignCertified)) | |
363 | + | then throw("Sign Certificate not found on Sign-web.app smart contract for this address.") | |
364 | + | else if ((size(cidDisplay) == 0)) | |
365 | + | then throw("Display CID cannot be empty") | |
366 | + | else if (!(validateString(name, 100))) | |
367 | + | then throw("100 Characters maximum for the name") | |
368 | + | else if (!(validateString(description, 1000))) | |
369 | + | then throw("1000 Characters maximum for the description") | |
370 | + | else { | |
371 | + | let tagsList = split(tags, ",") | |
372 | + | if ((size(tagsList) > 5)) | |
373 | + | then throw("Tags should be maximum 5 single word separated by space.") | |
374 | + | else { | |
375 | + | let userIsRegistered = match getString(this, ("user_status_" + callerAddress)) { | |
376 | + | case s: String => | |
377 | + | s | |
378 | + | case _ => | |
379 | + | userUnregistered | |
380 | + | } | |
381 | + | let timestamp = lastBlock.timestamp | |
382 | + | if (if (isDefined(userIsRegistered)) | |
383 | + | then (userIsRegistered == userUnregistered) | |
384 | + | else false) | |
385 | + | then throw("Please register this account first with \"User infos\" tab") | |
386 | + | else if ((userIsRegistered == userSuspended)) | |
387 | + | then throw("Your account is suspended") | |
388 | + | else if ((userIsRegistered == userRemoved)) | |
389 | + | then throw("Your account have been removed") | |
390 | + | else if ((maxmint > 10)) | |
391 | + | then throw("Maximum 10 editions per artwork") | |
392 | + | else if ((size(sha256Hash) != 64)) | |
393 | + | then throw("Hash should be sha256 string composed of 64 char.") | |
394 | + | else [StringEntry(keyArtOwnerByHash(sha256Hash), callerAddress), StringEntry(keyArtTxidByHashOwner(sha256Hash, callerAddress), artId), IntegerEntry(keyArtDate(callerAddress, artId), timestamp), StringEntry(keyArtName(callerAddress, artId), name), StringEntry(keyArtDesc(callerAddress, artId), description), StringEntry(keyArtDisplayCid(callerAddress, artId), cidDisplay), StringEntry(keyArtExportCid(callerAddress, artId), cidExport), StringEntry(keyArtExportHash(callerAddress, artId), sha256Export), StringEntry(keyArtLicenceHash(callerAddress, artId), sha256Licence), StringEntry(keyArtLicenceCid(callerAddress, artId), cidLicence), StringEntry(keyArtType(callerAddress, artId), type), StringEntry(keyArtTags(callerAddress, artId), tags), IntegerEntry(keyArtMaxMint(callerAddress, artId), maxmint), StringEntry(keyArtSignID(callerAddress, artId), signID), IntegerEntry(keyArtIssued(callerAddress, artId), 0), BooleanEntry(keyArtOnSale(callerAddress, artId), false), StringEntry(keyArtArtidBySignid(callerAddress, signID), artId), StringEntry("last_invoke_id", artId), StringEntry(keyArtHashByTxidAddr(callerAddress, artId), sha256Hash), ScriptTransfer(Address(fromBase58String(feeReceiver)), amount, assetId)] | |
395 | + | } | |
396 | + | } | |
397 | + | } | |
398 | + | } | |
399 | + | } | |
400 | + | } | |
408 | 401 | } | |
409 | 402 | ||
410 | 403 | ||
413 | 406 | func updateArtwork (txid,name,description,tags,type,maxmint,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence) = { | |
414 | 407 | let updateId = toBase58String(invoke.transactionId) | |
415 | 408 | let callerAddress = toBase58String(invoke.caller.bytes) | |
416 | - | if (if ((cidDisplay != "")) | |
417 | - | then !(validateCID(cidDisplay)) | |
418 | - | else false) | |
419 | - | then throw("Wrong Display CID length") | |
420 | - | else if (if ((cidExport != "")) | |
421 | - | then !(validateCID(cidExport)) | |
422 | - | else false) | |
423 | - | then throw("Wrong Export CID length") | |
424 | - | else if (if ((cidLicence != "")) | |
425 | - | then !(validateCID(cidLicence)) | |
426 | - | else false) | |
427 | - | then throw("Wrong Licence CID length") | |
428 | - | else if (if ((sha256Export != "")) | |
429 | - | then !(validateHash(sha256Export)) | |
430 | - | else false) | |
431 | - | then throw("Export Hash should be 64 characters maximum") | |
432 | - | else if (if ((sha256Licence != "")) | |
433 | - | then !(validateHash(sha256Licence)) | |
434 | - | else false) | |
435 | - | then throw("Licence Hash should be 64 characters maximum") | |
436 | - | else { | |
437 | - | let entryExist = getStringByKey(keyArtName(callerAddress, txid)) | |
438 | - | if ((entryExist == "")) | |
439 | - | then throw("This entry doesn't exist or you are not the owner") | |
440 | - | else if ((size(name) == 0)) | |
441 | - | then throw("Title cannot be empty") | |
442 | - | else if ((size(name) > 100)) | |
443 | - | then throw("100 Characters maximum for the name") | |
444 | - | else if ((size(description) > 1000)) | |
445 | - | then throw("1000 Characters maximum for the description") | |
446 | - | else if ((size(description) == 0)) | |
447 | - | then throw("Description cannot be empty") | |
448 | - | else { | |
449 | - | let artworkMinted = match getInteger(this, keyArtIssued(callerAddress, txid)) { | |
450 | - | case b: Int => | |
451 | - | if ((b == 0)) | |
452 | - | then false | |
453 | - | else true | |
454 | - | case _ => | |
455 | - | false | |
456 | - | } | |
457 | - | let tagsList = split(tags, ",") | |
458 | - | if ((size(tagsList) > 5)) | |
459 | - | then throw("Tags should be maximum 5 single word separated by space.") | |
460 | - | else { | |
461 | - | let userIsRegistered = match getString(this, ("user_status_" + callerAddress)) { | |
462 | - | case s: String => | |
463 | - | s | |
464 | - | case _ => | |
465 | - | userUnregistered | |
466 | - | } | |
467 | - | if (if (isDefined(userIsRegistered)) | |
468 | - | then (userIsRegistered == userUnregistered) | |
469 | - | else false) | |
470 | - | then throw("Please register this account first with \"User infos\" tab") | |
471 | - | else if ((userIsRegistered == userSuspended)) | |
472 | - | then throw("Your account is suspended") | |
473 | - | else if ((userIsRegistered == userRemoved)) | |
474 | - | then throw("Your account have been removed") | |
475 | - | else if ((maxmint > 10)) | |
476 | - | then throw("Maximum 10 editions per artwork") | |
477 | - | else if (!(artworkMinted)) | |
478 | - | then [StringEntry(keyArtName(callerAddress, txid), name), StringEntry(keyArtDesc(callerAddress, txid), description), StringEntry(keyArtDisplayCid(callerAddress, txid), cidDisplay), StringEntry(keyArtExportCid(callerAddress, txid), cidExport), StringEntry(keyArtExportHash(callerAddress, txid), sha256Export), StringEntry(keyArtLicenceCid(callerAddress, txid), cidLicence), StringEntry(keyArtLicenceHash(callerAddress, txid), sha256Licence), IntegerEntry(keyArtMaxMint(callerAddress, txid), maxmint), StringEntry(keyArtTags(callerAddress, txid), tags), StringEntry(keyArtType(callerAddress, txid), type), StringEntry("last_invoke_id", updateId)] | |
479 | - | else throw("You cannot edit artwork that have already minted NFT(s)") | |
480 | - | } | |
481 | - | } | |
482 | - | } | |
409 | + | if (!(validateAllCID(cidDisplay, cidExport, cidLicence))) | |
410 | + | then throw("Problem with CID") | |
411 | + | else if (!(validateAllHash(sha256Export, sha256Licence))) | |
412 | + | then throw("Problem with Hashes") | |
413 | + | else { | |
414 | + | let entryExist = getStringByKey(keyArtName(callerAddress, txid)) | |
415 | + | if ((entryExist == "")) | |
416 | + | then throw("Entry not found") | |
417 | + | else if (!(validateString(name, 100))) | |
418 | + | then throw("100 Char. max for the name") | |
419 | + | else if (!(validateString(description, 1000))) | |
420 | + | then throw("1000 Char. max for the description") | |
421 | + | else { | |
422 | + | let artworkMinted = match getInteger(this, keyArtIssued(callerAddress, txid)) { | |
423 | + | case b: Int => | |
424 | + | if ((b == 0)) | |
425 | + | then false | |
426 | + | else true | |
427 | + | case _ => | |
428 | + | false | |
429 | + | } | |
430 | + | if ((size(split(tags, ",")) > 5)) | |
431 | + | then throw("5 tags max.") | |
432 | + | else { | |
433 | + | let userIsRegistered = match getString(this, ("user_status_" + callerAddress)) { | |
434 | + | case s: String => | |
435 | + | s | |
436 | + | case _ => | |
437 | + | userUnregistered | |
438 | + | } | |
439 | + | if (if (isDefined(userIsRegistered)) | |
440 | + | then (userIsRegistered == userUnregistered) | |
441 | + | else false) | |
442 | + | then throw("Please register this account first with \"User infos\" tab") | |
443 | + | else if ((userIsRegistered == userSuspended)) | |
444 | + | then throw("Your account is suspended") | |
445 | + | else if ((userIsRegistered == userRemoved)) | |
446 | + | then throw("Your account have been removed") | |
447 | + | else if ((maxmint > 10)) | |
448 | + | then throw("Maximum 10 editions per artwork") | |
449 | + | else if (!(artworkMinted)) | |
450 | + | then [StringEntry(keyArtName(callerAddress, txid), name), StringEntry(keyArtDesc(callerAddress, txid), description), StringEntry(keyArtDisplayCid(callerAddress, txid), cidDisplay), StringEntry(keyArtExportCid(callerAddress, txid), cidExport), StringEntry(keyArtExportHash(callerAddress, txid), sha256Export), StringEntry(keyArtLicenceCid(callerAddress, txid), cidLicence), StringEntry(keyArtLicenceHash(callerAddress, txid), sha256Licence), IntegerEntry(keyArtMaxMint(callerAddress, txid), maxmint), StringEntry(keyArtTags(callerAddress, txid), tags), StringEntry(keyArtType(callerAddress, txid), type), StringEntry("last_invoke_id", updateId)] | |
451 | + | else throw("You cannot edit artwork that have already minted NFT(s)") | |
452 | + | } | |
453 | + | } | |
454 | + | } | |
483 | 455 | } | |
484 | 456 | ||
485 | 457 | ||
681 | 653 | then true | |
682 | 654 | else (callerAddr == admin2)) | |
683 | 655 | then [DeleteEntry(keyUserDate(address)), DeleteEntry(keyUserAddr(address)), DeleteEntry(keyUserName(address)), DeleteEntry(keyUserDesc(address)), DeleteEntry(keyUserSocial(address)), DeleteEntry(keyUserThumb(address)), StringEntry(keyUserStatus(address), userRemoved), StringEntry("last_invoke_id", id)] | |
684 | - | else throw("You are not allowed | |
656 | + | else throw("You are not allowed") | |
685 | 657 | } | |
686 | 658 | ||
687 | 659 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let storageVerifier = value(addressFromString("3N2s5RtaHPBenCsx2ECcoFRbYHx3noZhXW1")) | |
5 | 5 | ||
6 | 6 | let signVerifier = value(addressFromString("3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB")) | |
7 | 7 | ||
8 | 8 | let feeReceiver = "3N1E6tXddRoVaRfQ9dQ3vg5LaW2fsd8HKub" | |
9 | 9 | ||
10 | 10 | let signAssetId = base58'Gf9t8FA4H3ssoZPCwrg3KwUFCci8zuUFP9ssRsUY3s6a' | |
11 | 11 | ||
12 | 12 | let usdnAssetId = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT' | |
13 | 13 | ||
14 | 14 | let wavesAssetId = base58'' | |
15 | 15 | ||
16 | 16 | let signCut = 8 | |
17 | 17 | ||
18 | 18 | let usdnCut = 10 | |
19 | 19 | ||
20 | 20 | let wavesCut = 10 | |
21 | 21 | ||
22 | 22 | let admin = "3MsG6jPNCrVJUtYB7XJBxS7utWsXAf4n9Vp" | |
23 | 23 | ||
24 | 24 | let admin2 = "3Mzm4VLwsN9uZwbTMzPj3XuxV6kEfAR8UDN" | |
25 | 25 | ||
26 | 26 | let WHITELISTEDONLY = true | |
27 | 27 | ||
28 | 28 | let userAllowed = "ALLOWED" | |
29 | 29 | ||
30 | 30 | let userRegistered = "REGISTERED" | |
31 | 31 | ||
32 | 32 | let userVerified = "VERIFIED" | |
33 | 33 | ||
34 | 34 | let userSuspended = "SUSPENDED" | |
35 | 35 | ||
36 | 36 | let userRemoved = "REMOVED" | |
37 | 37 | ||
38 | 38 | let userUnregistered = "UNREGISTERED" | |
39 | 39 | ||
40 | 40 | let userReset = "RESET" | |
41 | 41 | ||
42 | 42 | let onSale = "ON_SALE" | |
43 | 43 | ||
44 | 44 | let sold = "SOLD" | |
45 | 45 | ||
46 | 46 | let canceled = "CANCELED" | |
47 | 47 | ||
48 | 48 | func getStringByKey (key) = match getString(this, key) { | |
49 | 49 | case a: String => | |
50 | 50 | a | |
51 | 51 | case _ => | |
52 | 52 | "" | |
53 | 53 | } | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | func getIntegerByKey (key) = match getInteger(this, key) { | |
57 | 57 | case i: Int => | |
58 | 58 | i | |
59 | 59 | case _ => | |
60 | 60 | 0 | |
61 | 61 | } | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func getBooleanByKey (key) = match getBoolean(this, key) { | |
65 | 65 | case i: Boolean => | |
66 | 66 | i | |
67 | 67 | case _ => | |
68 | 68 | false | |
69 | 69 | } | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func checkSignCertificate (signID,Owner,sha256Hash) = match getString(signVerifier, ((("data_fc_" + signID) + "_") + Owner)) { | |
73 | 73 | case a: String => | |
74 | 74 | if (contains(a, sha256Hash)) | |
75 | 75 | then true | |
76 | 76 | else false | |
77 | 77 | case _ => | |
78 | 78 | false | |
79 | 79 | } | |
80 | 80 | ||
81 | 81 | ||
82 | - | func validateNFTs (accumulator,id) = { | |
83 | - | let assetDetails = value(assetInfo(fromBase58String(id))) | |
84 | - | if (if (if ((assetDetails.quantity != 1)) | |
85 | - | then true | |
86 | - | else (assetDetails.decimals != 0)) | |
87 | - | then true | |
88 | - | else (assetDetails.reissuable != false)) | |
89 | - | then (accumulator + 0) | |
90 | - | else (accumulator + 1) | |
91 | - | } | |
92 | - | ||
93 | - | ||
94 | 82 | func validateCID (cid) = if (if ((75 > size(cid))) | |
95 | 83 | then (60 > size(split(cid, "/")[0])) | |
96 | 84 | else false) | |
97 | 85 | then (16 > size(split(cid, "/")[1])) | |
98 | 86 | else false | |
99 | 87 | ||
100 | 88 | ||
101 | 89 | func validateHash (hash) = (65 > size(hash)) | |
102 | - | ||
103 | - | ||
104 | - | func verifyStatus (addr) = match getString(this, ("user_status_" + addr)) { | |
105 | - | case b: String => | |
106 | - | b | |
107 | - | case _ => | |
108 | - | throw("Something went wrong.") | |
109 | - | } | |
110 | 90 | ||
111 | 91 | ||
112 | 92 | func keyUserAddr (callerAddr) = ("user_" + callerAddr) | |
113 | 93 | ||
114 | 94 | ||
115 | 95 | func keyUserName (callerAddr) = ("user_name_" + callerAddr) | |
116 | 96 | ||
117 | 97 | ||
118 | 98 | func keyUserDesc (callerAddr) = ("user_desc_" + callerAddr) | |
119 | 99 | ||
120 | 100 | ||
121 | 101 | func keyUserSocial (callerAddr) = ("user_social_" + callerAddr) | |
122 | 102 | ||
123 | 103 | ||
124 | 104 | func keyUserThumb (callerAddr) = ("user_thumb_" + callerAddr) | |
125 | 105 | ||
126 | 106 | ||
127 | 107 | func keyUserStatus (callerAddr) = ("user_status_" + callerAddr) | |
128 | 108 | ||
129 | 109 | ||
130 | 110 | func keyUserDate (callerAddr) = ("user_date_" + callerAddr) | |
131 | 111 | ||
132 | 112 | ||
133 | 113 | func keyArtDate (callerAddr,artId) = ((("art_date_" + artId) + "_") + callerAddr) | |
134 | 114 | ||
135 | 115 | ||
136 | 116 | func keyArtName (callerAddr,artId) = ((("art_name_" + artId) + "_") + callerAddr) | |
137 | 117 | ||
138 | 118 | ||
139 | 119 | func keyArtDesc (callerAddr,artId) = ((("art_desc_" + artId) + "_") + callerAddr) | |
140 | 120 | ||
141 | 121 | ||
142 | 122 | func keyArtDisplayCid (callerAddr,artId) = ((("art_display_cid_" + artId) + "_") + callerAddr) | |
143 | 123 | ||
144 | 124 | ||
145 | 125 | func keyArtExportHash (callerAddr,artId) = ((("art_export_hash_" + artId) + "_") + callerAddr) | |
146 | 126 | ||
147 | 127 | ||
148 | 128 | func keyArtExportCid (callerAddr,artId) = ((("art_export_cid_" + artId) + "_") + callerAddr) | |
149 | 129 | ||
150 | 130 | ||
151 | 131 | func keyArtMaxMint (callerAddr,artId) = ((("art_maxmint_" + artId) + "_") + callerAddr) | |
152 | 132 | ||
153 | 133 | ||
154 | 134 | func keyArtSignID (callerAddr,artId) = ((("art_signid_" + artId) + "_") + callerAddr) | |
155 | 135 | ||
156 | 136 | ||
157 | 137 | func keyArtIssued (callerAddr,artId) = ((("art_issued_" + artId) + "_") + callerAddr) | |
158 | 138 | ||
159 | 139 | ||
160 | 140 | func keyArtOnSale (callerAddr,artId) = ((("art_onsale_" + artId) + "_") + callerAddr) | |
161 | 141 | ||
162 | 142 | ||
163 | 143 | func keyArtLicenceHash (callerAddr,artId) = ((("art_licence_hash_" + artId) + "_") + callerAddr) | |
164 | 144 | ||
165 | 145 | ||
166 | 146 | func keyArtLicenceCid (callerAddr,artId) = ((("art_licence_cid_" + artId) + "_") + callerAddr) | |
167 | 147 | ||
168 | 148 | ||
169 | 149 | func keyArtTags (callerAddr,artId) = ((("art_tags_" + artId) + "_") + callerAddr) | |
170 | 150 | ||
171 | 151 | ||
172 | 152 | func keyArtType (callerAddr,artId) = ((("art_type_" + artId) + "_") + callerAddr) | |
173 | 153 | ||
174 | 154 | ||
175 | 155 | func keyArtPrice (callerAddr,artId) = ((("art_price_" + artId) + "_") + callerAddr) | |
176 | 156 | ||
177 | 157 | ||
178 | 158 | func keyArtAssetIdAccepted (callerAddr,artId) = ((("art_assetAccepted_" + artId) + "_") + callerAddr) | |
179 | 159 | ||
180 | 160 | ||
181 | 161 | func keyArtHashByTxidAddr (callerAddr,txid) = ((("get_hashbytxidaddr_" + txid) + "_") + callerAddr) | |
182 | 162 | ||
183 | 163 | ||
184 | 164 | func keyArtOwnerByHash (sha256Hash) = ("get_owner_by_hash_" + sha256Hash) | |
185 | 165 | ||
186 | 166 | ||
187 | 167 | func keyArtArtidBySignid (callerAddr,signId) = ((("get_artidbysignid_" + signId) + "_") + callerAddr) | |
188 | 168 | ||
189 | 169 | ||
190 | 170 | func keyArtTxidByHashOwner (sha256Hash,callerAddr) = ("get_txid_by_hash_owner_" + toBase58String(sha256_16Kb(toBytes((sha256Hash + callerAddr))))) | |
171 | + | ||
172 | + | ||
173 | + | func validateAllCID (cidDisplay,cidExport,cidLicence) = if (if ((cidDisplay != "")) | |
174 | + | then !(validateCID(cidDisplay)) | |
175 | + | else false) | |
176 | + | then throw("Wrong Display CID length") | |
177 | + | else if (if ((cidExport != "")) | |
178 | + | then !(validateCID(cidExport)) | |
179 | + | else false) | |
180 | + | then throw("Wrong Export CID length") | |
181 | + | else if (if ((cidLicence != "")) | |
182 | + | then !(validateCID(cidLicence)) | |
183 | + | else false) | |
184 | + | then throw("Wrong Licence CID length") | |
185 | + | else true | |
186 | + | ||
187 | + | ||
188 | + | func validateAllHash (sha256Export,sha256Licence) = if (if ((sha256Export != "")) | |
189 | + | then !(validateHash(sha256Export)) | |
190 | + | else false) | |
191 | + | then throw("Export Hash should be 64 characters maximum") | |
192 | + | else if (if ((sha256Licence != "")) | |
193 | + | then !(validateHash(sha256Licence)) | |
194 | + | else false) | |
195 | + | then throw("Licence Hash should be 64 characters maximum") | |
196 | + | else true | |
197 | + | ||
198 | + | ||
199 | + | func validateString (str,max) = if ((size(str) == 0)) | |
200 | + | then throw("Field cannot be is empty") | |
201 | + | else if ((size(str) > max)) | |
202 | + | then throw((str + " is too long")) | |
203 | + | else true | |
191 | 204 | ||
192 | 205 | ||
193 | 206 | @Callable(i) | |
194 | 207 | func registerUser (name,description,thumb,social) = { | |
195 | 208 | let callerAddr = toString(addressFromPublicKey(i.callerPublicKey)) | |
196 | 209 | let userCanRegister = getStringByKey(keyUserStatus(callerAddr)) | |
197 | 210 | let id = toBase58String(i.transactionId) | |
198 | 211 | let timestamp = lastBlock.timestamp | |
199 | 212 | if (if ((userCanRegister == userSuspended)) | |
200 | 213 | then true | |
201 | 214 | else (userCanRegister == userRemoved)) | |
202 | 215 | then throw("You are now allowed to register, your account have been suspended/ removed.") | |
203 | 216 | else if ((userCanRegister == userRegistered)) | |
204 | 217 | then throw("You are already registered, please use update method instead.") | |
205 | 218 | else if (if ((userCanRegister == "")) | |
206 | 219 | then WHITELISTEDONLY | |
207 | 220 | else false) | |
208 | 221 | then throw("You are now allowed to register yet, please contact us first to get approved.") | |
209 | 222 | else if (if ((name == "")) | |
210 | 223 | then true | |
211 | 224 | else (description == "")) | |
212 | 225 | then throw("Name and description cannot be empty") | |
213 | 226 | else if ((size(description) > 600)) | |
214 | 227 | then throw("600 Characters maximum for the description") | |
215 | 228 | else [IntegerEntry(keyUserDate(callerAddr), timestamp), StringEntry(keyUserAddr(callerAddr), ((id + "_") + toString(lastBlock.timestamp))), StringEntry(keyUserName(callerAddr), name), StringEntry(keyUserDesc(callerAddr), description), StringEntry(keyUserSocial(callerAddr), social), StringEntry(keyUserThumb(callerAddr), thumb), StringEntry(keyUserStatus(callerAddr), userRegistered), StringEntry("last_invoke_id", id)] | |
216 | 229 | } | |
217 | 230 | ||
218 | 231 | ||
219 | 232 | ||
220 | 233 | @Callable(i) | |
221 | 234 | func deleteEntry (entry) = { | |
222 | 235 | let callerAddr = toString(addressFromPublicKey(i.callerPublicKey)) | |
223 | 236 | if ((callerAddr == admin)) | |
224 | 237 | then [DeleteEntry(entry)] | |
225 | 238 | else throw("no") | |
226 | 239 | } | |
227 | 240 | ||
228 | 241 | ||
229 | 242 | ||
230 | 243 | @Callable(i) | |
231 | 244 | func updateUser (name,description,thumb,social) = { | |
232 | 245 | let callerAddr = toString(addressFromPublicKey(i.callerPublicKey)) | |
233 | 246 | let userCanRegister = getStringByKey(keyUserStatus(callerAddr)) | |
234 | 247 | if (if ((userCanRegister == userSuspended)) | |
235 | 248 | then true | |
236 | 249 | else (userCanRegister == userRemoved)) | |
237 | 250 | then throw("You are now allowed to register, your account have been suspended/ removed.") | |
238 | 251 | else if (if ((userCanRegister == "")) | |
239 | 252 | then true | |
240 | 253 | else (userCanRegister == userAllowed)) | |
241 | 254 | then throw("Please register first with registerUser") | |
242 | 255 | else { | |
243 | 256 | let id = toBase58String(i.transactionId) | |
244 | 257 | let timestamp = lastBlock.timestamp | |
245 | 258 | if (if ((name == "")) | |
246 | 259 | then true | |
247 | 260 | else (description == "")) | |
248 | 261 | then throw("Name and description cannot be empty") | |
249 | 262 | else if ((size(description) > 600)) | |
250 | 263 | then throw("600 Characters maximum for the description") | |
251 | 264 | else [StringEntry(keyUserName(callerAddr), name), StringEntry(keyUserDesc(callerAddr), description), StringEntry(keyUserSocial(callerAddr), social), StringEntry(keyUserThumb(callerAddr), thumb), StringEntry("last_invoke_id", id)] | |
252 | 265 | } | |
253 | 266 | } | |
254 | 267 | ||
255 | 268 | ||
256 | 269 | ||
257 | 270 | @Callable(i) | |
258 | 271 | func changeUserStatus (address,status) = { | |
259 | 272 | let callerAddr = toString(addressFromPublicKey(i.callerPublicKey)) | |
260 | 273 | let id = toBase58String(i.transactionId) | |
261 | 274 | let currentStatus = getStringByKey(keyUserStatus(address)) | |
262 | 275 | let statusToSet = if ((status == userVerified)) | |
263 | 276 | then userVerified | |
264 | 277 | else if ((status == userRegistered)) | |
265 | 278 | then userRegistered | |
266 | 279 | else if ((status == userSuspended)) | |
267 | 280 | then userSuspended | |
268 | 281 | else if ((status == userRemoved)) | |
269 | 282 | then userRemoved | |
270 | 283 | else if ((status == userAllowed)) | |
271 | 284 | then userAllowed | |
272 | 285 | else if (if ((status == userReset)) | |
273 | 286 | then (currentStatus == userAllowed) | |
274 | 287 | else false) | |
275 | 288 | then "" | |
276 | 289 | else throw("Unknown status") | |
277 | 290 | if (if ((currentStatus == userAllowed)) | |
278 | 291 | then (status == userAllowed) | |
279 | 292 | else false) | |
280 | 293 | then throw("This user is already allowed") | |
281 | 294 | else if (if ((currentStatus == userRegistered)) | |
282 | 295 | then (status == userAllowed) | |
283 | 296 | else false) | |
284 | 297 | then throw("This user is already allowed and registered") | |
285 | 298 | else if (if ((currentStatus == userVerified)) | |
286 | 299 | then (status == userAllowed) | |
287 | 300 | else false) | |
288 | 301 | then throw("This user is already allowed and verified") | |
289 | 302 | else if (if ((callerAddr == admin)) | |
290 | 303 | then true | |
291 | 304 | else (callerAddr == admin2)) | |
292 | 305 | then [StringEntry(keyUserStatus(address), statusToSet), StringEntry("last_invoke_id", id)] | |
293 | 306 | else throw(((("You are not allowed to change user status " + callerAddr) + " / ") + admin)) | |
294 | 307 | } | |
295 | 308 | ||
296 | 309 | ||
297 | 310 | ||
298 | 311 | @Callable(i) | |
299 | 312 | func creditUser (address) = { | |
300 | 313 | let callerAddr = toString(addressFromPublicKey(i.callerPublicKey)) | |
301 | 314 | let id = toBase58String(i.transactionId) | |
302 | 315 | if (if ((callerAddr == admin)) | |
303 | 316 | then true | |
304 | 317 | else (callerAddr == admin2)) | |
305 | 318 | then [ScriptTransfer(Address(fromBase58String(address)), 150000000000, signAssetId)] | |
306 | 319 | else throw("You are not allowed to do that") | |
307 | 320 | } | |
308 | 321 | ||
309 | 322 | ||
310 | 323 | ||
311 | 324 | @Callable(invoke) | |
312 | 325 | func addArtwork (sha256Hash,signID,name,description,tags,type,maxmint,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence) = { | |
313 | 326 | let artId = toBase58String(invoke.transactionId) | |
314 | 327 | let callerAddress = toBase58String(invoke.caller.bytes) | |
315 | - | if (if ((cidDisplay != "")) | |
316 | - | then !(validateCID(cidDisplay)) | |
317 | - | else false) | |
318 | - | then throw("Wrong Display CID length") | |
319 | - | else if (if ((cidExport != "")) | |
320 | - | then !(validateCID(cidExport)) | |
321 | - | else false) | |
322 | - | then throw("Wrong Export CID length") | |
323 | - | else if (if ((cidLicence != "")) | |
324 | - | then !(validateCID(cidLicence)) | |
325 | - | else false) | |
326 | - | then throw("Wrong Licence CID length") | |
327 | - | else if (!(validateHash(sha256Hash))) | |
328 | - | then throw("Source Hash should be 64 characters maximum") | |
329 | - | else if (if ((sha256Export != "")) | |
330 | - | then !(validateHash(sha256Export)) | |
331 | - | else false) | |
332 | - | then throw("Export Hash should be 64 characters maximum") | |
333 | - | else if (if ((sha256Licence != "")) | |
334 | - | then !(validateHash(sha256Licence)) | |
328 | + | if (!(validateAllCID(cidDisplay, cidExport, cidLicence))) | |
329 | + | then throw("Problem with CID") | |
330 | + | else if (!(validateHash(sha256Hash))) | |
331 | + | then throw("Hash should be 64 characters maximum") | |
332 | + | else if (!(validateAllHash(sha256Export, sha256Licence))) | |
333 | + | then throw("Problem with Hashes") | |
334 | + | else if ((size(invoke.payments) == 0)) | |
335 | + | then throw("No payment attached") | |
336 | + | else { | |
337 | + | let payment = value(invoke.payments[0]) | |
338 | + | let amount = value(payment.amount) | |
339 | + | let assetId = if (if (isDefined(payment.assetId)) | |
340 | + | then (payment.assetId == signAssetId) | |
335 | 341 | else false) | |
336 | - | then throw("Licence Hash should be 64 characters maximum") | |
337 | - | else if ((size(invoke.payments) == 0)) | |
338 | - | then throw("No payment attached") | |
339 | - | else { | |
340 | - | let payment = value(invoke.payments[0]) | |
341 | - | let amount = value(payment.amount) | |
342 | - | let assetId = if (if (isDefined(payment.assetId)) | |
343 | - | then (payment.assetId == signAssetId) | |
344 | - | else false) | |
345 | - | then payment.assetId | |
346 | - | else throw("Only SIGN token accepted at the moment") | |
347 | - | let currentCertificationPrice = match getInteger(storageVerifier, ("certification_fee_" + toBase58String(signAssetId))) { | |
348 | - | case price: Int => | |
349 | - | price | |
350 | - | case _ => | |
351 | - | throw("Price undefined in oracle") | |
352 | - | } | |
353 | - | if ((amount != currentCertificationPrice)) | |
354 | - | then throw(("Payment amount should be " + toString(currentCertificationPrice))) | |
355 | - | else { | |
356 | - | let entryExist = getStringByKey(keyArtTxidByHashOwner(sha256Hash, callerAddress)) | |
357 | - | if ((entryExist != "")) | |
358 | - | then throw("You already added this artwork on Sign Art") | |
359 | - | else { | |
360 | - | let hashExist = getStringByKey(keyArtOwnerByHash(sha256Hash)) | |
361 | - | if ((hashExist != "")) | |
362 | - | then throw("This artwork hash is already registered on Sign Art") | |
363 | - | else { | |
364 | - | let isSignCertified = checkSignCertificate(signID, callerAddress, sha256Hash) | |
365 | - | if (!(isSignCertified)) | |
366 | - | then throw("Sign Certificate not found on Sign-web.app smart contract for this address.") | |
367 | - | else if ((size(cidDisplay) == 0)) | |
368 | - | then throw("Display CID cannot be empty") | |
369 | - | else if ((size(name) == 0)) | |
370 | - | then throw("Title cannot be empty") | |
371 | - | else if ((size(name) > 100)) | |
372 | - | then throw("100 Characters maximum for the name") | |
373 | - | else if ((size(description) > 1000)) | |
374 | - | then throw("1000 Characters maximum for the description") | |
375 | - | else if ((size(description) == 0)) | |
376 | - | then throw("Description cannot be empty") | |
377 | - | else { | |
378 | - | let tagsList = split(tags, ",") | |
379 | - | if ((size(tagsList) > 5)) | |
380 | - | then throw("Tags should be maximum 5 single word separated by space.") | |
381 | - | else { | |
382 | - | let userIsRegistered = match getString(this, ("user_status_" + callerAddress)) { | |
383 | - | case s: String => | |
384 | - | s | |
385 | - | case _ => | |
386 | - | userUnregistered | |
387 | - | } | |
388 | - | let timestamp = lastBlock.timestamp | |
389 | - | if (if (isDefined(userIsRegistered)) | |
390 | - | then (userIsRegistered == userUnregistered) | |
391 | - | else false) | |
392 | - | then throw("Please register this account first with \"User infos\" tab") | |
393 | - | else if ((userIsRegistered == userSuspended)) | |
394 | - | then throw("Your account is suspended") | |
395 | - | else if ((userIsRegistered == userRemoved)) | |
396 | - | then throw("Your account have been removed") | |
397 | - | else if ((maxmint > 10)) | |
398 | - | then throw("Maximum 10 editions per artwork") | |
399 | - | else if ((size(sha256Hash) != 64)) | |
400 | - | then throw("Hash should be sha256 string composed of 64 char.") | |
401 | - | else [StringEntry(keyArtOwnerByHash(sha256Hash), callerAddress), StringEntry(keyArtTxidByHashOwner(sha256Hash, callerAddress), artId), IntegerEntry(keyArtDate(callerAddress, artId), timestamp), StringEntry(keyArtName(callerAddress, artId), name), StringEntry(keyArtDesc(callerAddress, artId), description), StringEntry(keyArtDisplayCid(callerAddress, artId), cidDisplay), StringEntry(keyArtExportCid(callerAddress, artId), cidExport), StringEntry(keyArtExportHash(callerAddress, artId), sha256Export), StringEntry(keyArtLicenceHash(callerAddress, artId), sha256Licence), StringEntry(keyArtLicenceCid(callerAddress, artId), cidLicence), StringEntry(keyArtType(callerAddress, artId), type), StringEntry(keyArtTags(callerAddress, artId), tags), IntegerEntry(keyArtMaxMint(callerAddress, artId), maxmint), StringEntry(keyArtSignID(callerAddress, artId), signID), IntegerEntry(keyArtIssued(callerAddress, artId), 0), BooleanEntry(keyArtOnSale(callerAddress, artId), false), StringEntry(keyArtArtidBySignid(callerAddress, signID), artId), StringEntry("last_invoke_id", artId), StringEntry(keyArtHashByTxidAddr(callerAddress, artId), sha256Hash), ScriptTransfer(Address(fromBase58String(feeReceiver)), amount, assetId)] | |
402 | - | } | |
403 | - | } | |
404 | - | } | |
405 | - | } | |
406 | - | } | |
407 | - | } | |
342 | + | then payment.assetId | |
343 | + | else throw("Only SIGN token accepted at the moment") | |
344 | + | let currentCertificationPrice = match getInteger(storageVerifier, ("certification_fee_" + toBase58String(signAssetId))) { | |
345 | + | case price: Int => | |
346 | + | price | |
347 | + | case _ => | |
348 | + | throw("Price undefined in oracle") | |
349 | + | } | |
350 | + | if ((amount != currentCertificationPrice)) | |
351 | + | then throw(("Payment amount should be " + toString(currentCertificationPrice))) | |
352 | + | else { | |
353 | + | let entryExist = getStringByKey(keyArtTxidByHashOwner(sha256Hash, callerAddress)) | |
354 | + | if ((entryExist != "")) | |
355 | + | then throw("You already added this artwork on Sign Art") | |
356 | + | else { | |
357 | + | let hashExist = getStringByKey(keyArtOwnerByHash(sha256Hash)) | |
358 | + | if ((hashExist != "")) | |
359 | + | then throw("This artwork hash is already registered on Sign Art") | |
360 | + | else { | |
361 | + | let isSignCertified = checkSignCertificate(signID, callerAddress, sha256Hash) | |
362 | + | if (!(isSignCertified)) | |
363 | + | then throw("Sign Certificate not found on Sign-web.app smart contract for this address.") | |
364 | + | else if ((size(cidDisplay) == 0)) | |
365 | + | then throw("Display CID cannot be empty") | |
366 | + | else if (!(validateString(name, 100))) | |
367 | + | then throw("100 Characters maximum for the name") | |
368 | + | else if (!(validateString(description, 1000))) | |
369 | + | then throw("1000 Characters maximum for the description") | |
370 | + | else { | |
371 | + | let tagsList = split(tags, ",") | |
372 | + | if ((size(tagsList) > 5)) | |
373 | + | then throw("Tags should be maximum 5 single word separated by space.") | |
374 | + | else { | |
375 | + | let userIsRegistered = match getString(this, ("user_status_" + callerAddress)) { | |
376 | + | case s: String => | |
377 | + | s | |
378 | + | case _ => | |
379 | + | userUnregistered | |
380 | + | } | |
381 | + | let timestamp = lastBlock.timestamp | |
382 | + | if (if (isDefined(userIsRegistered)) | |
383 | + | then (userIsRegistered == userUnregistered) | |
384 | + | else false) | |
385 | + | then throw("Please register this account first with \"User infos\" tab") | |
386 | + | else if ((userIsRegistered == userSuspended)) | |
387 | + | then throw("Your account is suspended") | |
388 | + | else if ((userIsRegistered == userRemoved)) | |
389 | + | then throw("Your account have been removed") | |
390 | + | else if ((maxmint > 10)) | |
391 | + | then throw("Maximum 10 editions per artwork") | |
392 | + | else if ((size(sha256Hash) != 64)) | |
393 | + | then throw("Hash should be sha256 string composed of 64 char.") | |
394 | + | else [StringEntry(keyArtOwnerByHash(sha256Hash), callerAddress), StringEntry(keyArtTxidByHashOwner(sha256Hash, callerAddress), artId), IntegerEntry(keyArtDate(callerAddress, artId), timestamp), StringEntry(keyArtName(callerAddress, artId), name), StringEntry(keyArtDesc(callerAddress, artId), description), StringEntry(keyArtDisplayCid(callerAddress, artId), cidDisplay), StringEntry(keyArtExportCid(callerAddress, artId), cidExport), StringEntry(keyArtExportHash(callerAddress, artId), sha256Export), StringEntry(keyArtLicenceHash(callerAddress, artId), sha256Licence), StringEntry(keyArtLicenceCid(callerAddress, artId), cidLicence), StringEntry(keyArtType(callerAddress, artId), type), StringEntry(keyArtTags(callerAddress, artId), tags), IntegerEntry(keyArtMaxMint(callerAddress, artId), maxmint), StringEntry(keyArtSignID(callerAddress, artId), signID), IntegerEntry(keyArtIssued(callerAddress, artId), 0), BooleanEntry(keyArtOnSale(callerAddress, artId), false), StringEntry(keyArtArtidBySignid(callerAddress, signID), artId), StringEntry("last_invoke_id", artId), StringEntry(keyArtHashByTxidAddr(callerAddress, artId), sha256Hash), ScriptTransfer(Address(fromBase58String(feeReceiver)), amount, assetId)] | |
395 | + | } | |
396 | + | } | |
397 | + | } | |
398 | + | } | |
399 | + | } | |
400 | + | } | |
408 | 401 | } | |
409 | 402 | ||
410 | 403 | ||
411 | 404 | ||
412 | 405 | @Callable(invoke) | |
413 | 406 | func updateArtwork (txid,name,description,tags,type,maxmint,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence) = { | |
414 | 407 | let updateId = toBase58String(invoke.transactionId) | |
415 | 408 | let callerAddress = toBase58String(invoke.caller.bytes) | |
416 | - | if (if ((cidDisplay != "")) | |
417 | - | then !(validateCID(cidDisplay)) | |
418 | - | else false) | |
419 | - | then throw("Wrong Display CID length") | |
420 | - | else if (if ((cidExport != "")) | |
421 | - | then !(validateCID(cidExport)) | |
422 | - | else false) | |
423 | - | then throw("Wrong Export CID length") | |
424 | - | else if (if ((cidLicence != "")) | |
425 | - | then !(validateCID(cidLicence)) | |
426 | - | else false) | |
427 | - | then throw("Wrong Licence CID length") | |
428 | - | else if (if ((sha256Export != "")) | |
429 | - | then !(validateHash(sha256Export)) | |
430 | - | else false) | |
431 | - | then throw("Export Hash should be 64 characters maximum") | |
432 | - | else if (if ((sha256Licence != "")) | |
433 | - | then !(validateHash(sha256Licence)) | |
434 | - | else false) | |
435 | - | then throw("Licence Hash should be 64 characters maximum") | |
436 | - | else { | |
437 | - | let entryExist = getStringByKey(keyArtName(callerAddress, txid)) | |
438 | - | if ((entryExist == "")) | |
439 | - | then throw("This entry doesn't exist or you are not the owner") | |
440 | - | else if ((size(name) == 0)) | |
441 | - | then throw("Title cannot be empty") | |
442 | - | else if ((size(name) > 100)) | |
443 | - | then throw("100 Characters maximum for the name") | |
444 | - | else if ((size(description) > 1000)) | |
445 | - | then throw("1000 Characters maximum for the description") | |
446 | - | else if ((size(description) == 0)) | |
447 | - | then throw("Description cannot be empty") | |
448 | - | else { | |
449 | - | let artworkMinted = match getInteger(this, keyArtIssued(callerAddress, txid)) { | |
450 | - | case b: Int => | |
451 | - | if ((b == 0)) | |
452 | - | then false | |
453 | - | else true | |
454 | - | case _ => | |
455 | - | false | |
456 | - | } | |
457 | - | let tagsList = split(tags, ",") | |
458 | - | if ((size(tagsList) > 5)) | |
459 | - | then throw("Tags should be maximum 5 single word separated by space.") | |
460 | - | else { | |
461 | - | let userIsRegistered = match getString(this, ("user_status_" + callerAddress)) { | |
462 | - | case s: String => | |
463 | - | s | |
464 | - | case _ => | |
465 | - | userUnregistered | |
466 | - | } | |
467 | - | if (if (isDefined(userIsRegistered)) | |
468 | - | then (userIsRegistered == userUnregistered) | |
469 | - | else false) | |
470 | - | then throw("Please register this account first with \"User infos\" tab") | |
471 | - | else if ((userIsRegistered == userSuspended)) | |
472 | - | then throw("Your account is suspended") | |
473 | - | else if ((userIsRegistered == userRemoved)) | |
474 | - | then throw("Your account have been removed") | |
475 | - | else if ((maxmint > 10)) | |
476 | - | then throw("Maximum 10 editions per artwork") | |
477 | - | else if (!(artworkMinted)) | |
478 | - | then [StringEntry(keyArtName(callerAddress, txid), name), StringEntry(keyArtDesc(callerAddress, txid), description), StringEntry(keyArtDisplayCid(callerAddress, txid), cidDisplay), StringEntry(keyArtExportCid(callerAddress, txid), cidExport), StringEntry(keyArtExportHash(callerAddress, txid), sha256Export), StringEntry(keyArtLicenceCid(callerAddress, txid), cidLicence), StringEntry(keyArtLicenceHash(callerAddress, txid), sha256Licence), IntegerEntry(keyArtMaxMint(callerAddress, txid), maxmint), StringEntry(keyArtTags(callerAddress, txid), tags), StringEntry(keyArtType(callerAddress, txid), type), StringEntry("last_invoke_id", updateId)] | |
479 | - | else throw("You cannot edit artwork that have already minted NFT(s)") | |
480 | - | } | |
481 | - | } | |
482 | - | } | |
409 | + | if (!(validateAllCID(cidDisplay, cidExport, cidLicence))) | |
410 | + | then throw("Problem with CID") | |
411 | + | else if (!(validateAllHash(sha256Export, sha256Licence))) | |
412 | + | then throw("Problem with Hashes") | |
413 | + | else { | |
414 | + | let entryExist = getStringByKey(keyArtName(callerAddress, txid)) | |
415 | + | if ((entryExist == "")) | |
416 | + | then throw("Entry not found") | |
417 | + | else if (!(validateString(name, 100))) | |
418 | + | then throw("100 Char. max for the name") | |
419 | + | else if (!(validateString(description, 1000))) | |
420 | + | then throw("1000 Char. max for the description") | |
421 | + | else { | |
422 | + | let artworkMinted = match getInteger(this, keyArtIssued(callerAddress, txid)) { | |
423 | + | case b: Int => | |
424 | + | if ((b == 0)) | |
425 | + | then false | |
426 | + | else true | |
427 | + | case _ => | |
428 | + | false | |
429 | + | } | |
430 | + | if ((size(split(tags, ",")) > 5)) | |
431 | + | then throw("5 tags max.") | |
432 | + | else { | |
433 | + | let userIsRegistered = match getString(this, ("user_status_" + callerAddress)) { | |
434 | + | case s: String => | |
435 | + | s | |
436 | + | case _ => | |
437 | + | userUnregistered | |
438 | + | } | |
439 | + | if (if (isDefined(userIsRegistered)) | |
440 | + | then (userIsRegistered == userUnregistered) | |
441 | + | else false) | |
442 | + | then throw("Please register this account first with \"User infos\" tab") | |
443 | + | else if ((userIsRegistered == userSuspended)) | |
444 | + | then throw("Your account is suspended") | |
445 | + | else if ((userIsRegistered == userRemoved)) | |
446 | + | then throw("Your account have been removed") | |
447 | + | else if ((maxmint > 10)) | |
448 | + | then throw("Maximum 10 editions per artwork") | |
449 | + | else if (!(artworkMinted)) | |
450 | + | then [StringEntry(keyArtName(callerAddress, txid), name), StringEntry(keyArtDesc(callerAddress, txid), description), StringEntry(keyArtDisplayCid(callerAddress, txid), cidDisplay), StringEntry(keyArtExportCid(callerAddress, txid), cidExport), StringEntry(keyArtExportHash(callerAddress, txid), sha256Export), StringEntry(keyArtLicenceCid(callerAddress, txid), cidLicence), StringEntry(keyArtLicenceHash(callerAddress, txid), sha256Licence), IntegerEntry(keyArtMaxMint(callerAddress, txid), maxmint), StringEntry(keyArtTags(callerAddress, txid), tags), StringEntry(keyArtType(callerAddress, txid), type), StringEntry("last_invoke_id", updateId)] | |
451 | + | else throw("You cannot edit artwork that have already minted NFT(s)") | |
452 | + | } | |
453 | + | } | |
454 | + | } | |
483 | 455 | } | |
484 | 456 | ||
485 | 457 | ||
486 | 458 | ||
487 | 459 | @Callable(i) | |
488 | 460 | func deleteArtwork (artId,address) = { | |
489 | 461 | let callerAddress = toString(addressFromPublicKey(i.callerPublicKey)) | |
490 | 462 | let id = toBase58String(i.transactionId) | |
491 | 463 | let addressToUse = if (if ((callerAddress == admin)) | |
492 | 464 | then true | |
493 | 465 | else (callerAddress == admin2)) | |
494 | 466 | then address | |
495 | 467 | else callerAddress | |
496 | 468 | let entryExist = match getString(this, keyArtName(addressToUse, artId)) { | |
497 | 469 | case s: String => | |
498 | 470 | s | |
499 | 471 | case _ => | |
500 | 472 | throw("No artwork matching this request or you are not allowed") | |
501 | 473 | } | |
502 | 474 | let artworkMinted = match getInteger(this, keyArtIssued(addressToUse, artId)) { | |
503 | 475 | case b: Int => | |
504 | 476 | if ((b != 0)) | |
505 | 477 | then true | |
506 | 478 | else false | |
507 | 479 | case _ => | |
508 | 480 | false | |
509 | 481 | } | |
510 | 482 | let maxMint = getIntegerByKey(keyArtMaxMint(addressToUse, artId)) | |
511 | 483 | let sha256Hash = match getString(this, keyArtHashByTxidAddr(addressToUse, artId)) { | |
512 | 484 | case s: String => | |
513 | 485 | s | |
514 | 486 | case _ => | |
515 | 487 | throw("No artwork hash matching this request") | |
516 | 488 | } | |
517 | 489 | let signID = match getString(this, keyArtSignID(addressToUse, artId)) { | |
518 | 490 | case s: String => | |
519 | 491 | s | |
520 | 492 | case _ => | |
521 | 493 | throw("No SIGN ID matching this request") | |
522 | 494 | } | |
523 | 495 | 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)), StringEntry("last_invoke_id", id), DeleteEntry(keyArtOwnerByHash(sha256Hash)), DeleteEntry(keyArtArtidBySignid(addressToUse, signID)), DeleteEntry(keyArtTxidByHashOwner(sha256Hash, addressToUse)), DeleteEntry(keyArtPrice(addressToUse, artId)), DeleteEntry(keyArtMaxMint(addressToUse, artId)), DeleteEntry(keyArtAssetIdAccepted(addressToUse, artId)), DeleteEntry(((((("art_sold_1_of_" + toString(maxMint)) + "_") + artId) + "_") + addressToUse)), DeleteEntry(((((("art_sold_2_of_" + toString(maxMint)) + "_") + artId) + "_") + addressToUse)), DeleteEntry(((((("art_sold_3_of_" + toString(maxMint)) + "_") + artId) + "_") + addressToUse)), DeleteEntry(((((("art_sold_4_of_" + toString(maxMint)) + "_") + artId) + "_") + addressToUse)), DeleteEntry(((((("art_sold_5_of_" + toString(maxMint)) + "_") + artId) + "_") + addressToUse)), DeleteEntry(((((("art_sold_6_of_" + toString(maxMint)) + "_") + artId) + "_") + addressToUse)), DeleteEntry(((((("art_sold_7_of_" + toString(maxMint)) + "_") + artId) + "_") + addressToUse)), DeleteEntry(((((("art_sold_8_of_" + toString(maxMint)) + "_") + artId) + "_") + addressToUse)), DeleteEntry(((((("art_sold_9_of_" + toString(maxMint)) + "_") + artId) + "_") + addressToUse)), DeleteEntry(((((("art_sold_10_of_" + toString(maxMint)) + "_") + artId) + "_") + addressToUse))] | |
524 | 496 | if (if ((callerAddress == admin)) | |
525 | 497 | then true | |
526 | 498 | else (callerAddress == admin2)) | |
527 | 499 | then dataToDelete | |
528 | 500 | else if (!(artworkMinted)) | |
529 | 501 | then dataToDelete | |
530 | 502 | else throw("This artwork already have minted NFT, you cannot delete it") | |
531 | 503 | } | |
532 | 504 | ||
533 | 505 | ||
534 | 506 | ||
535 | 507 | @Callable(invoke) | |
536 | 508 | func sellArtwork (artId,price,maxMint,assetId) = { | |
537 | 509 | let id = toBase58String(invoke.transactionId) | |
538 | 510 | let callerAddress = toBase58String(invoke.caller.bytes) | |
539 | 511 | let sellDate = lastBlock.timestamp | |
540 | 512 | let exportCID = getStringByKey(keyArtExportCid(callerAddress, artId)) | |
541 | 513 | if ((size(split(exportCID, "/")[0]) != 59)) | |
542 | 514 | then throw("You cannot sell artwork with no export file") | |
543 | 515 | else { | |
544 | 516 | let exportHash = getStringByKey(keyArtExportHash(callerAddress, artId)) | |
545 | 517 | if ((size(exportHash) != 64)) | |
546 | 518 | then throw("You cannot sell artwork with no export hash") | |
547 | 519 | else if (if (if ((assetId != toBase58String(signAssetId))) | |
548 | 520 | then (assetId != toBase58String(wavesAssetId)) | |
549 | 521 | else false) | |
550 | 522 | then (assetId != toBase58String(usdnAssetId)) | |
551 | 523 | else false) | |
552 | 524 | then throw("Only SIGN, USDN or WAVES currency accepted at the moment") | |
553 | 525 | else { | |
554 | 526 | let artworkName = match getString(this, keyArtName(callerAddress, artId)) { | |
555 | 527 | case s: String => | |
556 | 528 | s | |
557 | 529 | case _ => | |
558 | 530 | throw("This artwork doesn't exit or you are not the owner") | |
559 | 531 | } | |
560 | 532 | let userIsRegistered = match getString(this, keyUserStatus(callerAddress)) { | |
561 | 533 | case s: String => | |
562 | 534 | s | |
563 | 535 | case _ => | |
564 | 536 | throw("Please register this account first") | |
565 | 537 | } | |
566 | 538 | let amountSold = match getInteger(this, keyArtIssued(callerAddress, artId)) { | |
567 | 539 | case n: Int => | |
568 | 540 | n | |
569 | 541 | case _ => | |
570 | 542 | 0 | |
571 | 543 | } | |
572 | 544 | let maxCanSell = match getInteger(this, keyArtMaxMint(callerAddress, artId)) { | |
573 | 545 | case n: Int => | |
574 | 546 | n | |
575 | 547 | case _ => | |
576 | 548 | 0 | |
577 | 549 | } | |
578 | 550 | if (if ((amountSold != 0)) | |
579 | 551 | then (amountSold == maxCanSell) | |
580 | 552 | else false) | |
581 | 553 | then throw("You reached the max edition allowed to sell for this edition.") | |
582 | 554 | else if (if ((amountSold > 0)) | |
583 | 555 | then (maxCanSell != maxMint) | |
584 | 556 | else false) | |
585 | 557 | then throw("You cannot change the maximum issuable anymore") | |
586 | 558 | else if ((userIsRegistered == userSuspended)) | |
587 | 559 | then throw("Your account is suspended") | |
588 | 560 | else if ((userIsRegistered == userRemoved)) | |
589 | 561 | then throw("Your account have been deleted") | |
590 | 562 | else { | |
591 | 563 | let sellStatus = if ((price > 0)) | |
592 | 564 | then true | |
593 | 565 | else false | |
594 | 566 | [BooleanEntry(keyArtOnSale(callerAddress, artId), sellStatus), IntegerEntry(keyArtPrice(callerAddress, artId), price), IntegerEntry(keyArtMaxMint(callerAddress, artId), maxMint), StringEntry(keyArtAssetIdAccepted(callerAddress, artId), assetId), StringEntry("last_invoke_id", id)] | |
595 | 567 | } | |
596 | 568 | } | |
597 | 569 | } | |
598 | 570 | } | |
599 | 571 | ||
600 | 572 | ||
601 | 573 | ||
602 | 574 | @Callable(invoke) | |
603 | 575 | func buyArtwork (artId,issuer) = { | |
604 | 576 | let id = toBase58String(invoke.transactionId) | |
605 | 577 | let callerAddress = toBase58String(invoke.caller.bytes) | |
606 | 578 | let totalNFT = getIntegerByKey("total_nft_issued") | |
607 | 579 | let signID = getStringByKey(keyArtSignID(issuer, artId)) | |
608 | 580 | let artworkName = match getString(this, keyArtName(issuer, artId)) { | |
609 | 581 | case s: String => | |
610 | 582 | s | |
611 | 583 | case _ => | |
612 | 584 | throw("This artwork doesn't exit") | |
613 | 585 | } | |
614 | 586 | let displayCID = getStringByKey(keyArtDisplayCid(issuer, artId)) | |
615 | 587 | let exportCID = getStringByKey(keyArtExportCid(issuer, artId)) | |
616 | 588 | let exportHash = getStringByKey(keyArtExportHash(issuer, artId)) | |
617 | 589 | let licenceCID = getStringByKey(keyArtLicenceCid(issuer, artId)) | |
618 | 590 | let licenceHash = getStringByKey(keyArtLicenceHash(issuer, artId)) | |
619 | 591 | let description = take(getStringByKey(keyArtDesc(issuer, artId)), 50) | |
620 | 592 | let amountSold = getIntegerByKey(keyArtIssued(issuer, artId)) | |
621 | 593 | let artworkPrice = getIntegerByKey(keyArtPrice(issuer, artId)) | |
622 | 594 | let isOnSale = getBooleanByKey(keyArtOnSale(issuer, artId)) | |
623 | 595 | let priceAssetId = getStringByKey(keyArtAssetIdAccepted(issuer, artId)) | |
624 | 596 | let sourceHash = getStringByKey(keyArtHashByTxidAddr(issuer, artId)) | |
625 | 597 | if ((artworkPrice == 0)) | |
626 | 598 | then throw("This artwork is not for sell") | |
627 | 599 | else if (!(isOnSale)) | |
628 | 600 | then throw("This artwork is not for sale") | |
629 | 601 | else { | |
630 | 602 | let maxCanSell = getIntegerByKey(keyArtMaxMint(issuer, artId)) | |
631 | 603 | let payment = value(invoke.payments[0]) | |
632 | 604 | let amount = value(payment.amount) | |
633 | 605 | let assetId = if (if (isDefined(payment.assetId)) | |
634 | 606 | then (payment.assetId == fromBase58String(priceAssetId)) | |
635 | 607 | else false) | |
636 | 608 | then payment.assetId | |
637 | 609 | else throw((("Only " + priceAssetId) + " token id accepted at the moment")) | |
638 | 610 | let cut = if ((priceAssetId == toBase58String(signAssetId))) | |
639 | 611 | then 8 | |
640 | 612 | else 10 | |
641 | 613 | let amountForSign = ((amount / 100) * cut) | |
642 | 614 | let amountForCreator = (amount - amountForSign) | |
643 | 615 | if ((amountSold == maxCanSell)) | |
644 | 616 | then throw("Cannot buy this artwork anymore, maximum editions reached") | |
645 | 617 | else if ((artworkPrice != amount)) | |
646 | 618 | then throw(((("Payment don't match seller price: " + toString(artworkPrice)) + " vs ") + toString(amount))) | |
647 | 619 | else { | |
648 | 620 | let newAmountSold = (amountSold + 1) | |
649 | 621 | let entryDate = lastBlock.timestamp | |
650 | 622 | let issueMeta = (((((((((((((((((((((((((((("{\"version\": 1, | |
651 | 623 | \"creator\": \"" + issuer) + "\", | |
652 | 624 | \"artID\": \"") + artId) + "\", | |
653 | 625 | \"signID\": \"") + signID) + "\", | |
654 | 626 | \"artwork_name\": \"") + artworkName) + "\", | |
655 | 627 | \"artwork_desc\": \"") + description) + "\", | |
656 | 628 | \"issue\": \"") + toString(newAmountSold)) + "/") + toString(maxCanSell)) + "\", | |
657 | 629 | \"maxIssuable\": \"") + toString(maxCanSell)) + "\", | |
658 | 630 | \"source_hash\": \"") + sourceHash) + "\", | |
659 | 631 | \"display_cid\": \"") + displayCID) + "\", | |
660 | 632 | \"export_cid\": \"") + exportCID) + "\", | |
661 | 633 | \"export_hash\": \"") + exportHash) + "\", | |
662 | 634 | \"licence_cid\": \"") + licenceCID) + "\", | |
663 | 635 | \"licence_hash\": \"") + licenceHash) + "\"}") | |
664 | 636 | let issueNFT = Issue(("SA_" + toString((totalNFT + 1))), issueMeta, 1, 0, false) | |
665 | 637 | let idNFT = calculateAssetId(issueNFT) | |
666 | 638 | let sellStatus = if ((newAmountSold == maxCanSell)) | |
667 | 639 | then false | |
668 | 640 | else true | |
669 | 641 | [IntegerEntry(keyArtIssued(issuer, artId), newAmountSold), StringEntry(((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer), ((((((((callerAddress + "_") + toString(entryDate)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId)), IntegerEntry("total_nft_issued", (totalNFT + 1)), BooleanEntry(keyArtOnSale(issuer, artId), sellStatus), StringEntry("last_invoke_id", id), issueNFT, ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId), ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId), ScriptTransfer(invoke.caller, 1, idNFT)] | |
670 | 642 | } | |
671 | 643 | } | |
672 | 644 | } | |
673 | 645 | ||
674 | 646 | ||
675 | 647 | ||
676 | 648 | @Callable(i) | |
677 | 649 | func deleteUser (address) = { | |
678 | 650 | let callerAddr = toString(addressFromPublicKey(i.callerPublicKey)) | |
679 | 651 | let id = toBase58String(i.transactionId) | |
680 | 652 | if (if ((callerAddr == admin)) | |
681 | 653 | then true | |
682 | 654 | else (callerAddr == admin2)) | |
683 | 655 | then [DeleteEntry(keyUserDate(address)), DeleteEntry(keyUserAddr(address)), DeleteEntry(keyUserName(address)), DeleteEntry(keyUserDesc(address)), DeleteEntry(keyUserSocial(address)), DeleteEntry(keyUserThumb(address)), StringEntry(keyUserStatus(address), userRemoved), StringEntry("last_invoke_id", id)] | |
684 | - | else throw("You are not allowed | |
656 | + | else throw("You are not allowed") | |
685 | 657 | } | |
686 | 658 | ||
687 | 659 |
github/deemru/w8io/026f985 78.65 ms ◑