Skip to content

Commit 9bdbb5f

Browse files
authored
[fix] Get deploy scripts working (#102)
* Add go mod files for deploys * Using bash files instead of golang script to format deploy config * remove chmod
1 parent e378870 commit 9bdbb5f

File tree

21 files changed

+133
-857
lines changed

21 files changed

+133
-857
lines changed

goerli-devnet/2023-05-18-deploy/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ include .env
77
##
88
.PHONY: deploy
99
deploy:
10-
go run cmd/foundry_deploy_config_gen/main.go
10+
./inputs/construct-config.sh && \
1111
forge script --rpc-url $(L1_RPC_URL) DeployBedrock --broadcast
1212
jq --sort-keys . unsorted.json > deployed/addresses.json
1313
cp deployed/addresses.json ../addresses.json

goerli-devnet/2023-05-18-deploy/cmd/foundry_deploy_config_gen/main.go

-115
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
DEPLOY_FIELDS='"batchSenderAddress","controller","deployerAddress","finalSystemOwner","finalizationPeriodSeconds","gasPriceOracleOverhead","gasPriceOracleScalar","l2BlockTime","l2OutputOracleChallenger","l2OutputOracleProposer","l2OutputOracleStartingBlockNumber","l2OutputOracleSubmissionInterval","p2pSequencerAddress","proxyAdminOwnerL2"'
4+
5+
DEPLOY_CONFIG_FILE="inputs/deploy-config.json"
6+
MISC_CONFIG_FILE="inputs/misc-config.json"
7+
FOUNDRY_CONFIG_FILE="inputs/foundry-config.json"
8+
9+
# Convert field from hex to decimal
10+
VALUE=$(jq -r '.l2GenesisBlockGasLimit' "$DEPLOY_CONFIG_FILE")
11+
GAS_LIMIT=$(printf %d $VALUE)
12+
13+
# Construct config file which will be the input in deploy script
14+
jq -s '.[0] * .[1]' "$DEPLOY_CONFIG_FILE" "$MISC_CONFIG_FILE" | \
15+
jq "with_entries(select([.key] | inside([$DEPLOY_FIELDS])))" | \
16+
jq --arg l2GenesisBlockGasLimit $GAS_LIMIT '. + {l2GenesisBlockGasLimit: $l2GenesisBlockGasLimit | tonumber}' | \
17+
jq --sort-keys | \
18+
jq '{"deployConfig": .}' > "$FOUNDRY_CONFIG_FILE"

goerli/2023-01-31-deploy/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ include .env
77
##
88
.PHONY: deploy
99
deploy:
10-
go run cmd/foundry_deploy_config_gen/main.go
10+
chmod +x inputs/construct-config.sh && ./inputs/construct-config.sh && \
1111
forge script --rpc-url $(L1_RPC_URL) RunDeployBedrock --broadcast
1212
jq --sort-keys . unsorted.json > deployed/addresses.json
1313
cp deployed/addresses.json ../addresses.json

goerli/2023-01-31-deploy/cmd/foundry_deploy_config_gen/main.go

-115
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
DEPLOY_FIELDS='"batchSenderAddress","controller","deployerAddress","finalSystemOwner","finalizationPeriodSeconds","gasPriceOracleOverhead","gasPriceOracleScalar","l2BlockTime","l2OutputOracleChallenger","l2OutputOracleProposer","l2OutputOracleStartingBlockNumber","l2OutputOracleSubmissionInterval","p2pSequencerAddress","proxyAdminOwnerL2"'
4+
5+
DEPLOY_CONFIG_FILE="inputs/deploy-config.json"
6+
MISC_CONFIG_FILE="inputs/misc-config.json"
7+
FOUNDRY_CONFIG_FILE="inputs/foundry-config.json"
8+
9+
# Convert field from hex to decimal
10+
VALUE=$(jq -r '.l2GenesisBlockGasLimit' "$DEPLOY_CONFIG_FILE")
11+
GAS_LIMIT=$(printf %d $VALUE)
12+
13+
# Construct config file which will be the input in deploy script
14+
jq -s '.[0] * .[1]' "$DEPLOY_CONFIG_FILE" "$MISC_CONFIG_FILE" | \
15+
jq "with_entries(select([.key] | inside([$DEPLOY_FIELDS])))" | \
16+
jq --arg l2GenesisBlockGasLimit $GAS_LIMIT '. + {l2GenesisBlockGasLimit: $l2GenesisBlockGasLimit | tonumber}' | \
17+
jq --sort-keys | \
18+
jq '{"deployConfig": .}' > "$FOUNDRY_CONFIG_FILE"

internal-devnet/2023-05-25-deploy/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ include .env
77
##
88
.PHONY: deploy
99
deploy:
10-
go run cmd/foundry_deploy_config_gen/main.go
10+
./inputs/construct-config.sh && \
1111
forge script --rpc-url $(L1_RPC_URL) --private-key $(PRIVATE_KEY) DeployBedrock --broadcast
1212
jq --sort-keys . unsorted.json > deployed/addresses.json
1313
cp deployed/addresses.json ../addresses.json

0 commit comments

Comments
 (0)