-
I am getting an error at around the 15: 20 mark when deploying the mocks. "TypeError: 1000000000 is not a function". I'd appreciate anybodys help. Thank you! Here is my 00-deply-mocks.js: const { network } = require("hardhat")
const { developmentChains } = require("../helper-hardhat-config")
const BASE_FEE = ethers.utils.parseEther("0.25") //0.25 is the premium . It costs 0.25 link per request
const GAS_PRICE_LINK = 1e9
module.exports = async function ({ getNamedAccounts, deployments }) {
const { deploy, log } = deployments
const { deployer } = await getNamedAccounts()
const args = [BASE_FEE, GAS_PRICE_LINK]
if (developmentChains.includes(network.name)) {
log("Local network detected! deploying mocks...")
// deploy a mock vrfCoordinator...
await deploy("VRFCoordinatorV2Mock", {
from: deployer,
log: true,
args: args,
})
log("Mocks Deployed!!!")
log("----------------------------")
}
}
module.exports.tags = ["all", "mocks"] helper-hardhat-config.js: const { ethers } = require("hardhat")
const networkConfig = {
4: {
name: "rinkeby",
vrfCoordinatorV2: "0x6168499c0cFfCaCD319c818142124B7A15E857ab",
entranceFee: ethers.utils.parseEther("0.01"),
gasLane: "0xd89b2bf150e3b9e13446986e571fb9cab24b13cea0a43ea20a6049a85cc807cc", // 30 gwei
subscriptionId: "0",
callbackGasLimit: "500000", // 500,000
interval: "30",
},
31337: {
name: "hardhat",
entranceFee: ethers.utils.parseEther("0.01"),
gasLane: "0xd89b2bf150e3b9e13446986e571fb9cab24b13cea0a43ea20a6049a85cc807cc", // 30 gwei
callbackGasLimit: "500000", // 500,000
interval: "30",
},
}
const developmentChains = ["hardhat", "localhost"]
module.exports = {
networkConfig,
developmentChains,
} Link to github repo |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
can you push it on github and share the link |
Beta Was this translation helpful? Give feedback.
-
I think you by mistake put a parenthesis in line 5 after '1e9' const GAS_PRICE_LINK = 1e9( the closing parenthesis is in line 29, so the whole deploy script basically becomes the input to a function. remove the parenthesis and see if it works |
Beta Was this translation helpful? Give feedback.
can you push it on github and share the link