Closed ericwooley closed 6 years ago
Hi @ericwooley - I'm guessing that if you increase your gas limit (add the gas
parameter to the contract deploy operation) this won't fail anymore.
If this still fails, then my suspicion is that it's caused by the same problem causing this issue, which we believe to be an ethereumjs-vm bug, at the moment.
That said, even if you can make it succeed by increasing the gas limit, if you're running the exact same request on geth and/or parity and it succeeds, but then it fails on ganache, this is likely still a bug.
@benjamincburns You are correct, increasing the gas allowed it to go through. Is there anything the can be done to allow the gas to be estimated correctly?
When It fails, i am just allowing meta mask to estimate the gas.
The interesting part is that in the receipt, it says that the transaction cost was the same that metamask was estimating.
I have to give it almost double the amount of gas for it to be successful.
@benjamincburns In regards to the ethereumjs-vm bug, I ran through it with the remix version of the ethereumjs-vm runner, and it was successful. I don't know what version either project uses though.
Although, remix doesn't estimate gas, it sets it at 3000000 by default
I played around with remix ethereumjs-vm, and it does succeed with manual gas, that is very very close to what metamask is estimating.
In regards to the ethereumjs-vm bug, I ran through it with the remix version of the ethereumjs-vm runner, and it was successful
@ericwooley thanks! that's really encouraging. I know we're at least one release behind, and I've been meaning to update. I'll give that a go today or tomorrow and report back.
@ericwooley we're addressing gas estimation issues in https://github.com/trufflesuite/ganache-core/issues/26 which should give a high water mark estimation. In that issue, there will be a link at some point to another issue where we'll work more accurate estimation using a VM step handler. I'm going to close this issue in favor of https://github.com/trufflesuite/ganache-core/issues/26
Thanks!
When running ganache, deploying a contract from a contract method errors.
Expected Behavior
Successful transaction
Current Behavior
Error: VM Exception while processing transaction: revert
Possible Solution
:( only way to proceed ATM is geth private network as far as I can tell.
Steps to Reproduce (for bugs)
500, true
You should see the following the remix console.
Running the same steps with a geth private network success. remix-scenarios.zip
Context
Contract Factory pattern, for deploying a contract from another contract method, with an optional donation.
Your Environment