aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/scripts/lib/tx-gas-utils.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/scripts/lib/tx-gas-utils.js b/app/scripts/lib/tx-gas-utils.js
index ccf8bb1b1..5e49fdb22 100644
--- a/app/scripts/lib/tx-gas-utils.js
+++ b/app/scripts/lib/tx-gas-utils.js
@@ -81,6 +81,7 @@ module.exports = class txProvideUtil {
}
async validateTxParams (txParams) {
+ this.validateRecipient(txParams)
if ('value' in txParams) {
const value = txParams.value.toString()
if (value.includes('-')) {
@@ -92,4 +93,14 @@ module.exports = class txProvideUtil {
}
}
}
+ validateRecipient (txParams) {
+ if (txParams.to === '0x') {
+ if (txParams.data) {
+ delete txParams.to
+ } else {
+ throw new Error('Invalid recipient address')
+ }
+ }
+ return txParams
+ }
}