wbobeirne / eth-balance-checker

Solidity contract to batch balance checks in one call
MIT License
253 stars 82 forks source link

[Discussion] Automatically select contract address for network #19

Open varanauskas opened 3 years ago

varanauskas commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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