this is my contract:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
contract Franklin is ERC721 , ERC721URIStorage , Ownable
{
using Counters for Counters.Counter;
Counters.Counter private _tokenIdCounter;
constructor() ERC721("Franklin","FRK"){}
function _baseURI() internal pure override returns (string memory) {
return "https://example.com/nft/";
}
function safeMint(address to, string memory uri) public onlyOwner {
uint256 tokenId = _tokenIdCounter.current();
_tokenIdCounter.increment();
_safeMint(to, tokenId);
_setTokenURI(tokenId, uri);
}
function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) {
super._burn(tokenId);
}
function tokenURI(uint256 tokenId)
public
view
override(ERC721, ERC721URIStorage)
returns (string memory)
{
return super.tokenURI(tokenId);
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721,ERC721URIStorage) returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
and this is hardhat.config.js:
require("@nomicfoundation/hardhat-toolbox");
module.exports = {
solidity: "0.8.17",
networks: {
mumbai: {
url: "https://rpc-mumbai.maticvigil.com",
accounts: ["my private key"]
}
}
};
and this is deploying file(deploy.js):
async function main()
{
async function main() {
const nft = await ethers.deployContract("Franklin",["FRK"]);
await nft.waitForDeployment();
console.log("SimpleStorage Contract Address:", await nft.getAddress());
await nft.mint("https://ipfs.io/ipfs/QmWLSYkLAdFLL8UJeVST75V3sbuUwg5Jhs1eoFrnWr6BK7");
console.log("NFT Success mint!");
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error)
process.exit(1)
})
}
When I type the following code, my contract is not deployed and no error is given, and it is exactly as follows:
PS C:\Users\D-W\Desktop\franklin> npx hardhat run scripts/deploy.js
PS C:\Users\D-W\Desktop\franklin>
what's the solution?