Reputation: 385
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.
Upvotes: 2
Views: 1851
Reputation: 1
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.
Upvotes: 0
Reputation: 81
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.
Upvotes: 1
Reputation: 435
@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
Upvotes: 0