PatrickAlphaC / hardhat-fund-me-fcc

82 stars 184 forks source link

Error: insufficient funds for intrinsic transaction cost #139

Closed JaysonYator closed 1 year ago

JaysonYator commented 1 year ago

I keep getting this error while running the staging test. Here's my code

const { getNamedAccounts, ethers, network } = require("hardhat");
const { developmentChains } = require("../../helper-hardhat-config");
const { assert } = require("chai");

developmentChains.includes(network.name)
  ? describe.skip
  : describe("FundMe", function () {
      let FundMe;
      let deployer;
      const sendValue = ethers.utils.parseEther("1");
      beforeEach(async function () {
        deployer = (await getNamedAccounts()).deployer;
        FundMe = await ethers.getContract("FundMe", deployer);
      });
      it("Allows people to withdraw", async function () {
        await FundMe.fund({ value: sendValue });
        await FundMe.withdraw();
        const endingBalance = awaitFundMe.provider.getBalance(FundMe.address);
        assert.equal(endingBalance.toString(), 0);
      });
    });
PatrickAlphaC commented 1 year ago

Can you:

  1. Make this a discusson on the full repo? https://github.com/smartcontractkit/full-blockchain-solidity-course-js/
  2. Follow this section for formatting questions? https://www.youtube.com/watch?t=19846&v=gyMwXuJrbJQ&feature=youtu.be