Giter VIP home page Giter VIP logo

Comments (12)

PatrickAlphaC avatar PatrickAlphaC commented on August 28, 2024 1

Closing for now, if it's an issue with the M1... I won't be much help here sorry :/

from brownie_fund_me.

PatrickAlphaC avatar PatrickAlphaC commented on August 28, 2024

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.

Madgeniusblink avatar Madgeniusblink commented on August 28, 2024

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.

GratefulDave avatar GratefulDave commented on August 28, 2024

@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.

PatrickAlphaC avatar PatrickAlphaC commented on August 28, 2024

There might be something wrong with your local network... what happens when you remove the network flag?

from brownie_fund_me.

GratefulDave avatar GratefulDave commented on August 28, 2024

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.

PatrickAlphaC avatar PatrickAlphaC commented on August 28, 2024

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.

GratefulDave avatar GratefulDave commented on August 28, 2024

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.

PatrickAlphaC avatar PatrickAlphaC commented on August 28, 2024
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.

GratefulDave avatar GratefulDave commented on August 28, 2024

I cloned your repo and added my .env file. Same code.

from brownie_fund_me.

PatrickAlphaC avatar PatrickAlphaC commented on August 28, 2024

Do you have ETH in your metamask?

from brownie_fund_me.

GratefulDave avatar GratefulDave commented on August 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.