New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
solidity custom error support #26823
Comments
I added custom error handling a while ago: #23161 |
@MariusVanDerWijden is it correct that Geth currently doesn't surface custom revert messages in call/gas estimation? |
yes |
Got it, thank you! |
Could you please elaborate a bit on that want to be sure. edited: I did make a test calls over Alchemy to see what is happening and I see that in Data there is info that is signature of error |
Are there plans to support this anytime soon? Took me a while to figure out what was happening, and seems like our only option is to revert to more gas-expensive string errors. Probably not that hard to take the 4byte error code from the data and show it as part of the error string, unless I'm missing something? |
bumping this for attention |
I suppose its intended to be solved on app level, like Tenderly solves that perfectly most of the time, etherscan sadly still doesn't for some reason. |
Are those projects even using geth abigen? We're using abigen directly and this is making us unable to use custom errors in our contracts. Unless I'm missing something when simulating transactions to estimate gas limit, there's no way right now to retrieve the error string, as its not exposed by geth. |
ethereum/solidity#14442 just got merged. The Solidity change is specifically enabling custom errors to use with the common |
Bump |
Rationale
Formerly, the only way to return a revert reason was using
require(condition, ‘Something bad happened’);
. The code generated by the abigen tool for a smartcontract, returned the revert reason if something was wrong. This error was triggered during the gas estimation.Now, the new way of adding custom errors (revert messages) is
revert NotAllowed();
. Using the code generated by the abigen, the error received is justexecution reverted
.I could decode the error by my own if i had access to the output data returned in the tx but this is inside the autogenerated code and not exported.
I want to keep receiving the same revert reason even using the new solidity custom errors.
If this feature is already implemented, if so how can i use it??
Implementation
It should be something like this:
https://blog.soliditylang.org/2021/04/21/custom-errors/
The text was updated successfully, but these errors were encountered: