-
the error i'm getting is
code: const { network, ethers, getChainId } = require("hardhat")
const {
developementChains,
networkConfig,
} = require("../helper-hardhat.config")
const { verify } = require("../utils/verify")
module.exports = async ({ getNamedAccounts, deployments }) => {
const { deploy, log } = deployments
const { deployer } = await getNamedAccounts()
const chainId = network.config.chainId
let vrfCoordinatorV2Address
if (chainId == 31337 /*developementChains.includes(network.name)*/) {
const vrfCoordinatorV2Mock = await ethers.getContract(
"VRFCoordinatorV2Mock"
)
vrfCoordinatorV2Address = vrfCoordinatorV2Mock.address
const transactionResponse =
await vrfCoordinatorV2Mock.createSubsctiption()
const transactionRecepit = await transactionResponse.wait(1)
subscriptionId = transactionRecepit.events[0].args.subId
} else {
vrfCoordinatorV2Address = networkConfig[chainId]["vrfCoordinatorV2"]
subscriptionId = networkConfig[chainId]["subscriptionId"]
}
const entranceFee = networkConfig[chainId]["lotteryEntranceFee"]
const gasLane = networkConfigp[chainId]["gasLane"]
const callbackGasLimit = networkConfig[chainId]["callbackGasLimit"]
const interval = networkConfig[chainId]["keepersUpdateInterval"]
const args = [
vrfCoordinatorV2Address,
entranceFee,
gasLane,
subscriptionId,
callbackGasLimit,
interval,
]
const lottery = await deploy("Lottery", {
from: deployer,
args: args,
log: true,
waitConfirmationms: network.config.blockConfirmations || 1,
})
if (chainId != 31337 && process.env.ETHERSCAN_API_KEY) {
log("verify...")
await verify(lottery.address, args)
}
log("--------------------------------------------")
}
module.exports.tags = ["all", "deploy"] |
Beta Was this translation helpful? Give feedback.
Answered by
krakxn
Jul 23, 2022
Replies: 1 comment 2 replies
-
Context: Problem: There is a typo above. Can be fixed by copying mine. Solution: Hope this helps!! |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context:
await vrfCoordinatorV2Mock.createSubsctiption()
Problem: There is a typo above. Can be fixed by copying mine.
Solution:
await vrfCoordinatorV2Mock.createSubscription()
Hope this helps!!