diff --git a/CHANGELOG.md b/CHANGELOG.md index a625bc250..2a59c1198 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Current Master - [#317](https://github.com/poanetwork/nifty-wallet/pull/317) - Fix path to derive accounts in HD wallets for RSK, ETC +- [#318](https://github.com/poanetwork/nifty-wallet/pull/318) - (Fix) pasting of ABI for contract type account ## 4.11.10 Tue Feb 04 2020 diff --git a/old-ui/app/accounts/import/contract.js b/old-ui/app/accounts/import/contract.js index 906984b1f..0e84fa7e9 100644 --- a/old-ui/app/accounts/import/contract.js +++ b/old-ui/app/accounts/import/contract.js @@ -41,13 +41,13 @@ class ContractImportView extends Component { }) } - abiOnChange (abi) { + abiOnChange (abi, APIInputDisabled) { this.props.hideWarning() try { if (abi) { this.setState({ - abi: JSON.stringify(abi), - abiInputDisabled: true, + abi: abi, + abiInputDisabled: APIInputDisabled || false, importDisabled: false, }) } @@ -124,7 +124,15 @@ class ContractImportView extends Component { return } getFullABI(web3.eth, contractAddr, network, type) - .then(finalABI => this.abiOnChange(finalABI)) + .then(finalABI => { + if (finalABI) { + finalABI = JSON.stringify(finalABI) + const APIInputDisabled = true + return this.abiOnChange(finalABI, APIInputDisabled) + } else { + return null + } + }) .catch(e => { this.clearAbi() log.debug(e) diff --git a/old-ui/app/components/send/send-contract.js b/old-ui/app/components/send/send-contract.js index 36c1f715e..285ce8719 100644 --- a/old-ui/app/components/send/send-contract.js +++ b/old-ui/app/components/send/send-contract.js @@ -161,9 +161,10 @@ class SendTransactionScreen extends PersistentForm { options={this.state.options} style={{ marginBottom: '10px' }} onChange={(opt) => { + const isConstantMethod = opt.metadata && (opt.metadata.constant || opt.metadata.stateMutability === 'view') this.setState({ methodSelected: opt.value, - isConstantMethod: opt.metadata.constant, + isConstantMethod: isConstantMethod, methodABI: opt.metadata, outputValues: {}, inputValues: {},