entranceFee is undefined #6443
khushbusandhu
started this conversation in
General
Replies: 1 comment 6 replies
-
|
in your helper hardhat-hardhat-config your chain id is 32337 It needs to be 31337. Let me know it works :) |
Beta Was this translation helpful? Give feedback.
6 replies
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.
-
hi everyone
i am getting this error while running the deploy scripts
here is my helper-hardhat-config
const { ethers, hardhatArguments } = require("hardhat") const networkConfig = { 11155111: { name: "sepolia", vrfCoordinatorV2: "0x8103B0A8A00be2DDC778e6e7eaa21791Cd364625", gasLane: "0x474e34a077df58807dbe9c96d3c009b23b3c6d0cce433e59bbf5b34f823bc56c", subscriptionId: "0", entranceFee: ethers.parseEther("0.01"), callbackGasLimit: "500000", interval: "30", }, 32337: { name: "hardhat", gasLane: "0x474e34a077df58807dbe9c96d3c009b23b3c6d0cce433e59bbf5b34f823bc56c", entranceFee: ethers.parseEther("0.01"), callbackGasLimit: "500000", interval: "30", }, } const deploymentChains = ["hardhat", "localhost"] module.exports = { networkConfig, deploymentChains, }here is deploy.raffle.sol
const { network, getNamedAccounts, ethers } = require("hardhat") const { developmentChains, networkConfig } = require("../helper-hardhat-config") const { verify } = require("../utils/verify") const VRF_SUB_FUND_AMOUNT = ethers.parseEther("2") module.exports = async function ({ getNamedAccounts, deployments }) { const { deploy, log } = deployments const { deployer } = await getNamedAccounts() const chainId = network.config.chainId let vrfCoordinatorV2Address, subscriptionId if (chainId == 31337) { const vrfCorrdinatorV2Mock = await ethers.getContract("VRFCoordinatorV2Mock") vrfCoordinatorV2Address = vrfCorrdinatorV2Mock.address const transactionResponse = await vrfCorrdinatorV2Mock.createSubscription() const transactionReceipt = await transactionResponse.wait(1) subscriptionId = transactionReceipt.logs[0].args.subId await vrfCorrdinatorV2Mock.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 mocks...") await verify(raffle.address, args) } log("---------------------------------------------") }Beta Was this translation helpful? Give feedback.
All reactions