You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this is the error from event emitter
ContractExecutionError: Error happened while trying to execute a function inside a smart contract
at Function._isReverted (/Users/alexluu/4.x/web3.js/packages/web3-core/src/web3_request_manager.ts:432:48)
at Web3RequestManager._processJsonRpcResponse (/Users/alexluu/4.x/web3.js/packages/web3-core/src/web3_request_manager.ts:361:35)
at Web3RequestManager. (/Users/alexluu/4.x/web3.js/packages/web3-core/src/web3_request_manager.ts:206:16)
at Generator.next ()
at fulfilled (/Users/alexluu/4.x/web3.js/packages/web3-core/lib/commonjs/web3_request_manager.js:21:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
cause: [Eip838ExecutionError: Error: VM Exception while processing transaction: reverted with reason string 'REVERTED WITH REVERT'] {
cause: [Eip838ExecutionError: Error: VM Exception while processing transaction: reverted with reason string 'REVERTED WITH REVERT'] {
cause: undefined,
code: undefined,
receipt: undefined,
data: '0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000145245564552544544205749544820524556455254000000000000000000000000'
},
code: -32603,
receipt: undefined,
data: '0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000145245564552544544205749544820524556455254000000000000000000000000'
},
code: 310,
receipt: undefined
}
https://github.com/web3/web3.js/blob/4.x/packages/web3-eth-contract/test/integration/contract_methods.test.ts#L151
contract method revert for hardhat should return an error with revert but instead returns a contract execution with a receipt of undefined.
this is the error from event emitter
ContractExecutionError: Error happened while trying to execute a function inside a smart contract
at Function._isReverted (/Users/alexluu/4.x/web3.js/packages/web3-core/src/web3_request_manager.ts:432:48)
at Web3RequestManager._processJsonRpcResponse (/Users/alexluu/4.x/web3.js/packages/web3-core/src/web3_request_manager.ts:361:35)
at Web3RequestManager. (/Users/alexluu/4.x/web3.js/packages/web3-core/src/web3_request_manager.ts:206:16)
at Generator.next ()
at fulfilled (/Users/alexluu/4.x/web3.js/packages/web3-core/lib/commonjs/web3_request_manager.js:21:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
cause: [Eip838ExecutionError: Error: VM Exception while processing transaction: reverted with reason string 'REVERTED WITH REVERT'] {
cause: [Eip838ExecutionError: Error: VM Exception while processing transaction: reverted with reason string 'REVERTED WITH REVERT'] {
cause: undefined,
code: undefined,
receipt: undefined,
data: '0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000145245564552544544205749544820524556455254000000000000000000000000'
},
code: -32603,
receipt: undefined,
data: '0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000145245564552544544205749544820524556455254000000000000000000000000'
},
code: 310,
receipt: undefined
}
but only returns
Object {
+ "name": "ContractExecutionError",
+ "receipt": undefined,
}
check revert error constructor
Expected behavior
Actual behavior
Steps to reproduce the behavior
Logs
Environment