diff --git a/ethereum/anvil_fork b/ethereum/anvil_fork index 9d5044c181..ad9644782d 100755 --- a/ethereum/anvil_fork +++ b/ethereum/anvil_fork @@ -5,11 +5,12 @@ set -euo pipefail # This script forks a chain using anvil with the mnemonic that is used in the # testing environment. -if [ -z "$1" ]; then +CHAIN_NAME="${1:-}" + +if [ -z "$CHAIN_NAME" ]; then echo "Usage: $0 " >&2 exit 1 fi -CHAIN_NAME="$1" DOCKER_ARGS="-p 8545:8545" ./foundry anvil --host 0.0.0.0 --base-fee 0 --fork-url $(worm info rpc mainnet $CHAIN_NAME) --mnemonic "myth like bonus scare over problem client lizard pioneer submit female collect" diff --git a/ethereum/sh/upgrade.sh b/ethereum/sh/upgrade.sh index 42e8c87b90..947b166181 100755 --- a/ethereum/sh/upgrade.sh +++ b/ethereum/sh/upgrade.sh @@ -8,14 +8,28 @@ set -euo pipefail -network=$1 -module=$2 -chain=$3 +network="${1:-}" +module="${2:-}" +chain="${3:-}" + +if [ -z "$network" ] || [ -z "$module" ] || [ -z "$chain" ]; then + echo "Usage: MNEMONIC=... $0 " >&2 + exit 1 +fi + +if [ -z "${MNEMONIC:-}" ]; then + echo "MNEMONIC unset" + exit 1 +fi secret=$MNEMONIC guardian_secret="" if [ "$network" = testnet ]; then + if [ -z "${GUARDIAN_MNEMONIC:-}" ]; then + echo "GUARDIAN_MNEMONIC unset" + exit 1 + fi guardian_secret=$GUARDIAN_MNEMONIC fi @@ -114,4 +128,4 @@ if [ "$network" = testnet ]; then worm submit $(worm generate upgrade -c "$chain" -a "$new_implementation" -m "$module" -g "$guardian_secret") -n "$network" else echo "../scripts/contract-upgrade-governance.sh -c $chain -m $verify_module -a $new_implementation" -fi \ No newline at end of file +fi diff --git a/ethereum/sh/upgrade_all_testnet.sh b/ethereum/sh/upgrade_all_testnet.sh index de3c283023..334fcde598 100755 --- a/ethereum/sh/upgrade_all_testnet.sh +++ b/ethereum/sh/upgrade_all_testnet.sh @@ -21,7 +21,7 @@ set -uo pipefail network=testnet for module in ${MODULES[@]}; do - for chain in ${chains[@]}; do + for chain in ${CHAINS[@]}; do echo "Upgrading ${chain} ${module} ********************************************************************" ./sh/upgrade.sh "$network" "$module" "$chain" done