tx · PZAJ9HQMsdyrhTLFW3XNd3oEJ3pgKGo6tavU1hnjR9b

3NBynfbXC2KastUxhukcMUaE58K9cBdB9UY:  -0.01900000 Waves

2023.03.24 07:25 [2503604] smart account 3NBynfbXC2KastUxhukcMUaE58K9cBdB9UY > SELF 0.00000000 Waves

{ "type": 13, "id": "PZAJ9HQMsdyrhTLFW3XNd3oEJ3pgKGo6tavU1hnjR9b", "fee": 1900000, "feeAssetId": null, "timestamp": 1679631985016, "version": 2, "chainId": 84, "sender": "3NBynfbXC2KastUxhukcMUaE58K9cBdB9UY", "senderPublicKey": "J9DCtJJxJBWZdtDR12BA1U94Q3cZzMi4R6k5hYkAzmzC", "proofs": [ "2fGuMyX5d3SujnGxNkrC4tXitSGBDtxTUqJUQbvNAuWQRdEHkUAPqT25KigoX1TJMxgh82ZEmgEHrtUcv9JDPBFf" ], "script": "base64:BgL+FAgCEgQKAggIEhAKDggICAgICAgICAgICAEIEg8KDQgICAgICAgICAgIAQgSBgoECAgICBIECgIICBIICgYIAQEIAQgSBAoCCAgSBAoCCAgSBwoFCAgICAgSBgoECAgICCIOZ2V0U3RyaW5nQnlLZXkiA2tleSIIdW5pdFRlc3QiCW9yYWNsZUZlZSIIc2lnbkRhcHAiC2ZlZVJlY2VpdmVyIgh1c2VyRGFwcCINd2hpdGVsaXN0RGFwcCILc2lnbkFzc2V0SWQiC3VzZG5Bc3NldElkIgt1c2R0QXNzZXRJZCIMd2F2ZXNBc3NldElkIgVjaHJpcyIZZ2V0SW50ZWdlckJ5S2V5RnJvbU9yYWNsZSIPZ2V0SW50ZWdlckJ5S2V5Ig5jaGVja1doaXRlbGlzdCIPZ2V0Qm9vbGVhbkJ5S2V5IgdzaWduQ3V0Igt1c2RuV2F2ZUN1dCIOZGVmYXVsdExpY2VuY2UiEmRlZmF1bHRIYXNoTGljZW5jZSILZGFwcFJ1bm5pbmciDm1haW50ZW5hbmNlTVNHIg11c2VyU3VzcGVuZGVkIgt1c2VyUmVtb3ZlZCIQ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kAyBMDCAUCY1YJYm9keUJ5dGVzCQCRAwIIBQJjVgZwcm9vZnMAAAkA2QQBCQECY20BCQCRAwIIBQJjWARhcmdzAAQJAPQDAwgFAmNWCWJvZHlCeXRlcwkAkQMCCAUCY1YGcHJvb2ZzAAAIBQJjVg9zZW5kZXJQdWJsaWNLZXkJAPQDAwgFAmNWCWJvZHlCeXRlcwkAkQMCCAUCY1YGcHJvb2ZzAAAIBQJjVg9zZW5kZXJQdWJsaWNLZXkFKlMf", "height": 2503604, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: J8zf2vhEUaVQ3VaBE3CuEXHDMcr5km2bvvRX2pEz2Gk6 Next: 5PLYnGSscri2dBD5JWsmqmBPKmDL3vA73U6xxezh2tCC Diff:
OldNewDifferences
402402
403403
404404 func buyMint (i,artId,issuer,bidId,bidOwner,pubKey) = {
405- let $t01304113111 = idCallerDateSponsored(i, pubKey)
406- let id = $t01304113111._1
407- let caller = $t01304113111._2
408- let date = $t01304113111._3
409- let isSponsored = $t01304113111._4
410- if (true)
411- then throw(((((caller + " / ") + issuer) + " / ") + toString(isSponsored)))
405+ let $t01304113130 = idCallerDateSponsored(i, pubKey)
406+ let id = $t01304113130._1
407+ let caller = $t01304113130._2
408+ let date = $t01304113130._3
409+ let isSponsored = $t01304113130._4
410+ let isBid = if (if (if ((caller == issuer))
411+ then (bidOwner != "")
412+ else false)
413+ then (bidId != "")
414+ else false)
415+ then true
416+ else false
417+ let blockEnd = getIntegerByKey(keyEndSale(caller, artId))
418+ if (if (if ((blockEnd != 0))
419+ then (height >= blockEnd)
420+ else false)
421+ then !(isBid)
422+ else false)
423+ then throw("Sale ended.")
412424 else {
413- let isBid = if (if (if ((caller == issuer))
414- then (bidOwner != "")
415- else false)
416- then (bidId != "")
417- else false)
418- then true
419- else false
420- let blockEnd = getIntegerByKey(keyEndSale(caller, artId))
421- if (if (if ((blockEnd != 0))
422- then (height >= blockEnd)
423- else false)
424- then !(isBid)
425- else false)
426- then throw("Sale ended.")
425+ let callerIsIssuer = (caller == issuer)
426+ let totalNFT = getIntegerByKey("total_nft_issued")
427+ let signID = getStringByKey(keySignID(issuer, artId))
428+ let artworkName = getStringByKey(keyName(issuer, artId))
429+ if ((artworkName == ""))
430+ then throw("Art doesn't exist")
427431 else {
428- let callerIsIssuer = (caller == issuer)
429- let totalNFT = getIntegerByKey("total_nft_issued")
430- let signID = getStringByKey(keySignID(issuer, artId))
431- let artworkName = getStringByKey(keyName(issuer, artId))
432- if ((artworkName == ""))
433- then throw("Art doesn't exist")
434- else {
435- let isOnSale = getBooleanByKey(keyOnSale(issuer, artId))
436- let amountSold = getIntegerByKey(keyIssued(issuer, artId))
437- let artworkPrice = if (callerIsIssuer)
438- then (currentCertificationPrice * 2)
439- else getIntegerByKey(keyPrice(issuer, artId))
440- let priceAssetId = if (callerIsIssuer)
441- then toBase58String(signAssetId)
442- else getStringByKey(keyAssetIdAccepted(issuer, artId))
443- let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId))
444- if (if (if (!(isBid))
445- then !(callerIsIssuer)
446- else false)
447- then if (if ((0 >= artworkPrice))
448- then true
449- else !(isOnSale))
450- then true
451- else (0 >= maxCanSell)
452- else false)
453- then throw("Art not for sale")
454- else if (if (if (!(isBid))
455- then callerIsIssuer
432+ let isOnSale = getBooleanByKey(keyOnSale(issuer, artId))
433+ let amountSold = getIntegerByKey(keyIssued(issuer, artId))
434+ let artworkPrice = if (callerIsIssuer)
435+ then (currentCertificationPrice * 2)
436+ else getIntegerByKey(keyPrice(issuer, artId))
437+ let priceAssetId = if (callerIsIssuer)
438+ then toBase58String(signAssetId)
439+ else getStringByKey(keyAssetIdAccepted(issuer, artId))
440+ let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId))
441+ if (if (if (!(isBid))
442+ then !(callerIsIssuer)
443+ else false)
444+ then if (if ((0 >= artworkPrice))
445+ then true
446+ else !(isOnSale))
447+ then true
448+ else (0 >= maxCanSell)
449+ else false)
450+ then throw("Art not for sale")
451+ else if (if (if (!(isBid))
452+ then callerIsIssuer
453+ else false)
454+ then (0 >= maxCanSell)
455+ else false)
456+ then throw("Max issuable not set")
457+ else {
458+ let checkUser = validateUser(issuer)
459+ if (if (isBid)
460+ then (checkUser != "")
456461 else false)
457- then (0 >= maxCanSell)
458- else false)
459- then throw("Max issuable not set")
462+ then throw(checkUser)
460463 else {
461- let checkUser = validateUser(issuer)
462- if (if (isBid)
463- then (checkUser != "")
464+ let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId)
465+ let $t01464914841 = if (isBid)
466+ then getPriceAssetIdFromBid(bidDataKey)
467+ else validatePriceAssetId(i, priceAssetId, artworkPrice)
468+ let amount = $t01464914841._1
469+ let assetId = $t01464914841._2
470+ let agent = valueOrElse(getString(userDapp, keyArtistAgentAddr(issuer)), feeReceiver)
471+ let agentShare = valueOrElse(getInteger(userDapp, keyPrimaryShareAgent(issuer)), 0)
472+ let publicAgent = valueOrElse(getString(userDapp, keyArtistPublicAgentAddr(issuer)), feeReceiver)
473+ let publicAgentShare = valueOrElse(getInteger(userDapp, keyPrimarySharePublicAgent(issuer)), 0)
474+ let isWhitelisted = checkWhitelist(issuer)
475+ let cut = if ((isWhitelisted > height))
476+ then 0
477+ else if ((assetId == signAssetId))
478+ then signCut
479+ else usdnWaveCut
480+ let amountForSign = fraction(amount, cut, 100)
481+ let amountForAgent = if (if (if ((agent != feeReceiver))
482+ then (agentShare > 0)
464483 else false)
465- then throw(checkUser)
484+ then (height > isWhitelisted)
485+ else false)
486+ then fraction(amount, agentShare, 10000)
487+ else 0
488+ let amountForPublicAgent = if (if (if ((publicAgent != feeReceiver))
489+ then (publicAgentShare > 0)
490+ else false)
491+ then (height > isWhitelisted)
492+ else false)
493+ then fraction(amount, publicAgentShare, 10000)
494+ else 0
495+ let amountForCreator = (amount - amountForSign)
496+ if ((amountSold == maxCanSell))
497+ then throw("Art sold out")
466498 else {
467- let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId)
468- let $t01473214924 = if (isBid)
469- then getPriceAssetIdFromBid(bidDataKey)
470- else validatePriceAssetId(i, priceAssetId, artworkPrice)
471- let amount = $t01473214924._1
472- let assetId = $t01473214924._2
473- let agent = valueOrElse(getString(userDapp, keyArtistAgentAddr(issuer)), feeReceiver)
474- let agentShare = valueOrElse(getInteger(userDapp, keyPrimaryShareAgent(issuer)), 0)
475- let publicAgent = valueOrElse(getString(userDapp, keyArtistPublicAgentAddr(issuer)), feeReceiver)
476- let publicAgentShare = valueOrElse(getInteger(userDapp, keyPrimarySharePublicAgent(issuer)), 0)
477- let isWhitelisted = checkWhitelist(issuer)
478- let cut = if ((isWhitelisted > height))
479- then 0
480- else if ((assetId == signAssetId))
481- then signCut
482- else usdnWaveCut
483- let amountForSign = fraction(amount, cut, 100)
484- let amountForAgent = if (if (if ((agent != feeReceiver))
485- then (agentShare > 0)
486- else false)
487- then (height > isWhitelisted)
488- else false)
489- then fraction(amount, agentShare, 10000)
490- else 0
491- let amountForPublicAgent = if (if (if ((publicAgent != feeReceiver))
492- then (publicAgentShare > 0)
493- else false)
494- then (height > isWhitelisted)
495- else false)
496- then fraction(amount, publicAgentShare, 10000)
497- else 0
498- let amountForCreator = (amount - amountForSign)
499- if ((amountSold == maxCanSell))
500- then throw("Art sold out")
501- else {
502- let newAmountSold = (amountSold + 1)
503- let issueMeta = ((((((((((("Creator: " + issuer) + ",
499+ let newAmountSold = (amountSold + 1)
500+ let issueMeta = ((((((((((("Creator: " + issuer) + ",
504501 ArtID: ") + artId) + ",
505502 SignID: ") + signID) + ",
506503 Artwork name: ") + artworkName) + ",
507504 Issue: ") + toString(newAmountSold)) + "/") + toString(maxCanSell))
508- let issueNFT = Issue(("SA_" + toString((totalNFT + 1))), issueMeta, 1, 0, false)
509- let idNFT = calculateAssetId(issueNFT)
510- let sellStatus = if (if ((newAmountSold == maxCanSell))
511- then true
512- else !(isOnSale))
513- then false
514- else true
515- let receiveNFT = if (if (if ((caller == issuer))
516- then (bidOwner != "")
517- else false)
518- then (bidId != "")
519- else false)
520- then addressFromStringValue(bidOwner)
521- else i.caller
522- let assetIdBid = if (!(isDefined(assetId)))
523- then "WAVES"
524- else toBase58String(value(assetId))
525- let bidData = getStringByKey((bidDataKey + "_OPEN"))
526- let bidDelOld = DeleteEntry((bidDataKey + "_OPEN"))
527- let bidUpdate = StringEntry((bidDataKey + "_CLOSED"), ((bidData + "_") + toString(date)))
528- let soldKey = ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer)
529- let soldValue = if (!(isBid))
530- then ((((((((((caller + "_") + toString(date)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + toBase58String(idNFT))
531- else ((((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + assetIdBid) + "_") + toBase58String(idNFT))
532- let soldData = StringEntry(soldKey, soldValue)
533- let commissionsWithAgent = if ((amountForAgent != 0))
534- then [ScriptTransfer(Address(fromBase58String(feeReceiver)), (amountForSign - amountForAgent), assetId), ScriptTransfer(Address(fromBase58String(agent)), amountForAgent, assetId)]
535- else [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)]
536- let commissionsWithPublicAgent = if ((amountForPublicAgent != 0))
537- then [ScriptTransfer(Address(fromBase58String(publicAgent)), amountForPublicAgent, assetId), ScriptTransfer(Address(fromBase58String(issuer)), (amountForCreator - amountForPublicAgent), assetId)]
538- else [ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId)]
539- let txToCaller = if (isSponsored)
540- then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
541- else nil
542- 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)
543- if (isBid)
544- then [soldData, bidUpdate, bidDelOld] :: buyRes
545- else soldData :: buyRes
546- }
505+ let issueNFT = Issue(("SA_" + toString((totalNFT + 1))), issueMeta, 1, 0, false)
506+ let idNFT = calculateAssetId(issueNFT)
507+ let sellStatus = if (if ((newAmountSold == maxCanSell))
508+ then true
509+ else !(isOnSale))
510+ then false
511+ else true
512+ let receiveNFT = if (if (if ((caller == issuer))
513+ then (bidOwner != "")
514+ else false)
515+ then (bidId != "")
516+ else false)
517+ then addressFromStringValue(bidOwner)
518+ else i.caller
519+ let assetIdBid = if (!(isDefined(assetId)))
520+ then "WAVES"
521+ else toBase58String(value(assetId))
522+ let bidData = getStringByKey((bidDataKey + "_OPEN"))
523+ let bidDelOld = DeleteEntry((bidDataKey + "_OPEN"))
524+ let bidUpdate = StringEntry((bidDataKey + "_CLOSED"), ((bidData + "_") + toString(date)))
525+ let soldKey = ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer)
526+ let soldValue = if (!(isBid))
527+ then ((((((((((caller + "_") + toString(date)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + toBase58String(idNFT))
528+ else ((((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + assetIdBid) + "_") + toBase58String(idNFT))
529+ let soldData = StringEntry(soldKey, soldValue)
530+ let commissionsWithAgent = if ((amountForAgent != 0))
531+ then [ScriptTransfer(Address(fromBase58String(feeReceiver)), (amountForSign - amountForAgent), assetId), ScriptTransfer(Address(fromBase58String(agent)), amountForAgent, assetId)]
532+ else [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)]
533+ let commissionsWithPublicAgent = if ((amountForPublicAgent != 0))
534+ then [ScriptTransfer(Address(fromBase58String(publicAgent)), amountForPublicAgent, assetId), ScriptTransfer(Address(fromBase58String(issuer)), (amountForCreator - amountForPublicAgent), assetId)]
535+ else [ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId)]
536+ let txToCaller = if (isSponsored)
537+ then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
538+ else nil
539+ 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)
540+ if (isBid)
541+ then [soldData, bidUpdate, bidDelOld] :: buyRes
542+ else soldData :: buyRes
547543 }
548544 }
549- }
545+ }
550546 }
551547 }
552548 }
574570
575571 @Callable(i)
576572 func addArtwork (sha256Hash,signID,name,description,tags,type,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence,crawler,royalties,pubKey) = {
577- let $t02010020173 = idCallerDateSponsored(i, pubKey)
578- let artId = $t02010020173._1
579- let caller = $t02010020173._2
580- let date = $t02010020173._3
581- let isSponsored = $t02010020173._4
573+ let $t02001720090 = idCallerDateSponsored(i, pubKey)
574+ let artId = $t02001720090._1
575+ let caller = $t02001720090._2
576+ let date = $t02001720090._3
577+ let isSponsored = $t02001720090._4
582578 if (!(validateHash(sha256Hash)))
583579 then throw("Hash should be 64 characters maximum")
584580 else {
585- let $t02027420343 = setLIcence(cidLicence, sha256Licence)
586- let licenceCID = $t02027420343._1
587- let licenceHash = $t02027420343._2
581+ let $t02019120260 = setLIcence(cidLicence, sha256Licence)
582+ let licenceCID = $t02019120260._1
583+ let licenceHash = $t02019120260._2
588584 let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, royalties)
589585 if ((validateArtwork != ""))
590586 then throw("Something went wrong!")
591587 else {
592588 let whitelisted_drop = (checkWhitelist((caller + "_free_drops")) > 0)
593- let $t02064220726 = if (whitelisted_drop)
589+ let $t02055920643 = if (whitelisted_drop)
594590 then $Tuple2(0, signID)
595591 else validatePayment(i)
596- let amount = $t02064220726._1
597- let assetId = $t02064220726._2
592+ let amount = $t02055920643._1
593+ let assetId = $t02055920643._2
598594 if (!(isDefined(amount)))
599595 then throw("Something went wrong")
600596 else {
635631 func updateArtwork (txid,name,description,tags,type,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence,crawler,royalties,pubKey) = if (!(dappRunning))
636632 then throw(maintenanceMSG)
637633 else {
638- let $t02376023830 = idCallerDateSponsored(i, pubKey)
639- let id = $t02376023830._1
640- let caller = $t02376023830._2
641- let date = $t02376023830._3
642- let isSponsored = $t02376023830._4
643- let $t02384023909 = setLIcence(cidLicence, sha256Licence)
644- let licenceCID = $t02384023909._1
645- let licenceHash = $t02384023909._2
634+ let $t02367723747 = idCallerDateSponsored(i, pubKey)
635+ let id = $t02367723747._1
636+ let caller = $t02367723747._2
637+ let date = $t02367723747._3
638+ let isSponsored = $t02367723747._4
639+ let $t02375723826 = setLIcence(cidLicence, sha256Licence)
640+ let licenceCID = $t02375723826._1
641+ let licenceHash = $t02375723826._2
646642 let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, royalties)
647643 if ((validateArtwork != ""))
648644 then throw("Something went wrong!")
670666
671667 @Callable(i)
672668 func flagArtwork (artId,addr,flag,note) = {
673- let $t02553625570 = idCallerDate(i)
674- let id = $t02553625570._1
675- let caller = $t02553625570._2
669+ let $t02545325487 = idCallerDate(i)
670+ let id = $t02545325487._1
671+ let caller = $t02545325487._2
676672 if (containsElement([chris, toString(this)], caller))
677673 then if (containsElement(["CONSENT", "", "CHANGE_REQUIRED", "FLAGGED", "ILLEGAL"], flag))
678674 then [StringEntry(keyFlag(addr, artId), flag), StringEntry(keyNote(addr, artId), note)]
684680
685681 @Callable(i)
686682 func deleteArtwork (artId,addr) = {
687- let $t02600626040 = idCallerDate(i)
688- let id = $t02600626040._1
689- let caller = $t02600626040._2
683+ let $t02592325957 = idCallerDate(i)
684+ let id = $t02592325957._1
685+ let caller = $t02592325957._2
690686 let addrToUse = if (containsElement([chris, toString(this)], caller))
691687 then addr
692688 else caller
719715
720716 @Callable(i)
721717 func sellArtwork (artId,price,maxMint,assetId,blockEnd,pubKey) = {
722- let $t02887628946 = idCallerDateSponsored(i, pubKey)
723- let id = $t02887628946._1
724- let caller = $t02887628946._2
725- let date = $t02887628946._3
726- let isSponsored = $t02887628946._4
718+ let $t02879328863 = idCallerDateSponsored(i, pubKey)
719+ let id = $t02879328863._1
720+ let caller = $t02879328863._2
721+ let date = $t02879328863._3
722+ let isSponsored = $t02879328863._4
727723 let artworkName = getStringByKey(keyName(caller, artId))
728724 if ((artworkName == ""))
729725 then throw("This art doesn't match your account")
797793
798794 @Callable(i)
799795 func setBid (artId,issuer) = {
800- let $t03132831368 = idCallerDate(i)
801- let id = $t03132831368._1
802- let caller = $t03132831368._2
803- let date = $t03132831368._3
804- let $t03137331409 = isPayment(i)
805- let payment = $t03137331409._1
806- let amount = $t03137331409._2
796+ let $t03124531285 = idCallerDate(i)
797+ let id = $t03124531285._1
798+ let caller = $t03124531285._2
799+ let date = $t03124531285._3
800+ let $t03129031326 = isPayment(i)
801+ let payment = $t03129031326._1
802+ let amount = $t03129031326._2
807803 let assetId = if (!(isDefined(payment.assetId)))
808804 then "WAVES"
809805 else toBase58String(value(payment.assetId))
834830
835831 @Callable(i)
836832 func acceptBid (artId,issuer,bidId,bidOwner,pubKey) = {
837- let $t03262932700 = idCallerDateSponsored(i, pubKey)
838- let id = $t03262932700._1
839- let caller1 = $t03262932700._2
840- let date = $t03262932700._3
841- let isSponsored = $t03262932700._4
833+ let $t03254632617 = idCallerDateSponsored(i, pubKey)
834+ let id = $t03254632617._1
835+ let caller1 = $t03254632617._2
836+ let date = $t03254632617._3
837+ let isSponsored = $t03254632617._4
842838 if ((caller1 != issuer))
843839 then throw("You cannot do this action")
844840 else buyMint(i, artId, issuer, bidId, bidOwner, pubKey)
848844
849845 @Callable(i)
850846 func cancelBid (artId,issuer,bidId,bidOwner) = {
851- let $t03293532996 = idCallerDate(i)
852- let id = $t03293532996._1
853- let caller = $t03293532996._2
854- let date = $t03293532996._3
847+ let $t03285232913 = idCallerDate(i)
848+ let id = $t03285232913._1
849+ let caller = $t03285232913._2
850+ let date = $t03285232913._3
855851 if (if ((caller != bidOwner))
856852 then (caller != issuer)
857853 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
383383 let caller = if (if ((toBase58String(i.caller.bytes) == toString(this)))
384384 then (isSponsored > 0)
385385 else false)
386386 then toString(addressFromPublicKey(fromBase58String(pubKey)))
387387 else toBase58String(i.caller.bytes)
388388 let get_sponsored_waves = if (if ((pubKey != ""))
389389 then (isSponsored > 0)
390390 else false)
391391 then invoke(whitelistDapp, "useFreeTx", [toString(addressFromPublicKey(fromBase58String(pubKey)))], nil)
392392 else unit
393393 if ((get_sponsored_waves == get_sponsored_waves))
394394 then $Tuple4(toBase58String(i.transactionId), caller, lastBlock.timestamp, (isSponsored > 0))
395395 else throw("Strict value is not equal to itself.")
396396 }
397397
398398
399399 func idCallerDate (i) = if (!(dappRunning))
400400 then throw(maintenanceMSG)
401401 else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp)
402402
403403
404404 func buyMint (i,artId,issuer,bidId,bidOwner,pubKey) = {
405- let $t01304113111 = idCallerDateSponsored(i, pubKey)
406- let id = $t01304113111._1
407- let caller = $t01304113111._2
408- let date = $t01304113111._3
409- let isSponsored = $t01304113111._4
410- if (true)
411- then throw(((((caller + " / ") + issuer) + " / ") + toString(isSponsored)))
405+ let $t01304113130 = idCallerDateSponsored(i, pubKey)
406+ let id = $t01304113130._1
407+ let caller = $t01304113130._2
408+ let date = $t01304113130._3
409+ let isSponsored = $t01304113130._4
410+ let isBid = if (if (if ((caller == issuer))
411+ then (bidOwner != "")
412+ else false)
413+ then (bidId != "")
414+ else false)
415+ then true
416+ else false
417+ let blockEnd = getIntegerByKey(keyEndSale(caller, artId))
418+ if (if (if ((blockEnd != 0))
419+ then (height >= blockEnd)
420+ else false)
421+ then !(isBid)
422+ else false)
423+ then throw("Sale ended.")
412424 else {
413- let isBid = if (if (if ((caller == issuer))
414- then (bidOwner != "")
415- else false)
416- then (bidId != "")
417- else false)
418- then true
419- else false
420- let blockEnd = getIntegerByKey(keyEndSale(caller, artId))
421- if (if (if ((blockEnd != 0))
422- then (height >= blockEnd)
423- else false)
424- then !(isBid)
425- else false)
426- then throw("Sale ended.")
425+ let callerIsIssuer = (caller == issuer)
426+ let totalNFT = getIntegerByKey("total_nft_issued")
427+ let signID = getStringByKey(keySignID(issuer, artId))
428+ let artworkName = getStringByKey(keyName(issuer, artId))
429+ if ((artworkName == ""))
430+ then throw("Art doesn't exist")
427431 else {
428- let callerIsIssuer = (caller == issuer)
429- let totalNFT = getIntegerByKey("total_nft_issued")
430- let signID = getStringByKey(keySignID(issuer, artId))
431- let artworkName = getStringByKey(keyName(issuer, artId))
432- if ((artworkName == ""))
433- then throw("Art doesn't exist")
434- else {
435- let isOnSale = getBooleanByKey(keyOnSale(issuer, artId))
436- let amountSold = getIntegerByKey(keyIssued(issuer, artId))
437- let artworkPrice = if (callerIsIssuer)
438- then (currentCertificationPrice * 2)
439- else getIntegerByKey(keyPrice(issuer, artId))
440- let priceAssetId = if (callerIsIssuer)
441- then toBase58String(signAssetId)
442- else getStringByKey(keyAssetIdAccepted(issuer, artId))
443- let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId))
444- if (if (if (!(isBid))
445- then !(callerIsIssuer)
446- else false)
447- then if (if ((0 >= artworkPrice))
448- then true
449- else !(isOnSale))
450- then true
451- else (0 >= maxCanSell)
452- else false)
453- then throw("Art not for sale")
454- else if (if (if (!(isBid))
455- then callerIsIssuer
432+ let isOnSale = getBooleanByKey(keyOnSale(issuer, artId))
433+ let amountSold = getIntegerByKey(keyIssued(issuer, artId))
434+ let artworkPrice = if (callerIsIssuer)
435+ then (currentCertificationPrice * 2)
436+ else getIntegerByKey(keyPrice(issuer, artId))
437+ let priceAssetId = if (callerIsIssuer)
438+ then toBase58String(signAssetId)
439+ else getStringByKey(keyAssetIdAccepted(issuer, artId))
440+ let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId))
441+ if (if (if (!(isBid))
442+ then !(callerIsIssuer)
443+ else false)
444+ then if (if ((0 >= artworkPrice))
445+ then true
446+ else !(isOnSale))
447+ then true
448+ else (0 >= maxCanSell)
449+ else false)
450+ then throw("Art not for sale")
451+ else if (if (if (!(isBid))
452+ then callerIsIssuer
453+ else false)
454+ then (0 >= maxCanSell)
455+ else false)
456+ then throw("Max issuable not set")
457+ else {
458+ let checkUser = validateUser(issuer)
459+ if (if (isBid)
460+ then (checkUser != "")
456461 else false)
457- then (0 >= maxCanSell)
458- else false)
459- then throw("Max issuable not set")
462+ then throw(checkUser)
460463 else {
461- let checkUser = validateUser(issuer)
462- if (if (isBid)
463- then (checkUser != "")
464+ let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId)
465+ let $t01464914841 = if (isBid)
466+ then getPriceAssetIdFromBid(bidDataKey)
467+ else validatePriceAssetId(i, priceAssetId, artworkPrice)
468+ let amount = $t01464914841._1
469+ let assetId = $t01464914841._2
470+ let agent = valueOrElse(getString(userDapp, keyArtistAgentAddr(issuer)), feeReceiver)
471+ let agentShare = valueOrElse(getInteger(userDapp, keyPrimaryShareAgent(issuer)), 0)
472+ let publicAgent = valueOrElse(getString(userDapp, keyArtistPublicAgentAddr(issuer)), feeReceiver)
473+ let publicAgentShare = valueOrElse(getInteger(userDapp, keyPrimarySharePublicAgent(issuer)), 0)
474+ let isWhitelisted = checkWhitelist(issuer)
475+ let cut = if ((isWhitelisted > height))
476+ then 0
477+ else if ((assetId == signAssetId))
478+ then signCut
479+ else usdnWaveCut
480+ let amountForSign = fraction(amount, cut, 100)
481+ let amountForAgent = if (if (if ((agent != feeReceiver))
482+ then (agentShare > 0)
464483 else false)
465- then throw(checkUser)
484+ then (height > isWhitelisted)
485+ else false)
486+ then fraction(amount, agentShare, 10000)
487+ else 0
488+ let amountForPublicAgent = if (if (if ((publicAgent != feeReceiver))
489+ then (publicAgentShare > 0)
490+ else false)
491+ then (height > isWhitelisted)
492+ else false)
493+ then fraction(amount, publicAgentShare, 10000)
494+ else 0
495+ let amountForCreator = (amount - amountForSign)
496+ if ((amountSold == maxCanSell))
497+ then throw("Art sold out")
466498 else {
467- let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId)
468- let $t01473214924 = if (isBid)
469- then getPriceAssetIdFromBid(bidDataKey)
470- else validatePriceAssetId(i, priceAssetId, artworkPrice)
471- let amount = $t01473214924._1
472- let assetId = $t01473214924._2
473- let agent = valueOrElse(getString(userDapp, keyArtistAgentAddr(issuer)), feeReceiver)
474- let agentShare = valueOrElse(getInteger(userDapp, keyPrimaryShareAgent(issuer)), 0)
475- let publicAgent = valueOrElse(getString(userDapp, keyArtistPublicAgentAddr(issuer)), feeReceiver)
476- let publicAgentShare = valueOrElse(getInteger(userDapp, keyPrimarySharePublicAgent(issuer)), 0)
477- let isWhitelisted = checkWhitelist(issuer)
478- let cut = if ((isWhitelisted > height))
479- then 0
480- else if ((assetId == signAssetId))
481- then signCut
482- else usdnWaveCut
483- let amountForSign = fraction(amount, cut, 100)
484- let amountForAgent = if (if (if ((agent != feeReceiver))
485- then (agentShare > 0)
486- else false)
487- then (height > isWhitelisted)
488- else false)
489- then fraction(amount, agentShare, 10000)
490- else 0
491- let amountForPublicAgent = if (if (if ((publicAgent != feeReceiver))
492- then (publicAgentShare > 0)
493- else false)
494- then (height > isWhitelisted)
495- else false)
496- then fraction(amount, publicAgentShare, 10000)
497- else 0
498- let amountForCreator = (amount - amountForSign)
499- if ((amountSold == maxCanSell))
500- then throw("Art sold out")
501- else {
502- let newAmountSold = (amountSold + 1)
503- let issueMeta = ((((((((((("Creator: " + issuer) + ",
499+ let newAmountSold = (amountSold + 1)
500+ let issueMeta = ((((((((((("Creator: " + issuer) + ",
504501 ArtID: ") + artId) + ",
505502 SignID: ") + signID) + ",
506503 Artwork name: ") + artworkName) + ",
507504 Issue: ") + toString(newAmountSold)) + "/") + toString(maxCanSell))
508- let issueNFT = Issue(("SA_" + toString((totalNFT + 1))), issueMeta, 1, 0, false)
509- let idNFT = calculateAssetId(issueNFT)
510- let sellStatus = if (if ((newAmountSold == maxCanSell))
511- then true
512- else !(isOnSale))
513- then false
514- else true
515- let receiveNFT = if (if (if ((caller == issuer))
516- then (bidOwner != "")
517- else false)
518- then (bidId != "")
519- else false)
520- then addressFromStringValue(bidOwner)
521- else i.caller
522- let assetIdBid = if (!(isDefined(assetId)))
523- then "WAVES"
524- else toBase58String(value(assetId))
525- let bidData = getStringByKey((bidDataKey + "_OPEN"))
526- let bidDelOld = DeleteEntry((bidDataKey + "_OPEN"))
527- let bidUpdate = StringEntry((bidDataKey + "_CLOSED"), ((bidData + "_") + toString(date)))
528- let soldKey = ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer)
529- let soldValue = if (!(isBid))
530- then ((((((((((caller + "_") + toString(date)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + toBase58String(idNFT))
531- else ((((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + assetIdBid) + "_") + toBase58String(idNFT))
532- let soldData = StringEntry(soldKey, soldValue)
533- let commissionsWithAgent = if ((amountForAgent != 0))
534- then [ScriptTransfer(Address(fromBase58String(feeReceiver)), (amountForSign - amountForAgent), assetId), ScriptTransfer(Address(fromBase58String(agent)), amountForAgent, assetId)]
535- else [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)]
536- let commissionsWithPublicAgent = if ((amountForPublicAgent != 0))
537- then [ScriptTransfer(Address(fromBase58String(publicAgent)), amountForPublicAgent, assetId), ScriptTransfer(Address(fromBase58String(issuer)), (amountForCreator - amountForPublicAgent), assetId)]
538- else [ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId)]
539- let txToCaller = if (isSponsored)
540- then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
541- else nil
542- 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)
543- if (isBid)
544- then [soldData, bidUpdate, bidDelOld] :: buyRes
545- else soldData :: buyRes
546- }
505+ let issueNFT = Issue(("SA_" + toString((totalNFT + 1))), issueMeta, 1, 0, false)
506+ let idNFT = calculateAssetId(issueNFT)
507+ let sellStatus = if (if ((newAmountSold == maxCanSell))
508+ then true
509+ else !(isOnSale))
510+ then false
511+ else true
512+ let receiveNFT = if (if (if ((caller == issuer))
513+ then (bidOwner != "")
514+ else false)
515+ then (bidId != "")
516+ else false)
517+ then addressFromStringValue(bidOwner)
518+ else i.caller
519+ let assetIdBid = if (!(isDefined(assetId)))
520+ then "WAVES"
521+ else toBase58String(value(assetId))
522+ let bidData = getStringByKey((bidDataKey + "_OPEN"))
523+ let bidDelOld = DeleteEntry((bidDataKey + "_OPEN"))
524+ let bidUpdate = StringEntry((bidDataKey + "_CLOSED"), ((bidData + "_") + toString(date)))
525+ let soldKey = ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer)
526+ let soldValue = if (!(isBid))
527+ then ((((((((((caller + "_") + toString(date)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + toBase58String(idNFT))
528+ else ((((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + assetIdBid) + "_") + toBase58String(idNFT))
529+ let soldData = StringEntry(soldKey, soldValue)
530+ let commissionsWithAgent = if ((amountForAgent != 0))
531+ then [ScriptTransfer(Address(fromBase58String(feeReceiver)), (amountForSign - amountForAgent), assetId), ScriptTransfer(Address(fromBase58String(agent)), amountForAgent, assetId)]
532+ else [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)]
533+ let commissionsWithPublicAgent = if ((amountForPublicAgent != 0))
534+ then [ScriptTransfer(Address(fromBase58String(publicAgent)), amountForPublicAgent, assetId), ScriptTransfer(Address(fromBase58String(issuer)), (amountForCreator - amountForPublicAgent), assetId)]
535+ else [ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId)]
536+ let txToCaller = if (isSponsored)
537+ then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
538+ else nil
539+ 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)
540+ if (isBid)
541+ then [soldData, bidUpdate, bidDelOld] :: buyRes
542+ else soldData :: buyRes
547543 }
548544 }
549- }
545+ }
550546 }
551547 }
552548 }
553549
554550
555551 func asString (bv) = match bv {
556552 case bv0: String =>
557553 bv0
558554 case _ =>
559555 throw("Sponsored Public Key String expected")
560556 }
561557
562558
563559 @Callable(invoke)
564560 func setConf (key,val) = {
565561 let caller = toString(invoke.caller)
566562 if (containsElement([chris, toString(this)], caller))
567563 then if (contains(key, "conf_"))
568564 then [StringEntry(key, val)]
569565 else throw("Entries starting with conf_ only")
570566 else throw("You are not allowed to change this")
571567 }
572568
573569
574570
575571 @Callable(i)
576572 func addArtwork (sha256Hash,signID,name,description,tags,type,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence,crawler,royalties,pubKey) = {
577- let $t02010020173 = idCallerDateSponsored(i, pubKey)
578- let artId = $t02010020173._1
579- let caller = $t02010020173._2
580- let date = $t02010020173._3
581- let isSponsored = $t02010020173._4
573+ let $t02001720090 = idCallerDateSponsored(i, pubKey)
574+ let artId = $t02001720090._1
575+ let caller = $t02001720090._2
576+ let date = $t02001720090._3
577+ let isSponsored = $t02001720090._4
582578 if (!(validateHash(sha256Hash)))
583579 then throw("Hash should be 64 characters maximum")
584580 else {
585- let $t02027420343 = setLIcence(cidLicence, sha256Licence)
586- let licenceCID = $t02027420343._1
587- let licenceHash = $t02027420343._2
581+ let $t02019120260 = setLIcence(cidLicence, sha256Licence)
582+ let licenceCID = $t02019120260._1
583+ let licenceHash = $t02019120260._2
588584 let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, royalties)
589585 if ((validateArtwork != ""))
590586 then throw("Something went wrong!")
591587 else {
592588 let whitelisted_drop = (checkWhitelist((caller + "_free_drops")) > 0)
593- let $t02064220726 = if (whitelisted_drop)
589+ let $t02055920643 = if (whitelisted_drop)
594590 then $Tuple2(0, signID)
595591 else validatePayment(i)
596- let amount = $t02064220726._1
597- let assetId = $t02064220726._2
592+ let amount = $t02055920643._1
593+ let assetId = $t02055920643._2
598594 if (!(isDefined(amount)))
599595 then throw("Something went wrong")
600596 else {
601597 let entryExist = getStringByKey(keyTxidByHashOwner(sha256Hash, caller))
602598 if ((entryExist != ""))
603599 then throw("You already added it")
604600 else {
605601 let hashExist = getStringByKey(keyOwnerByHash(sha256Hash))
606602 if ((hashExist != ""))
607603 then throw("Hash already registered")
608604 else {
609605 let isSignCertified = checkSignCertificate(signID, caller, sha256Hash)
610606 if (!(isSignCertified))
611607 then throw("Sign Certificate not found for this address.")
612608 else {
613609 let decrease_whitelist_drop = if (whitelisted_drop)
614610 then invoke(whitelistDapp, "useFreeDrop", [caller], nil)
615611 else unit
616612 if ((decrease_whitelist_drop == decrease_whitelist_drop))
617613 then {
618614 let txToCaller = if (isSponsored)
619615 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
620616 else nil
621617 ([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)
622618 }
623619 else throw("Strict value is not equal to itself.")
624620 }
625621 }
626622 }
627623 }
628624 }
629625 }
630626 }
631627
632628
633629
634630 @Callable(i)
635631 func updateArtwork (txid,name,description,tags,type,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence,crawler,royalties,pubKey) = if (!(dappRunning))
636632 then throw(maintenanceMSG)
637633 else {
638- let $t02376023830 = idCallerDateSponsored(i, pubKey)
639- let id = $t02376023830._1
640- let caller = $t02376023830._2
641- let date = $t02376023830._3
642- let isSponsored = $t02376023830._4
643- let $t02384023909 = setLIcence(cidLicence, sha256Licence)
644- let licenceCID = $t02384023909._1
645- let licenceHash = $t02384023909._2
634+ let $t02367723747 = idCallerDateSponsored(i, pubKey)
635+ let id = $t02367723747._1
636+ let caller = $t02367723747._2
637+ let date = $t02367723747._3
638+ let isSponsored = $t02367723747._4
639+ let $t02375723826 = setLIcence(cidLicence, sha256Licence)
640+ let licenceCID = $t02375723826._1
641+ let licenceHash = $t02375723826._2
646642 let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, royalties)
647643 if ((validateArtwork != ""))
648644 then throw("Something went wrong!")
649645 else {
650646 let entryExist = getStringByKey(keyName(caller, txid))
651647 if ((entryExist == ""))
652648 then throw("Entry not found")
653649 else {
654650 let flag = getStringByKey(keyFlag(caller, txid))
655651 if ((flag == "ILLEGAL"))
656652 then throw("Cannot update ILLEGAL artwork")
657653 else if (!(isArtMinted(caller, txid)))
658654 then {
659655 let txToCaller = if (isSponsored)
660656 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
661657 else nil
662658 ([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)
663659 }
664660 else throw("Already minted")
665661 }
666662 }
667663 }
668664
669665
670666
671667 @Callable(i)
672668 func flagArtwork (artId,addr,flag,note) = {
673- let $t02553625570 = idCallerDate(i)
674- let id = $t02553625570._1
675- let caller = $t02553625570._2
669+ let $t02545325487 = idCallerDate(i)
670+ let id = $t02545325487._1
671+ let caller = $t02545325487._2
676672 if (containsElement([chris, toString(this)], caller))
677673 then if (containsElement(["CONSENT", "", "CHANGE_REQUIRED", "FLAGGED", "ILLEGAL"], flag))
678674 then [StringEntry(keyFlag(addr, artId), flag), StringEntry(keyNote(addr, artId), note)]
679675 else throw(("Unknow status " + flag))
680676 else throw("You are not allowed")
681677 }
682678
683679
684680
685681 @Callable(i)
686682 func deleteArtwork (artId,addr) = {
687- let $t02600626040 = idCallerDate(i)
688- let id = $t02600626040._1
689- let caller = $t02600626040._2
683+ let $t02592325957 = idCallerDate(i)
684+ let id = $t02592325957._1
685+ let caller = $t02592325957._2
690686 let addrToUse = if (containsElement([chris, toString(this)], caller))
691687 then addr
692688 else caller
693689 let entryExist = valueOrErrorMessage(getStringByKey(keyName(addrToUse, artId)), "No art matching for this address")
694690 if ((entryExist == ""))
695691 then throw("No art matching for this address")
696692 else {
697693 let sha256Hash = getStringByKey(keyHashByTxidAddr(addrToUse, artId))
698694 if ((sha256Hash == ""))
699695 then throw("No art hash matching for this address")
700696 else {
701697 let signID = getStringByKey(keySignID(addrToUse, artId))
702698 if ((signID == ""))
703699 then throw("No SIGN ID matching")
704700 else {
705701 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))]
706702 if (!(isArtMinted(addrToUse, artId)))
707703 then if (!(dappRunning))
708704 then throw(maintenanceMSG)
709705 else dataToDelete
710706 else if (containsElement([chris, toString(this)], caller))
711707 then dataToDelete
712708 else throw("Art already minted, you cannot delete it")
713709 }
714710 }
715711 }
716712 }
717713
718714
719715
720716 @Callable(i)
721717 func sellArtwork (artId,price,maxMint,assetId,blockEnd,pubKey) = {
722- let $t02887628946 = idCallerDateSponsored(i, pubKey)
723- let id = $t02887628946._1
724- let caller = $t02887628946._2
725- let date = $t02887628946._3
726- let isSponsored = $t02887628946._4
718+ let $t02879328863 = idCallerDateSponsored(i, pubKey)
719+ let id = $t02879328863._1
720+ let caller = $t02879328863._2
721+ let date = $t02879328863._3
722+ let isSponsored = $t02879328863._4
727723 let artworkName = getStringByKey(keyName(caller, artId))
728724 if ((artworkName == ""))
729725 then throw("This art doesn't match your account")
730726 else {
731727 let flag = getStringByKey(keyFlag(caller, artId))
732728 if (containsElement(["CHANGE_REQUIRED", "FLAGGED", "ILLEGAL"], flag))
733729 then throw("Flagged artwork")
734730 else {
735731 let bidNbr = getIntegerByKey(("current_bidamount_" + artId))
736732 if ((0 > blockEnd))
737733 then throw("Negative end")
738734 else if (if ((blockEnd > 0))
739735 then if ((maxMint != 1))
740736 then true
741737 else (price != 0)
742738 else false)
743739 then throw("Timed offer only allowed for unique edition and offer only")
744740 else {
745741 let baseHeight = if ((blockEnd == 0))
746742 then 0
747743 else height
748744 if (!(acceptedAssetIds(assetId)))
749745 then throw("Something went wrong!")
750746 else if (!(validateMinSell(assetId, price)))
751747 then throw("Something went wrong!")
752748 else {
753749 let checkUser = validateUser(caller)
754750 if ((checkUser != ""))
755751 then throw(checkUser)
756752 else {
757753 let amountSold = getIntegerByKey(keyIssued(caller, artId))
758754 let maxCanSell = getIntegerByKey(keyMaxMint(caller, artId))
759755 if ((maxMint > 100))
760756 then throw("100 editions max per artwork")
761757 else if (if ((amountSold != 0))
762758 then (amountSold == maxCanSell)
763759 else false)
764760 then throw("Max edition reached.")
765761 else if (if ((amountSold > 0))
766762 then (maxCanSell != maxMint)
767763 else false)
768764 then throw("Cannot change maximum issuable anymore")
769765 else if (if ((bidNbr > 0))
770766 then (maxCanSell != maxMint)
771767 else false)
772768 then throw("Cannot change maximum issuable with active orders")
773769 else {
774770 let sellStatus = if (if ((price > 0))
775771 then (maxMint > 0)
776772 else false)
777773 then true
778774 else false
779775 let txToCaller = if (isSponsored)
780776 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
781777 else nil
782778 ([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)
783779 }
784780 }
785781 }
786782 }
787783 }
788784 }
789785 }
790786
791787
792788
793789 @Callable(i)
794790 func buyArtwork (artId,issuer) = buyMint(i, artId, issuer, "", "", "")
795791
796792
797793
798794 @Callable(i)
799795 func setBid (artId,issuer) = {
800- let $t03132831368 = idCallerDate(i)
801- let id = $t03132831368._1
802- let caller = $t03132831368._2
803- let date = $t03132831368._3
804- let $t03137331409 = isPayment(i)
805- let payment = $t03137331409._1
806- let amount = $t03137331409._2
796+ let $t03124531285 = idCallerDate(i)
797+ let id = $t03124531285._1
798+ let caller = $t03124531285._2
799+ let date = $t03124531285._3
800+ let $t03129031326 = isPayment(i)
801+ let payment = $t03129031326._1
802+ let amount = $t03129031326._2
807803 let assetId = if (!(isDefined(payment.assetId)))
808804 then "WAVES"
809805 else toBase58String(value(payment.assetId))
810806 let blockEnd = getIntegerByKey(keyEndSale(issuer, artId))
811807 if (if ((blockEnd != 0))
812808 then (height >= blockEnd)
813809 else false)
814810 then throw("Sale ended.")
815811 else {
816812 let bidNbr = getIntegerByKey(("current_bidamount_" + artId))
817813 if (!(acceptedAssetIds(assetId)))
818814 then throw("asset not accepted")
819815 else if (!(validateMinSell(assetId, amount)))
820816 then throw("Wrong min sell")
821817 else {
822818 let amountSold = getIntegerByKey(keyIssued(issuer, artId))
823819 let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId))
824820 if ((0 >= maxCanSell))
825821 then throw("No max edition set for this artwork")
826822 else if ((amountSold >= maxCanSell))
827823 then throw("Sold out, you cannot bid")
828824 else [StringEntry((((((((("bid_" + artId) + "_") + issuer) + "_") + caller) + "_") + id) + "_OPEN"), ((((assetId + "_") + toString(amount)) + "_") + toString(date))), IntegerEntry(("current_bidamount_" + artId), (bidNbr + 1))]
829825 }
830826 }
831827 }
832828
833829
834830
835831 @Callable(i)
836832 func acceptBid (artId,issuer,bidId,bidOwner,pubKey) = {
837- let $t03262932700 = idCallerDateSponsored(i, pubKey)
838- let id = $t03262932700._1
839- let caller1 = $t03262932700._2
840- let date = $t03262932700._3
841- let isSponsored = $t03262932700._4
833+ let $t03254632617 = idCallerDateSponsored(i, pubKey)
834+ let id = $t03254632617._1
835+ let caller1 = $t03254632617._2
836+ let date = $t03254632617._3
837+ let isSponsored = $t03254632617._4
842838 if ((caller1 != issuer))
843839 then throw("You cannot do this action")
844840 else buyMint(i, artId, issuer, bidId, bidOwner, pubKey)
845841 }
846842
847843
848844
849845 @Callable(i)
850846 func cancelBid (artId,issuer,bidId,bidOwner) = {
851- let $t03293532996 = idCallerDate(i)
852- let id = $t03293532996._1
853- let caller = $t03293532996._2
854- let date = $t03293532996._3
847+ let $t03285232913 = idCallerDate(i)
848+ let id = $t03285232913._1
849+ let caller = $t03285232913._2
850+ let date = $t03285232913._3
855851 if (if ((caller != bidOwner))
856852 then (caller != issuer)
857853 else false)
858854 then throw("You cannot do this action")
859855 else {
860856 let returnMoneyTo = if ((caller == issuer))
861857 then bidOwner
862858 else caller
863859 let bidNbr = getIntegerByKey(("current_bidamount_" + artId))
864860 let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId)
865861 let bidData = getStringByKey((bidDataKey + "_OPEN"))
866862 if ((bidData == ""))
867863 then throw("Bid not found")
868864 else {
869865 let bidDataArr = split(bidData, "_")
870866 let assetId = getBidAssetId(bidDataArr[0])
871867 let bidStatus = "CANCELED"
872868 [DeleteEntry((bidDataKey + "_OPEN")), StringEntry(((bidDataKey + "_") + bidStatus), ((bidData + "_") + toString(date))), IntegerEntry(("current_bidamount_" + artId), (bidNbr - 1)), ScriptTransfer(Address(fromBase58String(returnMoneyTo)), parseIntValue(bidDataArr[1]), assetId)]
873869 }
874870 }
875871 }
876872
877873
878874 @Verifier(tx)
879875 func verifier () = match tx {
880876 case inv: InvokeScriptTransaction =>
881877 if (if (if (if ((inv.function == "addArtwork"))
882878 then (inv.dApp == this)
883879 else false)
884880 then (inv.fee == 500000)
885881 else false)
886882 then (inv.feeAssetId == unit)
887883 else false)
888884 then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[13])))
889885 else if (if (if (if ((inv.function == "updateArtwork"))
890886 then (inv.dApp == this)
891887 else false)
892888 then (inv.fee == 500000)
893889 else false)
894890 then (inv.feeAssetId == unit)
895891 else false)
896892 then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[12])))
897893 else if (if (if (if ((inv.function == "sellArtwork"))
898894 then (inv.dApp == this)
899895 else false)
900896 then (inv.fee == 500000)
901897 else false)
902898 then (inv.feeAssetId == unit)
903899 else false)
904900 then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[5])))
905901 else if (if (if (if ((inv.function == "acceptBid"))
906902 then (inv.dApp == this)
907903 else false)
908904 then (inv.fee == 500000)
909905 else false)
910906 then (inv.feeAssetId == unit)
911907 else false)
912908 then sigVerify_128Kb(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[4])))
913909 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
914910 case _ =>
915911 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
916912 }
917913

github/deemru/w8io/169f3d6 
122.68 ms