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

Add basic support for ENS #216

Closed
iamdefinitelyahuman opened this issue Sep 19, 2019 · 0 comments · Fixed by #217
Closed

Add basic support for ENS #216

iamdefinitelyahuman opened this issue Sep 19, 2019 · 0 comments · Fixed by #217
Assignees
Labels
enhancement New feature or request priority Should be included in next release

Comments

@iamdefinitelyahuman
Copy link
Member

iamdefinitelyahuman commented Sep 19, 2019

The Issue

Brownie currently does not support the Ethereum Name Service.

Implementation

web3py already supports ENS, so all we have to do on this side is remove the check for a valid hexstring before passing along addresses. If a given address ends with .eth allow it with no checks, otherwise proceed as normal.

One issue is that attempts to resolve an ENS address via web3py raises an InvalidAddress if not connected to the main net. In situations where the user is using a different network we should connect to the main net via a temporary web3 instance, resolve the name, and disconnect. This will require a mainnet host declared in config.py, which means defining a standard name for that network. A similar behaviour will be needed for #175 - these two issues will likely end up handled together.

We should also be caching the resolved addresses on a per-session basis to avoid repetitive lookups.

@iamdefinitelyahuman iamdefinitelyahuman added enhancement New feature or request priority Should be included in next release labels Sep 19, 2019
@iamdefinitelyahuman iamdefinitelyahuman added this to the 1.0.0 milestone Sep 19, 2019
@iamdefinitelyahuman iamdefinitelyahuman self-assigned this Sep 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority Should be included in next release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant