From b6fd53742d8ad3e8ddc7462008d160ade0b8b2b2 Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Mon, 2 Dec 2024 17:08:15 -0500 Subject: [PATCH] TELEPORTER_PATH to ICM_SERVIVES_PATH --- scripts/abi_bindings.sh | 28 +++++++++++++------------- scripts/deploy_registry.sh | 4 ++-- scripts/deploy_teleporter.sh | 4 ++-- scripts/e2e_test.sh | 16 +++++++-------- scripts/install_avalanchego_release.sh | 6 +++--- scripts/install_subnetevm_release.sh | 6 +++--- scripts/lint.sh | 14 ++++++------- scripts/versions.sh | 8 ++++---- 8 files changed, 43 insertions(+), 43 deletions(-) diff --git a/scripts/abi_bindings.sh b/scripts/abi_bindings.sh index 762af320d..b7a2d58f2 100755 --- a/scripts/abi_bindings.sh +++ b/scripts/abi_bindings.sh @@ -4,13 +4,13 @@ set -e -TELEPORTER_PATH=$( +ICM_CONTRACTS_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" cd .. && pwd ) -source $TELEPORTER_PATH/scripts/constants.sh -source $TELEPORTER_PATH/scripts/versions.sh +source $ICM_CONTRACTS_PATH/scripts/constants.sh +source $ICM_CONTRACTS_PATH/scripts/versions.sh export ARCH=$(uname -m) [ $ARCH = x86_64 ] && ARCH=amd64 @@ -47,7 +47,7 @@ if [ "$HELP" = true ]; then fi if ! command -v forge &> /dev/null; then - echo "forge not found. You can install by calling $TELEPORTER_PATH/scripts/install_foundry.sh" && exit 1 + echo "forge not found. You can install by calling $ICM_CONTRACTS_PATH/scripts/install_foundry.sh" && exit 1 fi if ! command -v solc &> /dev/null; then @@ -70,12 +70,12 @@ echo "Building subnet-evm abigen" go install github.com/ava-labs/subnet-evm/cmd/abigen@${SUBNET_EVM_VERSION} # Solc does not recursively expand remappings, so we must construct them manually -remappings=$(cat $TELEPORTER_PATH/remappings.txt) +remappings=$(cat $ICM_CONTRACTS_PATH/remappings.txt) # Recursively search for all remappings.txt files in the lib directory. # For each file, prepend the remapping with the relative path to the file. while read -r filepath; do - relative_path="${filepath#$TELEPORTER_PATH/}" + relative_path="${filepath#$ICM_CONTRACTS_PATH/}" dir_path=$(dirname "$relative_path") echo $dir_path @@ -83,7 +83,7 @@ while read -r filepath; do # so that each remapping is of the form @token=lib/path/to/remapping transformed_lines=$(sed -n "s|^\(@[^=]*=\)\(.*\)|\1$dir_path/\2|p" "$filepath") remappings+=" $transformed_lines " -done < <(find "$TELEPORTER_PATH/lib" -type f -name "remappings.txt" ) +done < <(find "$ICM_CONTRACTS_PATH/lib" -type f -name "remappings.txt" ) function convertToLower() { if [ "$ARCH" = 'arm64' ]; then @@ -125,12 +125,12 @@ function generate_bindings() { dir="${dir#./}" echo "Building $contract_name..." - mkdir -p $TELEPORTER_PATH/out/$contract_name.sol + mkdir -p $ICM_CONTRACTS_PATH/out/$contract_name.sol - combined_json=$TELEPORTER_PATH/out/$contract_name.sol/combined-output.json + combined_json=$ICM_CONTRACTS_PATH/out/$contract_name.sol/combined-output.json cwd=$(pwd) - cd $TELEPORTER_PATH + cd $ICM_CONTRACTS_PATH solc --optimize --evm-version $EVM_VERSION --combined-json abi,bin,metadata,ast,devdoc,userdoc --pretty-json $cwd/$dir/$contract_name.sol $remappings > $combined_json cd $cwd @@ -140,7 +140,7 @@ function generate_bindings() { # Filter out the contract we are generating bindings for filtered_contracts=$(remove_matching_string $contracts $contract_name) - gen_path=$TELEPORTER_PATH/abi-bindings/go/$dir/$contract_name + gen_path=$ICM_CONTRACTS_PATH/abi-bindings/go/$dir/$contract_name mkdir -p $gen_path echo "Generating Go bindings for $contract_name..." @@ -174,15 +174,15 @@ if [[ -z "${CONTRACT_LIST}" ]]; then contract_names=($DEFAULT_CONTRACT_LIST) fi -cd $TELEPORTER_PATH/contracts +cd $ICM_CONTRACTS_PATH/contracts generate_bindings "${contract_names[@]}" contract_names=($PROXY_LIST) -cd $TELEPORTER_PATH/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/proxy/transparent +cd $ICM_CONTRACTS_PATH/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/proxy/transparent generate_bindings "${contract_names[@]}" contract_names=($SUBNET_EVM_LIST) -cd $TELEPORTER_PATH/lib/subnet-evm/contracts/contracts/interfaces +cd $ICM_CONTRACTS_PATH/lib/subnet-evm/contracts/contracts/interfaces generate_bindings "${contract_names[@]}" exit 0 diff --git a/scripts/deploy_registry.sh b/scripts/deploy_registry.sh index dc69b70f1..193e59f52 100755 --- a/scripts/deploy_registry.sh +++ b/scripts/deploy_registry.sh @@ -4,14 +4,14 @@ set -e -TELEPORTER_PATH=$( +ICM_CONTRACTS_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" cd .. && pwd ) # Check that foundry (specifically cast) is installed. if ! command -v cast &> /dev/null; then - echo "cast not found. You can install by calling $TELEPORTER_PATH/scripts/install_foundry.sh" && exit 1 + echo "cast not found. You can install by calling $ICM_CONTRACTS_PATH/scripts/install_foundry.sh" && exit 1 fi # Check that jq is installed. diff --git a/scripts/deploy_teleporter.sh b/scripts/deploy_teleporter.sh index f96564bec..606fe76f6 100755 --- a/scripts/deploy_teleporter.sh +++ b/scripts/deploy_teleporter.sh @@ -4,14 +4,14 @@ set -e -TELEPORTER_PATH=$( +ICM_CONTRACTS_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" cd .. && pwd ) # Check that foundry (specifically cast) is installed. if ! command -v cast &> /dev/null; then - echo "cast not found. You can install by calling $TELEPORTER_PATH/scripts/install_foundry.sh" && exit 1 + echo "cast not found. You can install by calling $ICM_CONTRACTS_PATH/scripts/install_foundry.sh" && exit 1 fi # Check that jq is installed. diff --git a/scripts/e2e_test.sh b/scripts/e2e_test.sh index 475367684..6020e93a8 100755 --- a/scripts/e2e_test.sh +++ b/scripts/e2e_test.sh @@ -4,7 +4,7 @@ set -e -TELEPORTER_PATH=$( +ICM_CONTRACTS_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" cd ../ && pwd ) @@ -26,7 +26,7 @@ Options: EOF } -valid_components=$(ls -d $TELEPORTER_PATH/tests/suites/*/ | xargs -n 1 basename) +valid_components=$(ls -d $ICM_CONTRACTS_PATH/tests/suites/*/ | xargs -n 1 basename) components= while [ $# -gt 0 ]; do @@ -58,23 +58,23 @@ for component in $(echo $components | tr ',' ' '); do fi done -source "$TELEPORTER_PATH"/scripts/constants.sh -source "$TELEPORTER_PATH"/scripts/versions.sh +source "$ICM_CONTRACTS_PATH"/scripts/constants.sh +source "$ICM_CONTRACTS_PATH"/scripts/versions.sh BASEDIR=${BASEDIR:-"$HOME/.teleporter-deps"} cwd=$(pwd) # Install the avalanchego and subnet-evm binaries rm -rf $BASEDIR/avalanchego -BASEDIR=$BASEDIR AVALANCHEGO_BUILD_PATH=$BASEDIR/avalanchego "${TELEPORTER_PATH}/scripts/install_avalanchego_release.sh" -BASEDIR=$BASEDIR "${TELEPORTER_PATH}/scripts/install_subnetevm_release.sh" +BASEDIR=$BASEDIR AVALANCHEGO_BUILD_PATH=$BASEDIR/avalanchego "${ICM_CONTRACTS_PATH}/scripts/install_avalanchego_release.sh" +BASEDIR=$BASEDIR "${ICM_CONTRACTS_PATH}/scripts/install_subnetevm_release.sh" cp ${BASEDIR}/subnet-evm/subnet-evm ${BASEDIR}/avalanchego/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy echo "Copied ${BASEDIR}/subnet-evm/subnet-evm binary to ${BASEDIR}/avalanchego/plugins/" export AVALANCHEGO_BUILD_PATH=$BASEDIR/avalanchego -cd $TELEPORTER_PATH +cd $ICM_CONTRACTS_PATH if command -v forge &> /dev/null; then forge build --skip test else @@ -82,7 +82,7 @@ else $HOME/.foundry/bin/forge build fi -cd "$TELEPORTER_PATH" +cd "$ICM_CONTRACTS_PATH" # Build ginkgo # to install the ginkgo binary (required for test build and run) go install -v github.com/onsi/ginkgo/v2/ginkgo@${GINKGO_VERSION} diff --git a/scripts/install_avalanchego_release.sh b/scripts/install_avalanchego_release.sh index eed230b31..f66759532 100755 --- a/scripts/install_avalanchego_release.sh +++ b/scripts/install_avalanchego_release.sh @@ -6,14 +6,14 @@ set -e # Load the versions -TELEPORTER_PATH=$( +ICM_CONTRACTS_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" cd .. && pwd ) -source "$TELEPORTER_PATH"/scripts/versions.sh +source "$ICM_CONTRACTS_PATH"/scripts/versions.sh # Load the constants -source "$TELEPORTER_PATH"/scripts/constants.sh +source "$ICM_CONTRACTS_PATH"/scripts/constants.sh ############################ # download avalanchego diff --git a/scripts/install_subnetevm_release.sh b/scripts/install_subnetevm_release.sh index bd14df502..a5cb497de 100755 --- a/scripts/install_subnetevm_release.sh +++ b/scripts/install_subnetevm_release.sh @@ -6,12 +6,12 @@ set -e # Load the versions -TELEPORTER_PATH=$( +ICM_CONTRACTS_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" cd .. && pwd ) -source "$TELEPORTER_PATH"/scripts/versions.sh -source "$TELEPORTER_PATH"/scripts/constants.sh +source "$ICM_CONTRACTS_PATH"/scripts/versions.sh +source "$ICM_CONTRACTS_PATH"/scripts/constants.sh ############################ # download subnet-evm diff --git a/scripts/lint.sh b/scripts/lint.sh index 6743ca1a4..af19105d4 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -4,29 +4,29 @@ set -e -TELEPORTER_PATH=$( +ICM_CONTRACTS_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" cd .. && pwd ) -source $TELEPORTER_PATH/scripts/versions.sh +source $ICM_CONTRACTS_PATH/scripts/versions.sh function solFormat() { # format solidity contracts echo "Formatting Solidity contracts..." - forge fmt --root $TELEPORTER_PATH $TELEPORTER_PATH/contracts/** + forge fmt --root $ICM_CONTRACTS_PATH $ICM_CONTRACTS_PATH/contracts/** } function solFormatCheck() { # format solidity contracts echo "Checking formatting of Solidity contracts..." - forge fmt --check --root $TELEPORTER_PATH $TELEPORTER_PATH/contracts/** + forge fmt --check --root $ICM_CONTRACTS_PATH $ICM_CONTRACTS_PATH/contracts/** } function solLinter() { # lint solidity contracts echo "Linting Solidity contracts..." - cd $TELEPORTER_PATH + cd $ICM_CONTRACTS_PATH # "solhint **/*.sol" runs differently than "solhint '**/*.sol'", where the latter checks sol files # in subdirectories. The former only checks sol files in the current directory and directories one level down. solhint '**/*.sol' --config ./.solhint.json --ignore-path ./.solhintignore --max-warnings 0 @@ -37,8 +37,8 @@ function golangLinter() { go install -v github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION} echo "Linting Golang code..." - cd $TELEPORTER_PATH - golangci-lint run --config=$TELEPORTER_PATH/.golangci.yml ./... + cd $ICM_CONTRACTS_PATH + golangci-lint run --config=$ICM_CONTRACTS_PATH/.golangci.yml ./... } function runAll() { diff --git a/scripts/versions.sh b/scripts/versions.sh index a2fd7cbce..a5bbd60da 100755 --- a/scripts/versions.sh +++ b/scripts/versions.sh @@ -5,7 +5,7 @@ set -e set -o pipefail -TELEPORTER_PATH=$( +ICM_CONTRACTS_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" cd .. && pwd ) @@ -13,7 +13,7 @@ TELEPORTER_PATH=$( # Pass in the full name of the dependency. # Parses go.mod for a matching entry and extracts the version number. function getDepVersion() { - grep -m1 "^\s*$1" $TELEPORTER_PATH/go.mod | cut -d ' ' -f2 + grep -m1 "^\s*$1" $ICM_CONTRACTS_PATH/go.mod | cut -d ' ' -f2 } function extract_commit() { @@ -44,5 +44,5 @@ SUBNET_EVM_VERSION=${SUBNET_EVM_VERSION:-$(extract_commit "$(getDepVersion githu GOLANGCI_LINT_VERSION=${GOLANGCI_LINT_VERSION:-'v1.60'} # Extract the Solidity version from foundry.toml -SOLIDITY_VERSION=$(awk -F"'" '/^solc_version/ {print $2}' $TELEPORTER_PATH/foundry.toml) -EVM_VERSION=$(awk -F"'" '/^evm_version/ {print $2}' $TELEPORTER_PATH/foundry.toml) +SOLIDITY_VERSION=$(awk -F"'" '/^solc_version/ {print $2}' $ICM_CONTRACTS_PATH/foundry.toml) +EVM_VERSION=$(awk -F"'" '/^evm_version/ {print $2}' $ICM_CONTRACTS_PATH/foundry.toml)