A bit of messing around with Hardhat and ERC20 deployments. I've deployed a created and tried to mint tokens for an account using this small snippet of code:
const ERC20 = await hre.ethers.getContractFactory("ERC20");
const deployUSDC = await ERC20.deploy("USD Coin", "USDC");
console.log("USDC token address: ", deployUSDC.address);
const mintToken = await deployUSDC._mint(deployer.address, { value: ethers.utils.parseEther("2048") })
console.log(mintToken.hash)
However I'm getting this error when trying to call the _mint
function:
TypeError: deployUSDC._mint is not a function
I've also tried calling mint
just in case, but I am getting the same error.
Anyone would a solution or an explanation of what I am doing wrong here please? So that I'd be able to mint tokens.