-
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
Introduce selfdestruct as a new stateMutability level #3221
Comments
Doesn't it make more sense to define that at the contract-level, maybe through a fake base contract? Then, the contracts cannot be destructed no matter which method is called/delegatecalled. |
I'm not at all fond of "fake base contracts". Perhaps pragmas? |
Yes, and the name didn't help either! I am not fond of pragmas because they apply to the whole source file. They seem like the wrong device to use here. What about a constructor-only specifier? Makes sense to declare its lifecycle at the point of creation. |
Yeah, constructor specifier makes sense. Also I don't think these are two mutually exclusive features, the above proposal is defining whether |
Let's take the following code example: contract Auction {
// ...
function endAuction() public {
// do some stuff and let users define custom behaviour in finalize
finalize();
}
}
contract MyAuction is Auction {
function finalize() destructible internal {
selfdestruct(owner);
}
} I assume |
There should be consistency between:
Currently we have parity
If we are considering to add a level that competes with these then effectively you are proposing |
This issue has been marked as stale due to inactivity for the last 90 days. |
I think we can safely close this given that |
Propose to introduce
destructible
either above or mutually exclusive withpayable
.Reasoning: it is an even more elevated state mutability case, than payable, which could warrant its on level.
Benefits: mutability checker will be able to reject
selfdestruct
used in a method where it may not be desired. Also, libraries could have the callable check restricted to functions marked this way.The text was updated successfully, but these errors were encountered: