const sendEth = ethers.utils.parseUnits("0.1")
describe("fund", async function () {
   it("update the amount funded data structure", async function () {
      const options = { value: sendEth }
      await fundMe.fund(options)
      const response = await fundMe.addressToAmount(deployer)
      await assert.equal(response.toString(), sendEth.toString())

Error message

1) FundMe
         update the amount funded data structure:
     Error: invalid address or ENS name (argument="name", value=undefined, code=INVALID_ARGUMENT, version=contracts/5.7.0)
      at Logger.makeError (node_modules\@ethersproject\logger\src.ts\index.ts:269:28)
      at Logger.throwError (node_modules\@ethersproject\logger\src.ts\index.ts:281:20)
      at Logger.throwArgumentError (node_modules\@ethersproject\logger\src.ts\index.ts:285:21)
      at C:\Users\user\OneDrive\Desktop\BlockChain\hardhat-fundme\node_modules\@ethersproject\contracts\src.ts\index.ts:123:16
      at step (node_modules\@ethersproject\contracts\lib\index.js:48:23)
      at Object.next (node_modules\@ethersproject\contracts\lib\index.js:29:53)
      at fulfilled (node_modules\@ethersproject\contracts\lib\index.js:20:58)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)
      at runNextTicks (node:internal/process/task_queues:65:3)
      at listOnTimeout (node:internal/timers:528:9)

Can someone help me out with this? I'm running in this error.

  • Its complicated to know where is the issue since you're actually doing more than 1 transaction in your test; I suggest that you make no more than 1 transaction per test.. that way you can narrow down your issue
    – Casareafer
    Commented Jan 21, 2023 at 6:36
  • if you can add more code it would be helpful to find out the issue (a feeling says the deployer is undefined here) Commented Jan 21, 2023 at 15:53


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.