HOW NFT SMART CONTRACTS REALLY WORK - Can metadata be changed? How staking works?

Поделиться
HTML-код
  • Опубликовано: 10 июн 2024
  • Fundamental knowledge you must know when working with NFTs. A must watch video for the whole NFT ecosystem wether you are a developer, flipper or noob.
    This video is NOT sponsored. Some product links are affiliate links, which means if you buy something I'll receive a small commission 😇
    ▬▬ TELEPORT YOURSELF ▬▬
    00:00 Intro
    01:43 Find Smart Contract of a collection
    03:10 Get owner of an NFT
    04:16 Get NFT art & metadata
    08:23 Set & change art & metadata
    10:14 Get how many NFTs an address has
    11:11 Get total supply of NFTs
    12:46 Withdraw money from NFT contract
    14:39 How NFT Staking works
    18:45 Summary
    19:35 Next videos to watch 👀
    ▬▬ LINKS MENTIONED IN THIS VIDEO ▬▬
    ✪ Etherscan: etherscan.io
    ✪ OpenSea: opensea.io
    ▬▬ NEXT VIDEOS TO WATCH ▬▬
    ✪ Which Blockchain to use for your NFT project?
    • Best Blockchain For NF...
    ✪ Build An App Like Instagram!
    • How To Create An App L...
    ▬▬ MY MISSION WITH THIS CHANNEL ▬▬
    Helping you launch your blockchain project as fast & easy as possible.
    Understand the market, learn blockchain coding, tools, tips & tricks, and much more.
    All on this one channel, at your convenience 🤩
    Make sure to subscribe ❤️
    My name is Michael Ionita, I am a blockchain developer, CTO and tech team builder: / michaelionita
    🚀 Let's go build some dApps! 🚀
    #blockchain #nfts #smartcontracts
  • ХоббиХобби

