-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENS reverse resolution support #7177
ENS reverse resolution support #7177
Conversation
74055a9
to
20b351e
Compare
bb7a388
to
1b094a5
Compare
This PR should be good to review now 😅 |
09d32a0
to
8f5db5c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QA'd and reviewed code. Tentatively approving in case the two comments I left don't require action. But if they require action, I'll approve again after they are addressed.
I think there are other place that we can show ENS names (on the send screen), but it may require design consideration. So we can handle those in another issue.
You may want to record a video of a demo of the feature implemented here for Bobby to review.
Recorded a video demo here: https://streamable.com/pevp4 |
@@ -116,8 +142,8 @@ export default class SenderToRecipient extends PureComponent { | |||
<span>{ addressOnly ? `${t('to')}: ` : '' }</span> | |||
{ | |||
addressOnly | |||
? checksummedRecipientAddress | |||
: (recipientNickname || recipientName || this.context.t('newContract')) | |||
? (recipientNickname || recipientEns || checksummedRecipientAddress) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting; what is addressOnly
supposed to do anyway? Using a nickname seems contrary to asking for the address to be used, but maybe I'm misunderstanding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressOnly
is the flag passed to the component when this is rendered in the tx details
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, but semantically what does it mean? "address only" implies to me that nicknames shouldn't be used, and you've just updated this to show the nickname in that case. If nicknames are desired, maybe the prop should be renamed? Or perhaps I'm misunderstanding the meaning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe the intended meaning was "no icons", in which case this is fine 🤔
8f5db5c
to
14d2b89
Compare
I think this is ready for another round of 👀 |
const domain = await this._ens.reverse(address) | ||
const registeredAddress = await this._ens.lookup(domain) | ||
if (registeredAddress === ZERO_ADDRESS || registeredAddress === ZERO_X_ERROR_ADDRESS) { | ||
return undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: it would be nice to know what happened in these cases though - e.g. whether the address didn't resolve, or whether it did but it couldn't be verified, etc.
Maybe a log.debug
statement would be appropriate in each of these cases? With something like the error messages you had before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
* ENS Reverse Resolution support * Save punycode for ENS domains with Unicode characters * Update SenderToRecipient recipientEns tooltip * Use cached results when reverse-resolving ENS names * Display ENS names in tx activity log
Closes #5525
This PR adds ENS Reverse Resolution support to the UI, showing ENS names in a few places where addresses are currently used (the confirm screen & tx activity log). This represents a step towards "level two" of ENS integration, as outlined in the ENS docs:[1]
And, further, from Resolving Names § Reverse Resolution:[2]
IDN homograph attack[3]
As we're showing user-generated domain names in sensitive places in the UI, we need to prevent malicious users from tricking users by registering domains that use Unicode characters to look visually similar to other registered names (see also #1913).
This PR converts ENS domain names to Punycode via
punycode.toASCII
.Tasks
Confirm Screen Screenshots (
SenderToRecipient
)Before, after, & tooltip
Transaction List Item Details (
TransactionListItemDetails
)Before, after, & tooltip
Test addresses
I've registered
peaksignal.eth
for test purposes and have correctly configured it to enable reverse resolution.[4]