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

ethers.getContract is not a function #173

Open
nenadV91 opened this issue Aug 30, 2023 · 1 comment
Open

ethers.getContract is not a function #173

nenadV91 opened this issue Aug 30, 2023 · 1 comment

Comments

@nenadV91
Copy link

On fresh clone when run hh run ./scripts/readPrice.js i get

TypeError: ethers.getContract is not a function

My dependencies

  "devDependencies": {
    "@chainlink/contracts": "0.5.1",
    "@ethersproject/abi": "^5.7.0",
    "@ethersproject/providers": "^5.7.1",
    "@nomicfoundation/hardhat-chai-matchers": "^1.0.3",
    "@nomicfoundation/hardhat-network-helpers": "^1.0.6",
    "@nomicfoundation/hardhat-toolbox": "^2.0.0",
    "@nomiclabs/hardhat-ethers": "^2.1.1",
    "@nomiclabs/hardhat-etherscan": "^3.1.0",
    "@typechain/ethers-v5": "^10.1.0",
    "@typechain/hardhat": "^6.1.3",
    "chai": "^4.3.6",
    "ethers": "^5.7.1",
    "hardhat": "^2.11.2",
    "hardhat-gas-reporter": "^1.0.9",
    "husky": "^8.0.1",
    "lint-staged": "^13.0.3",
    "prettier": "^2.7.1",
    "prettier-plugin-solidity": "^1.0.0-beta.24",
    "solhint": "^3.3.7",
    "solhint-plugin-prettier": "^0.0.5",
    "solidity-coverage": "^0.8.2",
    "typechain": "^8.1.0"
  },
@mscurtescu
Copy link

Yeah, readPrice.js is broken. Latest version of hardhat does not provide a getContract function, it was replaced with getContractAt, but this one requires the contract address.

I guess that this script was was replaced by the read-price-feed task. The task requires an explicit contract address argument, it is not trying to read it from the deployment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants