From 917ad7334a6565e3a361e5288d9e1954a1661962 Mon Sep 17 00:00:00 2001 From: lianahus Date: Thu, 6 May 2021 10:15:31 +0200 Subject: [PATCH] auto checksuming address for atAddress --- apps/remix-ide/src/app/tabs/runTab/contractDropdown.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js b/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js index 6918c305a3..bfd5328dbf 100644 --- a/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js +++ b/apps/remix-ide/src/app/tabs/runTab/contractDropdown.js @@ -97,7 +97,10 @@ class ContractDropdownUI { enableAtAddress (enable) { if (enable) { const address = this.atAddressButtonInput.value - if (!address || !ethJSUtil.isValidChecksumAddress(address)) return + if (!address || !ethJSUtil.isValidAddress(address)) { + this.enableAtAddress(false) + return + } this.atAddress.removeAttribute('disabled') this.atAddress.setAttribute('title', 'Interact with the given contract.') } else { @@ -387,7 +390,10 @@ class ContractDropdownUI { loadFromAddress () { this.event.trigger('clearInstance') - var address = this.atAddressButtonInput.value + let address = this.atAddressButtonInput.value + if (!ethJSUtil.isValidChecksumAddress(address)) { + address = ethJSUtil.toChecksumAddress(address) + } this.dropdownLogic.loadContractFromAddress(address, (cb) => { modalDialogCustom.confirm(null, 'Do you really want to interact with ' + address + ' using the current ABI definition?', cb)