-
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
Keyword to declare source code which is inheritable, but not compilable. #5046
Comments
@fulldecent I felt like this deserved it's own issue. Feel free to place your The term abstract has never made a lot of sense to me in this context, but I've seen it used for precisely this purpose so it might be the best choice. I like the behaviors you proposed as well. |
Consider the keyword Example from https://github.com/0xcert/ethereum-utils/blob/master/contracts/ownership/Ownable.sol
Nobody in their right mind would deploy the In addition to allowing
^^^ Presently this code is legal. I propose that it should be an error "Contracts with unimplemented methods must be explicitly marked as |
There is a long outstanding issue to track this: #649 Is it possible to move this discussion over there? |
👍 / I'll do one more copy paste |
Dupe of: #649 |
My most frequent pain point with inheritance is ambiguity about "which of these things are actually being deployed".
A typical repository might have 30
contracts
, but only 5 or 6 derived contracts which compile to bytecode that will be deployed. For example, there is no reason to ever deploy a contract which is simplyOwnable
, so why would that be declared ascontract Ownable { ... }
.I was impressed with how the 0xProject handled this with a strict naming convention using the terminology of 'Mixins'. For example, in this directory, only
Exchange.sol
will be deployed, everything else will be inherited to that contract.I would like to propose creating a new keyword for declaring an inheritable piece of code. The chief benefit would be a clear indication that "this is not intended to be a final contract".
Perhaps:
inheritable
,mixin
orclass
, could be used. The specific word isn't too important.Originally posted by @maurelian in #3729 (comment)
The text was updated successfully, but these errors were encountered: