Gas-Limit – How to Increase Block Gas Limit in Hardhat

gas-limithardhat

I'm just running some tests with massive functions, and I keep running into

InvalidInputError: Transaction gas limit is 30429720 and exceeds block gas limit of 30000000

How do I increase the block gas limit in hardhat?

Best Answer

If your hardhat.config.js increase the blockGasLimit

module.exports = {
    defaultNetwork: "hardhat",
    networks: {
        hardhat: {
            blockGasLimit: 100000000429720 // whatever you want here
        },
    }
}
Related Topic