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

[Discussion] Automatically select contract address for network #19

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

varanauskas
Copy link
Contributor

Depends on #18

This is a draft and has not been tested, but while deploying #18 I was thinking there should be a way to automatically detect the address

This would make using this extension easier

@wbobeirne
Copy link
Owner

Ah yeah looks like you've stumbled upon why I didn't do this in the first place; it makes the getContract call async, and I didn't want to break the API. I like what you've done here with getContractAddress though, perhaps we should simply add that method, and allow people to make it async if they want by doing:

const address = await getContractAddress(provider);
const contract = getContract(provider, address);

@varanauskas
Copy link
Contributor Author

As I understand getContract is not exposed (exported) thus changes to it’s signature should not break any usage?

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.

2 participants