Skip to content

Lesson 6: fund_me = FundMe[-1] not working in fund_and_withdraw.py scriptΒ #675

Open
@nikhsha

Description

When trying to run fund_and_withdraw.py script from terminal, I get the following error:

Running 'scripts/fund_and_withdraw.py::main'...
  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 24, in main
    fund_me = FundMe[-1]
  File "brownie/network/contract.py", line 173, in __getitem__
    return self._contracts[i]
IndexError: list index out of range

I've already run deploy.py successfully and the contract is visible on my local Ganache client. This error doesn't seem to occur when I deploy on Rinkeby, despite nothing else changing. How can I avoid this so I can test on local?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions