-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathverify.ts
32 lines (27 loc) · 1.05 KB
/
verify.ts
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
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { TASK_ETHERSCAN_VERIFY } from "hardhat-deploy";
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { run } = hre;
if (!["rinkeby", "mainnet", "kovan", "sokol", "xdai"].includes(hre.network.name)) {
return;
}
if (!process.env.INFURA_KEY) {
console.log(
`Could not find Infura key in env, unable to connect to network ${hre.network.name}`
);
return;
}
console.log("Verification of NFT in etherscan...");
console.log("Waiting for 1 minute before verifying contracts...");
// Etherscan needs some time to process before trying to verify.
await new Promise((resolve) => setTimeout(resolve, 60000));
console.log("Starting to verify now");
await run(TASK_ETHERSCAN_VERIFY, {
apiKey: process.env.ETHERSCAN_KEY_API,
license: "GPL-3.0",
solcInput: true,
forceLicense: true, // we need this because contracts license is LGPL-3.0-only
});
};
export default func;