Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
AboldUSER opened this issue Nov 7, 2022 · 1 comment · May be fixed by #2146
Open

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

AboldUSER opened this issue Nov 7, 2022 · 1 comment · May be fixed by #2146
Labels
needs-review issue/PR needs review from maintainer

Comments

@AboldUSER
Copy link

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 AboldUSER added the needs-review issue/PR needs review from maintainer label Nov 7, 2022
@andyrobert3
Copy link

Hey @AboldUSER, I am introducing a fix for EthCall here, by introducing a CustomError class

Will share with the community once the PR is out

@andyrobert3 andyrobert3 linked a pull request Feb 3, 2025 that will close this issue
3 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
needs-review issue/PR needs review from maintainer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants