aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/util.js
diff options
context:
space:
mode:
authorChi Kei Chan <chikeichan@gmail.com>2017-09-19 09:13:15 +0800
committerGitHub <noreply@github.com>2017-09-19 09:13:15 +0800
commita67d3ecd46ac2b9932d1a4181bb76631b27629c2 (patch)
treed96b262074f506a1a7a48975dbf85e1374207851 /ui/app/util.js
parent190330db921d5549a3e4363308545fb702e0089c (diff)
parent7094d965291fa19f96145d122cb9f0f76da053c0 (diff)
downloadtangerine-wallet-browser-a67d3ecd46ac2b9932d1a4181bb76631b27629c2.tar
tangerine-wallet-browser-a67d3ecd46ac2b9932d1a4181bb76631b27629c2.tar.gz
tangerine-wallet-browser-a67d3ecd46ac2b9932d1a4181bb76631b27629c2.tar.bz2
tangerine-wallet-browser-a67d3ecd46ac2b9932d1a4181bb76631b27629c2.tar.lz
tangerine-wallet-browser-a67d3ecd46ac2b9932d1a4181bb76631b27629c2.tar.xz
tangerine-wallet-browser-a67d3ecd46ac2b9932d1a4181bb76631b27629c2.tar.zst
tangerine-wallet-browser-a67d3ecd46ac2b9932d1a4181bb76631b27629c2.zip
Merge branch 'master' into NewUI-flat
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 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()