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/
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.
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?
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 :)
@@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".
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?
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/
Thanks for the video, you might consider talking about the variations that exist: Fractional NFTs, Dynamic NFTs.
Also, it looks like this is the first time overloaded functions have been introduced (2 variants of safeTransferFrom)
Wonderful! Thanks
Also I don't think you have introduced bytes4 or bytesN formally? Solidity is really a huge thing
thanks a lot
I believe this is the first time you've used the type() operator?
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.
I don't have much knowledge on URI stuff
@@smartcontractprogrammer You will be an expert on that! I believe you!
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?
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?
Thanks for the video, why are you using nested functions? Like _mint inside mint? Does it have any deep reason?
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 :)
Why there is return in balanceOf() function but not in ownerof() After require.
different ways to return a value from a function
At 3:24, you say "mapping isApprovedForAll " is a implementation of function isApprovedForAll , so it mean "mappimg" is one kind of "function?
Solidity automatically creates view functions for public state variables
@@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".
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?
i don't think that's specified in the ERC721 standard