Skip to content
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

Add CREATE2 contract factory #1644

Closed
nventuro opened this issue Feb 22, 2019 · 6 comments · Fixed by #2013
Closed

Add CREATE2 contract factory #1644

nventuro opened this issue Feb 22, 2019 · 6 comments · Fixed by #2013
Labels
contracts Smart contract code. feature New contracts, functions, or helpers.

Comments

@nventuro
Copy link
Contributor

nventuro commented Feb 22, 2019

As discussed with @cwhinfrey, @jamesyoung and @spalladino, it'd be interesting to include a factory such as archanova's (by @stanislaw-glogowski, which uses CREATE2, making it possible to predict the contract's address) into OpenZeppelin, possibly expanding upon it to cover more use cases.

One aspect in particular I'd like to discuss is constructor arguments: the linked implementation has a fixed bytecode, but it shouldn't be too difficult to come up with a scheme where these initial values are injected.

@nventuro nventuro added feature New contracts, functions, or helpers. contracts Smart contract code. labels Feb 22, 2019
@nventuro nventuro added this to the v2.3 milestone Feb 22, 2019
@come-maiz
Copy link
Contributor

Here is a nice example of a factory by @miguelmota, based on @stanislaw-glogowski's code:
https://github.com/miguelmota/solidity-create2-example

@marekkirejczyk
Copy link

I think there are two types of CREATE2 factories one might want to consider:

  1. standard on chain factory
  2. factory with support for metal-transactions

There is a significant difference in implementation, interface, and security, so I created a separate ticket for that #1651

@cwhinfrey
Copy link
Contributor

It may also be possible to have the factory contract in #1651 extend a base contract that only has internal functions like the one @stanislaw-glogowski created in archanova

@frangio frangio removed this from the v2.3 milestone Apr 8, 2019
@AugustoL
Copy link
Contributor

AugustoL commented May 9, 2019

Ive been playing with CREATE2, taking this issue, going to submit a PR with a simple CREATE2 factory. Later we can extend it to a factory with meta txs support.

@spalladino
Copy link
Contributor

@AugustoL keep an eye on the proxy factory we built for zOS, we could reuse some of that code.

@frangio
Copy link
Contributor

frangio commented Jan 20, 2020

We have this in a feature branch with some pending work. See #2013.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contracts Smart contract code. feature New contracts, functions, or helpers.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants