|
|
|
@ -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() |
|
|
|
|