-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Allow public constants in interfaces #3411
Comments
This is a tricky one. Interfaces only allow declarations which are reflected in the external ABI and a constant isn't such a thing. I think at this point this may cause more problems as it solves given the current messy handling of |
@axic Thank you, I have studied more how interfaces are implemented. For now I have reduced the scope of this issue to only address public constants without implementations (i.e. values). |
Can you actually revert the change and post this new version as a comment? My comment makes little to no sense now. |
Sorry, I lost history, I thought GitHub saved it. For clarity, I did at a note to the top. |
Having thought a bit more about this, I do not think constants belong to interfaces. Are you sure you do not need |
This issue only makes sense if interfaces are being removed/changed wholesale -- #3420 I'll let that discussion continue in #3420 If interfaces are truly just to track ABI of a contract on EVM (again, I hate the ABI word choice) then I agree and only So either way, yes I agree this should be closed. |
You are using this in all issues. How would you call it if not the ABI? The "JSON ABI" part can be misleading, there might be a better name for "the JSON description file of the particular entry points in a contract". |
The application binary interface is anything that touches EVM -- the function signature hash, function call data types, function return data types. Everything else is not ABI. The JSON file includes implementation-specific details:
Maybe that's a "contract description file" or something else. But I need to keep reminding myself that it is NOT an ABI. Thanks for listening. |
Since we allow accessing constants through contract names (#1290) and enums in interfaces (#4087), it may make sense to reconsider this feature, at least for some healthy discussion. I am still not sure if it is a good idea or not (it definitely can be useful from a users' perspective, but could be dangerous?) The case I ran into is the following (ralexstokes/deposit-verifier#2):
In this example the interface uses basic types (
|
(Previously, this issue discussed ALL constants, now it only addresses public constants.)
Currently constants are not allowed in interfaces:
Error is:
Public constants affect ABI and should be allowed in interfaces.
If this issue is implemented and also if interfaces gain the ability to bring default implementations, then this syntax will be even more useful:
The text was updated successfully, but these errors were encountered: