Skip to content

Commit

Permalink
Merge pull request #6280 from MetaMask/network-checksum-disable
Browse files Browse the repository at this point in the history
No longer check network when validating checksum addresses
  • Loading branch information
tmashuang authored Mar 11, 2019
2 parents 5abcce2 + ef7ac90 commit c44f785
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ui/app/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ function miniAddressSummary (address) {
function isValidAddress (address, network) {
var prefixed = ethUtil.addHexPrefix(address)
if (address === '0x0000000000000000000000000000000000000000') return false
if (!isEthNetwork(network)) return (ethUtil.isValidAddress(prefixed) && address === address.toLowerCase())
return (isAllOneCase(prefixed) && ethUtil.isValidAddress(prefixed)) || ethUtil.isValidChecksumAddress(prefixed)
}

Expand Down Expand Up @@ -315,7 +314,7 @@ function getTokenAddressFromTokenObject (token) {
*/
function checksumAddress (address, network) {
const checksummed = address ? ethUtil.toChecksumAddress(address) : ''
return checksummed && network && !isEthNetwork(network) ? checksummed.toLowerCase() : checksummed
return checksummed
}

function addressSlicer (address = '') {
Expand Down

0 comments on commit c44f785

Please sign in to comment.