Skip to content

Latest commit

 

History

History
46 lines (34 loc) · 1.13 KB

ERC721Details.md

File metadata and controls

46 lines (34 loc) · 1.13 KB

ERC721

  • ERC721, is a standard for non-fungible tokens (NFTs) on the Ethereum blockchain
  • Non-fungible refers to items that cannot be replaced with something else without changing the value of the original item.
  • One NFT != Other NFT
  • unlike ERC20, ERC721 cannot be divide into pieces

Difference between ERC20 & ERC721

  • In ERC20 mapping will hold each user and balanes
contract ERC20 {
    mapping(address user => uint256 amount) private s_balances;
}
  • In ERC721 mapping will hold each unique token and who is the owner of it
contract ERC721 {
    mapping(uint256 tokenId => address owner) private s_owners;
}
  • Addition to that ERC721 also contain a tokenURI()
  • Each NFT will have its own metadata
  • Using metadata, tokenURI will make each token to be unique
contract ERC721 {
    function tokenURI() {}
}

Off chain Metadata

  • Get IPFS
  • Add Image to IPFS and get the hash
  • Add the Image hash in metadata and
  • Add metadata to IPFS and it will provide the tokenURI
  • Add tokenURI to the smart contract

Chainlink