1

so I'm getting this error on my deploy script. I have seen the other questions and have tried their solutions but they are not working for me.

So this is my deploy script

const { netowrk, network, ethers } = require("hardhat")
const { developmentChains, networkConfig } = require("../helper-hardhat-config")
const { verify } = require("../helper-hardhat-config")


const VRF_SUB_FUND_AMOUNT = ethers.utils.parseEther("30")

module.exports = async function ({ getNamedAccounts, deployment }) {
    const { deploy, log } = deployments
    const { deployer } = await getNamedAccounts()
    const chainId = network.config.chainId
    let vrfCoordinatorV2Address, subscriptionId

    if (developmentChains.includes(network.name)) {
        const vrfCoordinatorV2Mock = await ethers.getContract("VRFCoordinatorV2Mock")
        vrfCoordinatorV2Address = vrfCoordinatorV2Mock.address
        const transactionRepsonse = await vrfCoordinatorV2Mock.createSubscription()
        const transactionRecepit = await transactionRepsonse.wait(1)
        subscriptionId = transactionRecepit.events[0].args.subId

        await vrfCoordinatorV2Mock.fundSubscription(subscriptionId, VRF_SUB_FUND_AMOUNT)
    } else {
    vrfCoordinatorV2Address = networkConfig[chainId]["vrfCoordinatorV2"]
    subscriptionId = networkConfig[chainId]["subscriptionId"]
}


const entranceFee = networkConfig[chainId]["entraceFee"]
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(netowrk.name) && process.env.ETHERSCAN_API_KEY) {
    log("Verifying...")
    await verify(raffle.address, args)
}

log("----------------------------------------------")
}

module.exports.tags = ["all", "raffle"]

And this is my helper-hardhat-config

const { ethers } = require("hardhat")

const networkConfig = {
    4: {
        name: "rinkeby",
        subscriptionId: "6926",
        gasLane: "0xd89b2bf150e3b9e13446986e571fb9cab24b13cea0a43ea20a6049a85cc807cc", // 30 gwei
        keepersUpdateInterval: "30",
        raffleEntranceFee: "100000000000000000", // 0.1 ETH
        callbackGasLimit: "500000", // 500,000 gas
        vrfCoordinatorV2: "0x6168499c0cFfCaCD319c818142124B7A15E857ab",
    },
    31337: {
        name: "localhost",
        subscriptionId: "588",
        gasLane: "0xd89b2bf150e3b9e13446986e571fb9cab24b13cea0a43ea20a6049a85cc807cc", // 30 gwei
        keepersUpdateInterval: "30",
        raffleEntranceFee: "100000000000000000", // 0.1 ETH
        callbackGasLimit: "500000", // 500,000 gas
    },
}

const developmentChains = ["hardhat", "localhost"]

module.exports = {
    networkConfig,
    developmentChains,
}

Thanks in advance, been stuck on this for the past 12 hours and not show on how to move on.

2
  • OP did you ever figure this out? I just completed this same exact tutorial (Chainlink) and got the same bigNumber errror. Have no idea how to fix it. PLease let me know if you found a solution. Thanks
    – Blockpain
    Aug 3, 2022 at 2:52
  • Yeah I soved the issue, I had spelling mistakes with interval. The best solution is go over it again. Aug 3, 2022 at 13:11

1 Answer 1

0

The issue is happening since one of the parameters that you are passing to args while deploying the ruffle contract is undefined or wrong. Just check your specified args (constructor arguments) via applying console.log(args). Then you will see which parameter is wrong.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.