Skip to content
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

Make sure every revert-able error is in the ABI #65

Open
norswap opened this issue Aug 7, 2023 · 0 comments
Open

Make sure every revert-able error is in the ABI #65

norswap opened this issue Aug 7, 2023 · 0 comments

Comments

@norswap
Copy link
Member

norswap commented Aug 7, 2023

For Wagmi to be able to parse contract reverts, the error must included in the contract that is initially called to cause that revert.

This means that if a transaction sent to contract A calls contract B which reverts with an error E, then E needs to be declared in contract A.

I don't think imports will solve the issue here (maybe if we can import inside a contract?). What doesn't work is copying the error in the contract file but outside the contract definition. For it to be included in the ABI, the error needs to be declared inside the contract definition.

Copying declaration is obviously very jank / prompt to being forgotten, so if we can't use imports, one thing we might do is patch the ABI on the JS side after.

Another solution that might work: bogus inheritance of a contract that defines the relevant errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant