diff options
Diffstat (limited to 'ui/app/util.js')
-rw-r--r-- | ui/app/util.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ui/app/util.js b/ui/app/util.js index be26e15a5..7aace1b3c 100644 --- a/ui/app/util.js +++ b/ui/app/util.js @@ -54,6 +54,7 @@ module.exports = { shortenBalance, getContractAtAddress, exportAsFile: exportAsFile, + isInvalidChecksumAddress, } function valuesFor (obj) { @@ -83,6 +84,12 @@ function isValidAddress (address) { return (isAllOneCase(prefixed) && ethUtil.isValidAddress(prefixed)) || ethUtil.isValidChecksumAddress(prefixed) } +function isInvalidChecksumAddress (address) { + var prefixed = ethUtil.addHexPrefix(address) + if (address === '0x0000000000000000000000000000000000000000') return false + return !isAllOneCase(prefixed) && !ethUtil.isValidChecksumAddress(prefixed) && ethUtil.isValidAddress(prefixed) +} + function isAllOneCase (address) { if (!address) return true var lower = address.toLowerCase() |