I’ve been working on building an NFT minting script and running into some problems. I followed an online guide but it seems outdated and I’m stuck on the final minting step.
Here’s my current script:
// scripts/deploy-nft.js
require("dotenv").config();
const { ethers } = require("ethers");
const tokenABI = require("../artifacts/contracts/CoolCats.sol/CoolCats.json");
const contractABI = tokenABI.abi;
const networkProvider = ethers.getDefaultProvider("goerli", {
alchemy: process.env.ALCHEMY_KEY,
});
const userWallet = new ethers.Wallet(process.env.WALLET_PRIVATE_KEY, networkProvider);
const coolCatsContract = new ethers.Contract(
process.env.DEPLOYED_CONTRACT_ADDRESS,
contractABI,
userWallet
);
const executeScript = () => {
coolCatsContract
.mintToken(process.env.WALLET_PUBLIC_KEY)
.then((result) => console.log(result))
.catch((error) => console.log("minting failed", error));
};
executeScript();
I’m getting a weird error about “quorum not met” when trying to estimate gas. The contract deployed successfully so I’m using that address. My environment variables are set up correctly but something is still breaking. Has anyone seen this kind of error before when minting NFTs? What could be causing the gas estimation to fail?