|
|
@ -37,6 +37,7 @@ module.exports = { |
|
|
|
bnTable: bnTable, |
|
|
|
bnTable: bnTable, |
|
|
|
isHex: isHex, |
|
|
|
isHex: isHex, |
|
|
|
exportAsFile: exportAsFile, |
|
|
|
exportAsFile: exportAsFile, |
|
|
|
|
|
|
|
isInvalidChecksumAddress, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function valuesFor (obj) { |
|
|
|
function valuesFor (obj) { |
|
|
@ -66,6 +67,12 @@ function isValidAddress (address) { |
|
|
|
return (isAllOneCase(prefixed) && ethUtil.isValidAddress(prefixed)) || ethUtil.isValidChecksumAddress(prefixed) |
|
|
|
return (isAllOneCase(prefixed) && ethUtil.isValidAddress(prefixed)) || ethUtil.isValidChecksumAddress(prefixed) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function isInvalidChecksumAddress (address) { |
|
|
|
|
|
|
|
var prefixed = ethUtil.addHexPrefix(address) |
|
|
|
|
|
|
|
if (address === '0x0000000000000000000000000000000000000000') return false |
|
|
|
|
|
|
|
return ethUtil.isValidAddress(prefixed) && !ethUtil.isValidChecksumAddress(prefixed) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function isAllOneCase (address) { |
|
|
|
function isAllOneCase (address) { |
|
|
|
if (!address) return true |
|
|
|
if (!address) return true |
|
|
|
var lower = address.toLowerCase() |
|
|
|
var lower = address.toLowerCase() |
|
|
|