-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Provide access to a contract's creation and runtime code #5647
Comments
@axic noted that it should not be breaking and I think I agree :) |
This is dangerous! Example:
This does not dump any code at an address while solidity assumes that the function |
I agree that this needs to be properly documented, but I would argue that the runtime code of the contract type |
@chriseth mentioned contract types already have structs and enums as properties and A potential solutions is to consider #1447:
|
At the moment I'd actually prefer |
Although I'd make it a method then |
Implementing as |
That shouldn't be problem if it uses |
@axic I'm going with the same semantics for |
It turns out the optimizer cannot optimize |
Right, perhaps if we assume the main user going to be factory contracts, then for the single reason of being able to optimise out the has it makes sense to make that restriction right now. |
Why did we call this |
Contract types should get new members:
which are immutable members of
bytes memory
type that provide access to the contract's creation and runtime code. This is useful for usingcreate2
in inline assembly.If the optimizer does not compute
keccak256(C.creationCode)
, we should also provide an accessor for that.Note that we have to be careful with libraries, because they modifier their code at creation time.
The text was updated successfully, but these errors were encountered: