-
Notifications
You must be signed in to change notification settings - Fork 64
Deploying ganache-local w/brownie: VM Exception while processing transaction: invalid opcode #6
Comments
Thanks for the kind words! This is likely due to the function you're calling... it doesn't like what you're doing. What happens when you use just the regular development network? Like Or... did you install with |
I am getting the same error after adding `def withdraw(): def main(): ERROR BrownieFundMeProject is the active project. Running 'scripts/fund_and_withdraw.py::main'... File "brownie/_cli/run.py", line 54, in main |
@PatrickAlphaC I installed with pipx. This was initially in the discussion here if you want to see all of the things we have tried. One user got it working. A few others have this same issue |
There might be something wrong with your local network... what happens when you remove the network flag? |
If I import deploy_fund_me() and run it prior to running fund() & withdraw() to ganache-cli it works properly. If I don't do that it can't find an instance of FundMe[-1]. I believe that happens because ganache-cli isn't persistent. |
Right, that makes sense. I'm thinking it's something wrong with your local chain... what happens when you try it on a testnet? |
If I run deploy.py and then fund_and_withdraw.py (w/o redeploying the mocks) I get the same error:
I also have ~17.5 ETH in my Rinkeby test account. |
This means you're not sending enough ETH, and your entrance fee is off. How are you getting the entrance fee? |
I cloned your repo and added my .env file. Same code. |
Do you have ETH in your metamask? |
I have Rinkeby eth as well. I was able to get this to work on ganache-local when I reinstalled on old machine. This appears to be a conflict with my installation/environment. @cromewar suggested I uninstall my versions of Python and try to reinstall them. I was excited getting a new MacBook Pro M1 Max Pro next week, but I've heard that there are some issues with web3 and the new silicon. :/ I do appreciate your help @PatrickAlphaC. If you can suggest how I might be able to diagnose - that would be great. If not, please feel free to close this ticket. |
Closing for now, if it's an issue with the M1... I won't be much help here sorry :/ |
Thanks for an amazing class Patrick. I taught myself to code 3 years ago and wish I did it 33 years ago! :)
Issue
I am going through brownie simple storage part of this course. The initial deploy,.py works properly, but I keeping getting some variation of invalid opcode and the transaction is reverting when I try to deploy to ganache-local. I am able to run the tests in this project to development/ganache-cli, but fail with ganache-local and Rinkeby.
I am experiencing the same issues as I am with my own code base. I decided to test with a clone of this repo as 'bss' and replacing .env files with my info and am experiencing the same issues. I'm on MacOS.
Steps to reproduce & Troubleshooting
brownie run scripts/deploy.py --network ganache-local
brownie run scripts/fund_and_withdraw.py --network ganache-local
fund_me.withdraw({"from": account})
->fund_me.withdraw({"from": account, 'gas_limit': 6721975})
Environment
Brownie
v.1.17.1
Ganache CLI
v6.12.2 (ganache-core: 2.13.2)
Node
v16.8.0
Npm
v7.21.0
Truffle
v5.0.22
The only part of the code that has been changed from the repo is adding the gas_limit. Still happy to share the code if request. For the life of me, I can't figure what invalid opcode is causing this to revert . . . Any help would be greatly appreciated!
Thanks in advance!
@GratefulDave
The text was updated successfully, but these errors were encountered: