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
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: