tx · FkuTsD32pNZdaBBLGokWqL4FPdosVqonf1uzEfJsNME9

3NBynfbXC2KastUxhukcMUaE58K9cBdB9UY:  -0.01900000 Waves

2023.03.24 07:17 [2503596] smart account 3NBynfbXC2KastUxhukcMUaE58K9cBdB9UY > SELF 0.00000000 Waves

{ "type": 13, "id": "FkuTsD32pNZdaBBLGokWqL4FPdosVqonf1uzEfJsNME9", "fee": 1900000, "feeAssetId": null, "timestamp": 1679631507062, "version": 2, "chainId": 84, "sender": "3NBynfbXC2KastUxhukcMUaE58K9cBdB9UY", "senderPublicKey": "J9DCtJJxJBWZdtDR12BA1U94Q3cZzMi4R6k5hYkAzmzC", "proofs": [ "2NLBxvnTLjwj7CQc4iN3aVdtwQXs3XPEwgszjEj79KXVb11zpGue8gmcFHbWozewZZNAVRC564VLGYrFx4Vned3t" ], "script": "base64:BgL+FAgCEgQKAggIEhAKDggICAgICAgICAgICAEIEg8KDQgICAgICAgICAgIAQgSBgoECAgICBIECgIICBIICgYIAQEIAQgSBAoCCAgSBAoCCAgSBwoFCAgICAgSBgoECAgICCIOZ2V0U3RyaW5nQnlLZXkiA2tleSIIdW5pdFRlc3QiCW9yYWNsZUZlZSIIc2lnbkRhcHAiC2ZlZVJlY2VpdmVyIgh1c2VyRGFwcCINd2hpdGVsaXN0RGFwcCILc2lnbkFzc2V0SWQiC3VzZG5Bc3NldElkIgt1c2R0QXNzZXRJZCIMd2F2ZXNBc3NldElkIgVjaHJpcyIZZ2V0SW50ZWdlckJ5S2V5RnJvbU9yYWNsZSIPZ2V0SW50ZWdlckJ5S2V5Ig5jaGVja1doaXRlbGlzdCIPZ2V0Qm9vbGVhbkJ5S2V5IgdzaWduQ3V0Igt1c2RuV2F2ZUN1dCIOZGVmYXVsdExpY2VuY2UiEmRlZmF1bHRIYXNoTGljZW5jZSILZGFwcFJ1bm5pbmciDm1haW50ZW5hbmNlTVNHIg11c2VyU3VzcGVuZGVkIgt1c2VyUmVtb3ZlZCIQdXNlclVucmVnaXN0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lkCQAAAggFAmNYBGRBcHAFBHRoaXMHCQAAAggFAmNYA2ZlZQCgwh4HCQAAAggFAmNYCmZlZUFzc2V0SWQFBHVuaXQHCQDIEwMIBQJjVglib2R5Qnl0ZXMJAJEDAggFAmNWBnByb29mcwAACQDZBAEJAQJjbQEJAJEDAggFAmNYBGFyZ3MABAkA9AMDCAUCY1YJYm9keUJ5dGVzCQCRAwIIBQJjVgZwcm9vZnMAAAgFAmNWD3NlbmRlclB1YmxpY0tleQkA9AMDCAUCY1YJYm9keUJ5dGVzCQCRAwIIBQJjVgZwcm9vZnMAAAgFAmNWD3NlbmRlclB1YmxpY0tlec+mlGY=", "height": 2503596, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: F4ePAvJhj9mAsWMcfc8YpYFFiTVRfKRuVPDexPShyUwQ Next: ZcWuPVLVaCx4apnEpDD7yyM7QwGrUu2VCdxycmpRzMG Diff:
OldNewDifferences
380380 let isSponsored = if ((pubKey != ""))
381381 then valueOrElse(checkWhitelist((toString(addressFromPublicKey(fromBase58String(pubKey))) + "_free_txs")), 0)
382382 else 0
383- let caller = if (if ((toBase58String(i.caller.bytes) == toString(this)))
384- then (isSponsored > 0)
385- else false)
386- then toString(addressFromPublicKey(fromBase58String(pubKey)))
387- else toBase58String(i.caller.bytes)
388- let get_sponsored_waves = if (if ((pubKey != ""))
389- then (isSponsored > 0)
390- else false)
391- then invoke(whitelistDapp, "useFreeTx", [toString(addressFromPublicKey(fromBase58String(pubKey)))], nil)
392- else unit
393- $Tuple4(toBase58String(i.transactionId), caller, lastBlock.timestamp, (isSponsored > 0))
383+ if ((isSponsored == isSponsored))
384+ then {
385+ let caller = if (if ((toBase58String(i.caller.bytes) == toString(this)))
386+ then (isSponsored > 0)
387+ else false)
388+ then toString(addressFromPublicKey(fromBase58String(pubKey)))
389+ else toBase58String(i.caller.bytes)
390+ let get_sponsored_waves = if (if ((pubKey != ""))
391+ then (isSponsored > 0)
392+ else false)
393+ then invoke(whitelistDapp, "useFreeTx", [toString(addressFromPublicKey(fromBase58String(pubKey)))], nil)
394+ else unit
395+ if ((get_sponsored_waves == get_sponsored_waves))
396+ then $Tuple4(toBase58String(i.transactionId), caller, lastBlock.timestamp, (isSponsored > 0))
397+ else throw("Strict value is not equal to itself.")
398+ }
399+ else throw("Strict value is not equal to itself.")
394400 }
395401
396402
400406
401407
402408 func buyMint (i,artId,issuer,bidId,bidOwner,pubKey) = {
403- let $t01303813127 = idCallerDateSponsored(i, pubKey)
404- let id = $t01303813127._1
405- let caller = $t01303813127._2
406- let date = $t01303813127._3
407- let isSponsored = $t01303813127._4
408- let isBid = if (if (if ((caller == issuer))
409- then (bidOwner != "")
410- else false)
411- then (bidId != "")
412- else false)
413- then true
414- else false
415- let blockEnd = getIntegerByKey(keyEndSale(caller, artId))
416- if (if (if ((blockEnd != 0))
417- then (height >= blockEnd)
418- else false)
419- then !(isBid)
420- else false)
421- then throw("Sale ended.")
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((caller == issuer)) + " / ") + toString(isSponsored)))
422416 else {
423- let callerIsIssuer = (caller == issuer)
424- let totalNFT = getIntegerByKey("total_nft_issued")
425- let signID = getStringByKey(keySignID(issuer, artId))
426- let artworkName = getStringByKey(keyName(issuer, artId))
427- if ((artworkName == ""))
428- then throw("Art doesn't exist")
417+ let isBid = if (if (if ((caller == issuer))
418+ then (bidOwner != "")
419+ else false)
420+ then (bidId != "")
421+ else false)
422+ then true
423+ else false
424+ let blockEnd = getIntegerByKey(keyEndSale(caller, artId))
425+ if (if (if ((blockEnd != 0))
426+ then (height >= blockEnd)
427+ else false)
428+ then !(isBid)
429+ else false)
430+ then throw("Sale ended.")
429431 else {
430- let isOnSale = getBooleanByKey(keyOnSale(issuer, artId))
431- let amountSold = getIntegerByKey(keyIssued(issuer, artId))
432- let artworkPrice = if (callerIsIssuer)
433- then (currentCertificationPrice * 2)
434- else getIntegerByKey(keyPrice(issuer, artId))
435- let priceAssetId = if (callerIsIssuer)
436- then toBase58String(signAssetId)
437- else getStringByKey(keyAssetIdAccepted(issuer, artId))
438- let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId))
439- if (if (if (!(isBid))
440- then !(callerIsIssuer)
441- else false)
442- then if (if ((0 >= artworkPrice))
443- then true
444- else !(isOnSale))
445- then true
446- else (0 >= maxCanSell)
447- else false)
448- then throw("Art not for sale")
449- else if (if (if (!(isBid))
450- then callerIsIssuer
451- else false)
452- then (0 >= maxCanSell)
453- else false)
454- then throw("Max issuable not set")
455- else {
456- let checkUser = validateUser(issuer)
457- if (if (isBid)
458- then (checkUser != "")
432+ let callerIsIssuer = (caller == issuer)
433+ let totalNFT = getIntegerByKey("total_nft_issued")
434+ let signID = getStringByKey(keySignID(issuer, artId))
435+ let artworkName = getStringByKey(keyName(issuer, artId))
436+ if ((artworkName == ""))
437+ then throw("Art doesn't exist")
438+ else {
439+ let isOnSale = getBooleanByKey(keyOnSale(issuer, artId))
440+ let amountSold = getIntegerByKey(keyIssued(issuer, artId))
441+ let artworkPrice = if (callerIsIssuer)
442+ then (currentCertificationPrice * 2)
443+ else getIntegerByKey(keyPrice(issuer, artId))
444+ let priceAssetId = if (callerIsIssuer)
445+ then toBase58String(signAssetId)
446+ else getStringByKey(keyAssetIdAccepted(issuer, artId))
447+ let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId))
448+ if (if (if (!(isBid))
449+ then !(callerIsIssuer)
450+ else false)
451+ then if (if ((0 >= artworkPrice))
452+ then true
453+ else !(isOnSale))
454+ then true
455+ else (0 >= maxCanSell)
456+ else false)
457+ then throw("Art not for sale")
458+ else if (if (if (!(isBid))
459+ then callerIsIssuer
459460 else false)
460- then throw(checkUser)
461+ then (0 >= maxCanSell)
462+ else false)
463+ then throw("Max issuable not set")
461464 else {
462- let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId)
463- let $t01464614838 = if (isBid)
464- then getPriceAssetIdFromBid(bidDataKey)
465- else validatePriceAssetId(i, priceAssetId, artworkPrice)
466- let amount = $t01464614838._1
467- let assetId = $t01464614838._2
468- let agent = valueOrElse(getString(userDapp, keyArtistAgentAddr(issuer)), feeReceiver)
469- let agentShare = valueOrElse(getInteger(userDapp, keyPrimaryShareAgent(issuer)), 0)
470- let publicAgent = valueOrElse(getString(userDapp, keyArtistPublicAgentAddr(issuer)), feeReceiver)
471- let publicAgentShare = valueOrElse(getInteger(userDapp, keyPrimarySharePublicAgent(issuer)), 0)
472- let isWhitelisted = checkWhitelist(issuer)
473- let cut = if ((isWhitelisted > height))
474- then 0
475- else if ((assetId == signAssetId))
476- then signCut
477- else usdnWaveCut
478- let amountForSign = fraction(amount, cut, 100)
479- let amountForAgent = if (if (if ((agent != feeReceiver))
480- then (agentShare > 0)
465+ let checkUser = validateUser(issuer)
466+ if (if (isBid)
467+ then (checkUser != "")
481468 else false)
482- then (height > isWhitelisted)
483- else false)
484- then fraction(amount, agentShare, 10000)
485- else 0
486- let amountForPublicAgent = if (if (if ((publicAgent != feeReceiver))
487- then (publicAgentShare > 0)
488- else false)
489- then (height > isWhitelisted)
490- else false)
491- then fraction(amount, publicAgentShare, 10000)
492- else 0
493- let amountForCreator = (amount - amountForSign)
494- if ((amountSold == maxCanSell))
495- then throw("Art sold out")
469+ then throw(checkUser)
496470 else {
497- let newAmountSold = (amountSold + 1)
498- let issueMeta = ((((((((((("Creator: " + issuer) + ",
471+ let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId)
472+ let $t01474014932 = if (isBid)
473+ then getPriceAssetIdFromBid(bidDataKey)
474+ else validatePriceAssetId(i, priceAssetId, artworkPrice)
475+ let amount = $t01474014932._1
476+ let assetId = $t01474014932._2
477+ let agent = valueOrElse(getString(userDapp, keyArtistAgentAddr(issuer)), feeReceiver)
478+ let agentShare = valueOrElse(getInteger(userDapp, keyPrimaryShareAgent(issuer)), 0)
479+ let publicAgent = valueOrElse(getString(userDapp, keyArtistPublicAgentAddr(issuer)), feeReceiver)
480+ let publicAgentShare = valueOrElse(getInteger(userDapp, keyPrimarySharePublicAgent(issuer)), 0)
481+ let isWhitelisted = checkWhitelist(issuer)
482+ let cut = if ((isWhitelisted > height))
483+ then 0
484+ else if ((assetId == signAssetId))
485+ then signCut
486+ else usdnWaveCut
487+ let amountForSign = fraction(amount, cut, 100)
488+ let amountForAgent = if (if (if ((agent != feeReceiver))
489+ then (agentShare > 0)
490+ else false)
491+ then (height > isWhitelisted)
492+ else false)
493+ then fraction(amount, agentShare, 10000)
494+ else 0
495+ let amountForPublicAgent = if (if (if ((publicAgent != feeReceiver))
496+ then (publicAgentShare > 0)
497+ else false)
498+ then (height > isWhitelisted)
499+ else false)
500+ then fraction(amount, publicAgentShare, 10000)
501+ else 0
502+ let amountForCreator = (amount - amountForSign)
503+ if ((amountSold == maxCanSell))
504+ then throw("Art sold out")
505+ else {
506+ let newAmountSold = (amountSold + 1)
507+ let issueMeta = ((((((((((("Creator: " + issuer) + ",
499508 ArtID: ") + artId) + ",
500509 SignID: ") + signID) + ",
501510 Artwork name: ") + artworkName) + ",
502511 Issue: ") + toString(newAmountSold)) + "/") + toString(maxCanSell))
503- let issueNFT = Issue(("SA_" + toString((totalNFT + 1))), issueMeta, 1, 0, false)
504- let idNFT = calculateAssetId(issueNFT)
505- let sellStatus = if (if ((newAmountSold == maxCanSell))
506- then true
507- else !(isOnSale))
508- then false
509- else true
510- let receiveNFT = if (if (if ((caller == issuer))
511- then (bidOwner != "")
512- else false)
513- then (bidId != "")
514- else false)
515- then addressFromStringValue(bidOwner)
516- else i.caller
517- let assetIdBid = if (!(isDefined(assetId)))
518- then "WAVES"
519- else toBase58String(value(assetId))
520- let bidData = getStringByKey((bidDataKey + "_OPEN"))
521- let bidDelOld = DeleteEntry((bidDataKey + "_OPEN"))
522- let bidUpdate = StringEntry((bidDataKey + "_CLOSED"), ((bidData + "_") + toString(date)))
523- let soldKey = ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer)
524- let soldValue = if (!(isBid))
525- then ((((((((((caller + "_") + toString(date)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + toBase58String(idNFT))
526- else ((((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + assetIdBid) + "_") + toBase58String(idNFT))
527- let soldData = StringEntry(soldKey, soldValue)
528- let commissionsWithAgent = if ((amountForAgent != 0))
529- then [ScriptTransfer(Address(fromBase58String(feeReceiver)), (amountForSign - amountForAgent), assetId), ScriptTransfer(Address(fromBase58String(agent)), amountForAgent, assetId)]
530- else [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)]
531- let commissionsWithPublicAgent = if ((amountForPublicAgent != 0))
532- then [ScriptTransfer(Address(fromBase58String(publicAgent)), amountForPublicAgent, assetId), ScriptTransfer(Address(fromBase58String(issuer)), (amountForCreator - amountForPublicAgent), assetId)]
533- else [ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId)]
534- let txToCaller = if (isSponsored)
535- then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
536- else nil
537- 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)
538- if (isBid)
539- then [soldData, bidUpdate, bidDelOld] :: buyRes
540- else soldData :: buyRes
512+ let issueNFT = Issue(("SA_" + toString((totalNFT + 1))), issueMeta, 1, 0, false)
513+ let idNFT = calculateAssetId(issueNFT)
514+ let sellStatus = if (if ((newAmountSold == maxCanSell))
515+ then true
516+ else !(isOnSale))
517+ then false
518+ else true
519+ let receiveNFT = if (if (if ((caller == issuer))
520+ then (bidOwner != "")
521+ else false)
522+ then (bidId != "")
523+ else false)
524+ then addressFromStringValue(bidOwner)
525+ else i.caller
526+ let assetIdBid = if (!(isDefined(assetId)))
527+ then "WAVES"
528+ else toBase58String(value(assetId))
529+ let bidData = getStringByKey((bidDataKey + "_OPEN"))
530+ let bidDelOld = DeleteEntry((bidDataKey + "_OPEN"))
531+ let bidUpdate = StringEntry((bidDataKey + "_CLOSED"), ((bidData + "_") + toString(date)))
532+ let soldKey = ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer)
533+ let soldValue = if (!(isBid))
534+ then ((((((((((caller + "_") + toString(date)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + toBase58String(idNFT))
535+ else ((((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + assetIdBid) + "_") + toBase58String(idNFT))
536+ let soldData = StringEntry(soldKey, soldValue)
537+ let commissionsWithAgent = if ((amountForAgent != 0))
538+ then [ScriptTransfer(Address(fromBase58String(feeReceiver)), (amountForSign - amountForAgent), assetId), ScriptTransfer(Address(fromBase58String(agent)), amountForAgent, assetId)]
539+ else [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)]
540+ let commissionsWithPublicAgent = if ((amountForPublicAgent != 0))
541+ then [ScriptTransfer(Address(fromBase58String(publicAgent)), amountForPublicAgent, assetId), ScriptTransfer(Address(fromBase58String(issuer)), (amountForCreator - amountForPublicAgent), assetId)]
542+ else [ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId)]
543+ let txToCaller = if (isSponsored)
544+ then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
545+ else nil
546+ 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)
547+ if (isBid)
548+ then [soldData, bidUpdate, bidDelOld] :: buyRes
549+ else soldData :: buyRes
550+ }
541551 }
542552 }
543- }
553+ }
544554 }
545555 }
546556 }
568578
569579 @Callable(i)
570580 func addArtwork (sha256Hash,signID,name,description,tags,type,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence,crawler,royalties,pubKey) = {
571- let $t02001420087 = idCallerDateSponsored(i, pubKey)
572- let artId = $t02001420087._1
573- let caller = $t02001420087._2
574- let date = $t02001420087._3
575- let isSponsored = $t02001420087._4
581+ let $t02010820181 = idCallerDateSponsored(i, pubKey)
582+ let artId = $t02010820181._1
583+ let caller = $t02010820181._2
584+ let date = $t02010820181._3
585+ let isSponsored = $t02010820181._4
576586 if (!(validateHash(sha256Hash)))
577587 then throw("Hash should be 64 characters maximum")
578588 else {
579- let $t02018820257 = setLIcence(cidLicence, sha256Licence)
580- let licenceCID = $t02018820257._1
581- let licenceHash = $t02018820257._2
589+ let $t02028220351 = setLIcence(cidLicence, sha256Licence)
590+ let licenceCID = $t02028220351._1
591+ let licenceHash = $t02028220351._2
582592 let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, royalties)
583593 if ((validateArtwork != ""))
584594 then throw("Something went wrong!")
585595 else {
586596 let whitelisted_drop = (checkWhitelist((caller + "_free_drops")) > 0)
587- let $t02055620640 = if (whitelisted_drop)
597+ let $t02065020734 = if (whitelisted_drop)
588598 then $Tuple2(0, signID)
589599 else validatePayment(i)
590- let amount = $t02055620640._1
591- let assetId = $t02055620640._2
600+ let amount = $t02065020734._1
601+ let assetId = $t02065020734._2
592602 if (!(isDefined(amount)))
593603 then throw("Something went wrong")
594604 else {
629639 func updateArtwork (txid,name,description,tags,type,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence,crawler,royalties,pubKey) = if (!(dappRunning))
630640 then throw(maintenanceMSG)
631641 else {
632- let $t02367423744 = idCallerDateSponsored(i, pubKey)
633- let id = $t02367423744._1
634- let caller = $t02367423744._2
635- let date = $t02367423744._3
636- let isSponsored = $t02367423744._4
637- let $t02375423823 = setLIcence(cidLicence, sha256Licence)
638- let licenceCID = $t02375423823._1
639- let licenceHash = $t02375423823._2
642+ let $t02376823838 = idCallerDateSponsored(i, pubKey)
643+ let id = $t02376823838._1
644+ let caller = $t02376823838._2
645+ let date = $t02376823838._3
646+ let isSponsored = $t02376823838._4
647+ let $t02384823917 = setLIcence(cidLicence, sha256Licence)
648+ let licenceCID = $t02384823917._1
649+ let licenceHash = $t02384823917._2
640650 let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, royalties)
641651 if ((validateArtwork != ""))
642652 then throw("Something went wrong!")
664674
665675 @Callable(i)
666676 func flagArtwork (artId,addr,flag,note) = {
667- let $t02545025484 = idCallerDate(i)
668- let id = $t02545025484._1
669- let caller = $t02545025484._2
677+ let $t02554425578 = idCallerDate(i)
678+ let id = $t02554425578._1
679+ let caller = $t02554425578._2
670680 if (containsElement([chris, toString(this)], caller))
671681 then if (containsElement(["CONSENT", "", "CHANGE_REQUIRED", "FLAGGED", "ILLEGAL"], flag))
672682 then [StringEntry(keyFlag(addr, artId), flag), StringEntry(keyNote(addr, artId), note)]
678688
679689 @Callable(i)
680690 func deleteArtwork (artId,addr) = {
681- let $t02592025954 = idCallerDate(i)
682- let id = $t02592025954._1
683- let caller = $t02592025954._2
691+ let $t02601426048 = idCallerDate(i)
692+ let id = $t02601426048._1
693+ let caller = $t02601426048._2
684694 let addrToUse = if (containsElement([chris, toString(this)], caller))
685695 then addr
686696 else caller
713723
714724 @Callable(i)
715725 func sellArtwork (artId,price,maxMint,assetId,blockEnd,pubKey) = {
716- let $t02879028860 = idCallerDateSponsored(i, pubKey)
717- let id = $t02879028860._1
718- let caller = $t02879028860._2
719- let date = $t02879028860._3
720- let isSponsored = $t02879028860._4
726+ let $t02888428954 = idCallerDateSponsored(i, pubKey)
727+ let id = $t02888428954._1
728+ let caller = $t02888428954._2
729+ let date = $t02888428954._3
730+ let isSponsored = $t02888428954._4
721731 let artworkName = getStringByKey(keyName(caller, artId))
722732 if ((artworkName == ""))
723733 then throw("This art doesn't match your account")
791801
792802 @Callable(i)
793803 func setBid (artId,issuer) = {
794- let $t03124231282 = idCallerDate(i)
795- let id = $t03124231282._1
796- let caller = $t03124231282._2
797- let date = $t03124231282._3
798- let $t03128731323 = isPayment(i)
799- let payment = $t03128731323._1
800- let amount = $t03128731323._2
804+ let $t03133631376 = idCallerDate(i)
805+ let id = $t03133631376._1
806+ let caller = $t03133631376._2
807+ let date = $t03133631376._3
808+ let $t03138131417 = isPayment(i)
809+ let payment = $t03138131417._1
810+ let amount = $t03138131417._2
801811 let assetId = if (!(isDefined(payment.assetId)))
802812 then "WAVES"
803813 else toBase58String(value(payment.assetId))
828838
829839 @Callable(i)
830840 func acceptBid (artId,issuer,bidId,bidOwner,pubKey) = {
831- let $t03254332614 = idCallerDateSponsored(i, pubKey)
832- let id = $t03254332614._1
833- let caller1 = $t03254332614._2
834- let date = $t03254332614._3
835- let isSponsored = $t03254332614._4
841+ let $t03263732708 = idCallerDateSponsored(i, pubKey)
842+ let id = $t03263732708._1
843+ let caller1 = $t03263732708._2
844+ let date = $t03263732708._3
845+ let isSponsored = $t03263732708._4
836846 if ((caller1 != issuer))
837847 then throw("You cannot do this action")
838848 else buyMint(i, artId, issuer, bidId, bidOwner, pubKey)
842852
843853 @Callable(i)
844854 func cancelBid (artId,issuer,bidId,bidOwner) = {
845- let $t03284932910 = idCallerDate(i)
846- let id = $t03284932910._1
847- let caller = $t03284932910._2
848- let date = $t03284932910._3
855+ let $t03294333004 = idCallerDate(i)
856+ let id = $t03294333004._1
857+ let caller = $t03294333004._2
858+ let date = $t03294333004._3
849859 if (if ((caller != bidOwner))
850860 then (caller != issuer)
851861 else false)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func getStringByKey (key) = valueOrElse(getString(this, key), "")
55
66
77 let unitTest = false
88
99 let oracleFee = value(addressFromString(getStringByKey("conf_oracle_fee")))
1010
1111 let signDapp = value(addressFromString(getStringByKey("conf_signweb_dapp")))
1212
1313 let feeReceiver = getStringByKey("conf_fee_receiver")
1414
1515 let userDapp = if (unitTest)
1616 then value(addressFromString("3Mt4RGMEyjSWYAocTPqd55wdHQQB3PU2UCm"))
1717 else value(addressFromString(getStringByKey("conf_users_dapp")))
1818
1919 let whitelistDapp = value(addressFromString(getStringByKey("conf_whitelist_dapp")))
2020
2121 let signAssetId = fromBase58String(getStringByKey("conf_accepted_asset_SIGN"))
2222
2323 let usdnAssetId = fromBase58String(getStringByKey("conf_accepted_asset_USDN"))
2424
2525 let usdtAssetId = fromBase58String(getStringByKey("conf_accepted_asset_USDT"))
2626
2727 let wavesAssetId = base58''
2828
2929 let chris = getStringByKey("conf_admin_1")
3030
3131 func getIntegerByKeyFromOracle (key) = valueOrErrorMessage(getInteger(oracleFee, key), "Integer undefine or 0 in oracle")
3232
3333
3434 func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 0)
3535
3636
3737 func checkWhitelist (key) = valueOrElse(getInteger(whitelistDapp, key), 0)
3838
3939
4040 func getBooleanByKey (key) = valueOrElse(getBoolean(this, key), false)
4141
4242
4343 let signCut = 7
4444
4545 let usdnWaveCut = 10
4646
4747 let defaultLicence = getStringByKey("conf_default_licence")
4848
4949 let defaultHashLicence = getStringByKey("conf_default_licence_hash")
5050
5151 let dappRunning = valueOrElse(getBoolean(userDapp, "conf_dapp_is_running"), true)
5252
5353 let maintenanceMSG = valueOrElse(getString(userDapp, "conf_maintenance_msg"), "")
5454
5555 let userSuspended = "SUSPENDED"
5656
5757 let userRemoved = "REMOVED"
5858
5959 let userUnregistered = "UNREGISTERED"
6060
6161 let userAllowed = "ALLOWED"
6262
6363 let currentCertificationPrice = getIntegerByKeyFromOracle(("certification_fee_" + toBase58String(signAssetId)))
6464
6565 func checkSignCertificate (signID,Owner,sha256Hash) = match getString(signDapp, ((("data_fc_" + signID) + "_") + Owner)) {
6666 case a: String =>
6767 if (contains(a, sha256Hash))
6868 then true
6969 else false
7070 case _ =>
7171 false
7272 }
7373
7474
7575 func validateCID (cid) = if (contains(cid, "/"))
7676 then if (if ((76 > size(cid)))
7777 then (size(split(cid, "/")[0]) == 59)
7878 else false)
7979 then (16 > size(split(cid, "/")[1]))
8080 else false
8181 else false
8282
8383
8484 func validateHash (hash) = (size(hash) == 64)
8585
8686
8787 func keyUserStatus (caller) = ("user_status_" + caller)
8888
8989
9090 func keyDate (caller,artId) = ((("art_date_" + artId) + "_") + caller)
9191
9292
9393 func keyName (caller,artId) = ((("art_name_" + artId) + "_") + caller)
9494
9595
9696 func keyDesc (caller,artId) = ((("art_desc_" + artId) + "_") + caller)
9797
9898
9999 func keyDisplayCid (caller,artId) = ((("art_display_cid_" + artId) + "_") + caller)
100100
101101
102102 func keyExportHash (caller,artId) = ((("art_export_hash_" + artId) + "_") + caller)
103103
104104
105105 func keyExportCid (caller,artId) = ((("art_export_cid_" + artId) + "_") + caller)
106106
107107
108108 func keyMaxMint (caller,artId) = ((("art_maxmint_" + artId) + "_") + caller)
109109
110110
111111 func keySignID (caller,artId) = ((("art_signid_" + artId) + "_") + caller)
112112
113113
114114 func keyIssued (caller,artId) = ((("art_issued_" + artId) + "_") + caller)
115115
116116
117117 func keyOnSale (caller,artId) = ((("art_onsale_" + artId) + "_") + caller)
118118
119119
120120 func keyLicenceHash (caller,artId) = ((("art_licence_hash_" + artId) + "_") + caller)
121121
122122
123123 func keyLicenceCid (caller,artId) = ((("art_licence_cid_" + artId) + "_") + caller)
124124
125125
126126 func keyTags (caller,artId) = ((("art_tags_" + artId) + "_") + caller)
127127
128128
129129 func keyType (caller,artId) = ((("art_type_" + artId) + "_") + caller)
130130
131131
132132 func keyNote (caller,artId) = ((("art_note_" + artId) + "_") + caller)
133133
134134
135135 func keyCrawler (caller,artId) = ((("art_crawler_cid_" + artId) + "_") + caller)
136136
137137
138138 func keyRoyalties (caller,artId) = ((("art_royalties_" + artId) + "_") + caller)
139139
140140
141141 func keyPrice (caller,artId) = ((("art_price_" + artId) + "_") + caller)
142142
143143
144144 func keyEndSale (caller,artId) = ((("art_endsale_" + artId) + "_") + caller)
145145
146146
147147 func keyAssetIdAccepted (caller,artId) = ((("art_assetAccepted_" + artId) + "_") + caller)
148148
149149
150150 func keyFlag (caller,artId) = ((("art_flag_" + artId) + "_") + caller)
151151
152152
153153 func keyArtistAgentAddr (artistAddr) = ("artist_agent_" + artistAddr)
154154
155155
156156 func keyPrimaryShareAgent (artistAddr) = ("artist_agent_primary_" + artistAddr)
157157
158158
159159 func keyArtistPublicAgentAddr (artistAddr) = ("artist_public_agent_" + artistAddr)
160160
161161
162162 func keyPrimarySharePublicAgent (artistAddr) = ("artist_public_agent_primary_" + artistAddr)
163163
164164
165165 func keyHashByTxidAddr (caller,txid) = ((("get_hashbytxidaddr_" + txid) + "_") + caller)
166166
167167
168168 func keyOwnerByHash (sha256Hash) = ("get_owner_by_hash_" + sha256Hash)
169169
170170
171171 func keyidBySignid (caller,signId) = ((("get_artidbysignid_" + signId) + "_") + caller)
172172
173173
174174 func keyTxidByHashOwner (sha256Hash,caller) = ("get_txid_by_hash_owner_" + toBase58String(sha256_16Kb(toBytes((sha256Hash + caller)))))
175175
176176
177177 func validateAllCID (cidDisplay,cidExport,cidLicence) = if (!(validateCID(cidDisplay)))
178178 then throw("Wrong Display CID")
179179 else if (!(validateCID(cidExport)))
180180 then throw("Wrong Export CID")
181181 else if (if ((cidLicence != ""))
182182 then !(validateCID(cidLicence))
183183 else false)
184184 then throw("Wrong Licence CID")
185185 else true
186186
187187
188188 func validateAllHash (sha256Export,sha256Licence) = if (!(validateHash(sha256Export)))
189189 then throw("Export Hash 64 char. max")
190190 else if (!(validateHash(sha256Licence)))
191191 then throw("Licence Hash 64 char. max")
192192 else true
193193
194194
195195 func validateString (str,max) = if ((size(str) == 0))
196196 then throw("Field cannot be is empty")
197197 else if ((size(str) > max))
198198 then throw((str + " is too long"))
199199 else true
200200
201201
202202 func validateUser (caller) = {
203203 let userStatus = valueOrElse(getString(userDapp, keyUserStatus(caller)), userUnregistered)
204204 if (if ((userStatus == userUnregistered))
205205 then true
206206 else (userStatus == userAllowed))
207207 then "Register this account first with \"Account\" tab"
208208 else if ((userStatus == userSuspended))
209209 then "Account suspended"
210210 else if ((userStatus == userRemoved))
211211 then "Account removed"
212212 else ""
213213 }
214214
215215
216216 func setLIcence (cidLicence,sha256Licence) = {
217217 let cid = if ((size(cidLicence) == 0))
218218 then defaultLicence
219219 else cidLicence
220220 let hash = if ((size(sha256Licence) == 0))
221221 then defaultHashLicence
222222 else sha256Licence
223223 $Tuple2(cid, hash)
224224 }
225225
226226
227227 func validateArtworkData (caller,cidDisplay,cidExport,licenceCID,sha256Export,licenceHash,name,description,tags,royalties) = {
228228 let checkUser = validateUser(caller)
229229 if ((checkUser != ""))
230230 then throw(checkUser)
231231 else if ((size(cidDisplay) == 0))
232232 then throw("Display CID cannot be empty")
233233 else if (!(validateAllCID(cidDisplay, cidExport, licenceCID)))
234234 then throw("Problem with CID")
235235 else if (!(validateAllHash(sha256Export, licenceHash)))
236236 then throw("Problem with Hashes")
237237 else if (!(validateString(name, 100)))
238238 then throw("100 Char. max name")
239239 else if (!(validateString(description, 1000)))
240240 then throw("1000 Char. max description")
241241 else if (if ((0 > royalties))
242242 then true
243243 else (royalties > 1000))
244244 then throw("Royalties cannot be less than 0% or higher than 10%")
245245 else if ((size(split(tags, ",")) > 5))
246246 then throw("5 tags max.")
247247 else ""
248248 }
249249
250250
251251 func isPayment (i) = if ((size(i.payments) == 0))
252252 then throw("No payment attached")
253253 else {
254254 let payment = value(i.payments[0])
255255 let amount = value(payment.amount)
256256 $Tuple2(payment, amount)
257257 }
258258
259259
260260 func validatePayment (i) = {
261261 let $t091809216 = isPayment(i)
262262 let payment = $t091809216._1
263263 let amount = $t091809216._2
264264 let assetId = if (if (isDefined(payment.assetId))
265265 then (payment.assetId == signAssetId)
266266 else false)
267267 then payment.assetId
268268 else throw("Only SIGN token accepted as transaction fee")
269269 if ((amount != currentCertificationPrice))
270270 then throw(("Payment amount should be " + toString(currentCertificationPrice)))
271271 else $Tuple2(amount, assetId)
272272 }
273273
274274
275275 func isArtMinted (addrToUse,artId) = match getInteger(this, keyIssued(addrToUse, artId)) {
276276 case b: Int =>
277277 if ((b != 0))
278278 then true
279279 else false
280280 case _ =>
281281 false
282282 }
283283
284284
285285 func validatePriceAssetId (i,priceAssetId,artworkPrice) = {
286286 let $t098049840 = isPayment(i)
287287 let payment = $t098049840._1
288288 let amount = $t098049840._2
289289 let assetId = if (!(isDefined(payment.assetId)))
290290 then unit
291291 else if (if ((size(priceAssetId) > 0))
292292 then (toBase58String(value(payment.assetId)) == priceAssetId)
293293 else false)
294294 then payment.assetId
295295 else throw("Wrong asset id")
296296 if (if ((assetId == unit))
297297 then (priceAssetId != "")
298298 else false)
299299 then throw("Wrong asset id")
300300 else if ((artworkPrice != amount))
301301 then throw("Payment don't match")
302302 else $Tuple2(amount, assetId)
303303 }
304304
305305
306306 func acceptedAssetIds (assetId) = if (if (if (if (if ((assetId != toBase58String(signAssetId)))
307307 then (assetId != toBase58String(wavesAssetId))
308308 else false)
309309 then (assetId != "WAVES")
310310 else false)
311311 then (assetId != toBase58String(usdnAssetId))
312312 else false)
313313 then (assetId != toBase58String(usdtAssetId))
314314 else false)
315315 then throw("Only SIGN, USDN,USDT or WAVES accepted")
316316 else true
317317
318318
319319 func validateMinSell (assetId,price) = {
320320 let minSellWaves = if (unitTest)
321321 then 10
322322 else getIntegerByKeyFromOracle("waves_min_sell")
323323 let minSellUsdn = 1000000
324324 let minSellSign = if (unitTest)
325325 then 1
326326 else (currentCertificationPrice * 2)
327327 if (if (if (if (if (if ((assetId == toBase58String(usdnAssetId)))
328328 then (minSellUsdn > price)
329329 else false)
330330 then (price != 0)
331331 else false)
332332 then true
333333 else if (if ((assetId == toBase58String(usdtAssetId)))
334334 then (minSellUsdn > price)
335335 else false)
336336 then (price != 0)
337337 else false)
338338 then true
339339 else if (if ((assetId == toBase58String(signAssetId)))
340340 then (minSellSign > price)
341341 else false)
342342 then (price != 0)
343343 else false)
344344 then true
345345 else if (if (if ((assetId == toBase58String(wavesAssetId)))
346346 then true
347347 else (assetId == "WAVES"))
348348 then (minSellWaves > price)
349349 else false)
350350 then (price != 0)
351351 else false)
352352 then throw("Wrong minimum sell price")
353353 else true
354354 }
355355
356356
357357 func getBidAssetId (assetId) = if ((assetId == "WAVES"))
358358 then unit
359359 else fromBase58String(assetId)
360360
361361
362362 func getPriceAssetIdFromBid (bidDataKey) = {
363363 let bidData = getStringByKey((bidDataKey + "_OPEN"))
364364 if ((bidData == ""))
365365 then throw("Bid not found")
366366 else {
367367 let bidDataArr = split(bidData, "_")
368368 let bidAmount = parseIntValue(bidDataArr[1])
369369 let bidAssetId = getBidAssetId(bidDataArr[0])
370370 if ((0 >= bidAmount))
371371 then throw("Wrong amount")
372372 else $Tuple2(bidAmount, bidAssetId)
373373 }
374374 }
375375
376376
377377 func idCallerDateSponsored (i,pubKey) = if (!(dappRunning))
378378 then throw(maintenanceMSG)
379379 else {
380380 let isSponsored = if ((pubKey != ""))
381381 then valueOrElse(checkWhitelist((toString(addressFromPublicKey(fromBase58String(pubKey))) + "_free_txs")), 0)
382382 else 0
383- let caller = if (if ((toBase58String(i.caller.bytes) == toString(this)))
384- then (isSponsored > 0)
385- else false)
386- then toString(addressFromPublicKey(fromBase58String(pubKey)))
387- else toBase58String(i.caller.bytes)
388- let get_sponsored_waves = if (if ((pubKey != ""))
389- then (isSponsored > 0)
390- else false)
391- then invoke(whitelistDapp, "useFreeTx", [toString(addressFromPublicKey(fromBase58String(pubKey)))], nil)
392- else unit
393- $Tuple4(toBase58String(i.transactionId), caller, lastBlock.timestamp, (isSponsored > 0))
383+ if ((isSponsored == isSponsored))
384+ then {
385+ let caller = if (if ((toBase58String(i.caller.bytes) == toString(this)))
386+ then (isSponsored > 0)
387+ else false)
388+ then toString(addressFromPublicKey(fromBase58String(pubKey)))
389+ else toBase58String(i.caller.bytes)
390+ let get_sponsored_waves = if (if ((pubKey != ""))
391+ then (isSponsored > 0)
392+ else false)
393+ then invoke(whitelistDapp, "useFreeTx", [toString(addressFromPublicKey(fromBase58String(pubKey)))], nil)
394+ else unit
395+ if ((get_sponsored_waves == get_sponsored_waves))
396+ then $Tuple4(toBase58String(i.transactionId), caller, lastBlock.timestamp, (isSponsored > 0))
397+ else throw("Strict value is not equal to itself.")
398+ }
399+ else throw("Strict value is not equal to itself.")
394400 }
395401
396402
397403 func idCallerDate (i) = if (!(dappRunning))
398404 then throw(maintenanceMSG)
399405 else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp)
400406
401407
402408 func buyMint (i,artId,issuer,bidId,bidOwner,pubKey) = {
403- let $t01303813127 = idCallerDateSponsored(i, pubKey)
404- let id = $t01303813127._1
405- let caller = $t01303813127._2
406- let date = $t01303813127._3
407- let isSponsored = $t01303813127._4
408- let isBid = if (if (if ((caller == issuer))
409- then (bidOwner != "")
410- else false)
411- then (bidId != "")
412- else false)
413- then true
414- else false
415- let blockEnd = getIntegerByKey(keyEndSale(caller, artId))
416- if (if (if ((blockEnd != 0))
417- then (height >= blockEnd)
418- else false)
419- then !(isBid)
420- else false)
421- then throw("Sale ended.")
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((caller == issuer)) + " / ") + toString(isSponsored)))
422416 else {
423- let callerIsIssuer = (caller == issuer)
424- let totalNFT = getIntegerByKey("total_nft_issued")
425- let signID = getStringByKey(keySignID(issuer, artId))
426- let artworkName = getStringByKey(keyName(issuer, artId))
427- if ((artworkName == ""))
428- then throw("Art doesn't exist")
417+ let isBid = if (if (if ((caller == issuer))
418+ then (bidOwner != "")
419+ else false)
420+ then (bidId != "")
421+ else false)
422+ then true
423+ else false
424+ let blockEnd = getIntegerByKey(keyEndSale(caller, artId))
425+ if (if (if ((blockEnd != 0))
426+ then (height >= blockEnd)
427+ else false)
428+ then !(isBid)
429+ else false)
430+ then throw("Sale ended.")
429431 else {
430- let isOnSale = getBooleanByKey(keyOnSale(issuer, artId))
431- let amountSold = getIntegerByKey(keyIssued(issuer, artId))
432- let artworkPrice = if (callerIsIssuer)
433- then (currentCertificationPrice * 2)
434- else getIntegerByKey(keyPrice(issuer, artId))
435- let priceAssetId = if (callerIsIssuer)
436- then toBase58String(signAssetId)
437- else getStringByKey(keyAssetIdAccepted(issuer, artId))
438- let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId))
439- if (if (if (!(isBid))
440- then !(callerIsIssuer)
441- else false)
442- then if (if ((0 >= artworkPrice))
443- then true
444- else !(isOnSale))
445- then true
446- else (0 >= maxCanSell)
447- else false)
448- then throw("Art not for sale")
449- else if (if (if (!(isBid))
450- then callerIsIssuer
451- else false)
452- then (0 >= maxCanSell)
453- else false)
454- then throw("Max issuable not set")
455- else {
456- let checkUser = validateUser(issuer)
457- if (if (isBid)
458- then (checkUser != "")
432+ let callerIsIssuer = (caller == issuer)
433+ let totalNFT = getIntegerByKey("total_nft_issued")
434+ let signID = getStringByKey(keySignID(issuer, artId))
435+ let artworkName = getStringByKey(keyName(issuer, artId))
436+ if ((artworkName == ""))
437+ then throw("Art doesn't exist")
438+ else {
439+ let isOnSale = getBooleanByKey(keyOnSale(issuer, artId))
440+ let amountSold = getIntegerByKey(keyIssued(issuer, artId))
441+ let artworkPrice = if (callerIsIssuer)
442+ then (currentCertificationPrice * 2)
443+ else getIntegerByKey(keyPrice(issuer, artId))
444+ let priceAssetId = if (callerIsIssuer)
445+ then toBase58String(signAssetId)
446+ else getStringByKey(keyAssetIdAccepted(issuer, artId))
447+ let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId))
448+ if (if (if (!(isBid))
449+ then !(callerIsIssuer)
450+ else false)
451+ then if (if ((0 >= artworkPrice))
452+ then true
453+ else !(isOnSale))
454+ then true
455+ else (0 >= maxCanSell)
456+ else false)
457+ then throw("Art not for sale")
458+ else if (if (if (!(isBid))
459+ then callerIsIssuer
459460 else false)
460- then throw(checkUser)
461+ then (0 >= maxCanSell)
462+ else false)
463+ then throw("Max issuable not set")
461464 else {
462- let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId)
463- let $t01464614838 = if (isBid)
464- then getPriceAssetIdFromBid(bidDataKey)
465- else validatePriceAssetId(i, priceAssetId, artworkPrice)
466- let amount = $t01464614838._1
467- let assetId = $t01464614838._2
468- let agent = valueOrElse(getString(userDapp, keyArtistAgentAddr(issuer)), feeReceiver)
469- let agentShare = valueOrElse(getInteger(userDapp, keyPrimaryShareAgent(issuer)), 0)
470- let publicAgent = valueOrElse(getString(userDapp, keyArtistPublicAgentAddr(issuer)), feeReceiver)
471- let publicAgentShare = valueOrElse(getInteger(userDapp, keyPrimarySharePublicAgent(issuer)), 0)
472- let isWhitelisted = checkWhitelist(issuer)
473- let cut = if ((isWhitelisted > height))
474- then 0
475- else if ((assetId == signAssetId))
476- then signCut
477- else usdnWaveCut
478- let amountForSign = fraction(amount, cut, 100)
479- let amountForAgent = if (if (if ((agent != feeReceiver))
480- then (agentShare > 0)
465+ let checkUser = validateUser(issuer)
466+ if (if (isBid)
467+ then (checkUser != "")
481468 else false)
482- then (height > isWhitelisted)
483- else false)
484- then fraction(amount, agentShare, 10000)
485- else 0
486- let amountForPublicAgent = if (if (if ((publicAgent != feeReceiver))
487- then (publicAgentShare > 0)
488- else false)
489- then (height > isWhitelisted)
490- else false)
491- then fraction(amount, publicAgentShare, 10000)
492- else 0
493- let amountForCreator = (amount - amountForSign)
494- if ((amountSold == maxCanSell))
495- then throw("Art sold out")
469+ then throw(checkUser)
496470 else {
497- let newAmountSold = (amountSold + 1)
498- let issueMeta = ((((((((((("Creator: " + issuer) + ",
471+ let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId)
472+ let $t01474014932 = if (isBid)
473+ then getPriceAssetIdFromBid(bidDataKey)
474+ else validatePriceAssetId(i, priceAssetId, artworkPrice)
475+ let amount = $t01474014932._1
476+ let assetId = $t01474014932._2
477+ let agent = valueOrElse(getString(userDapp, keyArtistAgentAddr(issuer)), feeReceiver)
478+ let agentShare = valueOrElse(getInteger(userDapp, keyPrimaryShareAgent(issuer)), 0)
479+ let publicAgent = valueOrElse(getString(userDapp, keyArtistPublicAgentAddr(issuer)), feeReceiver)
480+ let publicAgentShare = valueOrElse(getInteger(userDapp, keyPrimarySharePublicAgent(issuer)), 0)
481+ let isWhitelisted = checkWhitelist(issuer)
482+ let cut = if ((isWhitelisted > height))
483+ then 0
484+ else if ((assetId == signAssetId))
485+ then signCut
486+ else usdnWaveCut
487+ let amountForSign = fraction(amount, cut, 100)
488+ let amountForAgent = if (if (if ((agent != feeReceiver))
489+ then (agentShare > 0)
490+ else false)
491+ then (height > isWhitelisted)
492+ else false)
493+ then fraction(amount, agentShare, 10000)
494+ else 0
495+ let amountForPublicAgent = if (if (if ((publicAgent != feeReceiver))
496+ then (publicAgentShare > 0)
497+ else false)
498+ then (height > isWhitelisted)
499+ else false)
500+ then fraction(amount, publicAgentShare, 10000)
501+ else 0
502+ let amountForCreator = (amount - amountForSign)
503+ if ((amountSold == maxCanSell))
504+ then throw("Art sold out")
505+ else {
506+ let newAmountSold = (amountSold + 1)
507+ let issueMeta = ((((((((((("Creator: " + issuer) + ",
499508 ArtID: ") + artId) + ",
500509 SignID: ") + signID) + ",
501510 Artwork name: ") + artworkName) + ",
502511 Issue: ") + toString(newAmountSold)) + "/") + toString(maxCanSell))
503- let issueNFT = Issue(("SA_" + toString((totalNFT + 1))), issueMeta, 1, 0, false)
504- let idNFT = calculateAssetId(issueNFT)
505- let sellStatus = if (if ((newAmountSold == maxCanSell))
506- then true
507- else !(isOnSale))
508- then false
509- else true
510- let receiveNFT = if (if (if ((caller == issuer))
511- then (bidOwner != "")
512- else false)
513- then (bidId != "")
514- else false)
515- then addressFromStringValue(bidOwner)
516- else i.caller
517- let assetIdBid = if (!(isDefined(assetId)))
518- then "WAVES"
519- else toBase58String(value(assetId))
520- let bidData = getStringByKey((bidDataKey + "_OPEN"))
521- let bidDelOld = DeleteEntry((bidDataKey + "_OPEN"))
522- let bidUpdate = StringEntry((bidDataKey + "_CLOSED"), ((bidData + "_") + toString(date)))
523- let soldKey = ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer)
524- let soldValue = if (!(isBid))
525- then ((((((((((caller + "_") + toString(date)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + toBase58String(idNFT))
526- else ((((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + assetIdBid) + "_") + toBase58String(idNFT))
527- let soldData = StringEntry(soldKey, soldValue)
528- let commissionsWithAgent = if ((amountForAgent != 0))
529- then [ScriptTransfer(Address(fromBase58String(feeReceiver)), (amountForSign - amountForAgent), assetId), ScriptTransfer(Address(fromBase58String(agent)), amountForAgent, assetId)]
530- else [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)]
531- let commissionsWithPublicAgent = if ((amountForPublicAgent != 0))
532- then [ScriptTransfer(Address(fromBase58String(publicAgent)), amountForPublicAgent, assetId), ScriptTransfer(Address(fromBase58String(issuer)), (amountForCreator - amountForPublicAgent), assetId)]
533- else [ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId)]
534- let txToCaller = if (isSponsored)
535- then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
536- else nil
537- 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)
538- if (isBid)
539- then [soldData, bidUpdate, bidDelOld] :: buyRes
540- else soldData :: buyRes
512+ let issueNFT = Issue(("SA_" + toString((totalNFT + 1))), issueMeta, 1, 0, false)
513+ let idNFT = calculateAssetId(issueNFT)
514+ let sellStatus = if (if ((newAmountSold == maxCanSell))
515+ then true
516+ else !(isOnSale))
517+ then false
518+ else true
519+ let receiveNFT = if (if (if ((caller == issuer))
520+ then (bidOwner != "")
521+ else false)
522+ then (bidId != "")
523+ else false)
524+ then addressFromStringValue(bidOwner)
525+ else i.caller
526+ let assetIdBid = if (!(isDefined(assetId)))
527+ then "WAVES"
528+ else toBase58String(value(assetId))
529+ let bidData = getStringByKey((bidDataKey + "_OPEN"))
530+ let bidDelOld = DeleteEntry((bidDataKey + "_OPEN"))
531+ let bidUpdate = StringEntry((bidDataKey + "_CLOSED"), ((bidData + "_") + toString(date)))
532+ let soldKey = ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer)
533+ let soldValue = if (!(isBid))
534+ then ((((((((((caller + "_") + toString(date)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + toBase58String(idNFT))
535+ else ((((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + assetIdBid) + "_") + toBase58String(idNFT))
536+ let soldData = StringEntry(soldKey, soldValue)
537+ let commissionsWithAgent = if ((amountForAgent != 0))
538+ then [ScriptTransfer(Address(fromBase58String(feeReceiver)), (amountForSign - amountForAgent), assetId), ScriptTransfer(Address(fromBase58String(agent)), amountForAgent, assetId)]
539+ else [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)]
540+ let commissionsWithPublicAgent = if ((amountForPublicAgent != 0))
541+ then [ScriptTransfer(Address(fromBase58String(publicAgent)), amountForPublicAgent, assetId), ScriptTransfer(Address(fromBase58String(issuer)), (amountForCreator - amountForPublicAgent), assetId)]
542+ else [ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId)]
543+ let txToCaller = if (isSponsored)
544+ then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
545+ else nil
546+ 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)
547+ if (isBid)
548+ then [soldData, bidUpdate, bidDelOld] :: buyRes
549+ else soldData :: buyRes
550+ }
541551 }
542552 }
543- }
553+ }
544554 }
545555 }
546556 }
547557
548558
549559 func asString (bv) = match bv {
550560 case bv0: String =>
551561 bv0
552562 case _ =>
553563 throw("Sponsored Public Key String expected")
554564 }
555565
556566
557567 @Callable(invoke)
558568 func setConf (key,val) = {
559569 let caller = toString(invoke.caller)
560570 if (containsElement([chris, toString(this)], caller))
561571 then if (contains(key, "conf_"))
562572 then [StringEntry(key, val)]
563573 else throw("Entries starting with conf_ only")
564574 else throw("You are not allowed to change this")
565575 }
566576
567577
568578
569579 @Callable(i)
570580 func addArtwork (sha256Hash,signID,name,description,tags,type,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence,crawler,royalties,pubKey) = {
571- let $t02001420087 = idCallerDateSponsored(i, pubKey)
572- let artId = $t02001420087._1
573- let caller = $t02001420087._2
574- let date = $t02001420087._3
575- let isSponsored = $t02001420087._4
581+ let $t02010820181 = idCallerDateSponsored(i, pubKey)
582+ let artId = $t02010820181._1
583+ let caller = $t02010820181._2
584+ let date = $t02010820181._3
585+ let isSponsored = $t02010820181._4
576586 if (!(validateHash(sha256Hash)))
577587 then throw("Hash should be 64 characters maximum")
578588 else {
579- let $t02018820257 = setLIcence(cidLicence, sha256Licence)
580- let licenceCID = $t02018820257._1
581- let licenceHash = $t02018820257._2
589+ let $t02028220351 = setLIcence(cidLicence, sha256Licence)
590+ let licenceCID = $t02028220351._1
591+ let licenceHash = $t02028220351._2
582592 let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, royalties)
583593 if ((validateArtwork != ""))
584594 then throw("Something went wrong!")
585595 else {
586596 let whitelisted_drop = (checkWhitelist((caller + "_free_drops")) > 0)
587- let $t02055620640 = if (whitelisted_drop)
597+ let $t02065020734 = if (whitelisted_drop)
588598 then $Tuple2(0, signID)
589599 else validatePayment(i)
590- let amount = $t02055620640._1
591- let assetId = $t02055620640._2
600+ let amount = $t02065020734._1
601+ let assetId = $t02065020734._2
592602 if (!(isDefined(amount)))
593603 then throw("Something went wrong")
594604 else {
595605 let entryExist = getStringByKey(keyTxidByHashOwner(sha256Hash, caller))
596606 if ((entryExist != ""))
597607 then throw("You already added it")
598608 else {
599609 let hashExist = getStringByKey(keyOwnerByHash(sha256Hash))
600610 if ((hashExist != ""))
601611 then throw("Hash already registered")
602612 else {
603613 let isSignCertified = checkSignCertificate(signID, caller, sha256Hash)
604614 if (!(isSignCertified))
605615 then throw("Sign Certificate not found for this address.")
606616 else {
607617 let decrease_whitelist_drop = if (whitelisted_drop)
608618 then invoke(whitelistDapp, "useFreeDrop", [caller], nil)
609619 else unit
610620 if ((decrease_whitelist_drop == decrease_whitelist_drop))
611621 then {
612622 let txToCaller = if (isSponsored)
613623 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
614624 else nil
615625 ([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)
616626 }
617627 else throw("Strict value is not equal to itself.")
618628 }
619629 }
620630 }
621631 }
622632 }
623633 }
624634 }
625635
626636
627637
628638 @Callable(i)
629639 func updateArtwork (txid,name,description,tags,type,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence,crawler,royalties,pubKey) = if (!(dappRunning))
630640 then throw(maintenanceMSG)
631641 else {
632- let $t02367423744 = idCallerDateSponsored(i, pubKey)
633- let id = $t02367423744._1
634- let caller = $t02367423744._2
635- let date = $t02367423744._3
636- let isSponsored = $t02367423744._4
637- let $t02375423823 = setLIcence(cidLicence, sha256Licence)
638- let licenceCID = $t02375423823._1
639- let licenceHash = $t02375423823._2
642+ let $t02376823838 = idCallerDateSponsored(i, pubKey)
643+ let id = $t02376823838._1
644+ let caller = $t02376823838._2
645+ let date = $t02376823838._3
646+ let isSponsored = $t02376823838._4
647+ let $t02384823917 = setLIcence(cidLicence, sha256Licence)
648+ let licenceCID = $t02384823917._1
649+ let licenceHash = $t02384823917._2
640650 let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, royalties)
641651 if ((validateArtwork != ""))
642652 then throw("Something went wrong!")
643653 else {
644654 let entryExist = getStringByKey(keyName(caller, txid))
645655 if ((entryExist == ""))
646656 then throw("Entry not found")
647657 else {
648658 let flag = getStringByKey(keyFlag(caller, txid))
649659 if ((flag == "ILLEGAL"))
650660 then throw("Cannot update ILLEGAL artwork")
651661 else if (!(isArtMinted(caller, txid)))
652662 then {
653663 let txToCaller = if (isSponsored)
654664 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
655665 else nil
656666 ([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)
657667 }
658668 else throw("Already minted")
659669 }
660670 }
661671 }
662672
663673
664674
665675 @Callable(i)
666676 func flagArtwork (artId,addr,flag,note) = {
667- let $t02545025484 = idCallerDate(i)
668- let id = $t02545025484._1
669- let caller = $t02545025484._2
677+ let $t02554425578 = idCallerDate(i)
678+ let id = $t02554425578._1
679+ let caller = $t02554425578._2
670680 if (containsElement([chris, toString(this)], caller))
671681 then if (containsElement(["CONSENT", "", "CHANGE_REQUIRED", "FLAGGED", "ILLEGAL"], flag))
672682 then [StringEntry(keyFlag(addr, artId), flag), StringEntry(keyNote(addr, artId), note)]
673683 else throw(("Unknow status " + flag))
674684 else throw("You are not allowed")
675685 }
676686
677687
678688
679689 @Callable(i)
680690 func deleteArtwork (artId,addr) = {
681- let $t02592025954 = idCallerDate(i)
682- let id = $t02592025954._1
683- let caller = $t02592025954._2
691+ let $t02601426048 = idCallerDate(i)
692+ let id = $t02601426048._1
693+ let caller = $t02601426048._2
684694 let addrToUse = if (containsElement([chris, toString(this)], caller))
685695 then addr
686696 else caller
687697 let entryExist = valueOrErrorMessage(getStringByKey(keyName(addrToUse, artId)), "No art matching for this address")
688698 if ((entryExist == ""))
689699 then throw("No art matching for this address")
690700 else {
691701 let sha256Hash = getStringByKey(keyHashByTxidAddr(addrToUse, artId))
692702 if ((sha256Hash == ""))
693703 then throw("No art hash matching for this address")
694704 else {
695705 let signID = getStringByKey(keySignID(addrToUse, artId))
696706 if ((signID == ""))
697707 then throw("No SIGN ID matching")
698708 else {
699709 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))]
700710 if (!(isArtMinted(addrToUse, artId)))
701711 then if (!(dappRunning))
702712 then throw(maintenanceMSG)
703713 else dataToDelete
704714 else if (containsElement([chris, toString(this)], caller))
705715 then dataToDelete
706716 else throw("Art already minted, you cannot delete it")
707717 }
708718 }
709719 }
710720 }
711721
712722
713723
714724 @Callable(i)
715725 func sellArtwork (artId,price,maxMint,assetId,blockEnd,pubKey) = {
716- let $t02879028860 = idCallerDateSponsored(i, pubKey)
717- let id = $t02879028860._1
718- let caller = $t02879028860._2
719- let date = $t02879028860._3
720- let isSponsored = $t02879028860._4
726+ let $t02888428954 = idCallerDateSponsored(i, pubKey)
727+ let id = $t02888428954._1
728+ let caller = $t02888428954._2
729+ let date = $t02888428954._3
730+ let isSponsored = $t02888428954._4
721731 let artworkName = getStringByKey(keyName(caller, artId))
722732 if ((artworkName == ""))
723733 then throw("This art doesn't match your account")
724734 else {
725735 let flag = getStringByKey(keyFlag(caller, artId))
726736 if (containsElement(["CHANGE_REQUIRED", "FLAGGED", "ILLEGAL"], flag))
727737 then throw("Flagged artwork")
728738 else {
729739 let bidNbr = getIntegerByKey(("current_bidamount_" + artId))
730740 if ((0 > blockEnd))
731741 then throw("Negative end")
732742 else if (if ((blockEnd > 0))
733743 then if ((maxMint != 1))
734744 then true
735745 else (price != 0)
736746 else false)
737747 then throw("Timed offer only allowed for unique edition and offer only")
738748 else {
739749 let baseHeight = if ((blockEnd == 0))
740750 then 0
741751 else height
742752 if (!(acceptedAssetIds(assetId)))
743753 then throw("Something went wrong!")
744754 else if (!(validateMinSell(assetId, price)))
745755 then throw("Something went wrong!")
746756 else {
747757 let checkUser = validateUser(caller)
748758 if ((checkUser != ""))
749759 then throw(checkUser)
750760 else {
751761 let amountSold = getIntegerByKey(keyIssued(caller, artId))
752762 let maxCanSell = getIntegerByKey(keyMaxMint(caller, artId))
753763 if ((maxMint > 100))
754764 then throw("100 editions max per artwork")
755765 else if (if ((amountSold != 0))
756766 then (amountSold == maxCanSell)
757767 else false)
758768 then throw("Max edition reached.")
759769 else if (if ((amountSold > 0))
760770 then (maxCanSell != maxMint)
761771 else false)
762772 then throw("Cannot change maximum issuable anymore")
763773 else if (if ((bidNbr > 0))
764774 then (maxCanSell != maxMint)
765775 else false)
766776 then throw("Cannot change maximum issuable with active orders")
767777 else {
768778 let sellStatus = if (if ((price > 0))
769779 then (maxMint > 0)
770780 else false)
771781 then true
772782 else false
773783 let txToCaller = if (isSponsored)
774784 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
775785 else nil
776786 ([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)
777787 }
778788 }
779789 }
780790 }
781791 }
782792 }
783793 }
784794
785795
786796
787797 @Callable(i)
788798 func buyArtwork (artId,issuer) = buyMint(i, artId, issuer, "", "", "")
789799
790800
791801
792802 @Callable(i)
793803 func setBid (artId,issuer) = {
794- let $t03124231282 = idCallerDate(i)
795- let id = $t03124231282._1
796- let caller = $t03124231282._2
797- let date = $t03124231282._3
798- let $t03128731323 = isPayment(i)
799- let payment = $t03128731323._1
800- let amount = $t03128731323._2
804+ let $t03133631376 = idCallerDate(i)
805+ let id = $t03133631376._1
806+ let caller = $t03133631376._2
807+ let date = $t03133631376._3
808+ let $t03138131417 = isPayment(i)
809+ let payment = $t03138131417._1
810+ let amount = $t03138131417._2
801811 let assetId = if (!(isDefined(payment.assetId)))
802812 then "WAVES"
803813 else toBase58String(value(payment.assetId))
804814 let blockEnd = getIntegerByKey(keyEndSale(issuer, artId))
805815 if (if ((blockEnd != 0))
806816 then (height >= blockEnd)
807817 else false)
808818 then throw("Sale ended.")
809819 else {
810820 let bidNbr = getIntegerByKey(("current_bidamount_" + artId))
811821 if (!(acceptedAssetIds(assetId)))
812822 then throw("asset not accepted")
813823 else if (!(validateMinSell(assetId, amount)))
814824 then throw("Wrong min sell")
815825 else {
816826 let amountSold = getIntegerByKey(keyIssued(issuer, artId))
817827 let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId))
818828 if ((0 >= maxCanSell))
819829 then throw("No max edition set for this artwork")
820830 else if ((amountSold >= maxCanSell))
821831 then throw("Sold out, you cannot bid")
822832 else [StringEntry((((((((("bid_" + artId) + "_") + issuer) + "_") + caller) + "_") + id) + "_OPEN"), ((((assetId + "_") + toString(amount)) + "_") + toString(date))), IntegerEntry(("current_bidamount_" + artId), (bidNbr + 1))]
823833 }
824834 }
825835 }
826836
827837
828838
829839 @Callable(i)
830840 func acceptBid (artId,issuer,bidId,bidOwner,pubKey) = {
831- let $t03254332614 = idCallerDateSponsored(i, pubKey)
832- let id = $t03254332614._1
833- let caller1 = $t03254332614._2
834- let date = $t03254332614._3
835- let isSponsored = $t03254332614._4
841+ let $t03263732708 = idCallerDateSponsored(i, pubKey)
842+ let id = $t03263732708._1
843+ let caller1 = $t03263732708._2
844+ let date = $t03263732708._3
845+ let isSponsored = $t03263732708._4
836846 if ((caller1 != issuer))
837847 then throw("You cannot do this action")
838848 else buyMint(i, artId, issuer, bidId, bidOwner, pubKey)
839849 }
840850
841851
842852
843853 @Callable(i)
844854 func cancelBid (artId,issuer,bidId,bidOwner) = {
845- let $t03284932910 = idCallerDate(i)
846- let id = $t03284932910._1
847- let caller = $t03284932910._2
848- let date = $t03284932910._3
855+ let $t03294333004 = idCallerDate(i)
856+ let id = $t03294333004._1
857+ let caller = $t03294333004._2
858+ let date = $t03294333004._3
849859 if (if ((caller != bidOwner))
850860 then (caller != issuer)
851861 else false)
852862 then throw("You cannot do this action")
853863 else {
854864 let returnMoneyTo = if ((caller == issuer))
855865 then bidOwner
856866 else caller
857867 let bidNbr = getIntegerByKey(("current_bidamount_" + artId))
858868 let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId)
859869 let bidData = getStringByKey((bidDataKey + "_OPEN"))
860870 if ((bidData == ""))
861871 then throw("Bid not found")
862872 else {
863873 let bidDataArr = split(bidData, "_")
864874 let assetId = getBidAssetId(bidDataArr[0])
865875 let bidStatus = "CANCELED"
866876 [DeleteEntry((bidDataKey + "_OPEN")), StringEntry(((bidDataKey + "_") + bidStatus), ((bidData + "_") + toString(date))), IntegerEntry(("current_bidamount_" + artId), (bidNbr - 1)), ScriptTransfer(Address(fromBase58String(returnMoneyTo)), parseIntValue(bidDataArr[1]), assetId)]
867877 }
868878 }
869879 }
870880
871881
872882 @Verifier(tx)
873883 func verifier () = match tx {
874884 case inv: InvokeScriptTransaction =>
875885 if (if (if (if ((inv.function == "addArtwork"))
876886 then (inv.dApp == this)
877887 else false)
878888 then (inv.fee == 500000)
879889 else false)
880890 then (inv.feeAssetId == unit)
881891 else false)
882892 then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[13])))
883893 else if (if (if (if ((inv.function == "updateArtwork"))
884894 then (inv.dApp == this)
885895 else false)
886896 then (inv.fee == 500000)
887897 else false)
888898 then (inv.feeAssetId == unit)
889899 else false)
890900 then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[12])))
891901 else if (if (if (if ((inv.function == "sellArtwork"))
892902 then (inv.dApp == this)
893903 else false)
894904 then (inv.fee == 500000)
895905 else false)
896906 then (inv.feeAssetId == unit)
897907 else false)
898908 then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[5])))
899909 else if (if (if (if ((inv.function == "acceptBid"))
900910 then (inv.dApp == this)
901911 else false)
902912 then (inv.fee == 500000)
903913 else false)
904914 then (inv.feeAssetId == unit)
905915 else false)
906916 then sigVerify_128Kb(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[4])))
907917 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
908918 case _ =>
909919 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
910920 }
911921

github/deemru/w8io/169f3d6 
101.81 ms