Gas-Limit

增加塊氣體限制安全帽

  • April 12, 2022

我只是在執行一些具有大量功能的測試,而且我一直遇到

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

如何增加安全帽中的塊氣體限制?

如果你hardhat.config.js增加blockGasLimit

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

引用自:https://ethereum.stackexchange.com/questions/113706