Skip to content

Conversation

@alisinabh
Copy link

Hi,

This PR adds Elixir Ethers library to the libraries section. Ethers directly implements ENS Resolution as part of its public API.

Thank you

@alisinabh
Copy link
Author

Hey @gskril,

Any chance of this getting merged?

@gskril
Copy link
Member

gskril commented Apr 21, 2025

Hey @alisinabh sorry for the slow review here.

Does Elixir Ethers support resolving ENS data (like getEnsName(), getEnsAddress(), etc), or more focused on low-level contract calls? The former is a more common use of ENS and what we seek to highlight on https://docs.ens.domains/web/libraries, but it looks like Elixir Ethers may not have that from a quick glance at the docs.

I could be missing something in which case I'm happy to merge.

@alisinabh
Copy link
Author

alisinabh commented Apr 22, 2025

sorry for the slow review here.

No worries at all.

Does Elixir Ethers support resolving ENS data (like getEnsName(), getEnsAddress(), etc)

Yes, this library supports specific ENS resolve and reverse resolve functionalities in it's Ethers.NameService module.

As an example, one can resolve address of a given ens name like this

Ethers.NameService.resolve("vitalik.eth")
# Result
{:ok, "0xd8da6bf26964af9d7eed9e03e53415d37aa96045"}

It also supports things like: Reverse resolve and CCIP read.

You can read more about it here: https://hexdocs.pm/ethers/Ethers.NameService.html

or more focused on low-level contract calls?

Ethers is a swiss-army knife library for interacting with EVM chains using Elixir. It supports contract calls, ENS, Multicall, Signers, CCIP etc. It is not a ENS only library and if it is against your guidelines I understand.

If you have any other questions or need more examples I would be happy to answer :)

@gskril
Copy link
Member

gskril commented Apr 23, 2025

Awesome, I was able to get it running locally and confirm the result for vitalik.eth!

I'm having trouble resolving the ETH address for names that use resolvers with CCIP Read, though. See below:

Ethers.NameService.resolve("greg.offchaindemo.eth")
** (ArgumentError) Invalid HEX input <<59, 59, 87, 222, 24, 34, 255, 90, 46, 84, 75, 64, 8, 219, 168, 147, 84, 214, 234, 243, 170, 139, 201, 148, 123, 252, 249, 205, 224, 93, 48, 108, 64, 33, 63, 113>>
    (ethers 0.6.5) lib/ethers/utils.ex:64: Ethers.Utils.hex_decode!/1
    (ethers 0.6.5) lib/ethers/name_service.ex:90: Ethers.NameService.ensip10_resolve/3
    (ethers 0.6.5) lib/ethers/name_service.ex:66: Ethers.NameService.do_resolve/3
    iex:3: (file)

@alisinabh
Copy link
Author

@gskril Thank you for reporting this. This was a bug caused by a recent refactor.
Version 0.6.6 is out with a fix. Can you give a go?

@alisinabh
Copy link
Author

@gskril ping :)

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