Skip to content

Instantly share code, notes, and snippets.

@polluterofminds
Last active February 3, 2022 20:47
Show Gist options
  • Save polluterofminds/405441ff8791a3941d745a0777b1632c to your computer and use it in GitHub Desktop.
Save polluterofminds/405441ff8791a3941d745a0777b1632c to your computer and use it in GitHub Desktop.
Mint an NFT from hardhat script
const hre = require("hardhat");
async function main() {
try {
const Contract = await hre.ethers.getContractFactory("AvalancheNFTDrop");
const contract = await Contract.attach(
"YOUR CONTRACT ADDRESS" // The deployed contract address
);
let overrides = {
value: ethers.utils.parseEther((0.5).toString()),
};
const tx = await contract.mint("YOUR TEST WALLET ADDRESS");
console.log("Minted: ", tx);
} catch (error) {
console.log(error);
}
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment