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

fix: handle add deployment when source not in _source object #1290

Conversation

skellet0r
Copy link
Collaborator

@skellet0r skellet0r commented Oct 12, 2021

What I did

In some rare cases, the _sources attribute of a contract will be missing sources. When adding a contract to the cache, this results in an exception being thrown, even though the contract compiled successfully.

Here I just handled the situation by reading in the source file at the path provided, instead of expecting it to be in the sources object.

Fixes: #1047
Related: #1269

How I did it

How to verify it

Everything should pass as normal, and one should be able to import this contract from etherscan 0xee8389d235e092b2945fe363e97cdbed121a0439, you should have openzeppelin contracts version 3.2.0 installed

brownie pm install OpenZeppelin/openzeppelin-contracts@3.2.0

Checklist

  • I have confirmed that my PR passes all linting checks
  • I have included test cases
  • I have updated the documentation
  • I have added an entry to the changelog

@skellet0r
Copy link
Collaborator Author

Same issue here, infura endpoint getting hit too much, needs cooldown

@skellet0r skellet0r force-pushed the fix/add-deployment-from-etherscan branch from 8fb7cb2 to 945b8f9 Compare October 12, 2021 21:26
@iamdefinitelyahuman iamdefinitelyahuman merged commit 38cdf8d into eth-brownie:master Oct 12, 2021
@skellet0r
Copy link
Collaborator Author

wooooo

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

Successfully merging this pull request may close these issues.

Contract.from_explorer('0xee8389d235e092b2945fe363e97cdbed121a0439') errors
2 participants