LESSON 7:TypeError: verify is not a function #1078
Answered
by
alymurtazamemon
chiranjeev13
asked this question in
Q&A
-
Hi all I am getting this error while deploying using rinkeby i have tried a lot of things but nothing is working...Can you guys please help me out.. This is const { network } = require("hardhat");
const {
networkConfig,
developmentChains,
} = require("../helper-hardhat-config");
const { verify } = require("../utils/verify");
const chainId = network.config.chainId;
const ethUsdPriceFeedAddress = networkConfig[chainId]["ethUsdPriceFeed"];
module.exports = async ({ getNamedAccounts, deployments }) => {
const { deploy, log } = deployments;
const { deployer } = await getNamedAccounts();
let ethUsdPriceFeedAddress;
if (developmentChains.includes(network.name)) {
const ethUsdAggregator = await deployments.get("MockV3Aggregator");
ethUsdPriceFeedAddress = ethUsdAggregator.address;
log("*****");
console.log(ethUsdPriceFeedAddress);
} else {
ethUsdPriceFeedAddress = networkConfig[chainId].ethUsdPriceFeed;
console.log(ethUsdPriceFeedAddress);
}
const args = [ethUsdPriceFeedAddress];
const FundMe = await deploy("FundMe", {
from: deployer,
args: args,
log: true,
waitConfirmations: network.config.blockConfirmations || 1,
});
if (
!developmentChains.includes(network.name) &&
process.env.ETHERSCAN_API_KEY
) {
await verify(FundMe.address, args);
}
log("------------------------------");
};
module.exports.tags = ["all", "fundme"]; This is const { run } = require("hardhat");
const verify = async (contractAddress, args) => {
console.log("Verifying contract....");
try {
await run("verify:verify", {
address: contractAddress,
constructorArguments: args,
});
} catch (e) {
if (e.message.toLowerCase().includes("already verified")) {
console.log("Already Verified!");
} else {
console.log(e);
}
}
}; The error I am getting
|
Beta Was this translation helpful? Give feedback.
Answered by
alymurtazamemon
Jul 18, 2022
Replies: 2 comments 5 replies
-
Can you send the repo for this and link here - makes it much easier for me diagnose. Thank you |
Beta Was this translation helpful? Give feedback.
3 replies
-
@chiranjeev13 You are not exporting verify function. |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
chiranjeev13
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@chiranjeev13 You are not exporting verify function.