You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a POC of using createX to implement a create2 execution strategy. We want to work this up to a full implementation that we can release. You can find the PR here: #626
TODO
Rebase with development
Update CreateX to v0.1.0
In strategy update the list of existing deployed addresses to match: https://createx.rocks/deployments. If the network is not in the list, call eth_getCode at the create2 factory address 0xba5Ed099633D3B313e4D5F7bdc1305d3c28ba5Ed to see if someone else has deployed it.
In strategy init leverage the signed transactions outlined here: https://github.com/pcaversaccio/createx#new-deployments, to support creation of a factory in local nodes. If the factory is not present and it is not a 31337 chainId (i.e. a HH node) throw - we can deal with deploying a factory against a real network as a separate issue.
Update the api on the deploy function to be an enumeration that can have two values: basic | create2. If no strategy is given default to basic.
Update the UI to show the strategy, the suggestion is everywhere we currently show Deploying [xxx] we should show the strategy (and that it is a strategy). If other changes are needed make a call. The UI tweaks doc is likely useful for considering the different cases: https://www.notion.so/nomicfoundation/UI-tweaks-4197056e017e43239550c582f9b962cb?pvs=4
Test Suite
Maybe an approach to testing here is to add a new section under the hardat-plugin package integration tests.
Those tests should iterate between the two strategies: basic and create2 for a core set of tests:
Deploy a contract
Deploy multiple contracts
Make a call against a contract
Read an event from a constructor
Read an event from a call
The goal here is to show up a problem with a strategy where we switch from one strategy to another (e.g. calls still work even though we are mainly about contract deploys in create2), and allow us to support an increasing number of strategies.
There should also be a section of integration tests just for create2 testing:
Deploy with an existing create2 contract based on the known list (chainId hackery for the win)
Deploy with an existing create2 not on the list
Deploy without a create2 to 31337
Deploy without a create2 to non-31337 throws
The text was updated successfully, but these errors were encountered:
Hello. While the CREATE2 could be usable for independent contracts, it does not allow deployments to the same address if you use different constructor parameters (for immutable variables for instance).
CreateX conveniently provides a CREATE3 functionality, that lets you deploy to a deterministic address independent from the actual bytecode. This would probably be more useful for Hardhat users.
Do you think it would be better to add create3 strategy, or modify the create2 one to actually work as create3?
Hello. While the CREATE2 could be usable for independent contracts, it does not allow deployments to the same address if you use different constructor parameters (for immutable variables for instance). CreateX conveniently provides a CREATE3 functionality, that lets you deploy to a deterministic address independent from the actual bytecode. This would probably be more useful for Hardhat users. Do you think it would be better to add create3 strategy, or modify the create2 one to actually work as create3?
Hey @lastperson, create3 support is a great suggestion. I have opened an issue for it here: #726, so others can weigh in/up vote.
We have a POC of using createX to implement a
create2
execution strategy. We want to work this up to a full implementation that we can release. You can find the PR here: #626TODO
v0.1.0
eth_getCode
at the create2 factory address0xba5Ed099633D3B313e4D5F7bdc1305d3c28ba5Ed
to see if someone else has deployed it.basic
|create2
. If no strategy is given default tobasic
.Deploying [xxx]
we should show the strategy (and that it is a strategy). If other changes are needed make a call. The UI tweaks doc is likely useful for considering the different cases: https://www.notion.so/nomicfoundation/UI-tweaks-4197056e017e43239550c582f9b962cb?pvs=4Test Suite
Maybe an approach to testing here is to add a new section under the
hardat-plugin
package integration tests.Those tests should iterate between the two strategies:
basic
andcreate2
for a core set of tests:The goal here is to show up a problem with a strategy where we switch from one strategy to another (e.g. calls still work even though we are mainly about contract deploys in create2), and allow us to support an increasing number of strategies.
There should also be a section of integration tests just for create2 testing:
The text was updated successfully, but these errors were encountered: