Created
January 13, 2022 16:10
-
-
Save polluterofminds/3b197112c365ee0b2dcf85bdba3fc254 to your computer and use it in GitHub Desktop.
Get Token URI with Hardhat
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 | |
); | |
const uri = await contract.tokenURI(1); | |
console.log("Token URI: ", uri); | |
} 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