web3j icon indicating copy to clipboard operation
web3j copied to clipboard

Solidity Custom Errors not supported by EthCall or Smart Contract Wrapper components

Open AboldUSER opened this issue 2 years ago • 0 comments

Issue_title

Web3J does not currently support Custom Errors, introduced in Solidity v0.8.4

Issue_description

Smart contracts that include custom errors do not return error data when using EthCall directly or when interacting with smart contracts via a Web3J generated Smart Contract Wrapper.

Issue_context

Solidity's Custom Errors has introduced the ability to revert with errors other than the default error signature/selector - Error(String) / 0x08c379a0. When using Web3J's EthCall.java to call a node client with eth.call endpoint, Web3J seems to currently use the default error selector to determine if the response's data contains an error message. If the data starts with 0x08c379a0, then it will decode and return it. Web3J's Smart Contract Wrapper does not contain support for including custom errors defined in the smart contract's ABI.

AboldUSER avatar Nov 07 '22 16:11 AboldUSER