eth-brownie / brownie

A Python-based development and testing framework for smart contracts targeting the Ethereum Virtual Machine.
https://eth-brownie.readthedocs.io
MIT License
2.65k stars 553 forks source link

Namespace collision when fetching a contract from etherscan #888

Closed Macarse closed 3 years ago

Macarse commented 3 years ago

Environment information

Repro steps

Open a console with brownie console --network mainnet-fork and run:

a = Contract.from_explorer("0x1D415aa39D647834786EB9B5a333A50e9935b796")

Output is

Fetching source of 0x1D415aa39D647834786EB9B5a333A50e9935b796 from api.etherscan.io...
  File "<console>", line 1, in <module>
  File "brownie/network/contract.py", line 909, in from_explorer
    _DeployedContractBase.__init__(self, address, owner)
  File "brownie/network/contract.py", line 455, in __init__
    self._check_and_set(abi["name"], fn)
  File "brownie/network/contract.py", line 474, in _check_and_set
    raise AttributeError(f"Namespace collision: '{self._name}.{name}'")
AttributeError: Namespace collision: 'AddressConfig._owner'
iamdefinitelyahuman commented 3 years ago

Ooof, that's a hard one.

Related to #718

iamdefinitelyahuman commented 3 years ago

Fixed in #961