Commit 2d3216cd authored by Diederik Loerakker's avatar Diederik Loerakker Committed by GitHub

feat(ops-bedrock): fix devnet setup (#2584)

Co-authored-by: default avatarmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent dd29c40d
...@@ -58,8 +58,9 @@ devnet-clean: ...@@ -58,8 +58,9 @@ devnet-clean:
rm -rf ./contracts-bedrock/deployments/devnetL1 rm -rf ./contracts-bedrock/deployments/devnetL1
rm -rf ./.devnet rm -rf ./.devnet
cd ./ops-bedrock && docker-compose down cd ./ops-bedrock && docker-compose down
docker volume rm ops_l1_data docker volume rm ops-bedrock_l1_data
docker volume rm ops_l2_data docker volume rm ops-bedrock_l2_data
docker volume rm ops-bedrock_op_log
.PHONY: devnet-clean .PHONY: devnet-clean
test-unit: test-unit:
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
# time in this script. # time in this script.
# #
# This script is safe to run multiple times. It stores state in `.devnet`, and # This script is safe to run multiple times. It stores state in `.devnet`, and
# packages/contracts/deployments/devnetL1. # contracts-bedrock/deployments/devnetL1.
# #
# Don't run this script directly. Run it using the makefile, e.g. `make devnet-up`. # Don't run this script directly. Run it using the makefile, e.g. `make devnet-up`.
# To clean up your devnet, run `make devnet-clean`. # To clean up your devnet, run `make devnet-clean`.
...@@ -72,17 +72,17 @@ wait_up $L1_URL ...@@ -72,17 +72,17 @@ wait_up $L1_URL
cd ../ cd ../
# Deploy contracts using Hardhat. # Deploy contracts using Hardhat.
if [ ! -f ./packages/contracts/deployments/devnetL1/OptimismPortal.json ]; then if [ ! -f ./contracts-bedrock/deployments/devnetL1/OptimismPortal.json ]; then
echo "Deploying contracts." echo "Deploying contracts."
cd ./packages/contracts cd ./contracts-bedrock
L2OO_STARTING_BLOCK_TIMESTAMP=$GENESIS_TIMESTAMP yarn hardhat --network devnetL1 deploy L2OO_STARTING_BLOCK_TIMESTAMP=$GENESIS_TIMESTAMP yarn hardhat --network devnetL1 deploy
cd ../../ cd ../
else else
echo "Contracts already deployed, skipping." echo "Contracts already deployed, skipping."
fi fi
function get_deployed_bytecode() { function get_deployed_bytecode() {
echo $(jq -r .deployedBytecode ./packages/contracts/artifacts/contracts/$1) echo $(jq -r .deployedBytecode ./contracts-bedrock/artifacts/contracts/$1)
} }
# Pull out the necessary bytecode/addresses from the artifacts/deployments. # Pull out the necessary bytecode/addresses from the artifacts/deployments.
...@@ -92,8 +92,8 @@ OPTIMISM_MINTABLE_TOKEN_FACTORY_BYTECODE=$(get_deployed_bytecode universal/Optim ...@@ -92,8 +92,8 @@ OPTIMISM_MINTABLE_TOKEN_FACTORY_BYTECODE=$(get_deployed_bytecode universal/Optim
L2_STANDARD_BRIDGE_BYTECODE=$(get_deployed_bytecode L2/L2StandardBridge.sol/L2StandardBridge.json) L2_STANDARD_BRIDGE_BYTECODE=$(get_deployed_bytecode L2/L2StandardBridge.sol/L2StandardBridge.json)
L1_BLOCK_INFO_BYTECODE=$(get_deployed_bytecode L2/L1Block.sol/L1Block.json) L1_BLOCK_INFO_BYTECODE=$(get_deployed_bytecode L2/L1Block.sol/L1Block.json)
DEPOSIT_CONTRACT_ADDRESS=$(jq -r .address < ./packages/contracts/deployments/devnetL1/OptimismPortal.json) DEPOSIT_CONTRACT_ADDRESS=$(jq -r .address < ./contracts-bedrock/deployments/devnetL1/OptimismPortal.json)
L2OO_ADDRESS=$(jq -r .address < ./packages/contracts/deployments/devnetL1/L2OutputOracle.json) L2OO_ADDRESS=$(jq -r .address < ./contracts-bedrock/deployments/devnetL1/L2OutputOracle.json)
# Replace values in the L2 genesis file. It doesn't matter if this gets run every time, # Replace values in the L2 genesis file. It doesn't matter if this gets run every time,
# since the replaced values will be the same. # since the replaced values will be the same.
......
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