Lesson 9: Error Thrown when executing hh test and hh deploy. Would appreciate some help. #5425
egutierrez130
started this conversation in
General
Replies: 1 comment 1 reply
-
|
vrfCoordinatorV2Address = vrfCoordinatorV2Mock.address (remove vrfCoordinatorV2Mock.address) and try VRFCoordinatorV2Mock.address |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
const { network, ethers } = require("hardhat") const { developmentChains, networkConfig } = require("../helper-hardhat-config") const { verify } = require("../utils/verify") const VRF_SUB_FUND_AMOUNT = ethers.utils.parseEther("2") module.exports = async ({ getNamedAccounts, deployments }) => { const { deploy, log } = deployments const { deployer } = await getNamedAccounts() const chainId = network.config.chainId let vrfCoordinatorV2Address, subscriptionId, vrfCoordinatorV2Mock if (developmentChains.includes(network.name)) { const VRFCoordinatorV2Mock = await ethers.getContract("VRFCoordinatorV2Mock") vrfCoordinatorV2Address = vrfCoordinatorV2Mock.address const transactionResponse = await vrfCoordinatorV2Mock.createSubscription() const transactionReceipt = await transactionResponse.wait(1) subscriptionId = transactionReceipt.events[0].args.subId // Fund the subscription // Usuall, you'd need the link token on a real network await vrfCoordinatorV2Mock.fundSubscription(subscriptionId, VRF_SUB_FUND_AMOUNT) } else { vrfCoordinatorV2Address = networkConfig[chainId]["vrfCoordinatorV2"] subscriptionId = networkConfig[chainId]["subscriptionId"] } const entranceFee = networkConfig[chainId]["entranceFee"] const gasLane = networkConfig[chainId]["gasLane"] const callbackGasLimit = networkConfig[chainId]["callbackGasLimit"] const interval = networkConfig[chainId]["interval"] const args = [ vrfCoordinatorV2Address, entranceFee, gasLane, subscriptionId, callbackGasLimit, interval, ] const raffle = await deploy("Raffle", { from: deployer, args: args, log: true, waitConfirmations: network.config.blockConfirmations || 1, }) if (!developmentChains.includes(network.name) && process.env.ETHERSCAN_API_KEY) { log("Verifying...") await verify(raffle.address, args) } log("---------------------------------------") } module.exports.tags = ["all", "raffle"]Hello on this 01-deploy-raffle.js file, I am running into the following error when running hh test and hh deploy in the terminal.
Can someone tell me what's going on?
Thank you so much!
Also, here is a link to my repo if needed.
Beta Was this translation helpful? Give feedback.
All reactions