-
-
Notifications
You must be signed in to change notification settings - Fork 793
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
Support Custom Errors #2994
Comments
meeting notes: punt for now as testing frameworks can use other means of error detection. implement if some production smart contracts require handling or issuing of specific custom errors. |
idea for how we can export for debugging: # example: x, y and z are local variables
if x > 10:
raise # @error My Custom Error, @trace x,y
# no runtime reason, tooling should print something like "My Custom Error, x = 11, y = ..." |
Here's a use-case where production smart contracts require issuing of specific custom errors: https://eips.ethereum.org/EIPS/eip-3668
|
raw_revert as implemented in #3136 should address this particular use case |
We should consider adding custom errors to |
custom errors is basically a requirement now |
Version Information
vyper --version
): 0.3.3python --version
): 3.8What's your issue about?
I want to mimic the behavior of custom errors in solidity: https://blog.soliditylang.org/2021/04/21/custom-errors/
Right now I'm just trying to
raise
an error without parameters, adding parameters would be nice to have.Should be able to
raise
bytes4 | Bytes[4]
but encountering following errors:vyper.exceptions.TypeMismatch: Given reference has type Bytes[4], expected String[1024]
vyper.exceptions.InvalidType: Expected String[1024] but literal can only be cast as bytes4
Tried all these different options with no success:
The text was updated successfully, but these errors were encountered: