ERC721 | Solidity 0.8

Поделиться
HTML-код
  • Опубликовано: 18 сен 2024

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

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

    0:00 - Intro
    0:49 - State variables
    3:31 - Function supportsInterface
    4:32 - Function balanceOf
    5:18 - Function ownerOf
    5:54 - Function setApprovalForAll
    7:36 - Function approve
    9:08 - Function getApproved
    10:03 - Internal function _isApprovedOrOwner
    11:00 - Function transferFrom
    13:18 - Function safeTransferFrom
    15:57 - Fix compiler errors
    16:29 - Internal function _mint
    18:00 - Internal function _burn
    19:04 - Create custom NFT
    Code
    solidity-by-example.org/app/erc721
    Take a course
    www.smartcontract.engineer/

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

    Thanks for the video, you might consider talking about the variations that exist: Fractional NFTs, Dynamic NFTs.

  • @MrCoreyTexas
    @MrCoreyTexas 2 месяца назад

    Also, it looks like this is the first time overloaded functions have been introduced (2 variants of safeTransferFrom)

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

    Wonderful! Thanks

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

    thanks a lot

  • @_chonkov
    @_chonkov Год назад +2

    Hi, there. Can somebody explain to me how does the safeTransferFrom function checks whether or not a contract has implemented a function to safely transfer nfts so that they do not get locked? From what I've so far understood, we just use a function selector to see if it exists, but how does that help?

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

      I am also curious about this. Not sure why the safe check is made after transferring the token. Isn't it better to not transfer if it is not safe?

  • @MrCoreyTexas
    @MrCoreyTexas 2 месяца назад

    Also I don't think you have introduced bytes4 or bytesN formally? Solidity is really a huge thing

  • @MrCoreyTexas
    @MrCoreyTexas 2 месяца назад

    I believe this is the first time you've used the type() operator?

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

    Thanks for the video, why are you using nested functions? Like _mint inside mint? Does it have any deep reason?

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

      I haven;t watched the tutorial yet, but I've seen this pattern in different contracts, my best guess is because the mint() function is public and it allows to be called from anyone, whereas the _mint() function is a private function that can only be called from within the contract itself.... You can think of this pattern as a way to allow you to validate a number of things in the public function before calling the private function.... I'll try to update my answer after I watch the video :)

  • @Abdullah-b8t8m
    @Abdullah-b8t8m Месяц назад

    Why there is return in balanceOf() function but not in ownerof() After require.

  • @user-qf2fm4js1z
    @user-qf2fm4js1z Год назад

    At 3:24, you say "mapping isApprovedForAll " is a implementation of function isApprovedForAll , so it mean "mappimg" is one kind of "function?

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

      Solidity automatically creates view functions for public state variables

    • @MrCoreyTexas
      @MrCoreyTexas 2 месяца назад

      @@smartcontractprogrammer Probably would help to point that out explicitly, until now I've only seen auto generated view functions for simple types like uint or address. It's interesting how it converts a mapping of a mapping into a function with 2 arguments. I think the challenge in teaching is putting yourself in the position of the student who doesn't know what you know yet :) So at first I was thinking, "Oh, I guess it's OK in solidity to have a function and a state variable with the same name. I guess he's going to implement the function later".

  • @user-qf2fm4js1z
    @user-qf2fm4js1z Год назад

    Excellent! Thanks so much! Will you have the part-2 course of ERC 721 to handle the baseURI and tokenURI which for integrate with NFT platform like Opensea? I am so confused on the baseURI and URI part and can't display my NFT image file on Opensea by code.

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

    I was wondering the require statement of the approve function has not _approvals[tokenId] == msg.sender also in them. If someone is approved for a single token, they should also be allowed to approve another address no?