aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/util.js')
-rw-r--r--ui/app/util.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/ui/app/util.js b/ui/app/util.js
index 1368ebf11..3f8b4dcc3 100644
--- a/ui/app/util.js
+++ b/ui/app/util.js
@@ -37,6 +37,7 @@ module.exports = {
bnTable: bnTable,
isHex: isHex,
exportAsFile: exportAsFile,
+ isInvalidChecksumAddress,
}
function valuesFor (obj) {
@@ -66,6 +67,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()