Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Add extra validation of ETH address in send #4744

Closed
nuo-xu opened this issue Dec 16, 2021 · 1 comment · Fixed by #5275
Closed

Add extra validation of ETH address in send #4744

nuo-xu opened this issue Dec 16, 2021 · 1 comment · Fixed by #5275

Comments

@nuo-xu
Copy link
Contributor

nuo-xu commented Dec 16, 2021

Description:

Same as Desktop ref: brave/brave-browser#19532

In Ethereum an address casing is used as a checksum for validation. We should check this and if it fails give an error.

If an input address matches the API result for KeyringController's GetChecksumEthAddress then don't give a warning
If an address has each alphabetic character as lowercase, give a warning that the address has no checksum information and might be invalid.
If an address has each alphabetic character as uppercase, give a warning that the address has no checksum information and might be invalid.
If an address has both lowercase and uppercase alphabetic characters, and it doesn't match the checksum address, give an error and don't allow the user to send.

API available in v1.35.30 and above

@bbondy bbondy moved this to Backlog in Web3 Mar 18, 2022
@nuo-xu nuo-xu self-assigned this Apr 20, 2022
@nuo-xu nuo-xu moved this from Backlog to In Progress in Web3 Apr 20, 2022
Repository owner moved this from In Progress to Done in Web3 Apr 22, 2022
@nuo-xu nuo-xu added this to the 1.38 milestone Apr 27, 2022
@srirambv
Copy link
Contributor

Verification passed on the following devices running 1.38 (22.4.25.21)

☑️ iPhone 7+ (iOS 14.8.1) ☑️ iPhone XR (iOS 15.4.1) ☑️ iPad Pro (iOS 15.5 Beta)
  • Verified steps from #5275
  • Verified address validation happens for same address/checksum/contract/invalid address
Invalid ETH Address
Invalid Checksum
Invalid Checksum (lower/upper case)
Own Address
Contract Address

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.