diff --git a/apps/remix-ide/src/blockchain/blockchain.js b/apps/remix-ide/src/blockchain/blockchain.js index 4d07aed8ec..010696456f 100644 --- a/apps/remix-ide/src/blockchain/blockchain.js +++ b/apps/remix-ide/src/blockchain/blockchain.js @@ -295,7 +295,7 @@ export class Blockchain extends Plugin { if (error) { return finalCb(`creation of ${selectedContract.name} errored: ${error.message ? error.message : error}`) } - if (txResult.receipt.status === false || txResult.receipt.status === '0x0') { + if (txResult.receipt.status === false || txResult.receipt.status === '0x0' || txResult.receipt.status === 0) { return finalCb(`creation of ${selectedContract.name} errored: transaction execution failed`) } finalCb(null, selectedContract, address) diff --git a/libs/remix-lib/src/execution/txListener.ts b/libs/remix-lib/src/execution/txListener.ts index 96e8aee840..b1d8b0f169 100644 --- a/libs/remix-lib/src/execution/txListener.ts +++ b/libs/remix-lib/src/execution/txListener.ts @@ -104,7 +104,7 @@ export class TxListener { addExecutionCosts(txResult, tx, execResult) tx.envMode = this.executionContext.getProvider() - tx.status = txResult.receipt.status // 0x0 or 0x1 + tx.status = txResult.receipt.status this._resolve([tx]) }) }) diff --git a/libs/remix-lib/src/execution/txRunnerVM.ts b/libs/remix-lib/src/execution/txRunnerVM.ts index 010f27b31b..a24c03db51 100644 --- a/libs/remix-lib/src/execution/txRunnerVM.ts +++ b/libs/remix-lib/src/execution/txRunnerVM.ts @@ -137,11 +137,6 @@ export class TxRunnerVM { runBlockInVm (tx, block, callback) { this.getVMObject().vm.runBlock({ block: block, generate: true, skipBlockValidation: true, skipBalance: false, skipNonce: true }).then((results: RunBlockResult) => { const result: RunTxResult = results.results[0] - /*if (result) { - const status = result.execResult.exceptionError ? 0 : 1 - result.receipt.status - result.status = `0x${status}` - }*/ callback(null, { result, transactionHash: bufferToHex(Buffer.from(tx.hash())), diff --git a/libs/remix-simulator/src/methods/transactions.ts b/libs/remix-simulator/src/methods/transactions.ts index f743976a15..9535d49f3d 100644 --- a/libs/remix-simulator/src/methods/transactions.ts +++ b/libs/remix-simulator/src/methods/transactions.ts @@ -158,7 +158,7 @@ export class Transactions { processTx(this.txRunnerInstance, payload, true, (error, value: VMxecutionResult) => { const result: RunTxResult = value.result if (error) return cb(error) - if ((result as any).receipt === '0x0') { + if ((result as any).receipt?.status === '0x0' || (result as any).receipt?.status === 0) { try { const msg = `0x${result.execResult.returnValue.toString('hex') || '0'}` const abiCoder = new ethers.utils.AbiCoder() diff --git a/libs/remix-ui/terminal/src/lib/components/ChechTxStatus.tsx b/libs/remix-ui/terminal/src/lib/components/ChechTxStatus.tsx index 40a0d71a83..44411142f5 100644 --- a/libs/remix-ui/terminal/src/lib/components/ChechTxStatus.tsx +++ b/libs/remix-ui/terminal/src/lib/components/ChechTxStatus.tsx @@ -1,12 +1,12 @@ import React from 'react' // eslint-disable-line const CheckTxStatus = ({ tx, type }) => { - if (tx.status === '0x1' || tx.status === true) { + if (tx.status === 1 || tx.status === '0x1' || tx.status === true) { return () } if (type === 'call' || type === 'unknownCall' || type === 'unknown') { return (call) - } else if (tx.status === '0x0' || tx.status === false) { + } else if (tx.status === 0 || tx.status === '0x0' || tx.status === false) { return () } else { return () diff --git a/libs/remix-ui/terminal/src/lib/components/Table.tsx b/libs/remix-ui/terminal/src/lib/components/Table.tsx index 4ade0ceb64..32eb34d77c 100644 --- a/libs/remix-ui/terminal/src/lib/components/Table.tsx +++ b/libs/remix-ui/terminal/src/lib/components/Table.tsx @@ -19,9 +19,9 @@ const showTable = (opts, showTableHash) => { } if (!opts.isCall) { if (opts.status !== undefined && opts.status !== null) { - if (opts.status === '0x0' || opts.status === false) { + if (opts.status === 0 || opts.status === '0x0' || opts.status === false) { msg = 'Transaction mined but execution failed' - } else if (opts.status === '0x1' || opts.status === true) { + } else if (opts.status === 1 || opts.status === '0x1' || opts.status === true) { msg = 'Transaction mined and execution succeed' } } else {