i deploy the erc 721 contract on bsc test net(0x5542bD28FD0D8c22D4AC7D51E62735Ac32d32374) The mint function is working but the metadata is not showing on opensea test net. for metadata and image i am using pinata, here is the link for metadata
https://gateway.pinata.cloud/ipfs/Qmcchbbm2R6CdiwsYbcoLPcY7PSi7yska9HzDCvK977mMU.
the steps i am following: deploy the token, enable public mint , setting the tokenUri.
code
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract Minter is ERC721, Ownable{
string private baseTokenURI;
uint256 public mintPrice;
uint256 public totalSupply;
uint256 public maxSupply;
uint256 public maxPerWallet;
bool public isPublicMintEnabled;
address public withdrawWallet;
mapping (address=> uint256) public walletMints;
constructor() payable ERC721("NFTTutorial", "NFT") {
mintPrice= 1 ether;
totalSupply = 0;
maxSupply=14400;
maxPerWallet= 25;
withdrawWallet=0x658385eb2Abf80C76DEeF0d99491d41Fd7B638ff;
}
function setIspublicMintEnable( bool isPublicMintEnabled_) external onlyOwner{
isPublicMintEnabled= isPublicMintEnabled_;
}
function mint(uint256 quantity_) public payable{
require(isPublicMintEnabled,"minting not enabled");
//require(msg.value== quantity_* mintPrice, " wrong mint value");
require(totalSupply+quantity_<= maxSupply,"sold out");
require(walletMints[msg.sender]+ quantity_<= maxPerWallet);
for (uint256 i=0; i <quantity_; i++){
uint256 newTokenId=totalSupply+1;
totalSupply++;
walletMints[msg.sender] = walletMints[msg.sender] + quantity_;
_safeMint(msg.sender, newTokenId);
}
}
/// @dev Returns an URI for a given token ID
function _baseURI() internal view virtual override returns (string memory) {
return baseTokenURI;
}
/// @dev Sets the base token URI prefix.
function setBaseTokenURI(string memory _baseTokenURI) public {
baseTokenURI = _baseTokenURI;
}
function withdraw(address payable _to, uint _amount) public {
_to.transfer(_amount);
}
}