Repository: skalenetwork/IMA (language: python)

Issue:
Prepare infrastructure for skale-contracts
- add ABI generation
- store ABI to a github release
- store ABI to the `abi` branch
- add test of ABI generation


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 76548c7d8..7b4ebc403 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -41,8 +41,7 @@ jobs:
         cache: 'yarn'
 
     - name: Install project
-      run: |
-        yarn install
+      run: yarn install
 
     - name: Install slither
       run: pip3 install -r scripts/requirements.txt
@@ -59,6 +58,11 @@ jobs:
     - name: Slither checks
       run: yarn slither
 
+    - name: Test ABI generation
+      env:
+        VERSION: "0.0.0"
+      run: npx hardhat run scripts/generateAbi.ts
+
     - name: Gas calculation test
       run: npx hardhat test gas/calculateGas.ts
 
@@ -66,7 +70,7 @@ jobs:
       run: bash ./scripts/test_deploy.sh
 
     - name: Test upgrade
-      run: bash ./scripts/test_upgrade.sh
+      run: bash scripts/test_upgrade.sh
 
     - name: Run tests
       run: |
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 9b08804ed..b57976aaf 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -12,47 +12,43 @@ on:
     tags:
       - 'custom-release-*'
 
+env:
+  NODE_VERSION: 18
+  PYTHON_VERSION: 3.8
+
 jobs:
   build:
     runs-on: ubuntu-latest
-    if: github.event.pull_request.merged == true
+
+    if: github.event_name != 'pull_request' || github.event.pull_request.merged == true
+
     env:
       DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
       DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
-      PROXY_DIR: "proxy"
-    steps:
-    - uses: actions/checkout@v2
-      with:
-          submodules: recursive
 
-    - name: Get yarn cache directory path
-      id: yarn-cache-dir-path
-      run: echo "::set-output name=dir::$(yarn cache dir)"
+    defaults:
+      run:
+        working-directory: proxy
 
-    - uses: actions/cache@v2
-      id: yarn-cache
-      with:
-        path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
-        key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
-        restore-keys: |
-          ${{ runner.os }}-yarn-
+    outputs:
+      version: ${{ steps.version.outputs.version }}
 
-    - uses: actions/cache@v2
+    steps:
+    - uses: actions/checkout@v4
       with:
-        path: ~/.cache/pip
-        key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
-        restore-keys: |
-          ${{ runner.os }}-pip-
+          submodules: recursive
 
     - name: Install NODE JS
-      uses: actions/setup-node@v2
+      uses: actions/setup-node@v3
       with:
-        node-version: '18'
+        node-version: ${{ env.NODE_VERSION }}
+        cache: 'yarn'
 
-    - name: Install Python 3.8
-      uses: actions/setup-python@v2
+    - name: Set up Python
+      uses: actions/setup-python@v4
       with:
-        python-version: 3.8
+        python-version: ${{ env.PYTHON_VERSION }}
+        cache: 'pip'
 
     - name: Prepare for pip package building
       run: |
@@ -60,45 +56,44 @@ jobs:
         python3 -m pip install --user --upgrade twine
 
     - name: Install project
-      working-directory: ${{env.PROXY_DIR}}
-      run: |
-        yarn install
+      run: yarn install
 
     - name: Calculate version
