Commit 4c9b3313 authored by Mark Tyneway's avatar Mark Tyneway

devnet: refactor

parent 8906387e
...@@ -110,6 +110,20 @@ def deploy_contracts(paths): ...@@ -110,6 +110,20 @@ def deploy_contracts(paths):
response = json.loads(res) response = json.loads(res)
account = response['result'][0] account = response['result'][0]
log.info(f'Deploying with {account}')
# send some ether to the create2 deployer account
run_command([
'cast', 'send', '--from', account,
'--rpc-url', 'http://127.0.0.1:8545',
'--unlocked', '--value', '1ether', '0x3fAB184622Dc19b6109349B94811493BF2a45362'
], env={}, cwd=paths.contracts_bedrock_dir)
# deploy the create2 deployer
run_command([
'cast', 'publish', '--rpc-url', 'http://127.0.0.1:8545',
'0xf8a58085174876e800830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf31ba02222222222222222222222222222222222222222222222222222222222222222a02222222222222222222222222222222222222222222222222222222222222222'
], env={}, cwd=paths.contracts_bedrock_dir)
fqn = 'scripts/Deploy.s.sol:Deploy' fqn = 'scripts/Deploy.s.sol:Deploy'
run_command([ run_command([
...@@ -138,7 +152,8 @@ def devnet_l1_genesis(paths): ...@@ -138,7 +152,8 @@ def devnet_l1_genesis(paths):
geth = subprocess.Popen([ geth = subprocess.Popen([
'geth', '--dev', '--http', '--http.api', 'eth,debug', 'geth', '--dev', '--http', '--http.api', 'eth,debug',
'--verbosity', '4', '--gcmode', 'archive', '--dev.gaslimit', '30000000' '--verbosity', '4', '--gcmode', 'archive', '--dev.gaslimit', '30000000',
'--rpc.allow-unprotected-txs'
]) ])
forge = ChildProcess(deploy_contracts, paths) forge = ChildProcess(deploy_contracts, paths)
......
...@@ -55,8 +55,6 @@ func BuildL1DeveloperGenesis(config *DeployConfig, dump *gstate.Dump, l1Deployme ...@@ -55,8 +55,6 @@ func BuildL1DeveloperGenesis(config *DeployConfig, dump *gstate.Dump, l1Deployme
FundDevAccounts(memDB) FundDevAccounts(memDB)
SetPrecompileBalances(memDB) SetPrecompileBalances(memDB)
// TODO: perhaps place the code here?
if dump != nil { if dump != nil {
for address, account := range dump.Accounts { for address, account := range dump.Accounts {
name := "<unknown>" name := "<unknown>"
......
...@@ -49,12 +49,6 @@ contract Deploy is Deployer { ...@@ -49,12 +49,6 @@ 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_) {
...@@ -75,8 +69,6 @@ contract Deploy is Deployer { ...@@ -75,8 +69,6 @@ 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();
...@@ -111,24 +103,6 @@ contract Deploy is Deployer { ...@@ -111,24 +103,6 @@ contract Deploy is Deployer {
} }
} }
/// @notice
function deployCreate2Proxy() public {
if (CREATE2_PROXY.code.length == 0) {
require(CREATE2_PROXY_DEPLOYER.balance >= 0.007 ether, "Deployer balance too low");
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");
}
} else {
console.log("create2 proxy found at %s", CREATE2_PROXY);
}
}
/// @notice Deploy all of the proxies /// @notice Deploy all of the proxies
function deployProxies() public { function deployProxies() public {
deployAddressManager(); deployAddressManager();
......
...@@ -267,6 +267,8 @@ abstract contract Deployer is Script { ...@@ -267,6 +267,8 @@ abstract contract Deployer is Script {
'"', '"',
") | select(.transactionType == ", ") | select(.transactionType == ",
'"CREATE"', '"CREATE"',
" or .transactionType == "
'"CREATE2"',
")' < ", ")' < ",
deployPath deployPath
); );
......
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