Last active
February 3, 2022 20:47
-
-
Save polluterofminds/405441ff8791a3941d745a0777b1632c to your computer and use it in GitHub Desktop.
Mint an NFT from hardhat script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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