+      id: version
+      working-directory: ./
       run: |
         export BRANCH=${GITHUB_REF##*/}
         echo "Branch $BRANCH"
         export VERSION=$(bash ./scripts/calculate_version.sh)
         echo "VERSION=$VERSION" >> $GITHUB_ENV
+        echo "version=$VERSION" >> "$GITHUB_OUTPUT"
         echo "Version $VERSION"
         ( test $BRANCH = "stable" && export PRERELEASE=false ) || export PRERELEASE=true
         echo "PRERELEASE=$PRERELEASE" >> $GITHUB_ENV
 
     - name: Generate Manifest
-      working-directory: ${{env.PROXY_DIR}}
-      run: |
-        npx hardhat run migrations/generateManifest.ts
+      run: npx hardhat run migrations/generateManifest.ts
 
     - name: Install python testing staff
-      working-directory: ${{env.PROXY_DIR}}
       run: pip3 install -r predeployed/test/requirements.txt
 
     - name: Build predeployed pip package
-      working-directory: ${{env.PROXY_DIR}}
       env:
         VERSION: ${{ env.VERSION }}
-      run: |
-        ./predeployed/scripts/build_package.sh
+      run: ./predeployed/scripts/build_package.sh
 
     - name: Publish predeployed pip package
-      working-directory: ${{env.PROXY_DIR}}
       env:
         PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
-      run: |
-        ./predeployed/scripts/publish_package.sh
+      run: ./predeployed/scripts/publish_package.sh
+
+    - name: Generate mainnet ABIs
+      env:
+        VERSION: ${{ env.VERSION }}
+      run: npx hardhat run scripts/generateAbi.ts
 
-    - name: Generate ABIs
-      working-directory: ${{env.PROXY_DIR}}/predeployed
+    - name: Generate predeployed ABIs
+      working-directory: proxy/predeployed
       env:
         VERSION: ${{ env.VERSION }}
       run: |
@@ -108,47 +103,52 @@ jobs:
         mkdir data
         python scripts/generate_abi.py > data/ima-$VERSION-predeployed-abi.json
 
-    - name: Create Release
-      id: create_release
-      uses: actions/create-release@v1
-      env:
-        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+    - name: Store artifacts
+      uses: actions/upload-artifact@v4
       with:
-        tag_name: ${{ env.VERSION }}
-        release_name: ${{ env.VERSION }}
-        draft: false
-        prerelease: ${{ env.PRERELEASE }}
+        name: data
+        path: proxy/data
 
-    - name: Upload Release Assets
-      id: upload-release-assets
-      uses: dwenegar/upload-release-assets@v1
-      env:
-        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-      with:
-        release_id: ${{ steps.create_release.outputs.id }}
-        assets_path: proxy/predeployed/dist/
-
-    - name: Upload Release Assets
-      id: upload-static-data
-      uses: dwenegar/upload-release-assets@v1
-      env:
-        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-      with:
-        release_id: ${{ steps.create_release.outputs.id }}
-        assets_path: proxy/predeployed/data/
-
-    - name: Upload Release Assets
-      id: upload-manifest-data
-      uses: dwenegar/upload-release-assets@v1
-      env:
-        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+    - name: Create Release
+      uses: ncipollo/release-action@v1
       with:
-        release_id: ${{ steps.create_release.outputs.id }}
-        assets_path: proxy/data/ima-schain-*-manifest.json
+        tag: ${{ env.VERSION }}
+        prerelease: ${{ env.PRERELEASE }}
+        artifacts: "proxy/predeployed/dist/*,\
+                    proxy/predeployed/data/*,\
+                    proxy/data/ima-schain-*-manifest.json,\
+                    proxy/data/*-abi.json"
 
     - name: Build and publish image
+      working-directory: ./
       env:
         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
         DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
         DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
       run: scripts/build_and_publish_image.sh
+
+  abi:
+    runs-on: ubuntu-latest
+
+    needs:
+      build
+
+    env:
+      VERSION: ${{ needs.build.outputs.version }}
+
+    steps:
+      - uses: actions/checkout@v4
+        with:
+          ref: abi
+
+      - name: Load artifacts
+        uses: actions/download-artifact@v4
+        with:
+          name: data
+
+      - name: Commit ABI
+        uses: EndBug/add-and-commit@v9
+        with:
+          default_author: github_actions
+          message: "Add ABI for version ${{ env.VERSION }}"
+          add: "*-abi.json"
diff --git a/VERSION b/VERSION
index 7ec1d6db4..ccbccc3dc 100644
--- a/VERSION
+++ b/VERSION
@@ -1,1 +1,1 @@
-2.1.0
+2.2.0
diff --git a/proxy/migrations/deployMainnet.ts b/proxy/migrations/deployMainnet.ts
index 668506f2c..db2fe6b45 100644
--- a/proxy/migrations/deployMainnet.ts
+++ b/proxy/migrations/deployMainnet.ts
@@ -219,6 +219,13 @@ async function main() {
                     try {
                         await contractManagerInst.setContractsAddress( "MessageProxyForMainnet", deployed.get( "MessageProxyForMainnet" )?.address);
                         await contractManagerInst.setContractsAddress( "CommunityPool", deployed.get( "CommunityPool" )?.address);
+                        for (const contractName of contractsToDeploy) {
+                            const contractAddress = deployed.get(contractName);
+                            if (contractAddress === undefined) {
+                                throw new Error(`${contractName} was not found`);
+                            }
+                            await contractManagerInst.setContractsAddress( contractName, contractAddress);
+                        }
                         console.log( "Successfully registered MessageProxy in ContractManager" );
                     } catch ( error ) {
                         console.log( "Registration of MessageProxy is failed on ContractManager. Please redo it by yourself!\nError:", error );
diff --git a/proxy/migrations/deploySchain.ts b/proxy/migrations/deploySchain.ts
index ed4863d9e..dcf726a16 100644
--- a/proxy/migrations/deploySchain.ts
+++ b/proxy/migrations/deploySchain.ts
@@ -194,8 +194,6 @@ async function main() {
     deployed.set( "TokenManagerERC20", { address: tokenManagerERC20.address, interface: tokenManagerERC20.interface } );
     console.log("Contract TokenManagerERC20 deployed to", tokenManagerERC20.address);
 
-    // The end of TODO:
-
     console.log("Deploy TokenManagerERC721");
     const tokenManagerERC721Factory = await ethers.getContractFactory("TokenManagerERC721");
     const tokenManagerERC721 = await upgrades.deployProxy(tokenManagerERC721Factory, [
diff --git a/proxy/migrations/upgradeMainnet.ts b/proxy/migrations/upgradeMainnet.ts
index 8337fe2ab..0dad5177a 100644
--- a/proxy/migrations/upgradeMainnet.ts
+++ b/proxy/migrations/upgradeMainnet.ts
@@ -3,8 +3,10 @@ import { ethers } from "hardhat";
 import { promises as fs } from "fs";
 import { AutoSubmitter, Upgrader } from "@skalenetwork/upgrade-tools";
 import { SkaleABIFile } from "@skalenetwork/upgrade-tools/dist/src/types/SkaleABIFile";
-import { contracts } from "./deployMainnet";
+import { contracts, contractsToDeploy, getContractKeyInAbiFile } from "./deployMainnet";
 import { MessageProxyForMainnet } from "../typechain";
+import { Interface } from "@ethersproject/abi";
+
 
 class ImaMainnetUpgrader extends Upgrader {
 
@@ -44,7 +46,69 @@ class ImaMainnetUpgrader extends Upgrader {
 
     // deployNewContracts = () => { };
 
-    // initialize = async () => { };
+    initialize = async () => {
+        const contractManagerAddress = await (await this.getMessageProxyForMainnet()).contractManagerOfSkaleManager();
+        const contractManagerInterface = new Interface([{
+            "type": "function",
+            "name": "getContract",
+            "constant": true,
+            "stateMutability": "view",
+            "payable": false,
+            "inputs": [
+                {
+                    "type": "string",
+                    "name": "name"
+                }
+            ],
+            "outputs": [
+                {
+                    "type": "address",
+                    "name": "contractAddress"
+                }
+            ]
+        },
+        {
+            "type": "function",
+            "name": "setContractsAddress",
+            "constant": false,
+            "payable": false,
+            "inputs": [
+                {
+                    "type": "string",
+                    "name": "contractsName"
+                },
+                {
+                    "type": "address",
+                    "name": "newContractsAddress"
+                }
+            ],
+            "outputs": []
+        }]);
+        const contractManager = new ethers.Contract(
+            contractManagerAddress,
+            contractManagerInterface,
+            ethers.provider
+        )
+        for (const contractName of contractsToDeploy) {
+            try {
+                const contractAddress = await contractManager.getContract(contractName);
+                console.log(`Address of ${contractName} is set to ${contractAddress}`);
+            } catch {
+                // getContract failed because the contract is not set
+                const contractAddress = this.abi[`${getContractKeyInAbiFile(contractName)}_address`] as string;
+                this.transactions.push(
+                    {
+                        to: contractManager.address,
+                        data: contractManager.interface.encodeFunctionData(
+                            "setContractsAddress",
+                            [contractAddress]
+                        )
+                    }
+                )
+                console.log(`Set ${contractName} address to ${contractAddress}`);
+            }
+        }
+    };
 
     _getContractKeyInAbiFile(contract: string) {
         if (contract === "MessageProxyForMainnet") {
diff --git a/proxy/package.json b/proxy/package.json
index a78711f25..45dd74230 100644
--- a/proxy/package.json
+++ b/proxy/package.json
@@ -30,12 +30,8 @@
         "@skalenetwork/upgrade-tools": "^2.0.2",
         "axios": "^0.21.4",
         "dotenv": "^16.0.0",
-        "ethereumjs-tx": "2.1.2",
-        "ethereumjs-util": "^7.1.5",
         "ethers": "^5.7.2",
-        "ethers-eip712": "^0.2.0",
-        "hardhat": "2.11.0 - 2.16.1",
-        "path": "^0.12.7"
+        "hardhat": "2.11.0 - 2.16.1"
     },
     "devDependencies": {
         "@nomiclabs/hardhat-etherscan": "^3.1.0",
@@ -51,11 +47,9 @@
         "@types/sinon-chai": "^3.2.5",
         "@typescript-eslint/eslint-plugin": "^6.2.1",
         "@typescript-eslint/parser": "^6.2.1",
-        "bignumber.js": "^9.0.0",
         "chai": "^4.2.0",
         "chai-almost": "^1.0.1",
         "chai-as-promised": "^7.1.1",
-        "codecov": "^3.7.1",
         "eslint": "^8.46.0",
         "ethereum-waffle": "^4.0.10",
         "ganache": "7.9.2",
diff --git a/proxy/scripts/generateAbi.ts b/proxy/scripts/generateAbi.ts
new file mode 100644
index 000000000..45de5c5ec
--- /dev/null
+++ b/proxy/scripts/generateAbi.ts
@@ -0,0 +1,42 @@
+import { promises as fs } from 'fs';
+import { contracts as mainnetContracts } from "../migrations/deployMainnet";
+import { contracts as schainContracts } from "../migrations/deploySchain";
+import { ethers } from "hardhat";
+import { getAbi, getVersion } from '@skalenetwork/upgrade-tools';
+
+async function writeAbiToFile(contracts: string[], filename: string) {
+    const abi: {[name: string]: []} = {};
+    for (const contractName of contracts) {
+        console.log(`Load ABI of ${contractName}`);
+        const factory = await ethers.getContractFactory(contractName);
+        abi[contractName] = getAbi(factory.interface);
+    }
+    console.log(`Save to ${filename}`)
+    await fs.writeFile(filename, JSON.stringify(abi, null, 4));
+}
+
+async function main() {
+    const version = await getVersion();
+    const mainnetFilename = `data/mainnet-ima-${version}-abi.json`;
+    const schainFilename = `data/schain-ima-${version}-abi.json`;
+    await writeAbiToFile(
+        mainnetContracts,
+        mainnetFilename
+    );
+    await writeAbiToFile(
+        [
+            ...schainContracts,
+            "TokenManagerERC721WithMetadata"
+        ],
+        schainFilename
+    );
+}
+
+if (require.main === module) {
+    main()
+        .then(() => process.exit(0))
+        .catch(error => {
+            console.error(error);
+            process.exit(1);
+        });
+}
diff --git a/proxy/yarn.lock b/proxy/yarn.lock
index 19b5c35c8..73b7af7b1 100644
--- a/proxy/yarn.lock
+++ b/proxy/yarn.lock
@@ -1436,11 +1436,6 @@
   dependencies:
     antlr4ts "^0.5.0-alpha.4"
 
-"@tootallnate/once@1":
-  version "1.1.2"
-  resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82"
-  integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==
-
 "@trufflesuite/bigint-buffer@1.1.10":
   version "1.1.10"
   resolved "https://registry.yarnpkg.com/@trufflesuite/bigint-buffer/-/bigint-buffer-1.1.10.tgz#a1d9ca22d3cad1a138b78baaf15543637a3e1692"
@@ -2006,11 +2001,6 @@ argparse@^2.0.1:
   resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
   integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==
 
-argv@0.0.2:
-  version "0.0.2"
-  resolved "https://registry.yarnpkg.com/argv/-/argv-0.0.2.tgz#ecbd16f8949b157183711b1bda334f37840185ab"
-  integrity sha1-7L0W+JSbFXGDcRsb2jNPN4QBhas=
-
 array-back@^3.0.1, array-back@^3.1.0:
   version "3.1.0"
   resolved "https://registry.yarnpkg.com/array-back/-/array-back-3.1.0.tgz#b8859d7a508871c9a7b2cf42f99428f65e96bfb0"
@@ -2612,17 +2602,6 @@ cliui@^7.0.2:
     strip-ansi "^6.0.0"
     wrap-ansi "^7.0.0"
 
-codecov@^3.7.1:
-  version "3.8.3"
-  resolved "https://registry.yarnpkg.com/codecov/-/codecov-3.8.3.tgz#9c3e364b8a700c597346ae98418d09880a3fdbe7"
-  integrity sha512-Y8Hw+V3HgR7V71xWH2vQ9lyS358CbGCldWlJFR0JirqoGtOoas3R3/OclRTvgUYFK29mmJICDPauVKmpqbwhOA==
-  dependencies:
-    argv "0.0.2"
-    ignore-walk "3.0.4"
-    js-yaml "3.14.1"
-    teeny-request "7.1.1"
-    urlgrey "1.0.0"
-
 color-convert@^1.9.0:
   version "1.9.3"
   resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
@@ -3425,19 +3404,6 @@ ethereumjs-abi@0.6.8, ethereumjs-abi@^0.6.8:
     bn.js "^4.11.8"
     ethereumjs-util "^6.0.0"
 
-ethereumjs-common@^1.5.0:
-  version "1.5.2"
-  resolved "https://registry.yarnpkg.com/ethereumjs-common/-/ethereumjs-common-1.5.2.tgz#2065dbe9214e850f2e955a80e650cb6999066979"
-  integrity sha512-hTfZjwGX52GS2jcVO6E2sx4YuFnf0Fhp5ylo4pEPhEffNln7vS59Hr5sLnp3/QCazFLluuBZ+FZ6J5HTp0EqCA==
-
-ethereumjs-tx@2.1.2:
-  version "2.1.2"
-  resolved "https://registry.yarnpkg.com/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz#5dfe7688bf177b45c9a23f86cf9104d47ea35fed"
-  integrity sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==
-  dependencies:
-    ethereumjs-common "^1.5.0"
-    ethereumjs-util "^6.0.0"
-
 ethereumjs-util@7.1.3:
   version "7.1.3"
   resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.1.3.tgz#b55d7b64dde3e3e45749e4c41288238edec32d23"
@@ -3496,11 +3462,6 @@ ethereumjs-util@^7.1.4:
     ethereum-cryptography "^0.1.3"
     rlp "^2.2.4"
 
-ethers-eip712@^0.2.0:
-  version "0.2.0"
-  resolved "https://registry.yarnpkg.com/ethers-eip712/-/ethers-eip712-0.2.0.tgz#52973b3a9a22638f7357283bf66624994c6e91ed"
-  integrity sha512-fgS196gCIXeiLwhsWycJJuxI9nL/AoUPGSQ+yvd+8wdWR+43G+J1n69LmWVWvAON0M6qNaf2BF4/M159U8fujQ==
-
 ethers@5.7.2, ethers@^5.7.1, ethers@^5.7.2:
   version "5.7.2"
   resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e"
@@ -3654,13 +3615,6 @@ fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6:
   resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
   integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=
 
-fast-url-parser@^1.1.3:
-  version "1.1.3"
-  resolved "https://registry.yarnpkg.com/fast-url-parser/-/fast-url-parser-1.1.3.tgz#f4af3ea9f34d8a271cf58ad2b3759f431f0b318d"
-  integrity sha1-9K8+qfNNiicc9YrSs3WfQx8LMY0=
-  dependencies:
-    punycode "^1.3.2"
-
 fastq@^1.6.0:
   version "1.13.0"
   resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c"
@@ -4339,15 +4293,6 @@ http-https@^1.0.0:
   resolved "https://registry.yarnpkg.com/http-https/-/http-https-1.0.0.tgz#2f908dd5f1db4068c058cd6e6d4ce392c913389b"
   integrity sha1-L5CN1fHbQGjAWM1ubUzjkskTOJs=
 
-http-proxy-agent@^4.0.0:
-  version "4.0.1"
-  resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a"
-  integrity sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==
-  dependencies:
-    "@tootallnate/once" "1"
-    agent-base "6"
-    debug "4"
-
 http-signature@~1.2.0:
   version "1.2.0"
   resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1"
@@ -4377,13 +4322,6 @@ ieee754@^1.1.13, ieee754@^1.1.4, ieee754@^1.2.1:
   resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352"
   integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==
 
-ignore-walk@3.0.4:
-  version "3.0.4"
-  resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.4.tgz#c9a09f69b7c7b479a5d74ac1a3c0d4236d2a6335"
-  integrity sha512-PY6Ii8o1jMRA1z4F2hRkH/xN59ox43DavKvD3oDpfurRlOJyAHpifIwpbdv1n4jt4ov0jSpw3kQ4GhJnpBL6WQ==
-  dependencies:
-    minimatch "^3.0.4"
-
 ignore@^4.0.6:
   version "4.0.6"
   resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc"
@@ -4453,11 +4391,6 @@ inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, i
   resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
   integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
 
-inherits@2.0.3:
-  version "2.0.3"
-  resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
-  integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
-
 ini@^1.3.5:
   version "1.3.8"
   resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c"
@@ -4793,7 +4726,7 @@ js-yaml@3.13.1:
     argparse "^1.0.7"
     esprima "^4.0.0"
 
-js-yaml@3.14.1, js-yaml@3.x, js-yaml@^3.12.0, js-yaml@^3.13.0, js-yaml@^3.13.1:
+js-yaml@3.x, js-yaml@^3.12.0, js-yaml@^3.13.0, js-yaml@^3.13.1:
   version "3.14.1"
   resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537"
   integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==
@@ -5745,14 +5678,6 @@ path-type@^4.0.0:
   resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b"
   integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==
 
-path@^0.12.7:
-  version "0.12.7"
-  resolved "https://registry.yarnpkg.com/path/-/path-0.12.7.tgz#d4dc2a506c4ce2197eb481ebfcd5b36c0140b10f"
-  integrity sha1-1NwqUGxM4hl+tIHr/NWzbAFAsQ8=
-  dependencies:
-    process "^0.11.1"
-    util "^0.10.3"
-
 pathval@^1.1.1:
   version "1.1.1"
   resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d"
@@ -5814,11 +5739,6 @@ printj@~1.1.0:
   resolved "https://registry.yarnpkg.com/printj/-/printj-1.1.2.tgz#d90deb2975a8b9f600fb3a1c94e3f4c53c78a222"
   integrity sha512-zA2SmoLaxZyArQTOPj5LXecR+RagfPSU5Kw1qP+jkWeNlrq+eJZyY2oS68SU1Z/7/myXM4lo9716laOFAVStCQ==
 
-process@^0.11.1:
-  version "0.11.10"
-  resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182"
-  integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI=
-
 progress@^2.0.0:
   version "2.0.3"
   resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8"
@@ -5848,7 +5768,7 @@ psl@^1.1.28:
   resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7"
   integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==
 
-punycode@^1.3.2, punycode@^1.4.1:
+punycode@^1.4.1:
   version "1.4.1"
   resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
   integrity sha1-wNWmOycYgArY4esPpSachN1BhF4=
@@ -6461,13 +6381,6 @@ stacktrace-parser@^0.1.10:
   resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
   integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=
 
-stream-events@^1.0.5:
-  version "1.0.5"
-  resolved "https://registry.yarnpkg.com/stream-events/-/stream-events-1.0.5.tgz#bbc898ec4df33a4902d892333d47da9bf1c406d5"
-  integrity sha512-E1GUzBSgvct8Jsb3v2X15pjzN1tYebtbLaMg+eBOUOAxgbLoSbT2NS91ckc5lJD1KfLjId+jXJRgo0qnV5Nerg==
-  dependencies:
-    stubs "^3.0.0"
-
 streamsearch@^1.1.0:
   version "1.1.0"
   resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764"
@@ -6592,11 +6505,6 @@ strip-json-comments@3.1.1, strip-json-comments@^3.1.1:
   resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006"
   integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==
 
-stubs@^3.0.0:
-  version "3.0.0"
-  resolved "https://registry.yarnpkg.com/stubs/-/stubs-3.0.0.tgz#e8d2ba1fa9c90570303c030b6900f7d5f89abe5b"
-  integrity sha1-6NK6H6nJBXAwPAMLaQD31fiavls=
-
 supports-color@6.0.0:
   version "6.0.0"
   resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.0.0.tgz#76cfe742cf1f41bb9b1c29ad03068c05b4c0e40a"
@@ -6663,17 +6571,6 @@ table@^6.8.0:
     string-width "^4.2.3"
     strip-ansi "^6.0.1"
 
-teeny-request@7.1.1:
-  version "7.1.1"
-  resolved "https://registry.yarnpkg.com/teeny-request/-/teeny-request-7.1.1.tgz#2b0d156f4a8ad81de44303302ba8d7f1f05e20e6"
-  integrity sha512-iwY6rkW5DDGq8hE2YgNQlKbptYpY5Nn2xecjQiNjOXWbKzPGUfmeUBCSQbbr306d7Z7U2N0TPl+/SwYRfua1Dg==
-  dependencies:
-    http-proxy-agent "^4.0.0"
-    https-proxy-agent "^5.0.0"
-    node-fetch "^2.6.1"
-    stream-events "^1.0.5"
-    uuid "^8.0.0"
-
 text-table@^0.2.0:
   version "0.2.0"
   resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
@@ -6997,13 +6894,6 @@ url@^0.11.0:
     punycode "^1.4.1"
     qs "^6.11.0"
 
-urlgrey@1.0.0:
-  version "1.0.0"
-  resolved "https://registry.yarnpkg.com/urlgrey/-/urlgrey-1.0.0.tgz#72d2f904482d0b602e3c7fa599343d699bbe1017"
-  integrity sha512-hJfIzMPJmI9IlLkby8QrsCykQ+SXDeO2W5Q9QTW3QpqZVTx4a/K7p8/5q+/isD8vsbVaFgql/gvAoQCRQ2Cb5w==
-  dependencies:
-    fast-url-parser "^1.1.3"
-
 utf-8-validate@5.0.7:
   version "5.0.7"
   resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.7.tgz#c15a19a6af1f7ad9ec7ddc425747ca28c3644922"
@@ -7035,13 +6925,6 @@ util-deprecate@^1.0.1:
   resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
   integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==
 
-util@^0.10.3:
-  version "0.10.4"
-  resolved "https://registry.yarnpkg.com/util/-/util-0.10.4.tgz#3aa0125bfe668a4672de58857d3ace27ecb76901"
-  integrity sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==
-  dependencies:
-    inherits "2.0.3"
-
 util@^0.12.5:
   version "0.12.5"
   resolved "https://registry.yarnpkg.com/util/-/util-0.12.5.tgz#5f17a6059b73db61a875668781a1c2b136bd6fbc"
@@ -7058,7 +6941,7 @@ uuid@^3.3.2:
   resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee"
   integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==
 
-uuid@^8.0.0, uuid@^8.3.2:
+uuid@^8.3.2:
   version "8.3.2"
   resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
   integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==


Test patch:
diff --git a/proxy/scripts/test_upgrade.sh b/proxy/scripts/test_upgrade.sh
index 10ae15e09..ad27f2259 100755
--- a/proxy/scripts/test_upgrade.sh
+++ b/proxy/scripts/test_upgrade.sh
@@ -30,9 +30,8 @@ GANACHE=$(npx ganache \
     --wallet.accountKeysPath "$ACCOUNTS_FILENAME" \
 )
 
-cd "$DEPLOYED_DIR"
+cd "$DEPLOYED_DIR/proxy"
 yarn install
-cd proxy
 PRIVATE_KEY_FOR_ETHEREUM=$(cat "$ACCOUNTS_FILENAME" | jq -r  '.private_keys | to_entries | .[8].value')
 PRIVATE_KEY_FOR_SCHAIN=$(cat "$ACCOUNTS_FILENAME" | jq -r '.private_keys | to_entries | .[9].value')
 URL_W3_S_CHAIN="http://127.0.0.1:8545"