Is it possible to resolve a contract address with ENS? The reason for the question: if so, then could someone just change resolving address pointing it to some other address?


ENS implements resolver contracts, which can point to a final terminal address that can be changed if the contract is written that way. According to EIP137, the example standalone resolver contract shows an example of how you could change what the ENS domain points to. This is really the point of ENS, as described in the abstract:

This permits users and developers to refer to human-readable and easy to remember names, and permits those names to be updated as necessary when the underlying resource (contract, content-addressed data, etc) changes.

So, you're exactly right. If you wanted to deceive people (for example, in an ICO), you could create an ENS domain and then change the address that it resolves to maliciously, thus redirecting funds for your own gain.

However, most of the time this isn't the case. Since it's implied that the owner of an ENS domain controls it, the usual implication is that sending funds to said domain will get to the domain owner anyway.

  • ok. I was looking at a good way that we could make improvements in a smart contract or patch critical bugs. The contract patterns that I have found so far all seems like workarounds. But this seems like a right solution but with flaws, that needs to be addressed. Thanks – shonjs Feb 12 '18 at 16:32
  • Hmm, were you referring to resolving it from within ethereum through ENS? Because ethereum can't touch the network, thus it can't resolve ENS domains. The best way to update contracts, as described in this question is through libraries. That's probably what you actually want. – hakusaro Feb 12 '18 at 16:35
  • My name resolves to a particular contract address, and I patch the contract and deploy it and change the resolution to the new address. That is what I meant. Am I missing something ? – shonjs Feb 12 '18 at 16:42
  • but this way the storage of the old contract would be lost. Need to use delegate call if data is needed. Which way you want to update would depend on the use case and design of the contract I guess. – shonjs Feb 12 '18 at 16:51

Not the answer you're looking for? Browse other questions tagged or ask your own question.