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:AAIEAAAAAAAAAFoIAhIGCgQICAgIEgMKAQgSBgoECAgICBIECgIICBIDCgEIEg4KDAgICAgICAEICAgICBINCgsICAgICAEICAgICBIECgIICBIGCgQIAQEIEgQKAggIEgMKAQgAAAA6AAAAAA9zdG9yYWdlVmVyaWZpZXIJAQAAAAV2YWx1ZQAAAAEJAAQmAAAAAQIAAAAjM04yczVSdGFIUEJlbkNzeDJFQ2NvRlJiWUh4M25vWmhYVzEAAAAADHNpZ25WZXJpZmllcgkBAAAABXZhbHVlAAAAAQkABCYAAAABAgAAACMzTkMyOGhTaXZybXNUVVhhWUQxeDZMMzYySjRacFVub1RkQgAAAAALZmVlUmVjZWl2ZXICAAAAIzNOMUU2dFhkZFJvVmFSZlE5ZFEzdmc1TGFXMmZzZDhIS3ViAAAAAAtzaWduQXNzZXRJZAEAAAAg6KVqvMp3QvJwYTI1Sk9Fg7m5HuWZZxfDcerZC6EEresAAAAAC3VzZG5Bc3NldElkAQAAACAP8hwSrOTEPJrsRhqrJaiw7LoHK0bMbYhy8LXikkkBtAAAAAAMd2F2ZXNBc3Nld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AAQkBAAAADGtleVVzZXJUaHVtYgAAAAEFAAAAB2FkZHJlc3MJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkBAAAADWtleVVzZXJTdGF0dXMAAAABBQAAAAdhZGRyZXNzBQAAAAt1c2VyUmVtb3ZlZAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAAA5sYXN0X2ludm9rZV9pZAUAAAACaWQFAAAAA25pbAkAAAIAAAABAgAAABNZb3UgYXJlIG5vdCBhbGxvd2VkAAAAAJD3cOI=", "height": 1221583, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HdEyAaGRNuY2Wixqq3D7um2AkTyxToZHmGie4tXScPBy Next: CxHg64HGcYtsbZ9MTpLG2yaupKsd14esi2545sDP313B Diff:
OldNewDifferences
7979 }
8080
8181
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-
9482 func validateCID (cid) = if (if ((75 > size(cid)))
9583 then (60 > size(split(cid, "/")[0]))
9684 else false)
9987
10088
10189 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-}
11090
11191
11292 func keyUserAddr (callerAddr) = ("user_" + callerAddr)
188168
189169
190170 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
191204
192205
193206 @Callable(i)
312325 func addArtwork (sha256Hash,signID,name,description,tags,type,maxmint,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence) = {
313326 let artId = toBase58String(invoke.transactionId)
314327 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)
335341 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+ }
408401 }
409402
410403
413406 func updateArtwork (txid,name,description,tags,type,maxmint,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence) = {
414407 let updateId = toBase58String(invoke.transactionId)
415408 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+ }
483455 }
484456
485457
681653 then true
682654 else (callerAddr == admin2))
683655 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 to do that")
656+ else throw("You are not allowed")
685657 }
686658
687659
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let storageVerifier = value(addressFromString("3N2s5RtaHPBenCsx2ECcoFRbYHx3noZhXW1"))
55
66 let signVerifier = value(addressFromString("3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB"))
77
88 let feeReceiver = "3N1E6tXddRoVaRfQ9dQ3vg5LaW2fsd8HKub"
99
1010 let signAssetId = base58'Gf9t8FA4H3ssoZPCwrg3KwUFCci8zuUFP9ssRsUY3s6a'
1111
1212 let usdnAssetId = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'
1313
1414 let wavesAssetId = base58''
1515
1616 let signCut = 8
1717
1818 let usdnCut = 10
1919
2020 let wavesCut = 10
2121
2222 let admin = "3MsG6jPNCrVJUtYB7XJBxS7utWsXAf4n9Vp"
2323
2424 let admin2 = "3Mzm4VLwsN9uZwbTMzPj3XuxV6kEfAR8UDN"
2525
2626 let WHITELISTEDONLY = true
2727
2828 let userAllowed = "ALLOWED"
2929
3030 let userRegistered = "REGISTERED"
3131
3232 let userVerified = "VERIFIED"
3333
3434 let userSuspended = "SUSPENDED"
3535
3636 let userRemoved = "REMOVED"
3737
3838 let userUnregistered = "UNREGISTERED"
3939
4040 let userReset = "RESET"
4141
4242 let onSale = "ON_SALE"
4343
4444 let sold = "SOLD"
4545
4646 let canceled = "CANCELED"
4747
4848 func getStringByKey (key) = match getString(this, key) {
4949 case a: String =>
5050 a
5151 case _ =>
5252 ""
5353 }
5454
5555
5656 func getIntegerByKey (key) = match getInteger(this, key) {
5757 case i: Int =>
5858 i
5959 case _ =>
6060 0
6161 }
6262
6363
6464 func getBooleanByKey (key) = match getBoolean(this, key) {
6565 case i: Boolean =>
6666 i
6767 case _ =>
6868 false
6969 }
7070
7171
7272 func checkSignCertificate (signID,Owner,sha256Hash) = match getString(signVerifier, ((("data_fc_" + signID) + "_") + Owner)) {
7373 case a: String =>
7474 if (contains(a, sha256Hash))
7575 then true
7676 else false
7777 case _ =>
7878 false
7979 }
8080
8181
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-
9482 func validateCID (cid) = if (if ((75 > size(cid)))
9583 then (60 > size(split(cid, "/")[0]))
9684 else false)
9785 then (16 > size(split(cid, "/")[1]))
9886 else false
9987
10088
10189 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-}
11090
11191
11292 func keyUserAddr (callerAddr) = ("user_" + callerAddr)
11393
11494
11595 func keyUserName (callerAddr) = ("user_name_" + callerAddr)
11696
11797
11898 func keyUserDesc (callerAddr) = ("user_desc_" + callerAddr)
11999
120100
121101 func keyUserSocial (callerAddr) = ("user_social_" + callerAddr)
122102
123103
124104 func keyUserThumb (callerAddr) = ("user_thumb_" + callerAddr)
125105
126106
127107 func keyUserStatus (callerAddr) = ("user_status_" + callerAddr)
128108
129109
130110 func keyUserDate (callerAddr) = ("user_date_" + callerAddr)
131111
132112
133113 func keyArtDate (callerAddr,artId) = ((("art_date_" + artId) + "_") + callerAddr)
134114
135115
136116 func keyArtName (callerAddr,artId) = ((("art_name_" + artId) + "_") + callerAddr)
137117
138118
139119 func keyArtDesc (callerAddr,artId) = ((("art_desc_" + artId) + "_") + callerAddr)
140120
141121
142122 func keyArtDisplayCid (callerAddr,artId) = ((("art_display_cid_" + artId) + "_") + callerAddr)
143123
144124
145125 func keyArtExportHash (callerAddr,artId) = ((("art_export_hash_" + artId) + "_") + callerAddr)
146126
147127
148128 func keyArtExportCid (callerAddr,artId) = ((("art_export_cid_" + artId) + "_") + callerAddr)
149129
150130
151131 func keyArtMaxMint (callerAddr,artId) = ((("art_maxmint_" + artId) + "_") + callerAddr)
152132
153133
154134 func keyArtSignID (callerAddr,artId) = ((("art_signid_" + artId) + "_") + callerAddr)
155135
156136
157137 func keyArtIssued (callerAddr,artId) = ((("art_issued_" + artId) + "_") + callerAddr)
158138
159139
160140 func keyArtOnSale (callerAddr,artId) = ((("art_onsale_" + artId) + "_") + callerAddr)
161141
162142
163143 func keyArtLicenceHash (callerAddr,artId) = ((("art_licence_hash_" + artId) + "_") + callerAddr)
164144
165145
166146 func keyArtLicenceCid (callerAddr,artId) = ((("art_licence_cid_" + artId) + "_") + callerAddr)
167147
168148
169149 func keyArtTags (callerAddr,artId) = ((("art_tags_" + artId) + "_") + callerAddr)
170150
171151
172152 func keyArtType (callerAddr,artId) = ((("art_type_" + artId) + "_") + callerAddr)
173153
174154
175155 func keyArtPrice (callerAddr,artId) = ((("art_price_" + artId) + "_") + callerAddr)
176156
177157
178158 func keyArtAssetIdAccepted (callerAddr,artId) = ((("art_assetAccepted_" + artId) + "_") + callerAddr)
179159
180160
181161 func keyArtHashByTxidAddr (callerAddr,txid) = ((("get_hashbytxidaddr_" + txid) + "_") + callerAddr)
182162
183163
184164 func keyArtOwnerByHash (sha256Hash) = ("get_owner_by_hash_" + sha256Hash)
185165
186166
187167 func keyArtArtidBySignid (callerAddr,signId) = ((("get_artidbysignid_" + signId) + "_") + callerAddr)
188168
189169
190170 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
191204
192205
193206 @Callable(i)
194207 func registerUser (name,description,thumb,social) = {
195208 let callerAddr = toString(addressFromPublicKey(i.callerPublicKey))
196209 let userCanRegister = getStringByKey(keyUserStatus(callerAddr))
197210 let id = toBase58String(i.transactionId)
198211 let timestamp = lastBlock.timestamp
199212 if (if ((userCanRegister == userSuspended))
200213 then true
201214 else (userCanRegister == userRemoved))
202215 then throw("You are now allowed to register, your account have been suspended/ removed.")
203216 else if ((userCanRegister == userRegistered))
204217 then throw("You are already registered, please use update method instead.")
205218 else if (if ((userCanRegister == ""))
206219 then WHITELISTEDONLY
207220 else false)
208221 then throw("You are now allowed to register yet, please contact us first to get approved.")
209222 else if (if ((name == ""))
210223 then true
211224 else (description == ""))
212225 then throw("Name and description cannot be empty")
213226 else if ((size(description) > 600))
214227 then throw("600 Characters maximum for the description")
215228 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)]
216229 }
217230
218231
219232
220233 @Callable(i)
221234 func deleteEntry (entry) = {
222235 let callerAddr = toString(addressFromPublicKey(i.callerPublicKey))
223236 if ((callerAddr == admin))
224237 then [DeleteEntry(entry)]
225238 else throw("no")
226239 }
227240
228241
229242
230243 @Callable(i)
231244 func updateUser (name,description,thumb,social) = {
232245 let callerAddr = toString(addressFromPublicKey(i.callerPublicKey))
233246 let userCanRegister = getStringByKey(keyUserStatus(callerAddr))
234247 if (if ((userCanRegister == userSuspended))
235248 then true
236249 else (userCanRegister == userRemoved))
237250 then throw("You are now allowed to register, your account have been suspended/ removed.")
238251 else if (if ((userCanRegister == ""))
239252 then true
240253 else (userCanRegister == userAllowed))
241254 then throw("Please register first with registerUser")
242255 else {
243256 let id = toBase58String(i.transactionId)
244257 let timestamp = lastBlock.timestamp
245258 if (if ((name == ""))
246259 then true
247260 else (description == ""))
248261 then throw("Name and description cannot be empty")
249262 else if ((size(description) > 600))
250263 then throw("600 Characters maximum for the description")
251264 else [StringEntry(keyUserName(callerAddr), name), StringEntry(keyUserDesc(callerAddr), description), StringEntry(keyUserSocial(callerAddr), social), StringEntry(keyUserThumb(callerAddr), thumb), StringEntry("last_invoke_id", id)]
252265 }
253266 }
254267
255268
256269
257270 @Callable(i)
258271 func changeUserStatus (address,status) = {
259272 let callerAddr = toString(addressFromPublicKey(i.callerPublicKey))
260273 let id = toBase58String(i.transactionId)
261274 let currentStatus = getStringByKey(keyUserStatus(address))
262275 let statusToSet = if ((status == userVerified))
263276 then userVerified
264277 else if ((status == userRegistered))
265278 then userRegistered
266279 else if ((status == userSuspended))
267280 then userSuspended
268281 else if ((status == userRemoved))
269282 then userRemoved
270283 else if ((status == userAllowed))
271284 then userAllowed
272285 else if (if ((status == userReset))
273286 then (currentStatus == userAllowed)
274287 else false)
275288 then ""
276289 else throw("Unknown status")
277290 if (if ((currentStatus == userAllowed))
278291 then (status == userAllowed)
279292 else false)
280293 then throw("This user is already allowed")
281294 else if (if ((currentStatus == userRegistered))
282295 then (status == userAllowed)
283296 else false)
284297 then throw("This user is already allowed and registered")
285298 else if (if ((currentStatus == userVerified))
286299 then (status == userAllowed)
287300 else false)
288301 then throw("This user is already allowed and verified")
289302 else if (if ((callerAddr == admin))
290303 then true
291304 else (callerAddr == admin2))
292305 then [StringEntry(keyUserStatus(address), statusToSet), StringEntry("last_invoke_id", id)]
293306 else throw(((("You are not allowed to change user status " + callerAddr) + " / ") + admin))
294307 }
295308
296309
297310
298311 @Callable(i)
299312 func creditUser (address) = {
300313 let callerAddr = toString(addressFromPublicKey(i.callerPublicKey))
301314 let id = toBase58String(i.transactionId)
302315 if (if ((callerAddr == admin))
303316 then true
304317 else (callerAddr == admin2))
305318 then [ScriptTransfer(Address(fromBase58String(address)), 150000000000, signAssetId)]
306319 else throw("You are not allowed to do that")
307320 }
308321
309322
310323
311324 @Callable(invoke)
312325 func addArtwork (sha256Hash,signID,name,description,tags,type,maxmint,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence) = {
313326 let artId = toBase58String(invoke.transactionId)
314327 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)
335341 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+ }
408401 }
409402
410403
411404
412405 @Callable(invoke)
413406 func updateArtwork (txid,name,description,tags,type,maxmint,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence) = {
414407 let updateId = toBase58String(invoke.transactionId)
415408 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+ }
483455 }
484456
485457
486458
487459 @Callable(i)
488460 func deleteArtwork (artId,address) = {
489461 let callerAddress = toString(addressFromPublicKey(i.callerPublicKey))
490462 let id = toBase58String(i.transactionId)
491463 let addressToUse = if (if ((callerAddress == admin))
492464 then true
493465 else (callerAddress == admin2))
494466 then address
495467 else callerAddress
496468 let entryExist = match getString(this, keyArtName(addressToUse, artId)) {
497469 case s: String =>
498470 s
499471 case _ =>
500472 throw("No artwork matching this request or you are not allowed")
501473 }
502474 let artworkMinted = match getInteger(this, keyArtIssued(addressToUse, artId)) {
503475 case b: Int =>
504476 if ((b != 0))
505477 then true
506478 else false
507479 case _ =>
508480 false
509481 }
510482 let maxMint = getIntegerByKey(keyArtMaxMint(addressToUse, artId))
511483 let sha256Hash = match getString(this, keyArtHashByTxidAddr(addressToUse, artId)) {
512484 case s: String =>
513485 s
514486 case _ =>
515487 throw("No artwork hash matching this request")
516488 }
517489 let signID = match getString(this, keyArtSignID(addressToUse, artId)) {
518490 case s: String =>
519491 s
520492 case _ =>
521493 throw("No SIGN ID matching this request")
522494 }
523495 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))]
524496 if (if ((callerAddress == admin))
525497 then true
526498 else (callerAddress == admin2))
527499 then dataToDelete
528500 else if (!(artworkMinted))
529501 then dataToDelete
530502 else throw("This artwork already have minted NFT, you cannot delete it")
531503 }
532504
533505
534506
535507 @Callable(invoke)
536508 func sellArtwork (artId,price,maxMint,assetId) = {
537509 let id = toBase58String(invoke.transactionId)
538510 let callerAddress = toBase58String(invoke.caller.bytes)
539511 let sellDate = lastBlock.timestamp
540512 let exportCID = getStringByKey(keyArtExportCid(callerAddress, artId))
541513 if ((size(split(exportCID, "/")[0]) != 59))
542514 then throw("You cannot sell artwork with no export file")
543515 else {
544516 let exportHash = getStringByKey(keyArtExportHash(callerAddress, artId))
545517 if ((size(exportHash) != 64))
546518 then throw("You cannot sell artwork with no export hash")
547519 else if (if (if ((assetId != toBase58String(signAssetId)))
548520 then (assetId != toBase58String(wavesAssetId))
549521 else false)
550522 then (assetId != toBase58String(usdnAssetId))
551523 else false)
552524 then throw("Only SIGN, USDN or WAVES currency accepted at the moment")
553525 else {
554526 let artworkName = match getString(this, keyArtName(callerAddress, artId)) {
555527 case s: String =>
556528 s
557529 case _ =>
558530 throw("This artwork doesn't exit or you are not the owner")
559531 }
560532 let userIsRegistered = match getString(this, keyUserStatus(callerAddress)) {
561533 case s: String =>
562534 s
563535 case _ =>
564536 throw("Please register this account first")
565537 }
566538 let amountSold = match getInteger(this, keyArtIssued(callerAddress, artId)) {
567539 case n: Int =>
568540 n
569541 case _ =>
570542 0
571543 }
572544 let maxCanSell = match getInteger(this, keyArtMaxMint(callerAddress, artId)) {
573545 case n: Int =>
574546 n
575547 case _ =>
576548 0
577549 }
578550 if (if ((amountSold != 0))
579551 then (amountSold == maxCanSell)
580552 else false)
581553 then throw("You reached the max edition allowed to sell for this edition.")
582554 else if (if ((amountSold > 0))
583555 then (maxCanSell != maxMint)
584556 else false)
585557 then throw("You cannot change the maximum issuable anymore")
586558 else if ((userIsRegistered == userSuspended))
587559 then throw("Your account is suspended")
588560 else if ((userIsRegistered == userRemoved))
589561 then throw("Your account have been deleted")
590562 else {
591563 let sellStatus = if ((price > 0))
592564 then true
593565 else false
594566 [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)]
595567 }
596568 }
597569 }
598570 }
599571
600572
601573
602574 @Callable(invoke)
603575 func buyArtwork (artId,issuer) = {
604576 let id = toBase58String(invoke.transactionId)
605577 let callerAddress = toBase58String(invoke.caller.bytes)
606578 let totalNFT = getIntegerByKey("total_nft_issued")
607579 let signID = getStringByKey(keyArtSignID(issuer, artId))
608580 let artworkName = match getString(this, keyArtName(issuer, artId)) {
609581 case s: String =>
610582 s
611583 case _ =>
612584 throw("This artwork doesn't exit")
613585 }
614586 let displayCID = getStringByKey(keyArtDisplayCid(issuer, artId))
615587 let exportCID = getStringByKey(keyArtExportCid(issuer, artId))
616588 let exportHash = getStringByKey(keyArtExportHash(issuer, artId))
617589 let licenceCID = getStringByKey(keyArtLicenceCid(issuer, artId))
618590 let licenceHash = getStringByKey(keyArtLicenceHash(issuer, artId))
619591 let description = take(getStringByKey(keyArtDesc(issuer, artId)), 50)
620592 let amountSold = getIntegerByKey(keyArtIssued(issuer, artId))
621593 let artworkPrice = getIntegerByKey(keyArtPrice(issuer, artId))
622594 let isOnSale = getBooleanByKey(keyArtOnSale(issuer, artId))
623595 let priceAssetId = getStringByKey(keyArtAssetIdAccepted(issuer, artId))
624596 let sourceHash = getStringByKey(keyArtHashByTxidAddr(issuer, artId))
625597 if ((artworkPrice == 0))
626598 then throw("This artwork is not for sell")
627599 else if (!(isOnSale))
628600 then throw("This artwork is not for sale")
629601 else {
630602 let maxCanSell = getIntegerByKey(keyArtMaxMint(issuer, artId))
631603 let payment = value(invoke.payments[0])
632604 let amount = value(payment.amount)
633605 let assetId = if (if (isDefined(payment.assetId))
634606 then (payment.assetId == fromBase58String(priceAssetId))
635607 else false)
636608 then payment.assetId
637609 else throw((("Only " + priceAssetId) + " token id accepted at the moment"))
638610 let cut = if ((priceAssetId == toBase58String(signAssetId)))
639611 then 8
640612 else 10
641613 let amountForSign = ((amount / 100) * cut)
642614 let amountForCreator = (amount - amountForSign)
643615 if ((amountSold == maxCanSell))
644616 then throw("Cannot buy this artwork anymore, maximum editions reached")
645617 else if ((artworkPrice != amount))
646618 then throw(((("Payment don't match seller price: " + toString(artworkPrice)) + " vs ") + toString(amount)))
647619 else {
648620 let newAmountSold = (amountSold + 1)
649621 let entryDate = lastBlock.timestamp
650622 let issueMeta = (((((((((((((((((((((((((((("{\"version\": 1,
651623 \"creator\": \"" + issuer) + "\",
652624 \"artID\": \"") + artId) + "\",
653625 \"signID\": \"") + signID) + "\",
654626 \"artwork_name\": \"") + artworkName) + "\",
655627 \"artwork_desc\": \"") + description) + "\",
656628 \"issue\": \"") + toString(newAmountSold)) + "/") + toString(maxCanSell)) + "\",
657629 \"maxIssuable\": \"") + toString(maxCanSell)) + "\",
658630 \"source_hash\": \"") + sourceHash) + "\",
659631 \"display_cid\": \"") + displayCID) + "\",
660632 \"export_cid\": \"") + exportCID) + "\",
661633 \"export_hash\": \"") + exportHash) + "\",
662634 \"licence_cid\": \"") + licenceCID) + "\",
663635 \"licence_hash\": \"") + licenceHash) + "\"}")
664636 let issueNFT = Issue(("SA_" + toString((totalNFT + 1))), issueMeta, 1, 0, false)
665637 let idNFT = calculateAssetId(issueNFT)
666638 let sellStatus = if ((newAmountSold == maxCanSell))
667639 then false
668640 else true
669641 [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)]
670642 }
671643 }
672644 }
673645
674646
675647
676648 @Callable(i)
677649 func deleteUser (address) = {
678650 let callerAddr = toString(addressFromPublicKey(i.callerPublicKey))
679651 let id = toBase58String(i.transactionId)
680652 if (if ((callerAddr == admin))
681653 then true
682654 else (callerAddr == admin2))
683655 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 to do that")
656+ else throw("You are not allowed")
685657 }
686658
687659

github/deemru/w8io/026f985 
78.65 ms