Open dreammonkey opened 2 years ago
The issue happened cause the default gas limit per block in local ganache chain was lower than 10 million.
As of the writing this reply, the gas limit on Mainnet is a minimum of 15 million. It is expandable, as per requirement, with the maximum being 30 million.
Thanks for your answer, I tested some more and I was able to run the test and deploy the contract to the Ropsten Network using a gas price of 3 million. Removing the need to overwrite the ganache default block gas limit.
This makes me wonder: is this a normal process to go through when developing/deploying a contract ? Should one estimate in advance what would be an adequate gas price for a contract ?
Clearly larger contracts and contracts with a larger computational cost consume more gas, but how can we properly check the gas that contracts are likely to consume. I think this is not really addressed during the course...
(1) Gas Price of 3 million!!! Just be careful of the 'gas price'. Don't use such large values for mainnet.
(2) is this a normal ..... a contract ? No. It's not. Soon you will start using forked chains and also gas-reporters to understand your deployment costs and also, gas costs for each function. You will have to be mindful of your gas consumption.
(3) how ..... to consume? Please search for npm package gas-reporter. You should integrate that.
Hi,
In the kickstart project test script I ran into an issue where ganache was refusing to deploy the CampaignFactory.
It turned out I had to augment the gasLimit to 10 million when deploying:
After that the following error appeared:
Apparently I also needed to raise the global gasLimit in the ganache provider:
This resolved the issue and successfully deployed the factory on the test network. But I have yet to find the reason why this was needed ? And more importantly what would be the consequences when deploying this on the MainNet ?
Are there any thoughts on this ?
Best Regards, Diederik