Skip to content

Commit

Permalink
feat: setup to deploy on base network
Browse files Browse the repository at this point in the history
  • Loading branch information
yum0e committed Aug 17, 2023
1 parent c9e519b commit 1e07c08
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ lib
.hardhat/contracts

# Deployment files
deployments/test.json
**deployments/test/*.json
**/tmp/*
!**/tmp/example.json
2 changes: 2 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ solc_version="0.8.19"
[rpc_endpoints]
arbitrum_one = "https://arb-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}"
arbitrum_goerli = "https://arb-goerli.g.alchemy.com/v2/${ALCHEMY_API_KEY}"
base = "https://mainnet.base.org"
base_goerli = "https://goerli.base.org"
goerli = "https://eth-goerli.g.alchemy.com/v2/${ALCHEMY_API_KEY}"
gnosis = "https://rpc.gnosischain.com"
localhost = "http://localhost:8545"
Expand Down
4 changes: 3 additions & 1 deletion script/BaseConfig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,20 @@ contract BaseDeploymentConfig is Script {
_compareStrings(chainName, "polygon") ||
_compareStrings(chainName, "optimism") ||
_compareStrings(chainName, "arbitrum-one") ||
_compareStrings(chainName, "base") ||
_compareStrings(chainName, "testnet-goerli") ||
_compareStrings(chainName, "testnet-sepolia") ||
_compareStrings(chainName, "testnet-mumbai") ||
_compareStrings(chainName, "optimism-goerli") ||
_compareStrings(chainName, "arbitrum-goerli") ||
_compareStrings(chainName, "base-goerli") ||
_compareStrings(chainName, "scroll-testnet-goerli") ||
_compareStrings(chainName, "staging-goerli") ||
_compareStrings(chainName, "staging-mumbai") ||
_compareStrings(chainName, "test")
) {
config = _readDeploymentConfig(
string.concat(vm.projectRoot(), "/deployments/", chainName, "/run-latest.json")
string.concat(vm.projectRoot(), "/deployments/", chainName, ".json")
);
} else {
revert ChainNameNotFound(chainName);
Expand Down
6 changes: 1 addition & 5 deletions script/bash/save-deployments.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,12 @@ find "$source_folder" -type f -name "*.json" | while read -r json_file; do
subfolder_name=$(basename "$subfolder")
destination_folder="$destination_root/$subfolder_name"

# Create the destination folder after deleting the previous one if it exists
if [ -d "$destination_folder" ]; then rm -Rf $destination_folder; fi
mkdir "$destination_folder"

# Find the latest JSON file in the subfolder
latest_file=$(ls -t "$subfolder"/*.json | head -n 1)

if [ -n "$latest_file" ]; then
# Copy the latest JSON file to the destination folder to keep track of the latest deployment
cp "$latest_file" "$destination_folder"
cp "$latest_file" "$destination_root/$subfolder_name.json"
else
echo "No matching files found in $subfolder_name."
fi
Expand Down

0 comments on commit 1e07c08

Please sign in to comment.