Commit 483d83b8 authored by Mark Tyneway's avatar Mark Tyneway

ctb: ensure create2 deployer is present

parent 3c97d6da
...@@ -55,6 +55,8 @@ var DevAccounts = []common.Address{ ...@@ -55,6 +55,8 @@ var DevAccounts = []common.Address{
common.HexToAddress("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"), common.HexToAddress("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"),
// Test account used by geth tests // Test account used by geth tests
common.HexToAddress("0x71562b71999873DB5b286dF957af199Ec94617F7"), common.HexToAddress("0x71562b71999873DB5b286dF957af199Ec94617F7"),
// Deployer of create2 deterministic proxy https://github.com/Arachnid/deterministic-deployment-proxy
common.HexToAddress("0x3fab184622dc19b6109349b94811493bf2a45362"),
} }
// The devBalance is the amount of wei that a dev account is funded with. // The devBalance is the amount of wei that a dev account is funded with.
......
...@@ -49,6 +49,12 @@ contract Deploy is Deployer { ...@@ -49,6 +49,12 @@ contract Deploy is Deployer {
/// addresses will be the same across networks when deployed with create2. /// addresses will be the same across networks when deployed with create2.
bytes32 constant IMPL_SALT = bytes32("ether's phoenix"); bytes32 constant IMPL_SALT = bytes32("ether's phoenix");
/// @notice The address of the create2 proxy used to deploy the implementations.
address constant CREATE2_PROXY = address(0x4e59b44847b379578588920cA78FbF26c0B4956C);
/// @notice
address constant CREATE2_PROXY_DEPLOYER = address(0x3fab184622dc19b6109349b94811493bf2a45362);
/// @notice The name of the script, used to ensure the right deploy artifacts /// @notice The name of the script, used to ensure the right deploy artifacts
/// are used. /// are used.
function name() public pure override returns (string memory name_) { function name() public pure override returns (string memory name_) {
...@@ -69,6 +75,8 @@ contract Deploy is Deployer { ...@@ -69,6 +75,8 @@ contract Deploy is Deployer {
function run() public { function run() public {
console.log("Deploying L1 system"); console.log("Deploying L1 system");
deployCreate2Proxy();
deployProxies(); deployProxies();
deployImplementations(); deployImplementations();
...@@ -103,6 +111,19 @@ contract Deploy is Deployer { ...@@ -103,6 +111,19 @@ contract Deploy is Deployer {
} }
} }
function deployCreate2Proxy() public {
if (CREATE2_PROXY.code.length == 0) {
console.log("Deploying create2 proxy to %s", CREATE2_PROXY);
string[] memory commands = new string[](3);
commands[0] = "bash";
commands[1] = "-c";
commands[2] = "cast publish 0xf8a58085174876e800830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf31ba02222222222222222222222222222222222222222222222222222222222222222a02222222222222222222222222222222222222222222222222222222222222222"
try vm.ffi(commands) {} catch (bytes memory) {
console.log("Error publishing");
}
}
}
/// @notice Deploy all of the proxies /// @notice Deploy all of the proxies
function deployProxies() public { function deployProxies() public {
deployAddressManager(); deployAddressManager();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment