2

I'm new to ERC721 and have some question on it. I was following some tutorial and have question on constructor. The question parts are below.

constructor(string memory baseURI) ERC721("NFT Collectible", "NFTC") {
        setBaseURI(baseURI);
}

I understood what is memory but still don't know what is symbol and name in there. Can I change it randomly? What is the purpose of those? And Where can I find that symbol and name? That's my question. I'm freshman in blockchain so some terms are unfamiliar. So it will be great help if someone tells in details.

Alchemist
  • 325
  • 1
  • 17

3 Answers3

1

Yes, you can change it randomly. It does not matter if you have ERC20 or ERC721 token. Both of them need to have a name and a symbol. Let's say we have us dollar. So the name is "United States dollar" and symbol is "USD".

It is same for your tokens, you need to give them some name and symbol according to the ERC721 technical standard.

  • Thanks. I understand now. But how the people know my symbol and name? For example We know United States Dollar name and USD symbol from google and currency. Where that symbol and name appear? – Alchemist Jul 11 '22 at 12:41
  • 2
    Let's check for example the most famous NFT (ERC721 is NFT) collection BAYC - https://etherscan.io/address/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d. You can see there name "BoredApeYachtClub" and symbol "BAYC" in TokenTracker field. Other think is you can put your collection on Opensea. Opensea also takes your name and shows it. – David Tilšer Jul 11 '22 at 13:49
  • Thanks. I understand clearly now. It was great help. – Alchemist Jul 11 '22 at 18:16
0

@dev Initializes the contract by setting a name and a symbol to the token collection.

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

you can give your own token name and symbol for more info you can read this openzeppelin doc

Akhil
  • 411
  • 4
  • 13
0

I do not know the purpose of name and symbol but I think that the purpose of ERC721 is to not effect on our nft that we posted on any nft platform example like opensea, Rarible etc. if some how nft marketplaces are hacked then it not be effected.

Joy
  • 1