Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

running script "compare_crv_to_cvx.py" fails with ValueError #1

Open
markoinether opened this issue Sep 2, 2021 · 1 comment
Open

Comments

@markoinether
Copy link

Setup: WSL 1 under windows
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.3 LTS"

Problem:
in: lesson-17-applications-i

Here is the output when I run the script:

Brownie environment is ready.
>>> run('compare_crv_to_crv')
  File "<console>", line 1, in <module>
  File "brownie/project/scripts.py", line 42, in run
    script, project = _get_path(script_path)
  File "brownie/project/scripts.py", line 130, in _get_path
    raise FileNotFoundError(f"Cannot find {path_str}")
FileNotFoundError: Cannot find compare_crv_to_crv
>>> run('compare_crv_to_cvx')
  File "<console>", line 1, in <module>
  File "brownie/project/scripts.py", line 53, in run
    module = _import_from_path(script)
  File "brownie/project/scripts.py", line 149, in _import_from_path
    _import_cache[import_str] = importlib.import_module(import_str)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen, line line, in in
  File "<frozen, line line, in in
  File "<frozen, line line, in in
  File "<frozen, line line, in in
  File "<frozen, line line, in in
  File "<frozen, line line, in in
  File "./scripts/compare_crv_to_cvx.py", line 11, in <module>
    registry = load_contract("registry")
  File "./scripts/helpers/utils.py", line 13, in load_contract
    cont = Contract.from_explorer(addr)
  File "brownie/network/contract.py", line 1096, in from_explorer
    address = _resolve_address(address)
  File "brownie/network/web3.py", line 193, in _resolve_address
    return to_address(domain)
  File "brownie/convert/main.py", line 43, in to_address
    return str(EthAddress(value))
  File "brownie/convert/datatypes.py", line 204, in __new__
    raise ValueError(f"'{value}' is not a valid ETH address") from None
ValueError: 'registry' is not a valid ETH address
@zcor
Copy link
Collaborator

zcor commented Sep 2, 2021

This script stores some common curve contracts as aliases instead of contract addresses.
Run the script in lesson 16 to set aliases on your local machine and then this should work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants