Problem Mock & package.json
This commit is contained in:
+20
-18
@@ -1,26 +1,11 @@
|
||||
// imports
|
||||
const { ethers, run, network } = require("hardhat");
|
||||
const { exit } = require("process");
|
||||
|
||||
// async main
|
||||
async function main() {
|
||||
const verifyOnly = false;
|
||||
if (verifyOnly == true) {
|
||||
const address = "0xF90F7edF515001CD4293255bfaF7D17ffa415e91";
|
||||
|
||||
const ETHERSCAN_API_KEY_VERIFY = process.env.ETHERSCAN_API_KEY;
|
||||
console.log("Network config:", network.config);
|
||||
console.log("ChainId: " + network.config.chainId);
|
||||
if (network.config.chainId === 11155111) {
|
||||
console.log("Currently on Sepolia Testnet");
|
||||
if (ETHERSCAN_API_KEY_VERIFY !== undefined) {
|
||||
console.log("Verifying contract...");
|
||||
await verify(address, []);
|
||||
console.log("Verification complete");
|
||||
} else {
|
||||
console.log("ETHERSCAN_API_KEY is undefined");
|
||||
}
|
||||
}
|
||||
if (true) return;
|
||||
if (false) {
|
||||
await runVerifyOnly("0xF90F7edF515001CD4293255bfaF7D17ffa415e91");
|
||||
}
|
||||
|
||||
const simpleStorageFactory =
|
||||
@@ -85,6 +70,23 @@ async function verify(contractAddress, args) {
|
||||
}
|
||||
}
|
||||
|
||||
async function runVerifyOnly(address) {
|
||||
const ETHERSCAN_API_KEY_VERIFY = process.env.ETHERSCAN_API_KEY;
|
||||
console.log("Network config:", network.config);
|
||||
console.log("ChainId: " + network.config.chainId);
|
||||
if (network.config.chainId === 11155111) {
|
||||
console.log("Currently on Sepolia Testnet");
|
||||
if (ETHERSCAN_API_KEY_VERIFY !== undefined) {
|
||||
console.log("Verifying contract...");
|
||||
await verify(address, []);
|
||||
console.log("Verification complete");
|
||||
} else {
|
||||
console.log("ETHERSCAN_API_KEY is undefined");
|
||||
}
|
||||
}
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// main
|
||||
main()
|
||||
.then(() => process.getMaxListeners(0))
|
||||
|
||||
Reference in New Issue
Block a user