diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b0dfdb0f3..74be18a38a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## Current ### Features +- [#3531](https://github.com/poanetwork/blockscout/pull/3531) - Allow double quotes in input data of contract methods - [#3515](https://github.com/poanetwork/blockscout/pull/3515) - CRC total balance - [#3513](https://github.com/poanetwork/blockscout/pull/3513) - Allow square brackets for an array input data in contracts interaction - [#3480](https://github.com/poanetwork/blockscout/pull/3480) - Add support of Autonity client diff --git a/apps/block_scout_web/assets/js/lib/smart_contract/functions.js b/apps/block_scout_web/assets/js/lib/smart_contract/functions.js index ee85bb8c17..98c2b0fc51 100644 --- a/apps/block_scout_web/assets/js/lib/smart_contract/functions.js +++ b/apps/block_scout_web/assets/js/lib/smart_contract/functions.js @@ -183,6 +183,9 @@ function prepareMethodArgs ($functionInputs, inputs) { const inputType = inputs[ind] && inputs[ind].type let preparedVal if (isNonSpaceInputType(inputType)) { preparedVal = val.replace(/\s/g, '') } else { preparedVal = val } + if (isAddressInputType(inputType)) { + preparedVal = preparedVal.replaceAll('"', '') + } if (isArrayInputType(inputType)) { if (preparedVal === '') { return [[]] @@ -200,8 +203,12 @@ function isArrayInputType (inputType) { return inputType && inputType.includes('[') && inputType.includes(']') } +function isAddressInputType (inputType) { + return inputType.includes('address') +} + function isNonSpaceInputType (inputType) { - return inputType.includes('address') || inputType.includes('int') || inputType.includes('bool') + return isAddressInputType(inputType) || inputType.includes('int') || inputType.includes('bool') } function getTxValue ($functionInputs) {