ERC721 safeMint should return the tokenId
When auto increment ids are enabled, shouldn't the method also then return tokenId? Otherwise how would you know what token was minted?
Otherwise how would you know what token was minted?
Do you mean when you invoke this function off-chain? In that case you would use the Transfer event, and in fact the return value wouldn't be available.
Or do you have another scenario in mind?
The contract caller doesn't know the value of the new tokenId that was generated. I'm suggesting an implementation like this:
function safeMint(address to) public onlyOwner returns (uint256) {
uint256 tokenId = _tokenIdCounter.current();
_tokenIdCounter.increment();
_safeMint(to, tokenId);
return tokenId;
}
can i work on this issue @ericglau
@EthixLucifer Sure, thanks. You can find development setup steps in the readme.