Skip to content

sets the aggregator addresses correctly: ReferenceError: fundMe is not defined #6539

Answered by NIAZELOPER
karthikeh02 asked this question in Q&A
Discussion options

You must be logged in to vote

The error says that there is no variable named fundme. This is because you have initialized fundme and MockV3Aggregator variables inside the BeforeEach() , therefore describe block of constructor does not know fundme variable.

To fix issue Change the code from:

describe("FundMe", async () => {
    beforeEach(async function () {
        let fundMe
        let deployer
        let MockV3Aggregator
        //deploy our fundme contract
        // using hardhat deploy
        deployer = (await getNamedAccounts()).deployer
        await deployments.fixture(["all"])
        fundMe = await ethers.getContractAt("FundMe", deployer)
        MockV3Aggregator = await ethers.getContractAt(
            "…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by karthikeh02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants