LESSON 09 : TypeError: Cannot read properties of undefined (reading 'JsonRpcProvider') #5345
-
Hello everyone, I'm encountering an error while trying to deploy some mock contracts for my Hardhat smart contract project. Specifically, I'm getting the following error message: Error: ERROR processing skip func of /home/ubuntu/folder/hardhat-smartcontract-lottery/deploy/00-deploy-mocks.js: TypeError: Cannot read properties of undefined (reading 'JsonRpcProvider') I'm not sure what's causing this error, and I would appreciate any help or insights that anyone might have. Here's the relevant code from my deployment/00-deploy-mocks.js script: const { deployments, network, ethers } = require("hardhat")
const { developmentChains } = require("../helper-hardhat-config")
const BASE_FEE = ethers.utils.parseEther("0.25") // Cost 0.25 Link
const GAS_PRICE_LINK = 1e9 // Link per gas
module.exports = async function ({ getNamedAccounts, deployments }) {
const { deploy, logs } = deployments
const { deployer } = await getNamedAccounts()
const chainId = network.config.chainId
const args = [BASE_FEE, GAS_PRICE_LINK]
if (developmentChains.includes(network.name)) {
log("Local network detected! deploying mocks...")
// deploy a mock contract
await deploy("VRFCoordinatorV2Mock", {
from: deployer,
log: true,
args: args
})
log("Mocks Deployed")
log("---------------------------------------------")
}
}
module.exports.tags = ["all", "mocks"] I'm not sure what's causing the Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
The problem has been resolved I degraded my ethers version to ReferenceError: log is not defined |
Beta Was this translation helpful? Give feedback.
-
I didn't it is done by Vs code 😅 |
Beta Was this translation helpful? Give feedback.
@Umairulislam Why you have abstracted your contract? Remove the abstract keyword from the contract.