tx · AmQMAA9kpqWAbpWnjhziZShNUHoSnVNMK88gK5yWLcBg

3NBynfbXC2KastUxhukcMUaE58K9cBdB9UY:  -0.19000000 Waves

2023.03.24 06:59 [2503578] smart account 3NBynfbXC2KastUxhukcMUaE58K9cBdB9UY > SELF 0.00000000 Waves

{ "type": 13, "id": "AmQMAA9kpqWAbpWnjhziZShNUHoSnVNMK88gK5yWLcBg", "fee": 19000000, "feeAssetId": null, "timestamp": 1679630339592, "version": 2, "chainId": 84, "sender": "3NBynfbXC2KastUxhukcMUaE58K9cBdB9UY", "senderPublicKey": "J9DCtJJxJBWZdtDR12BA1U94Q3cZzMi4R6k5hYkAzmzC", "proofs": [ "45NoerogzstNQ2wzXVWDhnrxqEJ5SyGTNSgbBnmDq1cnsx9Ekq8dK9oqcLPynKe4AYjNWTgqa9mSB3rp6UFRTSJY" ], "script": "base64:BgKKFQgCEgQKAggIEhAKDggICAgICAgICAgICAEIEg8KDQgICAgICAgICAgIAQgSBgoECAgICBIECgIICBIICgYIAQEIAQgSBAoCCAgSBAoCCAgSBwoFCAgICAgSBgoECAgICCIOZ2V0U3RyaW5nQnlLZXkiA2tleSIIdW5pdFRlc3QiCW9yYWNsZUZlZSIIc2lnbkRhcHAiC2ZlZVJlY2VpdmVyIgh1c2VyRGFwcCINd2hpdGVsaXN0RGFwcCILc2lnbkFzc2V0SWQiC3VzZG5Bc3NldElkIgt1c2R0QXNzZXRJZCIMd2F2ZXNBc3NldElkIgVjaHJpcyIZZ2V0SW50ZWdlckJ5S2V5RnJvbU9yYWNsZSIPZ2V0SW50ZWdlckJ5S2V5Ig5jaGVja1doaXRlbGlzdCIPZ2V0Qm9vbGVhbkJ5S2V5IgdzaWduQ3V0Igt1c2RuV2F2ZUN1dCIOZGVmYXVsdExpY2VuY2UiEmRlZmF1bHRIYXNoTGljZW5jZSILZGFwcFJ1bm5pbmciDm1haW50ZW5hbmNlTVNHIg11c2VyU3VzcGVuZGVkIgt1c2VyUmVtb3ZlZCIQdXNl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IBQJjWQNmZWUAoMIeBwkAAAIIBQJjWQpmZWVBc3NldElkBQR1bml0BwkA9AMDCAUCY1cJYm9keUJ5dGVzCQCRAwIIBQJjVwZwcm9vZnMAAAkA2QQBCQECY24BCQCRAwIIBQJjWQRhcmdzAAUDAwMDCQAAAggFAmNZCGZ1bmN0aW9uAglhY2NlcHRCaWQJAAACCAUCY1kEZEFwcAUEdGhpcwcJAAACCAUCY1kDZmVlAKDCHgcJAAACCAUCY1kKZmVlQXNzZXRJZAUEdW5pdAcJAMgTAwgFAmNXCWJvZHlCeXRlcwkAkQMCCAUCY1cGcHJvb2ZzAAAJANkEAQkBAmNuAQkAkQMCCAUCY1kEYXJncwAECQD0AwMIBQJjVwlib2R5Qnl0ZXMJAJEDAggFAmNXBnByb29mcwAACAUCY1cPc2VuZGVyUHVibGljS2V5CQD0AwMIBQJjVwlib2R5Qnl0ZXMJAJEDAggFAmNXBnByb29mcwAACAUCY1cPc2VuZGVyUHVibGljS2V5v7nfsg==", "height": 2503578, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: A3MZ1wmGq3k3n2SJDLyrgY6fx3PXTrGW4Zsgwg4d2t2t Next: BUWmPvsmKTKiion78DmS9xZrAgfxnnbvdQAyyGR6M7SA Diff:
OldNewDifferences
380380 let isSponsored = if ((pubKey != ""))
381381 then valueOrElse(checkWhitelist((toString(addressFromPublicKey(fromBase58String(pubKey))) + "_free_txs")), 0)
382382 else 0
383- if ((isSponsored == isSponsored))
384- then {
385- let caller = if (if ((toBase58String(i.caller.bytes) == toString(this)))
386- then (isSponsored > 0)
387- else false)
388- then toString(addressFromPublicKey(fromBase58String(pubKey)))
389- else toBase58String(i.caller.bytes)
390- let get_sponsored_waves = if (if ((pubKey != ""))
391- then (isSponsored > 0)
392- else false)
393- then invoke(whitelistDapp, "useFreeTx", [toString(addressFromPublicKey(fromBase58String(pubKey)))], nil)
394- else unit
395- if ((get_sponsored_waves == get_sponsored_waves))
396- then $Tuple4(toBase58String(i.transactionId), caller, lastBlock.timestamp, isSponsored)
397- else throw("Strict value is not equal to itself.")
398- }
383+ let caller = if (if ((toBase58String(i.caller.bytes) == toString(this)))
384+ then (isSponsored > 0)
385+ else false)
386+ then toString(addressFromPublicKey(fromBase58String(pubKey)))
387+ else toBase58String(i.caller.bytes)
388+ let get_sponsored_waves = if (if ((pubKey != ""))
389+ then (isSponsored > 0)
390+ else false)
391+ then invoke(whitelistDapp, "useFreeTx", [toString(addressFromPublicKey(fromBase58String(pubKey)))], nil)
392+ else unit
393+ if ((get_sponsored_waves == get_sponsored_waves))
394+ then $Tuple4(toBase58String(i.transactionId), caller, lastBlock.timestamp, isSponsored)
399395 else throw("Strict value is not equal to itself.")
400396 }
401397
406402
407403
408404 func buyMint (i,artId,issuer,bidId,bidOwner,pubKey) = {
409- let $t01304013113 = idCallerDateSponsored(i, pubKey)
410- if (($t01304013113 == $t01304013113))
411- then {
412- let isSponsored = $t01304013113._4
413- let date = $t01304013113._3
414- let caller = $t01304013113._2
415- let id = $t01304013113._1
405+ let $t01303713107 = idCallerDateSponsored(i, pubKey)
406+ let id = $t01303713107._1
407+ let caller = $t01303713107._2
408+ let date = $t01303713107._3
409+ let isSponsored = $t01303713107._4
410+ if (true)
411+ then throw(toString(isSponsored))
412+ else {
413+ let new_caller = if (if ((toBase58String(i.caller.bytes) == toString(this)))
414+ then (isSponsored > 0)
415+ else false)
416+ then toString(addressFromPublicKey(fromBase58String(pubKey)))
417+ else toBase58String(i.caller.bytes)
416418 if (true)
417- then throw(toString(isSponsored))
419+ then throw(((((((new_caller + " / ") + issuer) + " / ") + bidOwner) + " / ") + pubKey))
418420 else {
419- let new_caller = if (if ((toBase58String(i.caller.bytes) == toString(this)))
420- then (isSponsored > 0)
421+ let isBid = if (if (if ((caller == issuer))
422+ then (bidOwner != "")
421423 else false)
422- then toString(addressFromPublicKey(fromBase58String(pubKey)))
423- else toBase58String(i.caller.bytes)
424- if (true)
425- then throw(((((((new_caller + " / ") + issuer) + " / ") + bidOwner) + " / ") + pubKey))
424+ then (bidId != "")
425+ else false)
426+ then true
427+ else false
428+ let blockEnd = getIntegerByKey(keyEndSale(caller, artId))
429+ if (if (if ((blockEnd != 0))
430+ then (height >= blockEnd)
431+ else false)
432+ then !(isBid)
433+ else false)
434+ then throw("Sale ended.")
426435 else {
427- let isBid = if (if (if ((caller == issuer))
428- then (bidOwner != "")
429- else false)
430- then (bidId != "")
431- else false)
432- then true
433- else false
434- let blockEnd = getIntegerByKey(keyEndSale(caller, artId))
435- if (if (if ((blockEnd != 0))
436- then (height >= blockEnd)
437- else false)
438- then !(isBid)
439- else false)
440- then throw("Sale ended.")
436+ let callerIsIssuer = (caller == issuer)
437+ let totalNFT = getIntegerByKey("total_nft_issued")
438+ let signID = getStringByKey(keySignID(issuer, artId))
439+ let artworkName = getStringByKey(keyName(issuer, artId))
440+ if ((artworkName == ""))
441+ then throw("Art doesn't exist")
441442 else {
442- let callerIsIssuer = (caller == issuer)
443- let totalNFT = getIntegerByKey("total_nft_issued")
444- let signID = getStringByKey(keySignID(issuer, artId))
445- let artworkName = getStringByKey(keyName(issuer, artId))
446- if ((artworkName == ""))
447- then throw("Art doesn't exist")
448- else {
449- let isOnSale = getBooleanByKey(keyOnSale(issuer, artId))
450- let amountSold = getIntegerByKey(keyIssued(issuer, artId))
451- let artworkPrice = if (callerIsIssuer)
452- then (currentCertificationPrice * 2)
453- else getIntegerByKey(keyPrice(issuer, artId))
454- let priceAssetId = if (callerIsIssuer)
455- then toBase58String(signAssetId)
456- else getStringByKey(keyAssetIdAccepted(issuer, artId))
457- let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId))
458- if (if (if (!(isBid))
459- then !(callerIsIssuer)
460- else false)
461- then if (if ((0 >= artworkPrice))
462- then true
463- else !(isOnSale))
464- then true
465- else (0 >= maxCanSell)
466- else false)
467- then throw("Art not for sale")
468- else if (if (if (!(isBid))
469- then callerIsIssuer
443+ let isOnSale = getBooleanByKey(keyOnSale(issuer, artId))
444+ let amountSold = getIntegerByKey(keyIssued(issuer, artId))
445+ let artworkPrice = if (callerIsIssuer)
446+ then (currentCertificationPrice * 2)
447+ else getIntegerByKey(keyPrice(issuer, artId))
448+ let priceAssetId = if (callerIsIssuer)
449+ then toBase58String(signAssetId)
450+ else getStringByKey(keyAssetIdAccepted(issuer, artId))
451+ let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId))
452+ if (if (if (!(isBid))
453+ then !(callerIsIssuer)
454+ else false)
455+ then if (if ((0 >= artworkPrice))
456+ then true
457+ else !(isOnSale))
458+ then true
459+ else (0 >= maxCanSell)
460+ else false)
461+ then throw("Art not for sale")
462+ else if (if (if (!(isBid))
463+ then callerIsIssuer
464+ else false)
465+ then (0 >= maxCanSell)
466+ else false)
467+ then throw("Max issuable not set")
468+ else {
469+ let checkUser = validateUser(issuer)
470+ if (if (isBid)
471+ then (checkUser != "")
470472 else false)
471- then (0 >= maxCanSell)
472- else false)
473- then throw("Max issuable not set")
473+ then throw(checkUser)
474474 else {
475- let checkUser = validateUser(issuer)
476- if (if (isBid)
477- then (checkUser != "")
475+ let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId)
476+ let $t01498315175 = if (isBid)
477+ then getPriceAssetIdFromBid(bidDataKey)
478+ else validatePriceAssetId(i, priceAssetId, artworkPrice)
479+ let amount = $t01498315175._1
480+ let assetId = $t01498315175._2
481+ let agent = valueOrElse(getString(userDapp, keyArtistAgentAddr(issuer)), feeReceiver)
482+ let agentShare = valueOrElse(getInteger(userDapp, keyPrimaryShareAgent(issuer)), 0)
483+ let publicAgent = valueOrElse(getString(userDapp, keyArtistPublicAgentAddr(issuer)), feeReceiver)
484+ let publicAgentShare = valueOrElse(getInteger(userDapp, keyPrimarySharePublicAgent(issuer)), 0)
485+ let isWhitelisted = checkWhitelist(issuer)
486+ let cut = if ((isWhitelisted > height))
487+ then 0
488+ else if ((assetId == signAssetId))
489+ then signCut
490+ else usdnWaveCut
491+ let amountForSign = fraction(amount, cut, 100)
492+ let amountForAgent = if (if (if ((agent != feeReceiver))
493+ then (agentShare > 0)
478494 else false)
479- then throw(checkUser)
495+ then (height > isWhitelisted)
496+ else false)
497+ then fraction(amount, agentShare, 10000)
498+ else 0
499+ let amountForPublicAgent = if (if (if ((publicAgent != feeReceiver))
500+ then (publicAgentShare > 0)
501+ else false)
502+ then (height > isWhitelisted)
503+ else false)
504+ then fraction(amount, publicAgentShare, 10000)
505+ else 0
506+ let amountForCreator = (amount - amountForSign)
507+ if ((amountSold == maxCanSell))
508+ then throw("Art sold out")
480509 else {
481- let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId)
482- let $t01498915181 = if (isBid)
483- then getPriceAssetIdFromBid(bidDataKey)
484- else validatePriceAssetId(i, priceAssetId, artworkPrice)
485- let amount = $t01498915181._1
486- let assetId = $t01498915181._2
487- let agent = valueOrElse(getString(userDapp, keyArtistAgentAddr(issuer)), feeReceiver)
488- let agentShare = valueOrElse(getInteger(userDapp, keyPrimaryShareAgent(issuer)), 0)
489- let publicAgent = valueOrElse(getString(userDapp, keyArtistPublicAgentAddr(issuer)), feeReceiver)
490- let publicAgentShare = valueOrElse(getInteger(userDapp, keyPrimarySharePublicAgent(issuer)), 0)
491- let isWhitelisted = checkWhitelist(issuer)
492- let cut = if ((isWhitelisted > height))
493- then 0
494- else if ((assetId == signAssetId))
495- then signCut
496- else usdnWaveCut
497- let amountForSign = fraction(amount, cut, 100)
498- let amountForAgent = if (if (if ((agent != feeReceiver))
499- then (agentShare > 0)
500- else false)
501- then (height > isWhitelisted)
502- else false)
503- then fraction(amount, agentShare, 10000)
504- else 0
505- let amountForPublicAgent = if (if (if ((publicAgent != feeReceiver))
506- then (publicAgentShare > 0)
507- else false)
508- then (height > isWhitelisted)
509- else false)
510- then fraction(amount, publicAgentShare, 10000)
511- else 0
512- let amountForCreator = (amount - amountForSign)
513- if ((amountSold == maxCanSell))
514- then throw("Art sold out")
515- else {
516- let newAmountSold = (amountSold + 1)
517- let issueMeta = ((((((((((("Creator: " + issuer) + ",
510+ let newAmountSold = (amountSold + 1)
511+ let issueMeta = ((((((((((("Creator: " + issuer) + ",
518512 ArtID: ") + artId) + ",
519513 SignID: ") + signID) + ",
520514 Artwork name: ") + artworkName) + ",
521515 Issue: ") + toString(newAmountSold)) + "/") + toString(maxCanSell))
522- let issueNFT = Issue(("SA_" + toString((totalNFT + 1))), issueMeta, 1, 0, false)
523- let idNFT = calculateAssetId(issueNFT)
524- let sellStatus = if (if ((newAmountSold == maxCanSell))
525- then true
526- else !(isOnSale))
527- then false
528- else true
529- let receiveNFT = if (if (if ((caller == issuer))
530- then (bidOwner != "")
531- else false)
532- then (bidId != "")
533- else false)
534- then addressFromStringValue(bidOwner)
535- else i.caller
536- let assetIdBid = if (!(isDefined(assetId)))
537- then "WAVES"
538- else toBase58String(value(assetId))
539- let bidData = getStringByKey((bidDataKey + "_OPEN"))
540- let bidDelOld = DeleteEntry((bidDataKey + "_OPEN"))
541- let bidUpdate = StringEntry((bidDataKey + "_CLOSED"), ((bidData + "_") + toString(date)))
542- let soldKey = ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer)
543- let soldValue = if (!(isBid))
544- then ((((((((((caller + "_") + toString(date)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + toBase58String(idNFT))
545- else ((((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + assetIdBid) + "_") + toBase58String(idNFT))
546- let soldData = StringEntry(soldKey, soldValue)
547- let commissionsWithAgent = if ((amountForAgent != 0))
548- then [ScriptTransfer(Address(fromBase58String(feeReceiver)), (amountForSign - amountForAgent), assetId), ScriptTransfer(Address(fromBase58String(agent)), amountForAgent, assetId)]
549- else [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)]
550- let commissionsWithPublicAgent = if ((amountForPublicAgent != 0))
551- then [ScriptTransfer(Address(fromBase58String(publicAgent)), amountForPublicAgent, assetId), ScriptTransfer(Address(fromBase58String(issuer)), (amountForCreator - amountForPublicAgent), assetId)]
552- else [ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId)]
553- let txToCaller = if ((isSponsored > 0))
554- then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
555- else nil
556- let buyRes = ((([IntegerEntry(keyIssued(issuer, artId), newAmountSold), StringEntry(("nft_" + toBase58String(idNFT)), soldKey), IntegerEntry("total_nft_issued", (totalNFT + 1)), IntegerEntry(keyEndSale(issuer, artId), 0), BooleanEntry(keyOnSale(issuer, artId), sellStatus), issueNFT, ScriptTransfer(receiveNFT, 1, idNFT)] ++ commissionsWithAgent) ++ commissionsWithPublicAgent) ++ txToCaller)
557- if (isBid)
558- then [soldData, bidUpdate, bidDelOld] :: buyRes
559- else soldData :: buyRes
560- }
516+ let issueNFT = Issue(("SA_" + toString((totalNFT + 1))), issueMeta, 1, 0, false)
517+ let idNFT = calculateAssetId(issueNFT)
518+ let sellStatus = if (if ((newAmountSold == maxCanSell))
519+ then true
520+ else !(isOnSale))
521+ then false
522+ else true
523+ let receiveNFT = if (if (if ((caller == issuer))
524+ then (bidOwner != "")
525+ else false)
526+ then (bidId != "")
527+ else false)
528+ then addressFromStringValue(bidOwner)
529+ else i.caller
530+ let assetIdBid = if (!(isDefined(assetId)))
531+ then "WAVES"
532+ else toBase58String(value(assetId))
533+ let bidData = getStringByKey((bidDataKey + "_OPEN"))
534+ let bidDelOld = DeleteEntry((bidDataKey + "_OPEN"))
535+ let bidUpdate = StringEntry((bidDataKey + "_CLOSED"), ((bidData + "_") + toString(date)))
536+ let soldKey = ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer)
537+ let soldValue = if (!(isBid))
538+ then ((((((((((caller + "_") + toString(date)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + toBase58String(idNFT))
539+ else ((((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + assetIdBid) + "_") + toBase58String(idNFT))
540+ let soldData = StringEntry(soldKey, soldValue)
541+ let commissionsWithAgent = if ((amountForAgent != 0))
542+ then [ScriptTransfer(Address(fromBase58String(feeReceiver)), (amountForSign - amountForAgent), assetId), ScriptTransfer(Address(fromBase58String(agent)), amountForAgent, assetId)]
543+ else [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)]
544+ let commissionsWithPublicAgent = if ((amountForPublicAgent != 0))
545+ then [ScriptTransfer(Address(fromBase58String(publicAgent)), amountForPublicAgent, assetId), ScriptTransfer(Address(fromBase58String(issuer)), (amountForCreator - amountForPublicAgent), assetId)]
546+ else [ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId)]
547+ let txToCaller = if ((isSponsored > 0))
548+ then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
549+ else nil
550+ let buyRes = ((([IntegerEntry(keyIssued(issuer, artId), newAmountSold), StringEntry(("nft_" + toBase58String(idNFT)), soldKey), IntegerEntry("total_nft_issued", (totalNFT + 1)), IntegerEntry(keyEndSale(issuer, artId), 0), BooleanEntry(keyOnSale(issuer, artId), sellStatus), issueNFT, ScriptTransfer(receiveNFT, 1, idNFT)] ++ commissionsWithAgent) ++ commissionsWithPublicAgent) ++ txToCaller)
551+ if (isBid)
552+ then [soldData, bidUpdate, bidDelOld] :: buyRes
553+ else soldData :: buyRes
561554 }
562555 }
563- }
556+ }
564557 }
565558 }
566559 }
567560 }
568- else throw("Strict value is not equal to itself.")
569561 }
570562
571563
591583
592584 @Callable(i)
593585 func addArtwork (sha256Hash,signID,name,description,tags,type,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence,crawler,royalties,pubKey) = {
594- let $t02036120434 = idCallerDateSponsored(i, pubKey)
595- let artId = $t02036120434._1
596- let caller = $t02036120434._2
597- let date = $t02036120434._3
598- let isSponsored = $t02036120434._4
586+ let $t02035520428 = idCallerDateSponsored(i, pubKey)
587+ let artId = $t02035520428._1
588+ let caller = $t02035520428._2
589+ let date = $t02035520428._3
590+ let isSponsored = $t02035520428._4
599591 if (!(validateHash(sha256Hash)))
600592 then throw("Hash should be 64 characters maximum")
601593 else {
602- let $t02053520604 = setLIcence(cidLicence, sha256Licence)
603- let licenceCID = $t02053520604._1
604- let licenceHash = $t02053520604._2
594+ let $t02052920598 = setLIcence(cidLicence, sha256Licence)
595+ let licenceCID = $t02052920598._1
596+ let licenceHash = $t02052920598._2
605597 let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, royalties)
606598 if ((validateArtwork != ""))
607599 then throw("Something went wrong!")
608600 else {
609601 let whitelisted_drop = (checkWhitelist((caller + "_free_drops")) > 0)
610- let $t02090320987 = if (whitelisted_drop)
602+ let $t02089720981 = if (whitelisted_drop)
611603 then $Tuple2(0, signID)
612604 else validatePayment(i)
613- let amount = $t02090320987._1
614- let assetId = $t02090320987._2
605+ let amount = $t02089720981._1
606+ let assetId = $t02089720981._2
615607 if (!(isDefined(amount)))
616608 then throw("Something went wrong")
617609 else {
652644 func updateArtwork (txid,name,description,tags,type,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence,crawler,royalties,pubKey) = if (!(dappRunning))
653645 then throw(maintenanceMSG)
654646 else {
655- let $t02402524095 = idCallerDateSponsored(i, pubKey)
656- let id = $t02402524095._1
657- let caller = $t02402524095._2
658- let date = $t02402524095._3
659- let isSponsored = $t02402524095._4
660- let $t02410524174 = setLIcence(cidLicence, sha256Licence)
661- let licenceCID = $t02410524174._1
662- let licenceHash = $t02410524174._2
647+ let $t02401924089 = idCallerDateSponsored(i, pubKey)
648+ let id = $t02401924089._1
649+ let caller = $t02401924089._2
650+ let date = $t02401924089._3
651+ let isSponsored = $t02401924089._4
652+ let $t02409924168 = setLIcence(cidLicence, sha256Licence)
653+ let licenceCID = $t02409924168._1
654+ let licenceHash = $t02409924168._2
663655 let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, royalties)
664656 if ((validateArtwork != ""))
665657 then throw("Something went wrong!")
687679
688680 @Callable(i)
689681 func flagArtwork (artId,addr,flag,note) = {
690- let $t02580525839 = idCallerDate(i)
691- let id = $t02580525839._1
692- let caller = $t02580525839._2
682+ let $t02579925833 = idCallerDate(i)
683+ let id = $t02579925833._1
684+ let caller = $t02579925833._2
693685 if (containsElement([chris, toString(this)], caller))
694686 then if (containsElement(["CONSENT", "", "CHANGE_REQUIRED", "FLAGGED", "ILLEGAL"], flag))
695687 then [StringEntry(keyFlag(addr, artId), flag), StringEntry(keyNote(addr, artId), note)]
701693
702694 @Callable(i)
703695 func deleteArtwork (artId,addr) = {
704- let $t02627526309 = idCallerDate(i)
705- let id = $t02627526309._1
706- let caller = $t02627526309._2
696+ let $t02626926303 = idCallerDate(i)
697+ let id = $t02626926303._1
698+ let caller = $t02626926303._2
707699 let addrToUse = if (containsElement([chris, toString(this)], caller))
708700 then addr
709701 else caller
736728
737729 @Callable(i)
738730 func sellArtwork (artId,price,maxMint,assetId,blockEnd,pubKey) = {
739- let $t02914529215 = idCallerDateSponsored(i, pubKey)
740- let id = $t02914529215._1
741- let caller = $t02914529215._2
742- let date = $t02914529215._3
743- let isSponsored = $t02914529215._4
731+ let $t02913929209 = idCallerDateSponsored(i, pubKey)
732+ let id = $t02913929209._1
733+ let caller = $t02913929209._2
734+ let date = $t02913929209._3
735+ let isSponsored = $t02913929209._4
744736 let artworkName = getStringByKey(keyName(caller, artId))
745737 if ((artworkName == ""))
746738 then throw("This art doesn't match your account")
814806
815807 @Callable(i)
816808 func setBid (artId,issuer) = {
817- let $t03160131641 = idCallerDate(i)
818- let id = $t03160131641._1
819- let caller = $t03160131641._2
820- let date = $t03160131641._3
821- let $t03164631682 = isPayment(i)
822- let payment = $t03164631682._1
823- let amount = $t03164631682._2
809+ let $t03159531635 = idCallerDate(i)
810+ let id = $t03159531635._1
811+ let caller = $t03159531635._2
812+ let date = $t03159531635._3
813+ let $t03164031676 = isPayment(i)
814+ let payment = $t03164031676._1
815+ let amount = $t03164031676._2
824816 let assetId = if (!(isDefined(payment.assetId)))
825817 then "WAVES"
826818 else toBase58String(value(payment.assetId))
851843
852844 @Callable(i)
853845 func acceptBid (artId,issuer,bidId,bidOwner,pubKey) = {
854- let $t03290232973 = idCallerDateSponsored(i, pubKey)
855- let id = $t03290232973._1
856- let caller1 = $t03290232973._2
857- let date = $t03290232973._3
858- let isSponsored = $t03290232973._4
846+ let $t03289632967 = idCallerDateSponsored(i, pubKey)
847+ let id = $t03289632967._1
848+ let caller1 = $t03289632967._2
849+ let date = $t03289632967._3
850+ let isSponsored = $t03289632967._4
859851 if ((caller1 != issuer))
860852 then throw("You cannot do this action")
861853 else buyMint(i, artId, issuer, bidId, bidOwner, pubKey)
865857
866858 @Callable(i)
867859 func cancelBid (artId,issuer,bidId,bidOwner) = {
868- let $t03320833269 = idCallerDate(i)
869- let id = $t03320833269._1
870- let caller = $t03320833269._2
871- let date = $t03320833269._3
860+ let $t03320233263 = idCallerDate(i)
861+ let id = $t03320233263._1
862+ let caller = $t03320233263._2
863+ let date = $t03320233263._3
872864 if (if ((caller != bidOwner))
873865 then (caller != issuer)
874866 else false)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func getStringByKey (key) = valueOrElse(getString(this, key), "")
55
66
77 let unitTest = false
88
99 let oracleFee = value(addressFromString(getStringByKey("conf_oracle_fee")))
1010
1111 let signDapp = value(addressFromString(getStringByKey("conf_signweb_dapp")))
1212
1313 let feeReceiver = getStringByKey("conf_fee_receiver")
1414
1515 let userDapp = if (unitTest)
1616 then value(addressFromString("3Mt4RGMEyjSWYAocTPqd55wdHQQB3PU2UCm"))
1717 else value(addressFromString(getStringByKey("conf_users_dapp")))
1818
1919 let whitelistDapp = value(addressFromString(getStringByKey("conf_whitelist_dapp")))
2020
2121 let signAssetId = fromBase58String(getStringByKey("conf_accepted_asset_SIGN"))
2222
2323 let usdnAssetId = fromBase58String(getStringByKey("conf_accepted_asset_USDN"))
2424
2525 let usdtAssetId = fromBase58String(getStringByKey("conf_accepted_asset_USDT"))
2626
2727 let wavesAssetId = base58''
2828
2929 let chris = getStringByKey("conf_admin_1")
3030
3131 func getIntegerByKeyFromOracle (key) = valueOrErrorMessage(getInteger(oracleFee, key), "Integer undefine or 0 in oracle")
3232
3333
3434 func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 0)
3535
3636
3737 func checkWhitelist (key) = valueOrElse(getInteger(whitelistDapp, key), 0)
3838
3939
4040 func getBooleanByKey (key) = valueOrElse(getBoolean(this, key), false)
4141
4242
4343 let signCut = 7
4444
4545 let usdnWaveCut = 10
4646
4747 let defaultLicence = getStringByKey("conf_default_licence")
4848
4949 let defaultHashLicence = getStringByKey("conf_default_licence_hash")
5050
5151 let dappRunning = valueOrElse(getBoolean(userDapp, "conf_dapp_is_running"), true)
5252
5353 let maintenanceMSG = valueOrElse(getString(userDapp, "conf_maintenance_msg"), "")
5454
5555 let userSuspended = "SUSPENDED"
5656
5757 let userRemoved = "REMOVED"
5858
5959 let userUnregistered = "UNREGISTERED"
6060
6161 let userAllowed = "ALLOWED"
6262
6363 let currentCertificationPrice = getIntegerByKeyFromOracle(("certification_fee_" + toBase58String(signAssetId)))
6464
6565 func checkSignCertificate (signID,Owner,sha256Hash) = match getString(signDapp, ((("data_fc_" + signID) + "_") + Owner)) {
6666 case a: String =>
6767 if (contains(a, sha256Hash))
6868 then true
6969 else false
7070 case _ =>
7171 false
7272 }
7373
7474
7575 func validateCID (cid) = if (contains(cid, "/"))
7676 then if (if ((76 > size(cid)))
7777 then (size(split(cid, "/")[0]) == 59)
7878 else false)
7979 then (16 > size(split(cid, "/")[1]))
8080 else false
8181 else false
8282
8383
8484 func validateHash (hash) = (size(hash) == 64)
8585
8686
8787 func keyUserStatus (caller) = ("user_status_" + caller)
8888
8989
9090 func keyDate (caller,artId) = ((("art_date_" + artId) + "_") + caller)
9191
9292
9393 func keyName (caller,artId) = ((("art_name_" + artId) + "_") + caller)
9494
9595
9696 func keyDesc (caller,artId) = ((("art_desc_" + artId) + "_") + caller)
9797
9898
9999 func keyDisplayCid (caller,artId) = ((("art_display_cid_" + artId) + "_") + caller)
100100
101101
102102 func keyExportHash (caller,artId) = ((("art_export_hash_" + artId) + "_") + caller)
103103
104104
105105 func keyExportCid (caller,artId) = ((("art_export_cid_" + artId) + "_") + caller)
106106
107107
108108 func keyMaxMint (caller,artId) = ((("art_maxmint_" + artId) + "_") + caller)
109109
110110
111111 func keySignID (caller,artId) = ((("art_signid_" + artId) + "_") + caller)
112112
113113
114114 func keyIssued (caller,artId) = ((("art_issued_" + artId) + "_") + caller)
115115
116116
117117 func keyOnSale (caller,artId) = ((("art_onsale_" + artId) + "_") + caller)
118118
119119
120120 func keyLicenceHash (caller,artId) = ((("art_licence_hash_" + artId) + "_") + caller)
121121
122122
123123 func keyLicenceCid (caller,artId) = ((("art_licence_cid_" + artId) + "_") + caller)
124124
125125
126126 func keyTags (caller,artId) = ((("art_tags_" + artId) + "_") + caller)
127127
128128
129129 func keyType (caller,artId) = ((("art_type_" + artId) + "_") + caller)
130130
131131
132132 func keyNote (caller,artId) = ((("art_note_" + artId) + "_") + caller)
133133
134134
135135 func keyCrawler (caller,artId) = ((("art_crawler_cid_" + artId) + "_") + caller)
136136
137137
138138 func keyRoyalties (caller,artId) = ((("art_royalties_" + artId) + "_") + caller)
139139
140140
141141 func keyPrice (caller,artId) = ((("art_price_" + artId) + "_") + caller)
142142
143143
144144 func keyEndSale (caller,artId) = ((("art_endsale_" + artId) + "_") + caller)
145145
146146
147147 func keyAssetIdAccepted (caller,artId) = ((("art_assetAccepted_" + artId) + "_") + caller)
148148
149149
150150 func keyFlag (caller,artId) = ((("art_flag_" + artId) + "_") + caller)
151151
152152
153153 func keyArtistAgentAddr (artistAddr) = ("artist_agent_" + artistAddr)
154154
155155
156156 func keyPrimaryShareAgent (artistAddr) = ("artist_agent_primary_" + artistAddr)
157157
158158
159159 func keyArtistPublicAgentAddr (artistAddr) = ("artist_public_agent_" + artistAddr)
160160
161161
162162 func keyPrimarySharePublicAgent (artistAddr) = ("artist_public_agent_primary_" + artistAddr)
163163
164164
165165 func keyHashByTxidAddr (caller,txid) = ((("get_hashbytxidaddr_" + txid) + "_") + caller)
166166
167167
168168 func keyOwnerByHash (sha256Hash) = ("get_owner_by_hash_" + sha256Hash)
169169
170170
171171 func keyidBySignid (caller,signId) = ((("get_artidbysignid_" + signId) + "_") + caller)
172172
173173
174174 func keyTxidByHashOwner (sha256Hash,caller) = ("get_txid_by_hash_owner_" + toBase58String(sha256_16Kb(toBytes((sha256Hash + caller)))))
175175
176176
177177 func validateAllCID (cidDisplay,cidExport,cidLicence) = if (!(validateCID(cidDisplay)))
178178 then throw("Wrong Display CID")
179179 else if (!(validateCID(cidExport)))
180180 then throw("Wrong Export CID")
181181 else if (if ((cidLicence != ""))
182182 then !(validateCID(cidLicence))
183183 else false)
184184 then throw("Wrong Licence CID")
185185 else true
186186
187187
188188 func validateAllHash (sha256Export,sha256Licence) = if (!(validateHash(sha256Export)))
189189 then throw("Export Hash 64 char. max")
190190 else if (!(validateHash(sha256Licence)))
191191 then throw("Licence Hash 64 char. max")
192192 else true
193193
194194
195195 func validateString (str,max) = if ((size(str) == 0))
196196 then throw("Field cannot be is empty")
197197 else if ((size(str) > max))
198198 then throw((str + " is too long"))
199199 else true
200200
201201
202202 func validateUser (caller) = {
203203 let userStatus = valueOrElse(getString(userDapp, keyUserStatus(caller)), userUnregistered)
204204 if (if ((userStatus == userUnregistered))
205205 then true
206206 else (userStatus == userAllowed))
207207 then "Register this account first with \"Account\" tab"
208208 else if ((userStatus == userSuspended))
209209 then "Account suspended"
210210 else if ((userStatus == userRemoved))
211211 then "Account removed"
212212 else ""
213213 }
214214
215215
216216 func setLIcence (cidLicence,sha256Licence) = {
217217 let cid = if ((size(cidLicence) == 0))
218218 then defaultLicence
219219 else cidLicence
220220 let hash = if ((size(sha256Licence) == 0))
221221 then defaultHashLicence
222222 else sha256Licence
223223 $Tuple2(cid, hash)
224224 }
225225
226226
227227 func validateArtworkData (caller,cidDisplay,cidExport,licenceCID,sha256Export,licenceHash,name,description,tags,royalties) = {
228228 let checkUser = validateUser(caller)
229229 if ((checkUser != ""))
230230 then throw(checkUser)
231231 else if ((size(cidDisplay) == 0))
232232 then throw("Display CID cannot be empty")
233233 else if (!(validateAllCID(cidDisplay, cidExport, licenceCID)))
234234 then throw("Problem with CID")
235235 else if (!(validateAllHash(sha256Export, licenceHash)))
236236 then throw("Problem with Hashes")
237237 else if (!(validateString(name, 100)))
238238 then throw("100 Char. max name")
239239 else if (!(validateString(description, 1000)))
240240 then throw("1000 Char. max description")
241241 else if (if ((0 > royalties))
242242 then true
243243 else (royalties > 1000))
244244 then throw("Royalties cannot be less than 0% or higher than 10%")
245245 else if ((size(split(tags, ",")) > 5))
246246 then throw("5 tags max.")
247247 else ""
248248 }
249249
250250
251251 func isPayment (i) = if ((size(i.payments) == 0))
252252 then throw("No payment attached")
253253 else {
254254 let payment = value(i.payments[0])
255255 let amount = value(payment.amount)
256256 $Tuple2(payment, amount)
257257 }
258258
259259
260260 func validatePayment (i) = {
261261 let $t091809216 = isPayment(i)
262262 let payment = $t091809216._1
263263 let amount = $t091809216._2
264264 let assetId = if (if (isDefined(payment.assetId))
265265 then (payment.assetId == signAssetId)
266266 else false)
267267 then payment.assetId
268268 else throw("Only SIGN token accepted as transaction fee")
269269 if ((amount != currentCertificationPrice))
270270 then throw(("Payment amount should be " + toString(currentCertificationPrice)))
271271 else $Tuple2(amount, assetId)
272272 }
273273
274274
275275 func isArtMinted (addrToUse,artId) = match getInteger(this, keyIssued(addrToUse, artId)) {
276276 case b: Int =>
277277 if ((b != 0))
278278 then true
279279 else false
280280 case _ =>
281281 false
282282 }
283283
284284
285285 func validatePriceAssetId (i,priceAssetId,artworkPrice) = {
286286 let $t098049840 = isPayment(i)
287287 let payment = $t098049840._1
288288 let amount = $t098049840._2
289289 let assetId = if (!(isDefined(payment.assetId)))
290290 then unit
291291 else if (if ((size(priceAssetId) > 0))
292292 then (toBase58String(value(payment.assetId)) == priceAssetId)
293293 else false)
294294 then payment.assetId
295295 else throw("Wrong asset id")
296296 if (if ((assetId == unit))
297297 then (priceAssetId != "")
298298 else false)
299299 then throw("Wrong asset id")
300300 else if ((artworkPrice != amount))
301301 then throw("Payment don't match")
302302 else $Tuple2(amount, assetId)
303303 }
304304
305305
306306 func acceptedAssetIds (assetId) = if (if (if (if (if ((assetId != toBase58String(signAssetId)))
307307 then (assetId != toBase58String(wavesAssetId))
308308 else false)
309309 then (assetId != "WAVES")
310310 else false)
311311 then (assetId != toBase58String(usdnAssetId))
312312 else false)
313313 then (assetId != toBase58String(usdtAssetId))
314314 else false)
315315 then throw("Only SIGN, USDN,USDT or WAVES accepted")
316316 else true
317317
318318
319319 func validateMinSell (assetId,price) = {
320320 let minSellWaves = if (unitTest)
321321 then 10
322322 else getIntegerByKeyFromOracle("waves_min_sell")
323323 let minSellUsdn = 1000000
324324 let minSellSign = if (unitTest)
325325 then 1
326326 else (currentCertificationPrice * 2)
327327 if (if (if (if (if (if ((assetId == toBase58String(usdnAssetId)))
328328 then (minSellUsdn > price)
329329 else false)
330330 then (price != 0)
331331 else false)
332332 then true
333333 else if (if ((assetId == toBase58String(usdtAssetId)))
334334 then (minSellUsdn > price)
335335 else false)
336336 then (price != 0)
337337 else false)
338338 then true
339339 else if (if ((assetId == toBase58String(signAssetId)))
340340 then (minSellSign > price)
341341 else false)
342342 then (price != 0)
343343 else false)
344344 then true
345345 else if (if (if ((assetId == toBase58String(wavesAssetId)))
346346 then true
347347 else (assetId == "WAVES"))
348348 then (minSellWaves > price)
349349 else false)
350350 then (price != 0)
351351 else false)
352352 then throw("Wrong minimum sell price")
353353 else true
354354 }
355355
356356
357357 func getBidAssetId (assetId) = if ((assetId == "WAVES"))
358358 then unit
359359 else fromBase58String(assetId)
360360
361361
362362 func getPriceAssetIdFromBid (bidDataKey) = {
363363 let bidData = getStringByKey((bidDataKey + "_OPEN"))
364364 if ((bidData == ""))
365365 then throw("Bid not found")
366366 else {
367367 let bidDataArr = split(bidData, "_")
368368 let bidAmount = parseIntValue(bidDataArr[1])
369369 let bidAssetId = getBidAssetId(bidDataArr[0])
370370 if ((0 >= bidAmount))
371371 then throw("Wrong amount")
372372 else $Tuple2(bidAmount, bidAssetId)
373373 }
374374 }
375375
376376
377377 func idCallerDateSponsored (i,pubKey) = if (!(dappRunning))
378378 then throw(maintenanceMSG)
379379 else {
380380 let isSponsored = if ((pubKey != ""))
381381 then valueOrElse(checkWhitelist((toString(addressFromPublicKey(fromBase58String(pubKey))) + "_free_txs")), 0)
382382 else 0
383- if ((isSponsored == isSponsored))
384- then {
385- let caller = if (if ((toBase58String(i.caller.bytes) == toString(this)))
386- then (isSponsored > 0)
387- else false)
388- then toString(addressFromPublicKey(fromBase58String(pubKey)))
389- else toBase58String(i.caller.bytes)
390- let get_sponsored_waves = if (if ((pubKey != ""))
391- then (isSponsored > 0)
392- else false)
393- then invoke(whitelistDapp, "useFreeTx", [toString(addressFromPublicKey(fromBase58String(pubKey)))], nil)
394- else unit
395- if ((get_sponsored_waves == get_sponsored_waves))
396- then $Tuple4(toBase58String(i.transactionId), caller, lastBlock.timestamp, isSponsored)
397- else throw("Strict value is not equal to itself.")
398- }
383+ let caller = if (if ((toBase58String(i.caller.bytes) == toString(this)))
384+ then (isSponsored > 0)
385+ else false)
386+ then toString(addressFromPublicKey(fromBase58String(pubKey)))
387+ else toBase58String(i.caller.bytes)
388+ let get_sponsored_waves = if (if ((pubKey != ""))
389+ then (isSponsored > 0)
390+ else false)
391+ then invoke(whitelistDapp, "useFreeTx", [toString(addressFromPublicKey(fromBase58String(pubKey)))], nil)
392+ else unit
393+ if ((get_sponsored_waves == get_sponsored_waves))
394+ then $Tuple4(toBase58String(i.transactionId), caller, lastBlock.timestamp, isSponsored)
399395 else throw("Strict value is not equal to itself.")
400396 }
401397
402398
403399 func idCallerDate (i) = if (!(dappRunning))
404400 then throw(maintenanceMSG)
405401 else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp)
406402
407403
408404 func buyMint (i,artId,issuer,bidId,bidOwner,pubKey) = {
409- let $t01304013113 = idCallerDateSponsored(i, pubKey)
410- if (($t01304013113 == $t01304013113))
411- then {
412- let isSponsored = $t01304013113._4
413- let date = $t01304013113._3
414- let caller = $t01304013113._2
415- let id = $t01304013113._1
405+ let $t01303713107 = idCallerDateSponsored(i, pubKey)
406+ let id = $t01303713107._1
407+ let caller = $t01303713107._2
408+ let date = $t01303713107._3
409+ let isSponsored = $t01303713107._4
410+ if (true)
411+ then throw(toString(isSponsored))
412+ else {
413+ let new_caller = if (if ((toBase58String(i.caller.bytes) == toString(this)))
414+ then (isSponsored > 0)
415+ else false)
416+ then toString(addressFromPublicKey(fromBase58String(pubKey)))
417+ else toBase58String(i.caller.bytes)
416418 if (true)
417- then throw(toString(isSponsored))
419+ then throw(((((((new_caller + " / ") + issuer) + " / ") + bidOwner) + " / ") + pubKey))
418420 else {
419- let new_caller = if (if ((toBase58String(i.caller.bytes) == toString(this)))
420- then (isSponsored > 0)
421+ let isBid = if (if (if ((caller == issuer))
422+ then (bidOwner != "")
421423 else false)
422- then toString(addressFromPublicKey(fromBase58String(pubKey)))
423- else toBase58String(i.caller.bytes)
424- if (true)
425- then throw(((((((new_caller + " / ") + issuer) + " / ") + bidOwner) + " / ") + pubKey))
424+ then (bidId != "")
425+ else false)
426+ then true
427+ else false
428+ let blockEnd = getIntegerByKey(keyEndSale(caller, artId))
429+ if (if (if ((blockEnd != 0))
430+ then (height >= blockEnd)
431+ else false)
432+ then !(isBid)
433+ else false)
434+ then throw("Sale ended.")
426435 else {
427- let isBid = if (if (if ((caller == issuer))
428- then (bidOwner != "")
429- else false)
430- then (bidId != "")
431- else false)
432- then true
433- else false
434- let blockEnd = getIntegerByKey(keyEndSale(caller, artId))
435- if (if (if ((blockEnd != 0))
436- then (height >= blockEnd)
437- else false)
438- then !(isBid)
439- else false)
440- then throw("Sale ended.")
436+ let callerIsIssuer = (caller == issuer)
437+ let totalNFT = getIntegerByKey("total_nft_issued")
438+ let signID = getStringByKey(keySignID(issuer, artId))
439+ let artworkName = getStringByKey(keyName(issuer, artId))
440+ if ((artworkName == ""))
441+ then throw("Art doesn't exist")
441442 else {
442- let callerIsIssuer = (caller == issuer)
443- let totalNFT = getIntegerByKey("total_nft_issued")
444- let signID = getStringByKey(keySignID(issuer, artId))
445- let artworkName = getStringByKey(keyName(issuer, artId))
446- if ((artworkName == ""))
447- then throw("Art doesn't exist")
448- else {
449- let isOnSale = getBooleanByKey(keyOnSale(issuer, artId))
450- let amountSold = getIntegerByKey(keyIssued(issuer, artId))
451- let artworkPrice = if (callerIsIssuer)
452- then (currentCertificationPrice * 2)
453- else getIntegerByKey(keyPrice(issuer, artId))
454- let priceAssetId = if (callerIsIssuer)
455- then toBase58String(signAssetId)
456- else getStringByKey(keyAssetIdAccepted(issuer, artId))
457- let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId))
458- if (if (if (!(isBid))
459- then !(callerIsIssuer)
460- else false)
461- then if (if ((0 >= artworkPrice))
462- then true
463- else !(isOnSale))
464- then true
465- else (0 >= maxCanSell)
466- else false)
467- then throw("Art not for sale")
468- else if (if (if (!(isBid))
469- then callerIsIssuer
443+ let isOnSale = getBooleanByKey(keyOnSale(issuer, artId))
444+ let amountSold = getIntegerByKey(keyIssued(issuer, artId))
445+ let artworkPrice = if (callerIsIssuer)
446+ then (currentCertificationPrice * 2)
447+ else getIntegerByKey(keyPrice(issuer, artId))
448+ let priceAssetId = if (callerIsIssuer)
449+ then toBase58String(signAssetId)
450+ else getStringByKey(keyAssetIdAccepted(issuer, artId))
451+ let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId))
452+ if (if (if (!(isBid))
453+ then !(callerIsIssuer)
454+ else false)
455+ then if (if ((0 >= artworkPrice))
456+ then true
457+ else !(isOnSale))
458+ then true
459+ else (0 >= maxCanSell)
460+ else false)
461+ then throw("Art not for sale")
462+ else if (if (if (!(isBid))
463+ then callerIsIssuer
464+ else false)
465+ then (0 >= maxCanSell)
466+ else false)
467+ then throw("Max issuable not set")
468+ else {
469+ let checkUser = validateUser(issuer)
470+ if (if (isBid)
471+ then (checkUser != "")
470472 else false)
471- then (0 >= maxCanSell)
472- else false)
473- then throw("Max issuable not set")
473+ then throw(checkUser)
474474 else {
475- let checkUser = validateUser(issuer)
476- if (if (isBid)
477- then (checkUser != "")
475+ let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId)
476+ let $t01498315175 = if (isBid)
477+ then getPriceAssetIdFromBid(bidDataKey)
478+ else validatePriceAssetId(i, priceAssetId, artworkPrice)
479+ let amount = $t01498315175._1
480+ let assetId = $t01498315175._2
481+ let agent = valueOrElse(getString(userDapp, keyArtistAgentAddr(issuer)), feeReceiver)
482+ let agentShare = valueOrElse(getInteger(userDapp, keyPrimaryShareAgent(issuer)), 0)
483+ let publicAgent = valueOrElse(getString(userDapp, keyArtistPublicAgentAddr(issuer)), feeReceiver)
484+ let publicAgentShare = valueOrElse(getInteger(userDapp, keyPrimarySharePublicAgent(issuer)), 0)
485+ let isWhitelisted = checkWhitelist(issuer)
486+ let cut = if ((isWhitelisted > height))
487+ then 0
488+ else if ((assetId == signAssetId))
489+ then signCut
490+ else usdnWaveCut
491+ let amountForSign = fraction(amount, cut, 100)
492+ let amountForAgent = if (if (if ((agent != feeReceiver))
493+ then (agentShare > 0)
478494 else false)
479- then throw(checkUser)
495+ then (height > isWhitelisted)
496+ else false)
497+ then fraction(amount, agentShare, 10000)
498+ else 0
499+ let amountForPublicAgent = if (if (if ((publicAgent != feeReceiver))
500+ then (publicAgentShare > 0)
501+ else false)
502+ then (height > isWhitelisted)
503+ else false)
504+ then fraction(amount, publicAgentShare, 10000)
505+ else 0
506+ let amountForCreator = (amount - amountForSign)
507+ if ((amountSold == maxCanSell))
508+ then throw("Art sold out")
480509 else {
481- let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId)
482- let $t01498915181 = if (isBid)
483- then getPriceAssetIdFromBid(bidDataKey)
484- else validatePriceAssetId(i, priceAssetId, artworkPrice)
485- let amount = $t01498915181._1
486- let assetId = $t01498915181._2
487- let agent = valueOrElse(getString(userDapp, keyArtistAgentAddr(issuer)), feeReceiver)
488- let agentShare = valueOrElse(getInteger(userDapp, keyPrimaryShareAgent(issuer)), 0)
489- let publicAgent = valueOrElse(getString(userDapp, keyArtistPublicAgentAddr(issuer)), feeReceiver)
490- let publicAgentShare = valueOrElse(getInteger(userDapp, keyPrimarySharePublicAgent(issuer)), 0)
491- let isWhitelisted = checkWhitelist(issuer)
492- let cut = if ((isWhitelisted > height))
493- then 0
494- else if ((assetId == signAssetId))
495- then signCut
496- else usdnWaveCut
497- let amountForSign = fraction(amount, cut, 100)
498- let amountForAgent = if (if (if ((agent != feeReceiver))
499- then (agentShare > 0)
500- else false)
501- then (height > isWhitelisted)
502- else false)
503- then fraction(amount, agentShare, 10000)
504- else 0
505- let amountForPublicAgent = if (if (if ((publicAgent != feeReceiver))
506- then (publicAgentShare > 0)
507- else false)
508- then (height > isWhitelisted)
509- else false)
510- then fraction(amount, publicAgentShare, 10000)
511- else 0
512- let amountForCreator = (amount - amountForSign)
513- if ((amountSold == maxCanSell))
514- then throw("Art sold out")
515- else {
516- let newAmountSold = (amountSold + 1)
517- let issueMeta = ((((((((((("Creator: " + issuer) + ",
510+ let newAmountSold = (amountSold + 1)
511+ let issueMeta = ((((((((((("Creator: " + issuer) + ",
518512 ArtID: ") + artId) + ",
519513 SignID: ") + signID) + ",
520514 Artwork name: ") + artworkName) + ",
521515 Issue: ") + toString(newAmountSold)) + "/") + toString(maxCanSell))
522- let issueNFT = Issue(("SA_" + toString((totalNFT + 1))), issueMeta, 1, 0, false)
523- let idNFT = calculateAssetId(issueNFT)
524- let sellStatus = if (if ((newAmountSold == maxCanSell))
525- then true
526- else !(isOnSale))
527- then false
528- else true
529- let receiveNFT = if (if (if ((caller == issuer))
530- then (bidOwner != "")
531- else false)
532- then (bidId != "")
533- else false)
534- then addressFromStringValue(bidOwner)
535- else i.caller
536- let assetIdBid = if (!(isDefined(assetId)))
537- then "WAVES"
538- else toBase58String(value(assetId))
539- let bidData = getStringByKey((bidDataKey + "_OPEN"))
540- let bidDelOld = DeleteEntry((bidDataKey + "_OPEN"))
541- let bidUpdate = StringEntry((bidDataKey + "_CLOSED"), ((bidData + "_") + toString(date)))
542- let soldKey = ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer)
543- let soldValue = if (!(isBid))
544- then ((((((((((caller + "_") + toString(date)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + toBase58String(idNFT))
545- else ((((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + assetIdBid) + "_") + toBase58String(idNFT))
546- let soldData = StringEntry(soldKey, soldValue)
547- let commissionsWithAgent = if ((amountForAgent != 0))
548- then [ScriptTransfer(Address(fromBase58String(feeReceiver)), (amountForSign - amountForAgent), assetId), ScriptTransfer(Address(fromBase58String(agent)), amountForAgent, assetId)]
549- else [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)]
550- let commissionsWithPublicAgent = if ((amountForPublicAgent != 0))
551- then [ScriptTransfer(Address(fromBase58String(publicAgent)), amountForPublicAgent, assetId), ScriptTransfer(Address(fromBase58String(issuer)), (amountForCreator - amountForPublicAgent), assetId)]
552- else [ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId)]
553- let txToCaller = if ((isSponsored > 0))
554- then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
555- else nil
556- let buyRes = ((([IntegerEntry(keyIssued(issuer, artId), newAmountSold), StringEntry(("nft_" + toBase58String(idNFT)), soldKey), IntegerEntry("total_nft_issued", (totalNFT + 1)), IntegerEntry(keyEndSale(issuer, artId), 0), BooleanEntry(keyOnSale(issuer, artId), sellStatus), issueNFT, ScriptTransfer(receiveNFT, 1, idNFT)] ++ commissionsWithAgent) ++ commissionsWithPublicAgent) ++ txToCaller)
557- if (isBid)
558- then [soldData, bidUpdate, bidDelOld] :: buyRes
559- else soldData :: buyRes
560- }
516+ let issueNFT = Issue(("SA_" + toString((totalNFT + 1))), issueMeta, 1, 0, false)
517+ let idNFT = calculateAssetId(issueNFT)
518+ let sellStatus = if (if ((newAmountSold == maxCanSell))
519+ then true
520+ else !(isOnSale))
521+ then false
522+ else true
523+ let receiveNFT = if (if (if ((caller == issuer))
524+ then (bidOwner != "")
525+ else false)
526+ then (bidId != "")
527+ else false)
528+ then addressFromStringValue(bidOwner)
529+ else i.caller
530+ let assetIdBid = if (!(isDefined(assetId)))
531+ then "WAVES"
532+ else toBase58String(value(assetId))
533+ let bidData = getStringByKey((bidDataKey + "_OPEN"))
534+ let bidDelOld = DeleteEntry((bidDataKey + "_OPEN"))
535+ let bidUpdate = StringEntry((bidDataKey + "_CLOSED"), ((bidData + "_") + toString(date)))
536+ let soldKey = ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer)
537+ let soldValue = if (!(isBid))
538+ then ((((((((((caller + "_") + toString(date)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + toBase58String(idNFT))
539+ else ((((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + assetIdBid) + "_") + toBase58String(idNFT))
540+ let soldData = StringEntry(soldKey, soldValue)
541+ let commissionsWithAgent = if ((amountForAgent != 0))
542+ then [ScriptTransfer(Address(fromBase58String(feeReceiver)), (amountForSign - amountForAgent), assetId), ScriptTransfer(Address(fromBase58String(agent)), amountForAgent, assetId)]
543+ else [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)]
544+ let commissionsWithPublicAgent = if ((amountForPublicAgent != 0))
545+ then [ScriptTransfer(Address(fromBase58String(publicAgent)), amountForPublicAgent, assetId), ScriptTransfer(Address(fromBase58String(issuer)), (amountForCreator - amountForPublicAgent), assetId)]
546+ else [ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId)]
547+ let txToCaller = if ((isSponsored > 0))
548+ then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
549+ else nil
550+ let buyRes = ((([IntegerEntry(keyIssued(issuer, artId), newAmountSold), StringEntry(("nft_" + toBase58String(idNFT)), soldKey), IntegerEntry("total_nft_issued", (totalNFT + 1)), IntegerEntry(keyEndSale(issuer, artId), 0), BooleanEntry(keyOnSale(issuer, artId), sellStatus), issueNFT, ScriptTransfer(receiveNFT, 1, idNFT)] ++ commissionsWithAgent) ++ commissionsWithPublicAgent) ++ txToCaller)
551+ if (isBid)
552+ then [soldData, bidUpdate, bidDelOld] :: buyRes
553+ else soldData :: buyRes
561554 }
562555 }
563- }
556+ }
564557 }
565558 }
566559 }
567560 }
568- else throw("Strict value is not equal to itself.")
569561 }
570562
571563
572564 func asString (bv) = match bv {
573565 case bv0: String =>
574566 bv0
575567 case _ =>
576568 throw("Sponsored Public Key String expected")
577569 }
578570
579571
580572 @Callable(invoke)
581573 func setConf (key,val) = {
582574 let caller = toString(invoke.caller)
583575 if (containsElement([chris, toString(this)], caller))
584576 then if (contains(key, "conf_"))
585577 then [StringEntry(key, val)]
586578 else throw("Entries starting with conf_ only")
587579 else throw("You are not allowed to change this")
588580 }
589581
590582
591583
592584 @Callable(i)
593585 func addArtwork (sha256Hash,signID,name,description,tags,type,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence,crawler,royalties,pubKey) = {
594- let $t02036120434 = idCallerDateSponsored(i, pubKey)
595- let artId = $t02036120434._1
596- let caller = $t02036120434._2
597- let date = $t02036120434._3
598- let isSponsored = $t02036120434._4
586+ let $t02035520428 = idCallerDateSponsored(i, pubKey)
587+ let artId = $t02035520428._1
588+ let caller = $t02035520428._2
589+ let date = $t02035520428._3
590+ let isSponsored = $t02035520428._4
599591 if (!(validateHash(sha256Hash)))
600592 then throw("Hash should be 64 characters maximum")
601593 else {
602- let $t02053520604 = setLIcence(cidLicence, sha256Licence)
603- let licenceCID = $t02053520604._1
604- let licenceHash = $t02053520604._2
594+ let $t02052920598 = setLIcence(cidLicence, sha256Licence)
595+ let licenceCID = $t02052920598._1
596+ let licenceHash = $t02052920598._2
605597 let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, royalties)
606598 if ((validateArtwork != ""))
607599 then throw("Something went wrong!")
608600 else {
609601 let whitelisted_drop = (checkWhitelist((caller + "_free_drops")) > 0)
610- let $t02090320987 = if (whitelisted_drop)
602+ let $t02089720981 = if (whitelisted_drop)
611603 then $Tuple2(0, signID)
612604 else validatePayment(i)
613- let amount = $t02090320987._1
614- let assetId = $t02090320987._2
605+ let amount = $t02089720981._1
606+ let assetId = $t02089720981._2
615607 if (!(isDefined(amount)))
616608 then throw("Something went wrong")
617609 else {
618610 let entryExist = getStringByKey(keyTxidByHashOwner(sha256Hash, caller))
619611 if ((entryExist != ""))
620612 then throw("You already added it")
621613 else {
622614 let hashExist = getStringByKey(keyOwnerByHash(sha256Hash))
623615 if ((hashExist != ""))
624616 then throw("Hash already registered")
625617 else {
626618 let isSignCertified = checkSignCertificate(signID, caller, sha256Hash)
627619 if (!(isSignCertified))
628620 then throw("Sign Certificate not found for this address.")
629621 else {
630622 let decrease_whitelist_drop = if (whitelisted_drop)
631623 then invoke(whitelistDapp, "useFreeDrop", [caller], nil)
632624 else unit
633625 if ((decrease_whitelist_drop == decrease_whitelist_drop))
634626 then {
635627 let txToCaller = if ((isSponsored > 0))
636628 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
637629 else nil
638630 ([StringEntry(keyOwnerByHash(sha256Hash), caller), StringEntry(keyTxidByHashOwner(sha256Hash, caller), artId), IntegerEntry(keyDate(caller, artId), date), StringEntry(keyName(caller, artId), name), StringEntry(keyDesc(caller, artId), description), StringEntry(keyDisplayCid(caller, artId), cidDisplay), StringEntry(keyExportCid(caller, artId), cidExport), StringEntry(keyExportHash(caller, artId), sha256Export), StringEntry(keyLicenceHash(caller, artId), licenceHash), StringEntry(keyLicenceCid(caller, artId), licenceCID), StringEntry(keyType(caller, artId), type), StringEntry(keyTags(caller, artId), tags), IntegerEntry(keyMaxMint(caller, artId), 0), StringEntry(keySignID(caller, artId), signID), IntegerEntry(keyIssued(caller, artId), 0), BooleanEntry(keyOnSale(caller, artId), false), StringEntry(keyidBySignid(caller, signID), artId), StringEntry(keyHashByTxidAddr(caller, artId), sha256Hash), StringEntry(keyCrawler(caller, artId), crawler), IntegerEntry(keyRoyalties(caller, artId), royalties), ScriptTransfer(Address(fromBase58String(feeReceiver)), amount, signAssetId)] ++ txToCaller)
639631 }
640632 else throw("Strict value is not equal to itself.")
641633 }
642634 }
643635 }
644636 }
645637 }
646638 }
647639 }
648640
649641
650642
651643 @Callable(i)
652644 func updateArtwork (txid,name,description,tags,type,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence,crawler,royalties,pubKey) = if (!(dappRunning))
653645 then throw(maintenanceMSG)
654646 else {
655- let $t02402524095 = idCallerDateSponsored(i, pubKey)
656- let id = $t02402524095._1
657- let caller = $t02402524095._2
658- let date = $t02402524095._3
659- let isSponsored = $t02402524095._4
660- let $t02410524174 = setLIcence(cidLicence, sha256Licence)
661- let licenceCID = $t02410524174._1
662- let licenceHash = $t02410524174._2
647+ let $t02401924089 = idCallerDateSponsored(i, pubKey)
648+ let id = $t02401924089._1
649+ let caller = $t02401924089._2
650+ let date = $t02401924089._3
651+ let isSponsored = $t02401924089._4
652+ let $t02409924168 = setLIcence(cidLicence, sha256Licence)
653+ let licenceCID = $t02409924168._1
654+ let licenceHash = $t02409924168._2
663655 let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, royalties)
664656 if ((validateArtwork != ""))
665657 then throw("Something went wrong!")
666658 else {
667659 let entryExist = getStringByKey(keyName(caller, txid))
668660 if ((entryExist == ""))
669661 then throw("Entry not found")
670662 else {
671663 let flag = getStringByKey(keyFlag(caller, txid))
672664 if ((flag == "ILLEGAL"))
673665 then throw("Cannot update ILLEGAL artwork")
674666 else if (!(isArtMinted(caller, txid)))
675667 then {
676668 let txToCaller = if ((isSponsored > 0))
677669 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
678670 else nil
679671 ([StringEntry(keyName(caller, txid), name), StringEntry(keyDesc(caller, txid), description), StringEntry(keyDisplayCid(caller, txid), cidDisplay), StringEntry(keyExportCid(caller, txid), cidExport), StringEntry(keyExportHash(caller, txid), sha256Export), StringEntry(keyLicenceCid(caller, txid), licenceCID), StringEntry(keyLicenceHash(caller, txid), licenceHash), StringEntry(keyTags(caller, txid), tags), StringEntry(keyType(caller, txid), type), StringEntry(keyCrawler(caller, txid), crawler), IntegerEntry(keyRoyalties(caller, txid), royalties)] ++ txToCaller)
680672 }
681673 else throw("Already minted")
682674 }
683675 }
684676 }
685677
686678
687679
688680 @Callable(i)
689681 func flagArtwork (artId,addr,flag,note) = {
690- let $t02580525839 = idCallerDate(i)
691- let id = $t02580525839._1
692- let caller = $t02580525839._2
682+ let $t02579925833 = idCallerDate(i)
683+ let id = $t02579925833._1
684+ let caller = $t02579925833._2
693685 if (containsElement([chris, toString(this)], caller))
694686 then if (containsElement(["CONSENT", "", "CHANGE_REQUIRED", "FLAGGED", "ILLEGAL"], flag))
695687 then [StringEntry(keyFlag(addr, artId), flag), StringEntry(keyNote(addr, artId), note)]
696688 else throw(("Unknow status " + flag))
697689 else throw("You are not allowed")
698690 }
699691
700692
701693
702694 @Callable(i)
703695 func deleteArtwork (artId,addr) = {
704- let $t02627526309 = idCallerDate(i)
705- let id = $t02627526309._1
706- let caller = $t02627526309._2
696+ let $t02626926303 = idCallerDate(i)
697+ let id = $t02626926303._1
698+ let caller = $t02626926303._2
707699 let addrToUse = if (containsElement([chris, toString(this)], caller))
708700 then addr
709701 else caller
710702 let entryExist = valueOrErrorMessage(getStringByKey(keyName(addrToUse, artId)), "No art matching for this address")
711703 if ((entryExist == ""))
712704 then throw("No art matching for this address")
713705 else {
714706 let sha256Hash = getStringByKey(keyHashByTxidAddr(addrToUse, artId))
715707 if ((sha256Hash == ""))
716708 then throw("No art hash matching for this address")
717709 else {
718710 let signID = getStringByKey(keySignID(addrToUse, artId))
719711 if ((signID == ""))
720712 then throw("No SIGN ID matching")
721713 else {
722714 let dataToDelete = [DeleteEntry(keyDate(addrToUse, artId)), DeleteEntry(keyName(addrToUse, artId)), DeleteEntry(keyDesc(addrToUse, artId)), DeleteEntry(keyDisplayCid(addrToUse, artId)), DeleteEntry(keyExportCid(addrToUse, artId)), DeleteEntry(keyExportHash(addrToUse, artId)), DeleteEntry(keyLicenceHash(addrToUse, artId)), DeleteEntry(keyLicenceCid(addrToUse, artId)), DeleteEntry(keyType(addrToUse, artId)), DeleteEntry(keyTags(addrToUse, artId)), DeleteEntry(keyMaxMint(addrToUse, artId)), DeleteEntry(keySignID(addrToUse, artId)), DeleteEntry(keyIssued(addrToUse, artId)), DeleteEntry(keyOnSale(addrToUse, artId)), DeleteEntry(keyFlag(addrToUse, artId)), DeleteEntry(keyPrice(addrToUse, artId)), DeleteEntry(keyAssetIdAccepted(addrToUse, artId)), DeleteEntry(keyOwnerByHash(sha256Hash)), DeleteEntry(keyidBySignid(addrToUse, signID)), DeleteEntry(keyTxidByHashOwner(sha256Hash, addrToUse)), DeleteEntry(keyEndSale(addrToUse, artId)), DeleteEntry(keyNote(addrToUse, artId)), DeleteEntry(keyCrawler(addrToUse, artId)), DeleteEntry(keyRoyalties(addrToUse, artId))]
723715 if (!(isArtMinted(addrToUse, artId)))
724716 then if (!(dappRunning))
725717 then throw(maintenanceMSG)
726718 else dataToDelete
727719 else if (containsElement([chris, toString(this)], caller))
728720 then dataToDelete
729721 else throw("Art already minted, you cannot delete it")
730722 }
731723 }
732724 }
733725 }
734726
735727
736728
737729 @Callable(i)
738730 func sellArtwork (artId,price,maxMint,assetId,blockEnd,pubKey) = {
739- let $t02914529215 = idCallerDateSponsored(i, pubKey)
740- let id = $t02914529215._1
741- let caller = $t02914529215._2
742- let date = $t02914529215._3
743- let isSponsored = $t02914529215._4
731+ let $t02913929209 = idCallerDateSponsored(i, pubKey)
732+ let id = $t02913929209._1
733+ let caller = $t02913929209._2
734+ let date = $t02913929209._3
735+ let isSponsored = $t02913929209._4
744736 let artworkName = getStringByKey(keyName(caller, artId))
745737 if ((artworkName == ""))
746738 then throw("This art doesn't match your account")
747739 else {
748740 let flag = getStringByKey(keyFlag(caller, artId))
749741 if (containsElement(["CHANGE_REQUIRED", "FLAGGED", "ILLEGAL"], flag))
750742 then throw("Flagged artwork")
751743 else {
752744 let bidNbr = getIntegerByKey(("current_bidamount_" + artId))
753745 if ((0 > blockEnd))
754746 then throw("Negative end")
755747 else if (if ((blockEnd > 0))
756748 then if ((maxMint != 1))
757749 then true
758750 else (price != 0)
759751 else false)
760752 then throw("Timed offer only allowed for unique edition and offer only")
761753 else {
762754 let baseHeight = if ((blockEnd == 0))
763755 then 0
764756 else height
765757 if (!(acceptedAssetIds(assetId)))
766758 then throw("Something went wrong!")
767759 else if (!(validateMinSell(assetId, price)))
768760 then throw("Something went wrong!")
769761 else {
770762 let checkUser = validateUser(caller)
771763 if ((checkUser != ""))
772764 then throw(checkUser)
773765 else {
774766 let amountSold = getIntegerByKey(keyIssued(caller, artId))
775767 let maxCanSell = getIntegerByKey(keyMaxMint(caller, artId))
776768 if ((maxMint > 100))
777769 then throw("100 editions max per artwork")
778770 else if (if ((amountSold != 0))
779771 then (amountSold == maxCanSell)
780772 else false)
781773 then throw("Max edition reached.")
782774 else if (if ((amountSold > 0))
783775 then (maxCanSell != maxMint)
784776 else false)
785777 then throw("Cannot change maximum issuable anymore")
786778 else if (if ((bidNbr > 0))
787779 then (maxCanSell != maxMint)
788780 else false)
789781 then throw("Cannot change maximum issuable with active orders")
790782 else {
791783 let sellStatus = if (if ((price > 0))
792784 then (maxMint > 0)
793785 else false)
794786 then true
795787 else false
796788 let txToCaller = if ((isSponsored > 0))
797789 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
798790 else nil
799791 ([BooleanEntry(keyOnSale(caller, artId), sellStatus), IntegerEntry(keyPrice(caller, artId), price), IntegerEntry(keyMaxMint(caller, artId), maxMint), StringEntry(keyAssetIdAccepted(caller, artId), assetId), IntegerEntry(keyEndSale(caller, artId), (baseHeight + blockEnd))] ++ txToCaller)
800792 }
801793 }
802794 }
803795 }
804796 }
805797 }
806798 }
807799
808800
809801
810802 @Callable(i)
811803 func buyArtwork (artId,issuer) = buyMint(i, artId, issuer, "", "", "")
812804
813805
814806
815807 @Callable(i)
816808 func setBid (artId,issuer) = {
817- let $t03160131641 = idCallerDate(i)
818- let id = $t03160131641._1
819- let caller = $t03160131641._2
820- let date = $t03160131641._3
821- let $t03164631682 = isPayment(i)
822- let payment = $t03164631682._1
823- let amount = $t03164631682._2
809+ let $t03159531635 = idCallerDate(i)
810+ let id = $t03159531635._1
811+ let caller = $t03159531635._2
812+ let date = $t03159531635._3
813+ let $t03164031676 = isPayment(i)
814+ let payment = $t03164031676._1
815+ let amount = $t03164031676._2
824816 let assetId = if (!(isDefined(payment.assetId)))
825817 then "WAVES"
826818 else toBase58String(value(payment.assetId))
827819 let blockEnd = getIntegerByKey(keyEndSale(issuer, artId))
828820 if (if ((blockEnd != 0))
829821 then (height >= blockEnd)
830822 else false)
831823 then throw("Sale ended.")
832824 else {
833825 let bidNbr = getIntegerByKey(("current_bidamount_" + artId))
834826 if (!(acceptedAssetIds(assetId)))
835827 then throw("asset not accepted")
836828 else if (!(validateMinSell(assetId, amount)))
837829 then throw("Wrong min sell")
838830 else {
839831 let amountSold = getIntegerByKey(keyIssued(issuer, artId))
840832 let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId))
841833 if ((0 >= maxCanSell))
842834 then throw("No max edition set for this artwork")
843835 else if ((amountSold >= maxCanSell))
844836 then throw("Sold out, you cannot bid")
845837 else [StringEntry((((((((("bid_" + artId) + "_") + issuer) + "_") + caller) + "_") + id) + "_OPEN"), ((((assetId + "_") + toString(amount)) + "_") + toString(date))), IntegerEntry(("current_bidamount_" + artId), (bidNbr + 1))]
846838 }
847839 }
848840 }
849841
850842
851843
852844 @Callable(i)
853845 func acceptBid (artId,issuer,bidId,bidOwner,pubKey) = {
854- let $t03290232973 = idCallerDateSponsored(i, pubKey)
855- let id = $t03290232973._1
856- let caller1 = $t03290232973._2
857- let date = $t03290232973._3
858- let isSponsored = $t03290232973._4
846+ let $t03289632967 = idCallerDateSponsored(i, pubKey)
847+ let id = $t03289632967._1
848+ let caller1 = $t03289632967._2
849+ let date = $t03289632967._3
850+ let isSponsored = $t03289632967._4
859851 if ((caller1 != issuer))
860852 then throw("You cannot do this action")
861853 else buyMint(i, artId, issuer, bidId, bidOwner, pubKey)
862854 }
863855
864856
865857
866858 @Callable(i)
867859 func cancelBid (artId,issuer,bidId,bidOwner) = {
868- let $t03320833269 = idCallerDate(i)
869- let id = $t03320833269._1
870- let caller = $t03320833269._2
871- let date = $t03320833269._3
860+ let $t03320233263 = idCallerDate(i)
861+ let id = $t03320233263._1
862+ let caller = $t03320233263._2
863+ let date = $t03320233263._3
872864 if (if ((caller != bidOwner))
873865 then (caller != issuer)
874866 else false)
875867 then throw("You cannot do this action")
876868 else {
877869 let returnMoneyTo = if ((caller == issuer))
878870 then bidOwner
879871 else caller
880872 let bidNbr = getIntegerByKey(("current_bidamount_" + artId))
881873 let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId)
882874 let bidData = getStringByKey((bidDataKey + "_OPEN"))
883875 if ((bidData == ""))
884876 then throw("Bid not found")
885877 else {
886878 let bidDataArr = split(bidData, "_")
887879 let assetId = getBidAssetId(bidDataArr[0])
888880 let bidStatus = "CANCELED"
889881 [DeleteEntry((bidDataKey + "_OPEN")), StringEntry(((bidDataKey + "_") + bidStatus), ((bidData + "_") + toString(date))), IntegerEntry(("current_bidamount_" + artId), (bidNbr - 1)), ScriptTransfer(Address(fromBase58String(returnMoneyTo)), parseIntValue(bidDataArr[1]), assetId)]
890882 }
891883 }
892884 }
893885
894886
895887 @Verifier(tx)
896888 func verifier () = match tx {
897889 case inv: InvokeScriptTransaction =>
898890 if (if (if (if ((inv.function == "addArtwork"))
899891 then (inv.dApp == this)
900892 else false)
901893 then (inv.fee == 500000)
902894 else false)
903895 then (inv.feeAssetId == unit)
904896 else false)
905897 then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[13])))
906898 else if (if (if (if ((inv.function == "updateArtwork"))
907899 then (inv.dApp == this)
908900 else false)
909901 then (inv.fee == 500000)
910902 else false)
911903 then (inv.feeAssetId == unit)
912904 else false)
913905 then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[12])))
914906 else if (if (if (if ((inv.function == "sellArtwork"))
915907 then (inv.dApp == this)
916908 else false)
917909 then (inv.fee == 500000)
918910 else false)
919911 then (inv.feeAssetId == unit)
920912 else false)
921913 then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[5])))
922914 else if (if (if (if ((inv.function == "acceptBid"))
923915 then (inv.dApp == this)
924916 else false)
925917 then (inv.fee == 500000)
926918 else false)
927919 then (inv.feeAssetId == unit)
928920 else false)
929921 then sigVerify_128Kb(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[4])))
930922 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
931923 case _ =>
932924 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
933925 }
934926

github/deemru/w8io/169f3d6 
115.06 ms