question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ability to deploy proxy using create2

See original GitHub issue

It would be helpful if it were possible to define a salt when calling deployProxy which would indicate to use CREATE2 and deploy out a proxy at a deterministic address.

Happy to elaborate more, but for instance if I wanted to deploy the same upgradable proxy on two different chains, and make it so they have the same address, it wouldn’t be possible when using this library.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Amxxcommented, Jun 24, 2021

@habdelra, an EOA (wallet with a private key) cannot use create2. create2 power can only be used by a smart contract. This is why you need a factory.

You first need to use a script similar to what gnosis does to create the factory at the right address … and then (and only then) you can use create2 to instanciate “child-contracts”.

If you want a generic factory, that is available on most networks, and can be used to deploy anything (simple contract or complex factories) you can use this one.

All the details necessary to deploy it on any new chain, including hardhat/ganache chains, can be found here

Last shameless plug: my devcon talk that discuss the need for such factory

1reaction
frangiocommented, May 12, 2021

Yeah the hard thing is getting the factory in the same address on every network. As far as I know this is only possible to do reliably using “Nick’s method”.

The ability to deploy proxies on the same address on every network sounds good, but unfortunately we don’t have enough bandwidth right now to make it a priority.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deploying Smart Contracts Using CREATE2
The CREATE2 opcode gives us the ability predict the address where a contract will be deployed, without ever having to do so. This...
Read more >
Can I use create2 to deploy minimal proxies in solidity, without ...
Solidity 0.6.2 allows the creation of contracts with the create2 opcode via the new keyword and passing a salt in addition to any...
Read more >
EIP Proposal: CREATE2 contract factory precompile for ...
The idea behind this EIP is adding a precompile that executes a CREATE2 with whatever data is sent to it and a fixed...
Read more >
Metamorphosis Smart Contracts using CREATE2
So far, all of the Smart Contracts are linking a Proxy to another Smart ... With this solution you deploy a Smart Contract...
Read more >
Why create2?. Doing the “impossible” with create | Coinmonks
The stated idea behind this is to be able to predetermine the address of a contract in advance of deployment, such that a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found