Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardhat not recognizing functions in my contract as functions #4478

Closed
eik-1 opened this issue Oct 15, 2023 · 1 comment
Closed

Hardhat not recognizing functions in my contract as functions #4478

eik-1 opened this issue Oct 15, 2023 · 1 comment
Assignees
Labels
status:needs-more-info There's not enough information to start working on this issue

Comments

@eik-1
Copy link

eik-1 commented Oct 15, 2023

Version of Hardhat

2.18.1

What happened?

I am writing tests for my smart contracts.
I am using deployments.get() to get my deployed contracts.
fundMe = await deployments.get("FundMe", deployer)

Now if I use fundMe.fund() in the testing code, it will give me an error:

TypeError: fundMe.fund is not a function

While if I use fundMe.fund instead, it will work just fine.
So the main problem arises when I have to enter the parameters for a function which I can't without using ().

Minimal reproduction steps

Add hardhat-deploy,hardhat-deploy-ethers and hardhat using yarn.
Override hardhat-ethers using the command

yarn add --dev @nomicfoundation/hardhat-ethers@npm:hardhat-deploy-ethers ethers

Write unit test for contracts.
Use the functions inside the contract using () at the end of function name.

Search terms

Testing

@fvictorio
Copy link
Member

Hey @eik-1, sorry but we'll need more detailed reproduction steps. Ideally a repository with a
minimal reproducible example that we can just clone and run some commands to reproduce the problem.

@fvictorio fvictorio added status:needs-more-info There's not enough information to start working on this issue and removed status:triaging labels Oct 16, 2023
@fvictorio fvictorio closed this as not planned Won't fix, can't repro, duplicate, stale Nov 10, 2023
@github-project-automation github-project-automation bot moved this from Backlog to Done in Hardhat Nov 10, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:needs-more-info There's not enough information to start working on this issue
Projects
Archived in project
Development

No branches or pull requests

2 participants