umbra-protocol icon indicating copy to clipboard operation
umbra-protocol copied to clipboard

Detect non-ASCII names wherever ENS names are used and warn user

Open mds1 opened this issue 4 years ago • 2 comments

Source tweet with more info here.

Full OpenSea warning is:

⚠️ ATTENTION: This name contains non-ASCII characters as shown above. Please be aware that there are characters that look identical or very similar to English letters, especially characters from Cyrillic and Greek. Also, traditional Chinese characters can look identical or very similar to simplified variants. For more information, please see this Wikipedia article.

mds1 avatar Apr 06 '21 21:04 mds1

Would we want this in send function / would this have to be triggered within metamask @mds1 ? We'd just do a check similar to what metamask does here https://github.com/MetaMask/metamask-extension/blob/2cb807dc20c77390f4d1ec3dbeea6c2c093c792a/ui/ducks/ens.js#L81

Looks like they a package called unicode-confusables. As opposed to installing a node module just for this check. I dug into the package and pulled out the code which we'd need to port over as a util file https://gist.github.com/thelostone-mc/8341aa3631f3e4016f787ddc5f0b8fcf

My assumption is that we would add it in the senc screen. CHECK IMAGE

thelostone-mc avatar Feb 03 '22 12:02 thelostone-mc

Ah nice find in MM! Yea I like the idea of just pulling in the code directly to keep dependencies down, and we can just link to the original sources (both MM and the package itself).

Agree the warning should be on the send page. I think ideally we'd use the q-input hint text to display a warning directly under the input field. If that's tricky cause the q-input error stuff gets in the way we can always just put it directly above the send button

Here are the color codes we use for warnings, though it might be nice to pull them out as variables into quasar.variables.sass

@apbendi let me know if you have any other thoughts

mds1 avatar Feb 03 '22 15:02 mds1

Wonder if ensjs has a method for this now: https://github.com/ensdomains/ensjs-v3

mds1 avatar May 25 '23 18:05 mds1

I looked and it looks like ensjs uses this library which has some confusable validation.

alexkeating avatar May 25 '23 21:05 alexkeating