tx · D5DNmHBBNvQX8fZnK9ct8VdFY218zBphrbaaVyoRPkrJ

3NBynfbXC2KastUxhukcMUaE58K9cBdB9UY:  -0.01900000 Waves

2023.03.24 06:54 [2503574] smart account 3NBynfbXC2KastUxhukcMUaE58K9cBdB9UY > SELF 0.00000000 Waves

{ "type": 13, "id": "D5DNmHBBNvQX8fZnK9ct8VdFY218zBphrbaaVyoRPkrJ", "fee": 1900000, "feeAssetId": null, "timestamp": 1679630087990, "version": 2, "chainId": 84, "sender": "3NBynfbXC2KastUxhukcMUaE58K9cBdB9UY", "senderPublicKey": "J9DCtJJxJBWZdtDR12BA1U94Q3cZzMi4R6k5hYkAzmzC", "proofs": [ "2GtjYZ5CfcgjCUCPzhqYkDwFBcSYX745Mcj52NTeCvAr5sCZj7afix3EKbtFdq86bcpxKRbHxcMxEDjuSZ5MabbY" ], "script": "base64:BgKKFQgCEgQKAggIEhAKDggICAgICAgICAgICAEIEg8KDQgICAgICAgICAgIAQgSBgoECAgICBIECgIICBIICgYIAQEIAQgSBAoCCAgSBAoCCAgSBwoFCAgICAgSBgoECAgICCIOZ2V0U3RyaW5nQnlLZXkiA2tleSIIdW5pdFRlc3QiCW9yYWNsZUZlZSIIc2lnbkRhcHAiC2ZlZVJlY2VpdmVyIgh1c2VyRGFwcCINd2hpdGVsaXN0RGFwcCILc2lnbkFzc2V0SWQiC3VzZG5Bc3NldElkIgt1c2R0QXNzZXRJZCIMd2F2ZXNBc3NldElkIgVjaHJpcyIZZ2V0SW50ZWdlckJ5S2V5RnJvbU9yYWNsZSIPZ2V0SW50ZWdlckJ5S2V5Ig5jaGVja1doaXRlbGlzdCIPZ2V0Qm9vbGVhbkJ5S2V5IgdzaWduQ3V0Igt1c2RuV2F2ZUN1dCIOZGVmYXVsdExpY2VuY2UiEmRlZmF1bHRIYXNoTGljZW5jZSILZGFwcFJ1bm5pbmciDm1haW50ZW5hbmNlTVNHIg11c2VyU3VzcGVuZGVkIgt1c2VyUmVtb3ZlZCIQdXNl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AJEDAggFAmNXBnByb29mcwAACQDZBAEJAQJjbgEJAJEDAggFAmNZBGFyZ3MADAMDAwMJAAACCAUCY1kIZnVuY3Rpb24CC3NlbGxBcnR3b3JrCQAAAggFAmNZBGRBcHAFBHRoaXMHCQAAAggFAmNZA2ZlZQCgwh4HCQAAAggFAmNZCmZlZUFzc2V0SWQFBHVuaXQHCQD0AwMIBQJjVwlib2R5Qnl0ZXMJAJEDAggFAmNXBnByb29mcwAACQDZBAEJAQJjbgEJAJEDAggFAmNZBGFyZ3MABQMDAwMJAAACCAUCY1kIZnVuY3Rpb24CCWFjY2VwdEJpZAkAAAIIBQJjWQRkQXBwBQR0aGlzBwkAAAIIBQJjWQNmZWUAoMIeBwkAAAIIBQJjWQpmZWVBc3NldElkBQR1bml0BwkAyBMDCAUCY1cJYm9keUJ5dGVzCQCRAwIIBQJjVwZwcm9vZnMAAAkA2QQBCQECY24BCQCRAwIIBQJjWQRhcmdzAAQJAPQDAwgFAmNXCWJvZHlCeXRlcwkAkQMCCAUCY1cGcHJvb2ZzAAAIBQJjVw9zZW5kZXJQdWJsaWNLZXkJAPQDAwgFAmNXCWJvZHlCeXRlcwkAkQMCCAUCY1cGcHJvb2ZzAAAIBQJjVw9zZW5kZXJQdWJsaWNLZXnfJLXV", "height": 2503574, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5n6ZqEQpyvCW2hXGULkWmzXznHexDojRkCKkMqAzLkhk Next: A3MZ1wmGq3k3n2SJDLyrgY6fx3PXTrGW4Zsgwg4d2t2t Diff:
OldNewDifferences
406406
407407
408408 func buyMint (i,artId,issuer,bidId,bidOwner,pubKey) = {
409- let $t01304413114 = idCallerDateSponsored(i, pubKey)
410- let id = $t01304413114._1
411- let caller = $t01304413114._2
412- let date = $t01304413114._3
413- let isSponsored = $t01304413114._4
414- if (true)
415- then throw(toString(isSponsored))
416- else {
417- let new_caller = if (if ((toBase58String(i.caller.bytes) == toString(this)))
418- then isSponsored
419- else false)
420- then toString(addressFromPublicKey(fromBase58String(pubKey)))
421- else toBase58String(i.caller.bytes)
409+ let $t01304413117 = idCallerDateSponsored(i, pubKey)
410+ if (($t01304413117 == $t01304413117))
411+ then {
412+ let isSponsored = $t01304413117._4
413+ let date = $t01304413117._3
414+ let caller = $t01304413117._2
415+ let id = $t01304413117._1
422416 if (true)
423- then throw(((((((new_caller + " / ") + issuer) + " / ") + bidOwner) + " / ") + pubKey))
417+ then throw(toString(isSponsored))
424418 else {
425- let isBid = if (if (if ((caller == issuer))
426- then (bidOwner != "")
419+ let new_caller = if (if ((toBase58String(i.caller.bytes) == toString(this)))
420+ then isSponsored
427421 else false)
428- then (bidId != "")
429- else false)
430- then true
431- else false
432- let blockEnd = getIntegerByKey(keyEndSale(caller, artId))
433- if (if (if ((blockEnd != 0))
434- then (height >= blockEnd)
435- else false)
436- then !(isBid)
437- else false)
438- then throw("Sale ended.")
422+ then toString(addressFromPublicKey(fromBase58String(pubKey)))
423+ else toBase58String(i.caller.bytes)
424+ if (true)
425+ then throw(((((((new_caller + " / ") + issuer) + " / ") + bidOwner) + " / ") + pubKey))
439426 else {
440- let callerIsIssuer = (caller == issuer)
441- let totalNFT = getIntegerByKey("total_nft_issued")
442- let signID = getStringByKey(keySignID(issuer, artId))
443- let artworkName = getStringByKey(keyName(issuer, artId))
444- if ((artworkName == ""))
445- then throw("Art doesn't exist")
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.")
446441 else {
447- let isOnSale = getBooleanByKey(keyOnSale(issuer, artId))
448- let amountSold = getIntegerByKey(keyIssued(issuer, artId))
449- let artworkPrice = if (callerIsIssuer)
450- then (currentCertificationPrice * 2)
451- else getIntegerByKey(keyPrice(issuer, artId))
452- let priceAssetId = if (callerIsIssuer)
453- then toBase58String(signAssetId)
454- else getStringByKey(keyAssetIdAccepted(issuer, artId))
455- let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId))
456- if (if (if (!(isBid))
457- then !(callerIsIssuer)
458- else false)
459- then if (if ((0 >= artworkPrice))
460- then true
461- else !(isOnSale))
462- then true
463- else (0 >= maxCanSell)
464- else false)
465- then throw("Art not for sale")
466- else if (if (if (!(isBid))
467- then callerIsIssuer
468- else false)
469- then (0 >= maxCanSell)
470- else false)
471- then throw("Max issuable not set")
472- else {
473- let checkUser = validateUser(issuer)
474- if (if (isBid)
475- then (checkUser != "")
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
476470 else false)
477- then throw(checkUser)
471+ then (0 >= maxCanSell)
472+ else false)
473+ then throw("Max issuable not set")
478474 else {
479- let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId)
480- let $t01498615178 = if (isBid)
481- then getPriceAssetIdFromBid(bidDataKey)
482- else validatePriceAssetId(i, priceAssetId, artworkPrice)
483- let amount = $t01498615178._1
484- let assetId = $t01498615178._2
485- let agent = valueOrElse(getString(userDapp, keyArtistAgentAddr(issuer)), feeReceiver)
486- let agentShare = valueOrElse(getInteger(userDapp, keyPrimaryShareAgent(issuer)), 0)
487- let publicAgent = valueOrElse(getString(userDapp, keyArtistPublicAgentAddr(issuer)), feeReceiver)
488- let publicAgentShare = valueOrElse(getInteger(userDapp, keyPrimarySharePublicAgent(issuer)), 0)
489- let isWhitelisted = checkWhitelist(issuer)
490- let cut = if ((isWhitelisted > height))
491- then 0
492- else if ((assetId == signAssetId))
493- then signCut
494- else usdnWaveCut
495- let amountForSign = fraction(amount, cut, 100)
496- let amountForAgent = if (if (if ((agent != feeReceiver))
497- then (agentShare > 0)
475+ let checkUser = validateUser(issuer)
476+ if (if (isBid)
477+ then (checkUser != "")
498478 else false)
499- then (height > isWhitelisted)
500- else false)
501- then fraction(amount, agentShare, 10000)
502- else 0
503- let amountForPublicAgent = if (if (if ((publicAgent != feeReceiver))
504- then (publicAgentShare > 0)
505- else false)
506- then (height > isWhitelisted)
507- else false)
508- then fraction(amount, publicAgentShare, 10000)
509- else 0
510- let amountForCreator = (amount - amountForSign)
511- if ((amountSold == maxCanSell))
512- then throw("Art sold out")
479+ then throw(checkUser)
513480 else {
514- let newAmountSold = (amountSold + 1)
515- let issueMeta = ((((((((((("Creator: " + issuer) + ",
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) + ",
516518 ArtID: ") + artId) + ",
517519 SignID: ") + signID) + ",
518520 Artwork name: ") + artworkName) + ",
519521 Issue: ") + toString(newAmountSold)) + "/") + toString(maxCanSell))
520- let issueNFT = Issue(("SA_" + toString((totalNFT + 1))), issueMeta, 1, 0, false)
521- let idNFT = calculateAssetId(issueNFT)
522- let sellStatus = if (if ((newAmountSold == maxCanSell))
523- then true
524- else !(isOnSale))
525- then false
526- else true
527- let receiveNFT = if (if (if ((caller == issuer))
528- then (bidOwner != "")
529- else false)
530- then (bidId != "")
531- else false)
532- then addressFromStringValue(bidOwner)
533- else i.caller
534- let assetIdBid = if (!(isDefined(assetId)))
535- then "WAVES"
536- else toBase58String(value(assetId))
537- let bidData = getStringByKey((bidDataKey + "_OPEN"))
538- let bidDelOld = DeleteEntry((bidDataKey + "_OPEN"))
539- let bidUpdate = StringEntry((bidDataKey + "_CLOSED"), ((bidData + "_") + toString(date)))
540- let soldKey = ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer)
541- let soldValue = if (!(isBid))
542- then ((((((((((caller + "_") + toString(date)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + toBase58String(idNFT))
543- else ((((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + assetIdBid) + "_") + toBase58String(idNFT))
544- let soldData = StringEntry(soldKey, soldValue)
545- let commissionsWithAgent = if ((amountForAgent != 0))
546- then [ScriptTransfer(Address(fromBase58String(feeReceiver)), (amountForSign - amountForAgent), assetId), ScriptTransfer(Address(fromBase58String(agent)), amountForAgent, assetId)]
547- else [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)]
548- let commissionsWithPublicAgent = if ((amountForPublicAgent != 0))
549- then [ScriptTransfer(Address(fromBase58String(publicAgent)), amountForPublicAgent, assetId), ScriptTransfer(Address(fromBase58String(issuer)), (amountForCreator - amountForPublicAgent), assetId)]
550- else [ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId)]
551- let txToCaller = if (isSponsored)
552- then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
553- else nil
554- 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)
555- if (isBid)
556- then [soldData, bidUpdate, bidDelOld] :: buyRes
557- else soldData :: buyRes
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)
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+ }
558561 }
559562 }
560- }
563+ }
561564 }
562565 }
563566 }
564567 }
568+ else throw("Strict value is not equal to itself.")
565569 }
566570
567571
587591
588592 @Callable(i)
589593 func addArtwork (sha256Hash,signID,name,description,tags,type,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence,crawler,royalties,pubKey) = {
590- let $t02035420427 = idCallerDateSponsored(i, pubKey)
591- let artId = $t02035420427._1
592- let caller = $t02035420427._2
593- let date = $t02035420427._3
594- let isSponsored = $t02035420427._4
594+ let $t02035720430 = idCallerDateSponsored(i, pubKey)
595+ let artId = $t02035720430._1
596+ let caller = $t02035720430._2
597+ let date = $t02035720430._3
598+ let isSponsored = $t02035720430._4
595599 if (!(validateHash(sha256Hash)))
596600 then throw("Hash should be 64 characters maximum")
597601 else {
598- let $t02052820597 = setLIcence(cidLicence, sha256Licence)
599- let licenceCID = $t02052820597._1
600- let licenceHash = $t02052820597._2
602+ let $t02053120600 = setLIcence(cidLicence, sha256Licence)
603+ let licenceCID = $t02053120600._1
604+ let licenceHash = $t02053120600._2
601605 let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, royalties)
602606 if ((validateArtwork != ""))
603607 then throw("Something went wrong!")
604608 else {
605609 let whitelisted_drop = (checkWhitelist((caller + "_free_drops")) > 0)
606- let $t02089620980 = if (whitelisted_drop)
610+ let $t02089920983 = if (whitelisted_drop)
607611 then $Tuple2(0, signID)
608612 else validatePayment(i)
609- let amount = $t02089620980._1
610- let assetId = $t02089620980._2
613+ let amount = $t02089920983._1
614+ let assetId = $t02089920983._2
611615 if (!(isDefined(amount)))
612616 then throw("Something went wrong")
613617 else {
648652 func updateArtwork (txid,name,description,tags,type,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence,crawler,royalties,pubKey) = if (!(dappRunning))
649653 then throw(maintenanceMSG)
650654 else {
651- let $t02401424084 = idCallerDateSponsored(i, pubKey)
652- let id = $t02401424084._1
653- let caller = $t02401424084._2
654- let date = $t02401424084._3
655- let isSponsored = $t02401424084._4
656- let $t02409424163 = setLIcence(cidLicence, sha256Licence)
657- let licenceCID = $t02409424163._1
658- let licenceHash = $t02409424163._2
655+ let $t02401724087 = idCallerDateSponsored(i, pubKey)
656+ let id = $t02401724087._1
657+ let caller = $t02401724087._2
658+ let date = $t02401724087._3
659+ let isSponsored = $t02401724087._4
660+ let $t02409724166 = setLIcence(cidLicence, sha256Licence)
661+ let licenceCID = $t02409724166._1
662+ let licenceHash = $t02409724166._2
659663 let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, royalties)
660664 if ((validateArtwork != ""))
661665 then throw("Something went wrong!")
683687
684688 @Callable(i)
685689 func flagArtwork (artId,addr,flag,note) = {
686- let $t02579025824 = idCallerDate(i)
687- let id = $t02579025824._1
688- let caller = $t02579025824._2
690+ let $t02579325827 = idCallerDate(i)
691+ let id = $t02579325827._1
692+ let caller = $t02579325827._2
689693 if (containsElement([chris, toString(this)], caller))
690694 then if (containsElement(["CONSENT", "", "CHANGE_REQUIRED", "FLAGGED", "ILLEGAL"], flag))
691695 then [StringEntry(keyFlag(addr, artId), flag), StringEntry(keyNote(addr, artId), note)]
697701
698702 @Callable(i)
699703 func deleteArtwork (artId,addr) = {
700- let $t02626026294 = idCallerDate(i)
701- let id = $t02626026294._1
702- let caller = $t02626026294._2
704+ let $t02626326297 = idCallerDate(i)
705+ let id = $t02626326297._1
706+ let caller = $t02626326297._2
703707 let addrToUse = if (containsElement([chris, toString(this)], caller))
704708 then addr
705709 else caller
732736
733737 @Callable(i)
734738 func sellArtwork (artId,price,maxMint,assetId,blockEnd,pubKey) = {
735- let $t02913029200 = idCallerDateSponsored(i, pubKey)
736- let id = $t02913029200._1
737- let caller = $t02913029200._2
738- let date = $t02913029200._3
739- let isSponsored = $t02913029200._4
739+ let $t02913329203 = idCallerDateSponsored(i, pubKey)
740+ let id = $t02913329203._1
741+ let caller = $t02913329203._2
742+ let date = $t02913329203._3
743+ let isSponsored = $t02913329203._4
740744 let artworkName = getStringByKey(keyName(caller, artId))
741745 if ((artworkName == ""))
742746 then throw("This art doesn't match your account")
810814
811815 @Callable(i)
812816 func setBid (artId,issuer) = {
813- let $t03158231622 = idCallerDate(i)
814- let id = $t03158231622._1
815- let caller = $t03158231622._2
816- let date = $t03158231622._3
817- let $t03162731663 = isPayment(i)
818- let payment = $t03162731663._1
819- let amount = $t03162731663._2
817+ let $t03158531625 = idCallerDate(i)
818+ let id = $t03158531625._1
819+ let caller = $t03158531625._2
820+ let date = $t03158531625._3
821+ let $t03163031666 = isPayment(i)
822+ let payment = $t03163031666._1
823+ let amount = $t03163031666._2
820824 let assetId = if (!(isDefined(payment.assetId)))
821825 then "WAVES"
822826 else toBase58String(value(payment.assetId))
847851
848852 @Callable(i)
849853 func acceptBid (artId,issuer,bidId,bidOwner,pubKey) = {
850- let $t03288332954 = idCallerDateSponsored(i, pubKey)
851- let id = $t03288332954._1
852- let caller1 = $t03288332954._2
853- let date = $t03288332954._3
854- let isSponsored = $t03288332954._4
854+ let $t03288632957 = idCallerDateSponsored(i, pubKey)
855+ let id = $t03288632957._1
856+ let caller1 = $t03288632957._2
857+ let date = $t03288632957._3
858+ let isSponsored = $t03288632957._4
855859 if ((caller1 != issuer))
856860 then throw("You cannot do this action")
857861 else buyMint(i, artId, issuer, bidId, bidOwner, pubKey)
861865
862866 @Callable(i)
863867 func cancelBid (artId,issuer,bidId,bidOwner) = {
864- let $t03318933250 = idCallerDate(i)
865- let id = $t03318933250._1
866- let caller = $t03318933250._2
867- let date = $t03318933250._3
868+ let $t03319233253 = idCallerDate(i)
869+ let id = $t03319233253._1
870+ let caller = $t03319233253._2
871+ let date = $t03319233253._3
868872 if (if ((caller != bidOwner))
869873 then (caller != issuer)
870874 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 if ((isSponsored == isSponsored))
384384 then {
385385 let caller = if (if ((toBase58String(i.caller.bytes) == toString(this)))
386386 then (isSponsored > 0)
387387 else false)
388388 then toString(addressFromPublicKey(fromBase58String(pubKey)))
389389 else toBase58String(i.caller.bytes)
390390 let get_sponsored_waves = if (if ((pubKey != ""))
391391 then (isSponsored > 0)
392392 else false)
393393 then invoke(whitelistDapp, "useFreeTx", [toString(addressFromPublicKey(fromBase58String(pubKey)))], nil)
394394 else unit
395395 if ((get_sponsored_waves == get_sponsored_waves))
396396 then $Tuple4(toBase58String(i.transactionId), caller, lastBlock.timestamp, (isSponsored > 0))
397397 else throw("Strict value is not equal to itself.")
398398 }
399399 else throw("Strict value is not equal to itself.")
400400 }
401401
402402
403403 func idCallerDate (i) = if (!(dappRunning))
404404 then throw(maintenanceMSG)
405405 else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp)
406406
407407
408408 func buyMint (i,artId,issuer,bidId,bidOwner,pubKey) = {
409- let $t01304413114 = idCallerDateSponsored(i, pubKey)
410- let id = $t01304413114._1
411- let caller = $t01304413114._2
412- let date = $t01304413114._3
413- let isSponsored = $t01304413114._4
414- if (true)
415- then throw(toString(isSponsored))
416- else {
417- let new_caller = if (if ((toBase58String(i.caller.bytes) == toString(this)))
418- then isSponsored
419- else false)
420- then toString(addressFromPublicKey(fromBase58String(pubKey)))
421- else toBase58String(i.caller.bytes)
409+ let $t01304413117 = idCallerDateSponsored(i, pubKey)
410+ if (($t01304413117 == $t01304413117))
411+ then {
412+ let isSponsored = $t01304413117._4
413+ let date = $t01304413117._3
414+ let caller = $t01304413117._2
415+ let id = $t01304413117._1
422416 if (true)
423- then throw(((((((new_caller + " / ") + issuer) + " / ") + bidOwner) + " / ") + pubKey))
417+ then throw(toString(isSponsored))
424418 else {
425- let isBid = if (if (if ((caller == issuer))
426- then (bidOwner != "")
419+ let new_caller = if (if ((toBase58String(i.caller.bytes) == toString(this)))
420+ then isSponsored
427421 else false)
428- then (bidId != "")
429- else false)
430- then true
431- else false
432- let blockEnd = getIntegerByKey(keyEndSale(caller, artId))
433- if (if (if ((blockEnd != 0))
434- then (height >= blockEnd)
435- else false)
436- then !(isBid)
437- else false)
438- then throw("Sale ended.")
422+ then toString(addressFromPublicKey(fromBase58String(pubKey)))
423+ else toBase58String(i.caller.bytes)
424+ if (true)
425+ then throw(((((((new_caller + " / ") + issuer) + " / ") + bidOwner) + " / ") + pubKey))
439426 else {
440- let callerIsIssuer = (caller == issuer)
441- let totalNFT = getIntegerByKey("total_nft_issued")
442- let signID = getStringByKey(keySignID(issuer, artId))
443- let artworkName = getStringByKey(keyName(issuer, artId))
444- if ((artworkName == ""))
445- then throw("Art doesn't exist")
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.")
446441 else {
447- let isOnSale = getBooleanByKey(keyOnSale(issuer, artId))
448- let amountSold = getIntegerByKey(keyIssued(issuer, artId))
449- let artworkPrice = if (callerIsIssuer)
450- then (currentCertificationPrice * 2)
451- else getIntegerByKey(keyPrice(issuer, artId))
452- let priceAssetId = if (callerIsIssuer)
453- then toBase58String(signAssetId)
454- else getStringByKey(keyAssetIdAccepted(issuer, artId))
455- let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId))
456- if (if (if (!(isBid))
457- then !(callerIsIssuer)
458- else false)
459- then if (if ((0 >= artworkPrice))
460- then true
461- else !(isOnSale))
462- then true
463- else (0 >= maxCanSell)
464- else false)
465- then throw("Art not for sale")
466- else if (if (if (!(isBid))
467- then callerIsIssuer
468- else false)
469- then (0 >= maxCanSell)
470- else false)
471- then throw("Max issuable not set")
472- else {
473- let checkUser = validateUser(issuer)
474- if (if (isBid)
475- then (checkUser != "")
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
476470 else false)
477- then throw(checkUser)
471+ then (0 >= maxCanSell)
472+ else false)
473+ then throw("Max issuable not set")
478474 else {
479- let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId)
480- let $t01498615178 = if (isBid)
481- then getPriceAssetIdFromBid(bidDataKey)
482- else validatePriceAssetId(i, priceAssetId, artworkPrice)
483- let amount = $t01498615178._1
484- let assetId = $t01498615178._2
485- let agent = valueOrElse(getString(userDapp, keyArtistAgentAddr(issuer)), feeReceiver)
486- let agentShare = valueOrElse(getInteger(userDapp, keyPrimaryShareAgent(issuer)), 0)
487- let publicAgent = valueOrElse(getString(userDapp, keyArtistPublicAgentAddr(issuer)), feeReceiver)
488- let publicAgentShare = valueOrElse(getInteger(userDapp, keyPrimarySharePublicAgent(issuer)), 0)
489- let isWhitelisted = checkWhitelist(issuer)
490- let cut = if ((isWhitelisted > height))
491- then 0
492- else if ((assetId == signAssetId))
493- then signCut
494- else usdnWaveCut
495- let amountForSign = fraction(amount, cut, 100)
496- let amountForAgent = if (if (if ((agent != feeReceiver))
497- then (agentShare > 0)
475+ let checkUser = validateUser(issuer)
476+ if (if (isBid)
477+ then (checkUser != "")
498478 else false)
499- then (height > isWhitelisted)
500- else false)
501- then fraction(amount, agentShare, 10000)
502- else 0
503- let amountForPublicAgent = if (if (if ((publicAgent != feeReceiver))
504- then (publicAgentShare > 0)
505- else false)
506- then (height > isWhitelisted)
507- else false)
508- then fraction(amount, publicAgentShare, 10000)
509- else 0
510- let amountForCreator = (amount - amountForSign)
511- if ((amountSold == maxCanSell))
512- then throw("Art sold out")
479+ then throw(checkUser)
513480 else {
514- let newAmountSold = (amountSold + 1)
515- let issueMeta = ((((((((((("Creator: " + issuer) + ",
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) + ",
516518 ArtID: ") + artId) + ",
517519 SignID: ") + signID) + ",
518520 Artwork name: ") + artworkName) + ",
519521 Issue: ") + toString(newAmountSold)) + "/") + toString(maxCanSell))
520- let issueNFT = Issue(("SA_" + toString((totalNFT + 1))), issueMeta, 1, 0, false)
521- let idNFT = calculateAssetId(issueNFT)
522- let sellStatus = if (if ((newAmountSold == maxCanSell))
523- then true
524- else !(isOnSale))
525- then false
526- else true
527- let receiveNFT = if (if (if ((caller == issuer))
528- then (bidOwner != "")
529- else false)
530- then (bidId != "")
531- else false)
532- then addressFromStringValue(bidOwner)
533- else i.caller
534- let assetIdBid = if (!(isDefined(assetId)))
535- then "WAVES"
536- else toBase58String(value(assetId))
537- let bidData = getStringByKey((bidDataKey + "_OPEN"))
538- let bidDelOld = DeleteEntry((bidDataKey + "_OPEN"))
539- let bidUpdate = StringEntry((bidDataKey + "_CLOSED"), ((bidData + "_") + toString(date)))
540- let soldKey = ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer)
541- let soldValue = if (!(isBid))
542- then ((((((((((caller + "_") + toString(date)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + toBase58String(idNFT))
543- else ((((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + assetIdBid) + "_") + toBase58String(idNFT))
544- let soldData = StringEntry(soldKey, soldValue)
545- let commissionsWithAgent = if ((amountForAgent != 0))
546- then [ScriptTransfer(Address(fromBase58String(feeReceiver)), (amountForSign - amountForAgent), assetId), ScriptTransfer(Address(fromBase58String(agent)), amountForAgent, assetId)]
547- else [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)]
548- let commissionsWithPublicAgent = if ((amountForPublicAgent != 0))
549- then [ScriptTransfer(Address(fromBase58String(publicAgent)), amountForPublicAgent, assetId), ScriptTransfer(Address(fromBase58String(issuer)), (amountForCreator - amountForPublicAgent), assetId)]
550- else [ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId)]
551- let txToCaller = if (isSponsored)
552- then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
553- else nil
554- 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)
555- if (isBid)
556- then [soldData, bidUpdate, bidDelOld] :: buyRes
557- else soldData :: buyRes
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)
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+ }
558561 }
559562 }
560- }
563+ }
561564 }
562565 }
563566 }
564567 }
568+ else throw("Strict value is not equal to itself.")
565569 }
566570
567571
568572 func asString (bv) = match bv {
569573 case bv0: String =>
570574 bv0
571575 case _ =>
572576 throw("Sponsored Public Key String expected")
573577 }
574578
575579
576580 @Callable(invoke)
577581 func setConf (key,val) = {
578582 let caller = toString(invoke.caller)
579583 if (containsElement([chris, toString(this)], caller))
580584 then if (contains(key, "conf_"))
581585 then [StringEntry(key, val)]
582586 else throw("Entries starting with conf_ only")
583587 else throw("You are not allowed to change this")
584588 }
585589
586590
587591
588592 @Callable(i)
589593 func addArtwork (sha256Hash,signID,name,description,tags,type,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence,crawler,royalties,pubKey) = {
590- let $t02035420427 = idCallerDateSponsored(i, pubKey)
591- let artId = $t02035420427._1
592- let caller = $t02035420427._2
593- let date = $t02035420427._3
594- let isSponsored = $t02035420427._4
594+ let $t02035720430 = idCallerDateSponsored(i, pubKey)
595+ let artId = $t02035720430._1
596+ let caller = $t02035720430._2
597+ let date = $t02035720430._3
598+ let isSponsored = $t02035720430._4
595599 if (!(validateHash(sha256Hash)))
596600 then throw("Hash should be 64 characters maximum")
597601 else {
598- let $t02052820597 = setLIcence(cidLicence, sha256Licence)
599- let licenceCID = $t02052820597._1
600- let licenceHash = $t02052820597._2
602+ let $t02053120600 = setLIcence(cidLicence, sha256Licence)
603+ let licenceCID = $t02053120600._1
604+ let licenceHash = $t02053120600._2
601605 let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, royalties)
602606 if ((validateArtwork != ""))
603607 then throw("Something went wrong!")
604608 else {
605609 let whitelisted_drop = (checkWhitelist((caller + "_free_drops")) > 0)
606- let $t02089620980 = if (whitelisted_drop)
610+ let $t02089920983 = if (whitelisted_drop)
607611 then $Tuple2(0, signID)
608612 else validatePayment(i)
609- let amount = $t02089620980._1
610- let assetId = $t02089620980._2
613+ let amount = $t02089920983._1
614+ let assetId = $t02089920983._2
611615 if (!(isDefined(amount)))
612616 then throw("Something went wrong")
613617 else {
614618 let entryExist = getStringByKey(keyTxidByHashOwner(sha256Hash, caller))
615619 if ((entryExist != ""))
616620 then throw("You already added it")
617621 else {
618622 let hashExist = getStringByKey(keyOwnerByHash(sha256Hash))
619623 if ((hashExist != ""))
620624 then throw("Hash already registered")
621625 else {
622626 let isSignCertified = checkSignCertificate(signID, caller, sha256Hash)
623627 if (!(isSignCertified))
624628 then throw("Sign Certificate not found for this address.")
625629 else {
626630 let decrease_whitelist_drop = if (whitelisted_drop)
627631 then invoke(whitelistDapp, "useFreeDrop", [caller], nil)
628632 else unit
629633 if ((decrease_whitelist_drop == decrease_whitelist_drop))
630634 then {
631635 let txToCaller = if (isSponsored)
632636 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
633637 else nil
634638 ([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)
635639 }
636640 else throw("Strict value is not equal to itself.")
637641 }
638642 }
639643 }
640644 }
641645 }
642646 }
643647 }
644648
645649
646650
647651 @Callable(i)
648652 func updateArtwork (txid,name,description,tags,type,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence,crawler,royalties,pubKey) = if (!(dappRunning))
649653 then throw(maintenanceMSG)
650654 else {
651- let $t02401424084 = idCallerDateSponsored(i, pubKey)
652- let id = $t02401424084._1
653- let caller = $t02401424084._2
654- let date = $t02401424084._3
655- let isSponsored = $t02401424084._4
656- let $t02409424163 = setLIcence(cidLicence, sha256Licence)
657- let licenceCID = $t02409424163._1
658- let licenceHash = $t02409424163._2
655+ let $t02401724087 = idCallerDateSponsored(i, pubKey)
656+ let id = $t02401724087._1
657+ let caller = $t02401724087._2
658+ let date = $t02401724087._3
659+ let isSponsored = $t02401724087._4
660+ let $t02409724166 = setLIcence(cidLicence, sha256Licence)
661+ let licenceCID = $t02409724166._1
662+ let licenceHash = $t02409724166._2
659663 let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, royalties)
660664 if ((validateArtwork != ""))
661665 then throw("Something went wrong!")
662666 else {
663667 let entryExist = getStringByKey(keyName(caller, txid))
664668 if ((entryExist == ""))
665669 then throw("Entry not found")
666670 else {
667671 let flag = getStringByKey(keyFlag(caller, txid))
668672 if ((flag == "ILLEGAL"))
669673 then throw("Cannot update ILLEGAL artwork")
670674 else if (!(isArtMinted(caller, txid)))
671675 then {
672676 let txToCaller = if (isSponsored)
673677 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
674678 else nil
675679 ([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)
676680 }
677681 else throw("Already minted")
678682 }
679683 }
680684 }
681685
682686
683687
684688 @Callable(i)
685689 func flagArtwork (artId,addr,flag,note) = {
686- let $t02579025824 = idCallerDate(i)
687- let id = $t02579025824._1
688- let caller = $t02579025824._2
690+ let $t02579325827 = idCallerDate(i)
691+ let id = $t02579325827._1
692+ let caller = $t02579325827._2
689693 if (containsElement([chris, toString(this)], caller))
690694 then if (containsElement(["CONSENT", "", "CHANGE_REQUIRED", "FLAGGED", "ILLEGAL"], flag))
691695 then [StringEntry(keyFlag(addr, artId), flag), StringEntry(keyNote(addr, artId), note)]
692696 else throw(("Unknow status " + flag))
693697 else throw("You are not allowed")
694698 }
695699
696700
697701
698702 @Callable(i)
699703 func deleteArtwork (artId,addr) = {
700- let $t02626026294 = idCallerDate(i)
701- let id = $t02626026294._1
702- let caller = $t02626026294._2
704+ let $t02626326297 = idCallerDate(i)
705+ let id = $t02626326297._1
706+ let caller = $t02626326297._2
703707 let addrToUse = if (containsElement([chris, toString(this)], caller))
704708 then addr
705709 else caller
706710 let entryExist = valueOrErrorMessage(getStringByKey(keyName(addrToUse, artId)), "No art matching for this address")
707711 if ((entryExist == ""))
708712 then throw("No art matching for this address")
709713 else {
710714 let sha256Hash = getStringByKey(keyHashByTxidAddr(addrToUse, artId))
711715 if ((sha256Hash == ""))
712716 then throw("No art hash matching for this address")
713717 else {
714718 let signID = getStringByKey(keySignID(addrToUse, artId))
715719 if ((signID == ""))
716720 then throw("No SIGN ID matching")
717721 else {
718722 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))]
719723 if (!(isArtMinted(addrToUse, artId)))
720724 then if (!(dappRunning))
721725 then throw(maintenanceMSG)
722726 else dataToDelete
723727 else if (containsElement([chris, toString(this)], caller))
724728 then dataToDelete
725729 else throw("Art already minted, you cannot delete it")
726730 }
727731 }
728732 }
729733 }
730734
731735
732736
733737 @Callable(i)
734738 func sellArtwork (artId,price,maxMint,assetId,blockEnd,pubKey) = {
735- let $t02913029200 = idCallerDateSponsored(i, pubKey)
736- let id = $t02913029200._1
737- let caller = $t02913029200._2
738- let date = $t02913029200._3
739- let isSponsored = $t02913029200._4
739+ let $t02913329203 = idCallerDateSponsored(i, pubKey)
740+ let id = $t02913329203._1
741+ let caller = $t02913329203._2
742+ let date = $t02913329203._3
743+ let isSponsored = $t02913329203._4
740744 let artworkName = getStringByKey(keyName(caller, artId))
741745 if ((artworkName == ""))
742746 then throw("This art doesn't match your account")
743747 else {
744748 let flag = getStringByKey(keyFlag(caller, artId))
745749 if (containsElement(["CHANGE_REQUIRED", "FLAGGED", "ILLEGAL"], flag))
746750 then throw("Flagged artwork")
747751 else {
748752 let bidNbr = getIntegerByKey(("current_bidamount_" + artId))
749753 if ((0 > blockEnd))
750754 then throw("Negative end")
751755 else if (if ((blockEnd > 0))
752756 then if ((maxMint != 1))
753757 then true
754758 else (price != 0)
755759 else false)
756760 then throw("Timed offer only allowed for unique edition and offer only")
757761 else {
758762 let baseHeight = if ((blockEnd == 0))
759763 then 0
760764 else height
761765 if (!(acceptedAssetIds(assetId)))
762766 then throw("Something went wrong!")
763767 else if (!(validateMinSell(assetId, price)))
764768 then throw("Something went wrong!")
765769 else {
766770 let checkUser = validateUser(caller)
767771 if ((checkUser != ""))
768772 then throw(checkUser)
769773 else {
770774 let amountSold = getIntegerByKey(keyIssued(caller, artId))
771775 let maxCanSell = getIntegerByKey(keyMaxMint(caller, artId))
772776 if ((maxMint > 100))
773777 then throw("100 editions max per artwork")
774778 else if (if ((amountSold != 0))
775779 then (amountSold == maxCanSell)
776780 else false)
777781 then throw("Max edition reached.")
778782 else if (if ((amountSold > 0))
779783 then (maxCanSell != maxMint)
780784 else false)
781785 then throw("Cannot change maximum issuable anymore")
782786 else if (if ((bidNbr > 0))
783787 then (maxCanSell != maxMint)
784788 else false)
785789 then throw("Cannot change maximum issuable with active orders")
786790 else {
787791 let sellStatus = if (if ((price > 0))
788792 then (maxMint > 0)
789793 else false)
790794 then true
791795 else false
792796 let txToCaller = if (isSponsored)
793797 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
794798 else nil
795799 ([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)
796800 }
797801 }
798802 }
799803 }
800804 }
801805 }
802806 }
803807
804808
805809
806810 @Callable(i)
807811 func buyArtwork (artId,issuer) = buyMint(i, artId, issuer, "", "", "")
808812
809813
810814
811815 @Callable(i)
812816 func setBid (artId,issuer) = {
813- let $t03158231622 = idCallerDate(i)
814- let id = $t03158231622._1
815- let caller = $t03158231622._2
816- let date = $t03158231622._3
817- let $t03162731663 = isPayment(i)
818- let payment = $t03162731663._1
819- let amount = $t03162731663._2
817+ let $t03158531625 = idCallerDate(i)
818+ let id = $t03158531625._1
819+ let caller = $t03158531625._2
820+ let date = $t03158531625._3
821+ let $t03163031666 = isPayment(i)
822+ let payment = $t03163031666._1
823+ let amount = $t03163031666._2
820824 let assetId = if (!(isDefined(payment.assetId)))
821825 then "WAVES"
822826 else toBase58String(value(payment.assetId))
823827 let blockEnd = getIntegerByKey(keyEndSale(issuer, artId))
824828 if (if ((blockEnd != 0))
825829 then (height >= blockEnd)
826830 else false)
827831 then throw("Sale ended.")
828832 else {
829833 let bidNbr = getIntegerByKey(("current_bidamount_" + artId))
830834 if (!(acceptedAssetIds(assetId)))
831835 then throw("asset not accepted")
832836 else if (!(validateMinSell(assetId, amount)))
833837 then throw("Wrong min sell")
834838 else {
835839 let amountSold = getIntegerByKey(keyIssued(issuer, artId))
836840 let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId))
837841 if ((0 >= maxCanSell))
838842 then throw("No max edition set for this artwork")
839843 else if ((amountSold >= maxCanSell))
840844 then throw("Sold out, you cannot bid")
841845 else [StringEntry((((((((("bid_" + artId) + "_") + issuer) + "_") + caller) + "_") + id) + "_OPEN"), ((((assetId + "_") + toString(amount)) + "_") + toString(date))), IntegerEntry(("current_bidamount_" + artId), (bidNbr + 1))]
842846 }
843847 }
844848 }
845849
846850
847851
848852 @Callable(i)
849853 func acceptBid (artId,issuer,bidId,bidOwner,pubKey) = {
850- let $t03288332954 = idCallerDateSponsored(i, pubKey)
851- let id = $t03288332954._1
852- let caller1 = $t03288332954._2
853- let date = $t03288332954._3
854- let isSponsored = $t03288332954._4
854+ let $t03288632957 = idCallerDateSponsored(i, pubKey)
855+ let id = $t03288632957._1
856+ let caller1 = $t03288632957._2
857+ let date = $t03288632957._3
858+ let isSponsored = $t03288632957._4
855859 if ((caller1 != issuer))
856860 then throw("You cannot do this action")
857861 else buyMint(i, artId, issuer, bidId, bidOwner, pubKey)
858862 }
859863
860864
861865
862866 @Callable(i)
863867 func cancelBid (artId,issuer,bidId,bidOwner) = {
864- let $t03318933250 = idCallerDate(i)
865- let id = $t03318933250._1
866- let caller = $t03318933250._2
867- let date = $t03318933250._3
868+ let $t03319233253 = idCallerDate(i)
869+ let id = $t03319233253._1
870+ let caller = $t03319233253._2
871+ let date = $t03319233253._3
868872 if (if ((caller != bidOwner))
869873 then (caller != issuer)
870874 else false)
871875 then throw("You cannot do this action")
872876 else {
873877 let returnMoneyTo = if ((caller == issuer))
874878 then bidOwner
875879 else caller
876880 let bidNbr = getIntegerByKey(("current_bidamount_" + artId))
877881 let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId)
878882 let bidData = getStringByKey((bidDataKey + "_OPEN"))
879883 if ((bidData == ""))
880884 then throw("Bid not found")
881885 else {
882886 let bidDataArr = split(bidData, "_")
883887 let assetId = getBidAssetId(bidDataArr[0])
884888 let bidStatus = "CANCELED"
885889 [DeleteEntry((bidDataKey + "_OPEN")), StringEntry(((bidDataKey + "_") + bidStatus), ((bidData + "_") + toString(date))), IntegerEntry(("current_bidamount_" + artId), (bidNbr - 1)), ScriptTransfer(Address(fromBase58String(returnMoneyTo)), parseIntValue(bidDataArr[1]), assetId)]
886890 }
887891 }
888892 }
889893
890894
891895 @Verifier(tx)
892896 func verifier () = match tx {
893897 case inv: InvokeScriptTransaction =>
894898 if (if (if (if ((inv.function == "addArtwork"))
895899 then (inv.dApp == this)
896900 else false)
897901 then (inv.fee == 500000)
898902 else false)
899903 then (inv.feeAssetId == unit)
900904 else false)
901905 then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[13])))
902906 else if (if (if (if ((inv.function == "updateArtwork"))
903907 then (inv.dApp == this)
904908 else false)
905909 then (inv.fee == 500000)
906910 else false)
907911 then (inv.feeAssetId == unit)
908912 else false)
909913 then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[12])))
910914 else if (if (if (if ((inv.function == "sellArtwork"))
911915 then (inv.dApp == this)
912916 else false)
913917 then (inv.fee == 500000)
914918 else false)
915919 then (inv.feeAssetId == unit)
916920 else false)
917921 then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[5])))
918922 else if (if (if (if ((inv.function == "acceptBid"))
919923 then (inv.dApp == this)
920924 else false)
921925 then (inv.fee == 500000)
922926 else false)
923927 then (inv.feeAssetId == unit)
924928 else false)
925929 then sigVerify_128Kb(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[4])))
926930 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
927931 case _ =>
928932 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
929933 }
930934

github/deemru/w8io/169f3d6 
113.52 ms