-
-
Save kevinjanada/b464731b93553a729c728ffb7d925d52 to your computer and use it in GitHub Desktop.
hardhat-tasks-tutorial
This file contains 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
// tasks/verify-etherscan.ts | |
import { task, types } from "hardhat/config"; | |
task("verify-etherscan", "Verify deployed contract on Etherscan") | |
.addParam("contractAddress", "Contract address deployed", undefined, types.string) | |
.setAction(async ({ contractAddress }: { contractAddress: string }, hre) => { | |
try { | |
await hre.run("verify:verify", { | |
address: contractAddress, | |
contract: 'contracts/NFT.sol:NFT' // <path-to-contract>:<contract-name> | |
}) | |
} catch ({ message }) { | |
console.error(message) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment