Better errors for un-configured ENS names
See original GitHub issueThe 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:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This has been published in 5.0.15. Try it out and let me know if there are any issues.
Thanks! 😃
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! 😃