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

@ -43,12 +43,6 @@ class DropdownLogic {
} }
loadContractFromAddress (address, confirmCb, cb) { 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'))) { if (/.(.abi)$/.exec(this.config.get('currentFile'))) {
confirmCb(() => { confirmCb(() => {
var abi var abi

Loading…
Cancel
Save