From 1e07c08c7b3cf004d85d2bfd6b423eb90744bc58 Mon Sep 17 00:00:00 2001 From: bigq Date: Thu, 17 Aug 2023 17:49:10 +0200 Subject: [PATCH] feat: setup to deploy on base network --- .gitignore | 1 + foundry.toml | 2 ++ script/BaseConfig.sol | 4 +++- script/bash/save-deployments.sh | 6 +----- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index c0b72bb..5cc712b 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ lib .hardhat/contracts # Deployment files +deployments/test.json **deployments/test/*.json **/tmp/* !**/tmp/example.json diff --git a/foundry.toml b/foundry.toml index e04919c..c94bbbf 100644 --- a/foundry.toml +++ b/foundry.toml @@ -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" diff --git a/script/BaseConfig.sol b/script/BaseConfig.sol index fbd7526..c7cbc61 100644 --- a/script/BaseConfig.sol +++ b/script/BaseConfig.sol @@ -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); diff --git a/script/bash/save-deployments.sh b/script/bash/save-deployments.sh index 52bf4ab..007c555 100755 --- a/script/bash/save-deployments.sh +++ b/script/bash/save-deployments.sh @@ -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