-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.js
35 lines (25 loc) · 875 Bytes
/
deploy.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const hre = require("hardhat");
async function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
async function main() {
// Deploy the CryptoDevs Contract
const nftContract = await hre.ethers.deployContract("TVCharactersNFT");
// wait for the contract to deploy
await nftContract.waitForDeployment();
// print the address of the deployed contract
console.log("NFT Contract Address:", nftContract.target);
// Sleep for 30 seconds while Etherscan indexes the new contract deployment
await sleep(30 * 1000); // 30s = 30 * 1000 milliseconds
// Verify the contract on etherscan
await hre.run("verify:verify", {
address: nftContract.target,
});
}
// Call the main function and catch if there is any error
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});