I made a dApp for minting NFTs. I tried to mint one on the Polygon Mumbai Testnet. The transaction went through and I got a hash, but the NFT isn’t showing up in my wallet.
Here’s my smart contract:
pragma solidity ^0.8.1;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract CoolNFTs is ERC721, Ownable {
uint256 public constant TOTAL_SUPPLY = 15;
uint256 public constant MINT_COST = 0.02 ether;
uint256 public currentTokenId = 1;
constructor() ERC721("CoolNFTs", "COOL") {}
function createNFT() public payable {
require(currentTokenId <= TOTAL_SUPPLY, "All NFTs have been minted");
require(msg.value >= MINT_COST, "Insufficient funds sent");
_safeMint(msg.sender, currentTokenId);
currentTokenId++;
}
function withdrawFunds() public onlyOwner {
uint256 contractBalance = address(this).balance;
payable(msg.sender).transfer(contractBalance);
}
}
Any ideas on what might be causing this? I’m stuck and could use some help figuring it out.
yo mia, had similar issues b4. check if ur using the right contract address in ur dapp. sometimes the testnet deploy gives a diff address than expected. also, try minting again - mumbai can be finicky. if nothin works, maybe theres a bug in the contract? gl with ur project!
Have you verified your contract on Polygonscan? This step is crucial for transparency and debugging. If not, I’d recommend doing so immediately. It allows you to interact with your contract directly through Polygonscan, which can help isolate whether the issue is with your contract or your dApp’s frontend.
Also, consider implementing event logging in your contract. Something like:
event NFTMinted(address to, uint256 tokenId);
function createNFT() public payable {
// ... existing code ...
emit NFTMinted(msg.sender, currentTokenId);
}
This would provide clear on-chain evidence of minting, viewable on Polygonscan. If you see the event but not the NFT, it might indicate a metadata or frontend issue rather than a contract problem.
hey there mia, sounds like you’re having a tricky time with your nft project! i’m curious, have you double-checked that your wallet is connected to the mumbai testnet? sometimes wallets can be sneaky and switch networks without us noticing 
also, how long did you wait after the transaction? occasionally it can take a bit for nfts to show up, especially on testnets. have you tried looking up the transaction on polygonscan to see if there’s any additional info?
oh, and one more thing - does your dapp have a function to view minted nfts? that could be a good way to confirm if the mint actually went through on the contract side.
let me know what you find out! i’m really interested in nft projects and would love to hear more about what you’re working on 