solidity - Metadata is not showing on opensea

2022-10-04 11:53 View 13

i am trying to develop a nft mint daap. 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

the steps i am following: deploy the token, enable public mint , setting the tokenUri.


// 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;
        maxPerWallet= 25;

      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;
            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 {
Catetory: GameFi Keyword: ERC721
Source Edit Drop Recommend Share

© Ore Star   
View on Mobile