Комментарии • 87

  • @kesselrunner3724
    @kesselrunner3724 Год назад +3

    Congrats Michael. With this video I've learned more about how to understand a smart contract than any other video I've seen. Thanks!

  • @romankokhatskyi8137
    @romankokhatskyi8137 2 года назад +3

    Valuable video!! No basics, only important information for users who already have some experience with NFTs. Thank you!

  • @FansOfCrypto
    @FansOfCrypto 2 года назад +15

    Brilliant video, Michael. Can you also talk about what is exactly happening when you create an NFT on OpenSea or other marketplaces? What smart contract is that NFT attached to? Can you remove that item from OpenSea? Could you list it on another marketplace while it's listed on OpenSea? How would you do it so that once it's sold in one place, its status changes to sold everywhere?

    • @mikeross9193
      @mikeross9193 2 года назад +7

      Hey Arthur, I can only say to avoid minting the same nft on opensea with Rarible. Avoid Rarible because they make you pay gas fees to remove your own nft's once you upload it on their site, making it impossible to remove your own works/nft from their site. Rarible also can't unlink your crypto wallet once you provided your wallet address to your account on their site, which makes it even more frustrating. Opensea is much better setup for their users. BE WARNED and avoid Rarible.

  • @63montywilliams50
    @63montywilliams50 Год назад

    Good content bri. The intro was 💯. You covered all the edge cases andbfor someone who has been independently studying solidy and web3 for a while this is one that i know ill be watching multiple times

  • @yabuking84
    @yabuking84 Год назад

    Nice! been searching for this kind of video Thank you so much!

  • @BitcoinAndCryptoCurrency
    @BitcoinAndCryptoCurrency Год назад

    quick and informative, loved it

  • @frankrosato
    @frankrosato 2 года назад

    Thank you Michael, this was so helpful and exactly what I was looking for. Looking forward to consuming more of your content!

  • @MichaelAsiedu_
    @MichaelAsiedu_ 2 года назад +1

    Awesome video , Michael! Thank you for putting this up!

  • @user-jp8nh9im2f
    @user-jp8nh9im2f 2 года назад

    Hey, what a great video, I really enjoyed it and I would love to know more about the staking part. I’ll be waiting for more videos

  • @BitcoinAndCryptoCurrency
    @BitcoinAndCryptoCurrency Год назад

    very in-depth and informative

  • @priyadarshangupta
    @priyadarshangupta Год назад

    Awesome video !

  • @BitcoinAndCryptoCurrency
    @BitcoinAndCryptoCurrency Год назад

    a lot to learn and this video made it easy

  • @vishnuganeshan
    @vishnuganeshan Год назад

    Thank you😊, sir I'm supposed to start building the NFT project and I had a lot of doubts about it, but after watching this video my doubts are solved and u also taught me how to read, understand and think about Smart contracts and NFTs
    Once again Thanks Michael Ionita Sir 😇

  • @BitcoinAndCryptoCurrency
    @BitcoinAndCryptoCurrency Год назад

    I enjoyed this and learning more

  • @AlinAdrianPana
    @AlinAdrianPana 2 года назад

    Nice explanations and easy to understand for everyone. keep an eye on nft market!

  • @NFTs_In_Business
    @NFTs_In_Business Год назад

    Great I love it!

  • @deltavthrust
    @deltavthrust 2 года назад

    Nice NFT overview for metadata and basic ipfs. Thanks.

  • @guillaumepato7423
    @guillaumepato7423 2 года назад

    Great video my man

  • @lunlun2930
    @lunlun2930 2 года назад +1

    This video help me understand about contract. thx. can u make video about how to deploy a contract and start uploading the nft image?

  • @BarryMarkGee
    @BarryMarkGee 2 года назад

    Great video. Really informative. Thank you.

  • @SoniaRay
    @SoniaRay 2 года назад +1

    You are amazing!!

  • @BitcoinAndCryptoCurrency
    @BitcoinAndCryptoCurrency Год назад

    very good thanks

  • @swissgoldengiovana5706
    @swissgoldengiovana5706 2 года назад

    I do really appreciate your content, thank you

  • @PurpleEarB
    @PurpleEarB 2 года назад +1

    Awsome Video! Could you really make a video, about how to put smart contracts for staking and all import stuff into nfts. I am new in the space, and i am trying to implement all this kind of stuff into my NFTs. But I'm kind of struggling, because I am not a develop. It would be awesome if you could make a step by step explanation how to do all this.

  • @0xcoder542
    @0xcoder542 Год назад

    Hi Michael, thank you for creating such a great video. Indeed, I've learnt a lot from it. I have a quick question here, you mentioned about giving the "ownership" of the SC. I assume technically using the transferFrom function? Otherwise, please advise. Thanks in advance

  • @BitcoinAndCryptoCurrency
    @BitcoinAndCryptoCurrency Год назад

    starting out an this helps

  • @JohnFRodgers
    @JohnFRodgers 2 года назад

    Awesome! Learned new stuff right away! Useful stuff! All the other videos out there are either 1. blockchain/NFT for dummies (what is crypto?) or.. 2. "First, clone the repository, then download VS code, then download React, then go this link to download the key ingredient that isn't correct but you think it is, then spend the next 2 hours trying to figure out why this whole thing keeps failing on you! And nobody can/will answer your pleas for help anywhere."

    • @michaelionita
      @michaelionita  2 года назад

      Hahahaha, totally feel you.
      That is also why I plan to do a short but good video about how to write smart contracts.
      One for Coins, one for NFTs and one for Staking using be best method to date.
      What do you think?

    • @JohnFRodgers
      @JohnFRodgers Год назад

      @@michaelionita Solana, please. Ha ha ha

  • @BitcoinAndCryptoCurrency
    @BitcoinAndCryptoCurrency Год назад

    good videos here

  • @kinderfun4005
    @kinderfun4005 2 года назад

    Immediately subscribed! It's not easy to find quality content on those topic out there, thanks!

    • @michaelionita
      @michaelionita  2 года назад

      THANK YOU! Appreciate that a lot ❤️

  • @artintheraw
    @artintheraw 2 года назад

    Hi Michael! In the case that the artist grants the buyer usage rights of the image/song - would this be detailed in the smart contract or just in the description….or just in the “unlockable”

  • @nikhilkadam9255
    @nikhilkadam9255 2 года назад +1

    If someone minted their own nfts on contract overview: Opensea opentoken and token tracker: Opensea collection. Is it possible change make that NFTs own token tracker and contract overview?

  • @gabrielguzmanmelendez799
    @gabrielguzmanmelendez799 2 года назад

    Hello Michael Lonita, I have watched 3 videos and they are soo helpful I do not usually like videos but these ones are so good and well explained, I am doing an NFT project but I am still learning because I am new in the NFT space. Can we meet one day or can I show you at least my project? By the way, do you speak spanish?? Keep doing these videos! Best regards, Gabriel

  • @arestituyo
    @arestituyo 2 года назад

    Awesome video
    I would like you to explain how NFT call other smart contract as in Wizard and Dragon also how they can change the meta data after its launch
    Thank you

    • @michaelionita
      @michaelionita  2 года назад +1

      Sure, I can do that. Noted :)
      For Wizards and Dragons you can see that they have a contract to store all the SVGs, which they needed to set from the outside.
      Meaning, they can set it anytime to something else.
      This is the contract for that: etherscan.io/address/0xa895a9b7515452073d690dbe1f809536c83d1a35#writeContract
      Function is called uploadTraits().
      Hope it helped?

  • @aspenmallery
    @aspenmallery 2 года назад

    Was it invoking the source owner contract in order to change ownership of the pointer in your staking scenario? or if I were to stake an NFT, could associating it with the staking platforms contract also change the ownership so that the metadata can not be changed while staked?

  • @brandonfowler1592
    @brandonfowler1592 Год назад

    I was under the impression that it’s basically in limbo, but then if you are the owner, you have the choice to solidify the contract by minting the contract or freezing it via minting on the blockchain. Open sea has a lot to lose if they were to do anything shady. I get what you are saying though, there is definitely a gray area their.

  • @danielberg8437
    @danielberg8437 2 года назад

    Wow so different amd honestly messy VS native assets. Have you looked into how cardano handles nfts?

  • @TSumersberger
    @TSumersberger 2 года назад +4

    Great explanation, easily understandable for no-coders :) so basically, like with staking when a separate contract was pointed towards; when BAYC mutated its apes, it also pointed to a new contract creating a new NFT in a separate collection? instead of staking it created a new one. correct?
    I would love to hear more about IPFS how it works, how the version of different apes are created and stored on IPFS. that would be cool

    • @michaelionita
      @michaelionita  2 года назад

      Happy it helped you :)
      Well, the mutant apes are a different smart contract, which is also why they are a separate collection on OpenSea.
      So it was basically like minting a new ape but this time from the mutant contract.
      But the mutant contract checks which original ape you have, before it mints you a MAYC ape. This way it can mint you a mutated ape that is derived from your original one. Meaning, the developers coded it in a way that you don‘t het a random MAYC but you get one that is mutated starting off from the original one.
      It would take a bit too long to explain it here but if you want a video about it, let me know :)
      This all means that one contract can call another contract to read data from it.
      This way all contracts can interact with each other IF those functions have been programmed before deploying the contract as contracts cannot be changed after they are deployed. But of course there are „Proxy Contracts“ which make the whole story a bit more exciting :-D
