I encountered a similar issue recently. The problem might be in your asynchronous handling. Try modifying your deployNFT function to use await properly:
This ensures the contract is fully deployed before you try to access its address. Also, make sure your Hardhat configuration is correct and you’re running on the right network. Let me know if this resolves your issue.
hey SparklingGem, i ran into this too. try adding await token.deployed() before logging the address. sometimes the contract isn’t fully deployed when you try to access it. also, double-check your contract name matches in the getContractFactory call. hope this helps!
hey sparklingGem! that’s a tricky one for sure. have you tried wrapping your deploy function in a main() and using async/await? something like this might work:
this way, you’re making sure everything’s properly awaited. also, double check your contract file name matches ‘MyNFT’ exactly. sometimes those little things trip us up! let me know if that helps or if you need more ideas?