question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Better errors for un-configured ENS names

See original GitHub issue

The documentation at https://docs.ethers.io/v5/api/providers/provider/#Provider--ens-methods mentions that:

In the ethers API, nearly anywhere that accepts an address, an ENS name may be used instead, which can simplify code and make reading and debugging much simpler.

Some examples I tried it on: new Contract(abi, address), provider.getBalance(address). And it works there, so awesome!

But when I did with a contract method:

> erc20ContractInstance.balanceOf('some.ens.name')

Error: invalid address (argument="address", value=null, code=INVALID_ARGUMENT, version=
address/5.0.2) (argument="_owner", value=null, code=INVALID_ARGUMENT, version=abi/5.0.2)

Is this expected?

Also seems like the value of address is being taken as null.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ricmoocommented, Oct 3, 2020

This has been published in 5.0.15. Try it out and let me know if there are any issues.

Thanks! 😃

0reactions
ricmoocommented, Sep 24, 2020

Yeah, a better error should only take like 4 minutes and I know exactly where to add it. 😃

I just need to finish the new publish script to match the new build script and I’ll add this. Sure, open a new issue to track it. 😃

Glad you enjoy the library! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolving Names
To remain future-proof, a correct integration of ENS treats any dot-separated name as a potential ENS name and will attempt a look-up. Looking...
Read more >
How do I configure a browser to resolve ENS names from ...
I want to preview a major revision of my Dwebsite before I update the IPFS CID to which the mainnet ENS name ......
Read more >
@ethersproject/properties | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
ethers: Versions
Fixed message signing errors that clobbered critical Error properties. ... (#1058; f0a5869); Better errors for unconfigured ENS names.
Read more >
What Is the Ethereum Name Service? How ENS Works and ...
Additionally, through the ENS, names and addresses become more transparent and easier to interact with. Anyone can create or register an ".eth" ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found