diff --git a/libs/remix-lib/src/execution/txRunner.ts b/libs/remix-lib/src/execution/txRunner.ts index 2606fcc01d..ff514d437b 100644 --- a/libs/remix-lib/src/execution/txRunner.ts +++ b/libs/remix-lib/src/execution/txRunner.ts @@ -118,7 +118,17 @@ export class TxRunner { this.executionContext.vm().stateManager.getAccount(Address.fromString(from)).then((res) => { // See https://github.com/ethereumjs/ethereumjs-tx/blob/master/docs/classes/transaction.md#constructor // for initialization fields and their types - value = value ? new BN(value, 10) : 0 + if (!value) value = 0 + if (typeof value === 'string') { + if (value.startsWith('0x')) value = new BN(value.replace('0x', ''), 'hex') + else { + try { + value = new BN(value, 10) + } catch (e) { + return callback('Unable to parse the value ' + e.message) + } + } + } const tx = Transaction.fromTxData({ nonce: new BN(res.nonce), gasPrice: '0x1',