Again a topic for a video, if you like?

    • @michaelionita
      @michaelionita  2 года назад +2

      PS: If you check the tokenURI() response from the MAYC contract you will get: boredapeyachtclub.com/api/mutants/2
      Meaning that the meta data of the MAYC is possibly not on IPFS but instead inside a database. But the images seem to be on IPFS.
      I suspect that all MAYC images for all mutations (M1, M2, M3) have been generated ahead of time and uploaded to IPFS.
      Then when you call tokenURI() the api gives you the JSON containing the link to the mutation you ACTUALLY have (on IPFS).
      Meaning the API has IPFS IDs of all mutations in a database somewhere.
      This is the MAYC contract btw: etherscan.io/address/0x60e4d786628fea6478f785a6d7e704777c86a7c6#readContract

  • @12copping
    @12copping 9 месяцев назад

    Great video!
    I was wondering if real world utility value promised by an artist is written in NFT contracts?
    Say for example an artist releases a collection of NFTs with the real world benefit of being entered into a competition to win physical prizes. Would the terms of the competition be in the smart contract? or if an added benefit of an NFT was being part of an online community, would this be written in the contract?
    Maybe a video touching on this topic would be great?
    Thanks

  • @cryptogirlusa
    @cryptogirlusa 2 года назад

    You mentioned in the video that you can do the withdraw function in a more secure way, how would you do that? Can you make another video discussing this please? And thank you for the great content! I’ve subscribed

    • @michaelionita
      @michaelionita  2 года назад +2

      Yes I meant the code should look like this rather:
      (sent, ) = SOMEADDRESS.call{value: SOMEAMOUNT}("");
      Reason:
      If the project sends funds to a multi-sig wallet (which is actually a smart contract itself) AND that contract costs too much gas to store your funds there, then the transaction will fail when using the transfer() function because that one is limited in how mich gas it can forward (which also has it's benefits). This can be detrimental for a project because IF it fails then the funds are stuck in the contract and are hard to get out if at all.
      If you want to be 100% sure that ALL the gas is forwarded to the next contract to have enough to execute all functions needed then it should use the call() method (which is NOT safe is many cases but in this case it is).
      Hope it helped?

  • @bappo92
    @bappo92 Год назад

    Great video but I have one question, who pays IPFS to store data? Thanks

  • @Tsynique
    @Tsynique 2 года назад

    Of the contract owner can just implement a function to lock the base URI forever. No need to remove the ownership then

  • @robllewellyn
    @robllewellyn Год назад

    Very useful and clear.. subscribed. I'm wondering how an NFT like Tiffany & Co works. Where the NFT checks if you have the NFT for an Ape and then allows you to order an irl necklace that they make for you...curious how that works.

    • @michaelionita
      @michaelionita  Год назад

      Oh I see. Yes that is possible.
      First you connect with your Metamask wallet.
      Then the Tiffany's can check IF you own an Ape (for example) and change prices or give you access to items if you do.
      Simple really.
      Tiffany's just need to know your address and the addresses of the NFT contracts it want to work with/support (Apes, Punks etc).

  • @BitcoinAndCryptoCurrency
    @BitcoinAndCryptoCurrency Год назад

    finally a solution against our current system

  • @crypto_is_not_a_scam
    @crypto_is_not_a_scam 2 года назад +1

    Hey Michael,
    thanks this was exactly what I was looking for really appreciate your help and Humour. & can I ask for another request, is their any way to remove || add any address from our not contract authority assuming during the time of mint we have given authority to 2 accounts but we lost control/ access to 1 of them.
    Thanks in Advance

    • @michaelionita
      @michaelionita  2 года назад +1

      Happy it helps!
      You can revoke Permission yes.
      But only if you are in control of the wallet address that you want to revoke permissions for of course.
      You need to know to which contract you have given permission in the first place.
      You can do that by checking transactions on your wallet address (etherscan etc) where it says "approve" or "setApprovalForAll".
      etherscan.io/address/YOUR_ADDRESS_HERE
      Then you go here: etherscan.io/tokenapprovalchecker and put the contract address. That took also helps you to revoke permissions.
      Hope this helps?

    • @crypto_is_not_a_scam
      @crypto_is_not_a_scam 2 года назад

      @@michaelionita and can u pls suggest something to do the same for multiple nft in 1 instruction. consider the case I have 1k nft mints with 2 authority account and 1 is a hardware wallet and I wanna revoke it's authority from all the nft's but oviously can't do it manually for all of those (In Solana)
      Thanks

  • @adityajain1450
    @adityajain1450 2 года назад

    Please tell something about nft launchpads like magic eden

  • @ovomesmaraphfu
    @ovomesmaraphfu 2 года назад +2

    Can someone "steal" your metadata? For example, I have seen many projects that are just basicly pixelized BAYC or they change only background layer. How do they do it and how to prevent that from happening?
    P.s. Excellent video, you are king

    • @drpflower75
      @drpflower75 2 года назад

      good question,plz reply its

  • @stephaneetcheto8988
    @stephaneetcheto8988 2 года назад

    👍👍👍

  • @pixel-house6461
    @pixel-house6461 2 года назад

    what's the difference between baseuri and hidden metadata uri?

  • @gabrielguzmanmelendez799
    @gabrielguzmanmelendez799 2 года назад

    Does this works for solana too?

  • @akscentarchitectsinteriors2437

    Hey Michael
    Your video helped me, Thank yuou.
    I have a question for you
    Can you just tell me that the TokenURI to be set at the time of deployment or after deployment and verification of smart contract on Etherscan as the Dev would ask the client for CID at the beginning of the contract.
    What are the best Possible ways that you would suggest Let me know

    • @michaelionita
      @michaelionita  Год назад +1

      Yes great question.
      The tokenURI is set after deployment because usually the NFTs are yet to be revealed.
      Meaning at first the tokenURI is set to a placeholder CID and once the reveal takes place, the CID is changed to the one pointing to the actual NFTs.
      Best practice is to set a custom variable in your smart contract usually called PROVENANCE to the final CID value. The function setting the PROVENANCE variable should not allow to call it twice.
      This way, once the PROVENANCE is set then it's final and cannot be changed.
      Now if the PROVENANCE does not equal the tokenURI CID then they changed the tokenURI which they shouldn't have done.
      Having said all of that, for games with changing NFT stats and looks this cannot work. Those will be subject to change all the time, and that's fine.
      Hope it helps?

    • @akscentarchitectsinteriors2437
      @akscentarchitectsinteriors2437 Год назад

      @@michaelionita yea it really helped thanks man.

  • @LealEdgar
    @LealEdgar 2 года назад

    Excellent video, another thing I wanted to add is the possibility of erasing the content of the IPFS (by the creator of the CID), this would mean that all the people who have their NFT cannot reveal the NFT and/or its properties. GL

  • @enriquevoss
    @enriquevoss 2 года назад

    Would be great to get a more in-depth video on the staking.

    • @michaelionita
      @michaelionita  2 года назад

      I hoped someone would say that :)
      Can‘t wait to talk more about it.
      What aspect of it do you want to know more about?

    • @enriquevoss
      @enriquevoss 2 года назад

      @@michaelionita I would love to see more of the code explained. I think not a lot of youtubers do that, explaining the code in a simple fashion. More on the functions etc.

    • @michaelionita
      @michaelionita  2 года назад +1

      @@enriquevoss I would love to do that. And I agree that not many explain it properly. I had to learn it the hard way because of that.
      Make sure to be subscribed and activate the bell to see when that video goes out.
      1-2 weeks from now.

  • @ja6920
    @ja6920 2 года назад

    If the image itself can be changed through changes to where its metadata is stored, then what is the non-fungible part?

    • @michaelionita
      @michaelionita  2 года назад

      The non fungible part is that you own an ID on the blockchain :-p
      Honestly.
      All the metadata, if not stored properly is useless to you.
      Solution: research the NFTs you want to own properly and check if they have a feature in the smart contract which revoked permission to change the matadata URL. Some have. Meaning the contract will always point to the same IPFS bucket and never change again. That would be a good implementation.
      But also keep in mind that not all NFTs can do that.
      Some have NFTs that are created over months and years, meaning they create new ones over time - in such cases IPFS is not very useful.

  • @0xmohit
    @0xmohit Год назад +2

    I have a question that can owner change the contract ?

    • @michaelionita
      @michaelionita  Год назад +1

      Yes you can call the Contract function called "renounceOwnership()" and define who the new owner should be.
      This is possible when a contract implements the "Ownable" interface.

    • @0xmohit
      @0xmohit Год назад +1

      @@michaelionita okay but I want to ask that if i deployed an NFT smart contract now I want to change something else like any security issue, can i modify the contract or once deployed contract can't be modified?

    • @michaelionita
      @michaelionita  Год назад +1

      ​@@0xmohit Once deployed the code cannot be modified. It's so called "immutable".
      The blockchain industry has come up with some "solutions" to that "problem".
      It's not really a problem as when you sign a contract you want it to never change again right? :)
      Which is why they are called smart Contracts.
      What you can do is add setter functions into your smart contract to be able to change variables after deploying the contract.
      You can't add new code or fix bugs but you can change variables like price, reveal URI, and so on.
      You can experiment with the "Coordinator Contract Pattern" or with "Upgradeable Contracts" if you want to have a bit more control after deploying the contract.
      Hope this made it a bit clearer?

    • @0xmohit
      @0xmohit Год назад

      @@michaelionita Thank you Michael for this amazing explanation :)

  • @rishiranjan9616
    @rishiranjan9616 2 года назад

    why dont you put up a tutorial for a mint website with coding solidity

    • @michaelionita
      @michaelionita  2 года назад

      Actually that is a great idea! Thanks!

  • @joaomirandaartista
    @joaomirandaartista Год назад

    does anyone know how to make my nft appear in opensea? he says he's not , content not available yet
    my collection is
    collection/turusu-forest in opensea , If anyone can help me

    • @michaelionita
      @michaelionita  Год назад

      You must mint at least 1 NFT for it to be able to actually show the data.
      Then OpenSea will call the function tokenURI() from your Smart Contract.
      That function must return a JSON in the right format: docs.opensea.io/docs/metadata-standards
      In that JSON there is a link to your image. That link must work.
      The same JSON also contains the title and description of your NFT.
      Hope this helps?