Skip to content

Commit

Permalink
Permit all-caps addresses (#9227)
Browse files Browse the repository at this point in the history
* permit all-caps addresses

* handle empty address
  • Loading branch information
PatrykLucka authored and Gudahtt committed Aug 14, 2020
1 parent d49c444 commit e47774d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ui/app/helpers/utils/util.js
Expand Up @@ -62,11 +62,11 @@ export function addressSummary (address, firstSegLength = 10, lastSegLength = 4,
}

export function isValidAddress (address) {
const prefixed = ethUtil.addHexPrefix(address)
if (address === '0x0000000000000000000000000000000000000000') {
if (!address || address === '0x0000000000000000000000000000000000000000') {
return false
}
return (isAllOneCase(prefixed) && ethUtil.isValidAddress(prefixed)) || ethUtil.isValidChecksumAddress(prefixed)
const prefixed = address.startsWith('0X') ? address : ethUtil.addHexPrefix(address)
return (isAllOneCase(prefixed.slice(2)) && ethUtil.isValidAddress(prefixed)) || ethUtil.isValidChecksumAddress(prefixed)
}

export function isValidDomainName (address) {
Expand Down

0 comments on commit e47774d

Please sign in to comment.