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.

Hi, I use ENS resolver and lookup method of ethers.js. Actually it works well for sample from documentation such as ("registrar.firefly.eth" & "0x6fC21092DA55B392b045eD78F4732bff3C580e2c") or ("ricmoose.eth" & "0x8ba1f109551bD432803012645Ac136ddd64DBA72").

image

however when i try different ENS like "ethereum.eth" it give me the address "0x8443379cBaF7A68B2Cc1626Df9e4Cb47d525A0e4" and then when i try this address for lookup method, null is returned. It doesnot give "ethereum.eth"

image

function AddressToENS () {
	
	var address = $('#checkAddress2').val();
    if ($('#checkAddress2').val() != "") {
		try {
			ethers.utils.getAddress(address); 
			provider.lookupAddress(address).then(function(address) {
			console.log("Name: " + address);
			if (address == null) {
				$("#result2").html("No record for this address")
				} else $("#result2").html(address);
			});
		} catch (error) {
		   $("#result2").html("Invalid address");
		  return;
        }			
	} else {
		$("#result2").html("Empty address");
	}

}

function ENStoAddress () {
	var address = $('#checkAddress3').val();
    if ($('#checkAddress3').val() != "") {

			provider.resolveName(address).then(function(address) {
			console.log("Address: " + address);
			if (address == null) {
				$("#result3").html("No record for this ENS")
				} else $("#result3").html(address);
			});

			
	} else {
		$("#result3").html("Empty address");
	}
	
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
ricmoocommented, Jan 28, 2021

Keep in mind that reverse records are opt-in and a name owner must configure it separately. I have configured my ens names and their reverse records, but many people do. It configure reverse records.

In these cases, lookupAddress doesn’t work, which is what I suspect you are seeing.

You can reach out to particular name owners and ask that the configure their reverse-records, but otherwise there is not much you can do. The owner didn’t opt-in for a reverse record… 😒

Make sense?

1reaction
fahimaltinorducommented, Feb 25, 2021

It works now @ricmoo thank you very much for all

Read more comments on GitHub >

github_iconTop Results From Across the Web

PublicResolver - ENS Documentation
PublicResolver implements a general-purpose ENS resolver that is suitable for most standard ENS use-cases. The public resolver permits updates to ENS ...
Read more >
Noob ENS question: what is the "Resolver"? : r/ethereum
The Resolver is the smart contract that acts as the translator of yourname.eth to some address. By default it is set to 0x0000...0000...
Read more >
How to Set Up ENS Resolver - Ethereum Name Service
Point your ENS name to your Ethereum (ETH) address to make it easier to request ... This video will show you how to...
Read more >
A collection of resolvers for ENS domains - GitHub
A collection of resolvers for ENS domains. Contribute to ensdomains/resolvers development by creating an account on GitHub.
Read more >
Introduction to the Ethereum Name Service | by Chris Remus
Any contract that implements the relevant standards may act as a resolver in ENS. General-purpose resolver implementations are offered for ...
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