-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Change the new operator to use CREATE2 #2136
Comments
Can you elaborate on this? |
Would that counter be shared across the contract for all creates, specific to the create in a certain code location or specific to creating a specific contract? |
I have written up this: https://ethereum-magicians.org/t/solidity-compiler-magicians-wanted-to-make-create2-usage-easier/2137 Yesterday I made this ERC20 contract (which is supposed to work under State rent when holders pay for storing their tokens): work: https://github.com/ledgerwatch/eth_state/blob/master/erc20/TokenContract.sol As you can see in the code, Solidity provides
It would be great to have (at least in a branch) a version of Solidity (derived from the current) supporting these two things. That would make further development of contracts like that much easier. |
The new2 function you suggest could be rather tricky to implement. What might be easier and could be almost as helpful to you would be something like |
Yes, that would definitely be helpful. And also the code hash, of course, because it can be computed at compile time |
The optimizer might take care of improving the hash computation, let's see. |
Created an issue #5647 |
@chriseth Your |
Let's not discuss in two different issues -> #5647 |
Separate from the Sometimes people drop into assembly to do things they shouldn't be doing, and I don't think we should be adding Solidity language features for such operations. However, using |
Whats the status of this? Would be nice to have a non-assembly CREATE2 |
Any there any suggestions for the syntax? I really dislike the
or just
We might even go so far to use
to replace |
Suggestion by @leonardoalt : |
Another suggestion by @leonardoalt: Also change to |
And then you can combine them: |
I like |
We might change it so that |
Suggestion from @axic: |
I also like |
Maybe we actually need to look at this in conjunction with #2296 and that we could consider removing the |
Folks seem to converge to |
Haha, I actually still like |
|
I am writing account contracts and there is a specific use case where I am having to override a function because I am unsure about gas operator. |
Decsion: We use |
Decision: We use |
But is it |
|
Implemented in #8177 |
This might require keeping a nonce or other measure to make the creation bytecode unique if
new
is used multpile times on the same contract.See https://eips.ethereum.org/EIPS/eip-1014
The text was updated successfully, but these errors were encountered: