Comments (12)
Closing for now, if it's an issue with the M1... I won't be much help here sorry :/
from brownie_fund_me.
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 brownie run scripts/deploy.py
?
Or... did you install with pipx
or pip
?
from brownie_fund_me.
I am getting the same error after adding
`def withdraw():
fund_me = FundMe[-1]
account = get_account()
fund_me.withdraw({"from": account})
def main():
fund()
withdraw()`
ERROR
`Brownie v1.17.1 - Python development framework for Ethereum
BrownieFundMeProject is the active project.
Running 'scripts/fund_and_withdraw.py::main'...
2500000
The current entry fee is 2500000
Funding
Transaction sent: 0x9338b42c7e89fcad35465d855aa7e2db78f9891b26fa611aa7b654ed08411fb4
Gas price: 20.0 gwei Gas limit: 61207 Nonce: 27
FundMe.fund confirmed Block: 28 Gas used: 55643 (90.91%)
File "brownie/_cli/run.py", line 54, in main
_include_frame=True,
File "brownie/project/scripts.py", line 103, in run
return_value = f_locals[method_name](*args, **kwargs)
File "./scripts/fund_and_withdraw.py", line 23, in main
withdraw()
File "./scripts/fund_and_withdraw.py", line 18, in withdraw
fund_me.withdraw({"from": account})
File "brownie/network/contract.py", line 1625, in call
return self.transact(*args)
File "brownie/network/contract.py", line 1509, in transact
allow_revert=tx["allow_revert"],
File "brownie/network/account.py", line 657, in transfer
silent,
File "brownie/network/account.py", line 727, in _make_transaction
raise VirtualMachineError(e) from None
File "brownie/exceptions.py", line 121, in init
raise ValueError(str(exc)) from None
ValueError: Gas estimation failed: 'execution reverted: VM Exception while processing transaction: invalid opcode'. This transaction will likely revert. If you wish to broadcast, you must set the gas limit manually.`
from brownie_fund_me.
@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
from brownie_fund_me.
There might be something wrong with your local network... what happens when you remove the network flag?
from brownie_fund_me.
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.
from brownie_fund_me.
Right, that makes sense. I'm thinking it's something wrong with your local chain... what happens when you try it on a testnet?
from brownie_fund_me.
If I run deploy.py and then fund_and_withdraw.py (w/o redeploying the mocks) I get the same error:
Brownie v1.17.1 - Python development framework for Ethereum
BrownieFundMeProject is the active project.
Running 'scripts/fund_and_withdraw.py::main'...
11912418682380178
The current entry fee is 11912418682380178
Funding
File "brownie/_cli/run.py", line 50, in main
return_value, frame = run(
File "brownie/project/scripts.py", line 103, in run
return_value = f_locals[method_name](*args, **kwargs)
File "./scripts/fund_and_withdraw.py", line 27, in main
fund()
File "./scripts/fund_and_withdraw.py", line 13, in fund
tx = fund_me.fund({"from": account, "value": entrance_fee})
File "brownie/network/contract.py", line 1625, in __call__
return self.transact(*args)
File "brownie/network/contract.py", line 1498, in transact
return tx["from"].transfer(
File "brownie/network/account.py", line 644, in transfer
receipt, exc = self._make_transaction(
File "brownie/network/account.py", line 727, in _make_transaction
raise VirtualMachineError(e) from None
File "brownie/exceptions.py", line 121, in __init__
raise ValueError(str(exc)) from None
ValueError: Gas estimation failed: 'execution reverted: You need to spend more ETH!'. This transaction will likely revert. If you wish to broadcast, you must set the gas limit manually.
I also have ~17.5 ETH in my Rinkeby test account.
from brownie_fund_me.
ValueError: Gas estimation failed: 'execution reverted: You need to spend more ETH!'
This means you're not sending enough ETH, and your entrance fee is off. How are you getting the entrance fee?
from brownie_fund_me.
I cloned your repo and added my .env file. Same code.
from brownie_fund_me.
Do you have ETH in your metamask?
from brownie_fund_me.
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.
from brownie_fund_me.
Related Issues (20)
- CompilerError HOT 1
- compile error HOT 1
- constructor sequece HOT 2
- test_only_owner_can_withdraw() doesnt work with Ganache UI v2.5.4 HOT 4
- IndexError: list index out of range HOT 5
- Test Failed HOT 1
- ValueError: execution reverted: VM Exception while processing transaction: revert Please Help HOT 2
- Please Help ValueError: execution reverted: VM Exception while processing transaction: revert unable to run Fund_and_withdraw.py script #1560 HOT 2
- Invalid API Key
- if get_account(): File line, line 988, in times] RecursionError: maximum recursion depth exceeded
- TypeError: 'NoneType' object is not subscriptable HOT 1
- ConnectionError: Status 404 when getting package versions from Github: 'Not Found' HOT 1
- ValueError: sender doesn't have enough funds to send tx. The upfront cost is: 9475020000000000 and the sender's account only has: 0 HOT 2
- Key Error HOT 2
- Compiler error HOT 1
- I have issue with verify contract when deploy on sepolia HOT 1
- Attribute Erroor HOT 1
- ValueError: Explorer API not set for this network
- ConnectionError: HTTPSConnectionPool(host='0.0.0.0', port=8545): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000001D3FBD86B00>: Failed to establish a new connection: [WinError 10049]
- I can't verify the source code HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brownie_fund_me.