address checks updated

pull/5370/head
aniket-engg 4 years ago committed by Aniket
parent b90a2b8edc
commit 01877261d1
  1. 3
      apps/remix-ide/src/app/tabs/runTab/contractDropdown.js
  2. 6
      apps/remix-ide/src/app/tabs/runTab/model/dropdownlogic.js

@ -98,8 +98,7 @@ class ContractDropdownUI {
enableAtAddress (enable) {
if (enable) {
const address = this.atAddressButtonInput.value
if (!address || !ethJSUtil.isValidAddress(address) ||
(/[a-f]/.test(address) && /[A-F]/.test(address) && !ethJSUtil.isValidChecksumAddress(address))) return
if (!address || !ethJSUtil.isValidChecksumAddress(address)) return
this.atAddress.removeAttribute('disabled')
this.atAddress.setAttribute('title', 'Interact with the given contract.')
} else {

@ -43,12 +43,6 @@ class DropdownLogic {
}
loadContractFromAddress (address, confirmCb, cb) {
if (!ethJSUtil.isValidAddress(address)) {
return cb('Invalid address.')
}
if (/[a-f]/.test(address) && /[A-F]/.test(address) && !ethJSUtil.isValidChecksumAddress(address)) {
return cb('Invalid checksum address.')
}
if (/.(.abi)$/.exec(this.config.get('currentFile'))) {
confirmCb(() => {
var abi

Loading…
Cancel
Save