Detect non-ASCII names wherever ENS names are used and warn user
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.
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
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
Wonder if ensjs has a method for this now: https://github.com/ensdomains/ensjs-v3
I looked and it looks like ensjs uses this library which has some confusable validation.