# 4 - Balancer-v2

L1X-EVM is a robust and reliable system that is ready for production use in the DeFi market. Our demo highlights the practical Host and Runtime functions of the L1X L1 layer and showcases its capabilities using a complex use case, the balancer-v2 protocol.

### [**Step 1: Setting Up Your Environment**](https://gist.github.com/rajesh-l1x/0789d1377933de9b786354fdbe9d5b6c#step-1-setting-up-your-environment) <a href="#user-content-step-1-setting-up-your-environment" id="user-content-step-1-setting-up-your-environment"></a>

* **1.1. Create an empty folder for this demonstration:**

  ```
   $ mkdir -p $HOME/l1x-home/l1x-demo-home/
  ```
* **1.2. Change your current directory to the newly created folder:**

  ```
  $ cd $HOME/l1x-home/l1x-demo-home/
  ```

### [**Step 2: Download the Demo Template**](https://gist.github.com/rajesh-l1x/0789d1377933de9b786354fdbe9d5b6c#step-2-download-the-demo-template) <a href="#user-content-step-2-download-the-demo-template" id="user-content-step-2-download-the-demo-template"></a>

* **2.1. Make sure you can access the `l1x-forge` tool from your command line.** If you don't have `l1x-forge` installed, follow the instructions in [Step 2: Checking the L1X Tool](https://app.gitbook.com/o/E37av3Jbz3uuBODbRRSf/s/eTLmER6Ab8VaxeOI6Vla/get-started-with-l1x-sde/setup-l1x-development-environment#step-2-checking-the-l1x-tool) before proceeding.
* **2.2. Use the `l1x-forge` command to create a new project workspace. We'll name it `l1x_demo04_balancer_v2` and use the template `l1x-balancer-v2`:**

  ```
  $ l1x-forge new --name l1x_demo04_balancer_v2 --template l1x-balancer-v2
  ```
* **2.3. After running the command, you'll receive a confirmation message indicating the successful creation of the "l1x\_demo04\_balancer\_v2" contract:**

  ```
  Created contract l1x_demo04_balancer_v2
  ```
* **2.4. Your workspace will now be populated with content from the template.**

  ```
   	$ exa -T -L 1 ./l1x_demo04_balancer_v2
   		./l1x_demo04_balancer_v2
   		├── Cargo.toml
   		├── devbox.json
   		├── devbox.lock
   		├── devnet-services-dc.yml
   		├── l1x-artifacts
   		├── l1x-conf
   		├── l1x-eth-contracts
   		├── l1x-evm-artifacts
   		├── l1x-traces
   		├── l1x-utils
   		├── process-compose-devnode.yaml
   		├── README.md
   		├── rust-toolchain.toml
   		└── rustfmt.toml
  ```

### [**Step 3: Starting with Workspace Workflow Script Commands**](https://gist.github.com/rajesh-l1x/0789d1377933de9b786354fdbe9d5b6c#step-3-starting-with-workspace-workflow-script-commands) <a href="#user-content-step-3-starting-with-workspace-workflow-script-commands" id="user-content-step-3-starting-with-workspace-workflow-script-commands"></a>

* **3.1. Introduction to Devbox Shell and Workflow Commands**

  If you're new to the l1x-sde template workspace, it's a good idea to familiarize yourself with the basics of the devbox shell and workflow commands. This will help you get started more smoothly. You can review the following links for an overview:

  * [Step 4: Understanding Configuration Files and Default Settings](https://app.gitbook.com/o/E37av3Jbz3uuBODbRRSf/s/eTLmER6Ab8VaxeOI6Vla/get-started-with-l1x-sde/setup-l1x-development-environment#step-4-understanding-configuration-files-and-default-settings)
  * [Step 5: Getting Started with the Devbox Shell](https://app.gitbook.com/o/E37av3Jbz3uuBODbRRSf/s/eTLmER6Ab8VaxeOI6Vla/get-started-with-l1x-sde/setup-l1x-development-environment#step-5-getting-started-with-the-devbox-shell)
* **3.2. Default Commands to Begin With**

  To start using the workspace, there are some default commands you can use:

  * **Activate the Shell:** To access the devbox shell, simply enter the following command in your terminal:

  ```
  $ devbox shell
  ```

  * **List Default Commands:** To see a list of the built-in default commands available in the devbox shell, you can use the following command:

    ```
    (devbox)$ devbox run -l | sort
    * 01_init_setup
    * 01_start_hardhat
    * 01_teardown_setup
    * 02_check_chain_state
    * 02_check_devnet_db_state
    * 02_prune_devnode
    * 02_start_devnode
    * 02_stop_devnode
    * 11_clean_logs
    * 11_clean_objs
    * 20_01_compile_evm_erc20
    * 20_02_compile_evm_erc201
    * 20_03_compile_evm_weth
    * 20_04_compile_evm_rateprovider
    * 20_05_compile_evm_rateProvider1
    * 20_06_compile_evm_authorizer
    * 20_07_compile_evm_vault
    * 20_08_compile_evm_protocolfee
    * 20_09_compile_evm_pool
    * 20_compile_evm_cmd
    * 42_deploy_cli_evm_bpool
    * 42_deploy_cli_evm_cmd
    * 42_init_cli_evm_bpool
    * 42_init_cli_evm_cmd
    * 43_01_test_cli_evm_getpoolid
    * 43_02_gettokenlist_calldata
    * 43_03_test_cli_evm_gettokenlist
    * 43_04_approve_tokens_calldata
    * 43_05_test_cli_evm_approve_tokens
    * 62_install_forge_evm_cmd_force_deploy
    * 63_install_forge_evm_cmd_reuse_deploy
    * 81_01_install_forge_evm_erc20
    * 81_02_install_forge_evm_erc201
    * 81_03_install_forge_evm_weth
    * 81_04_install_forge_evm_rateprovider
    * 81_05_install_forge_evm_rateprovider1
    * 81_06_install_forge_evm_authorizer
    * 81_07_install_forge_evm_vault
    * 81_08_install_forge_evm_protocolfee
    * 81_09_install_forge_evm_pool
    * 82_01_install_forge_evm_bpool
    Available scripts:
    ```
* **Initialize the Workspace:** To prepare your workspace for building and testing, run:

  ```
   (devbox)$ devbox run 01_init_setup
  ```

Now you have all the necessary tools and packages to work with the demo template workspace.

### [**Step 4: Building Balancer-v2 Smart Contracts for `l1x-evm`**](https://gist.github.com/rajesh-l1x/0789d1377933de9b786354fdbe9d5b6c#step-4-building-balancer-v2-smart-contracts-for-l1x-evm) <a href="#user-content-step-4-building-balancer-v2-smart-contracts-for-l1x-evm" id="user-content-step-4-building-balancer-v2-smart-contracts-for-l1x-evm"></a>

In this section, we'll walk you through the process of building and deploying the BalancerPool smart contracts.

**4.1 For this demonstration, we'll use the `super` key from the predefined wallet in `l1x-conf/l1x_dev_wallets.yaml`.**

[![Image Link](https://camo.githubusercontent.com/3ba5e3886084162be050f090a58af7162aa1fa7543cb233fb049574d91181475/68747470733a2f2f692e696d6775722e636f6d2f75707834616e472e706e67)](https://camo.githubusercontent.com/3ba5e3886084162be050f090a58af7162aa1fa7543cb233fb049574d91181475/68747470733a2f2f692e696d6775722e636f6d2f75707834616e472e706e67)

* This same key serves as the owner for the pool, as specified in the `l1x-eth-contracts/Balancer-v2/pkg/pool-stable/deploy/input.json` file.

[![](https://camo.githubusercontent.com/bd106be9c8611a2df9581fe6feb282e971d4e563d3b5b40d98e3e94a3c9ae18f/68747470733a2f2f692e696d6775722e636f6d2f4f41624f7233692e706e67)](https://camo.githubusercontent.com/bd106be9c8611a2df9581fe6feb282e971d4e563d3b5b40d98e3e94a3c9ae18f/68747470733a2f2f692e696d6775722e636f6d2f4f41624f7233692e706e67)

**4.2 Start the `hardhat` local node**

Open your workspace devbox shell terminal and run this command:

```
(devbox)$ devbox run 01_start_hardhat
```

[![](https://camo.githubusercontent.com/4328f4affe54617f4ae44e3fbb29a9389af00c96599c9825c028ab33af04aa6a/68747470733a2f2f692e696d6775722e636f6d2f77507862334d7a2e706e67)](https://camo.githubusercontent.com/4328f4affe54617f4ae44e3fbb29a9389af00c96599c9825c028ab33af04aa6a/68747470733a2f2f692e696d6775722e636f6d2f77507862334d7a2e706e67)

**4.3 Compiling and Deploying the Contract for `l1x-evm`**

To compile and deploy the contracts located at `l1x-eth-contracts/Balancer-v2/pkg/pool-stable`, execute this command:

```
(devbox)$ devbox run 82_01_install_forge_evm_bpool
```

[![](https://camo.githubusercontent.com/063d2b85aac3ba01dfe924753c78fdb58b5f8b254e46848d381eaa72656ac336/68747470733a2f2f692e696d6775722e636f6d2f4f6174626238572e706e67)](https://camo.githubusercontent.com/063d2b85aac3ba01dfe924753c78fdb58b5f8b254e46848d381eaa72656ac336/68747470733a2f2f692e696d6775722e636f6d2f4f6174626238572e706e67)

When you run this command, it will:

* Generate EVM bytecode object files in the `./l1x-evm-artifacts` folder, as shown below:

  ```
  exa -T -L 1 ./l1x-evm-artifacts
  ./l1x-evm-artifacts
  ├── creationAuthorizer.txt
  ├── creationCode20.txt
  ├── creationCode202.txt
  ├── creationCodePool.txt
  ├── creationProtocolFee.txt
  ├── creationRateProvider.txt
  ├── creationRateProvider2.txt
  ├── creationVault.txt
  └── creationWeth.txt
  ```
* Automatically update the contract address registry at `l1x-conf/config-contract-address-registry.yaml`.

[![](https://camo.githubusercontent.com/dfaba48320f71e08f770764208ddf368e6f89676a093923ef12ccd016a8b1b1f/68747470733a2f2f692e696d6775722e636f6d2f6150496f6e314d2e706e67)](https://camo.githubusercontent.com/dfaba48320f71e08f770764208ddf368e6f89676a093923ef12ccd016a8b1b1f/68747470733a2f2f692e696d6775722e636f6d2f6150496f6e314d2e706e67)

* This updated address from the contract address registry will be used in the transaction JSON payload files located in `l1x-conf/scripts` to interact with the deployed contracts, as shown below:

  ```
    exa -T -L 1 ./l1x-conf/scripts
    ./l1x-conf/scripts
    ├── 043-01-test-evm-pool-getpoolid.json
    ├── 043-02-test-evm-pool-gettokenlist.json
    ├── 043-03-test-evm-approve-erc20.json
    ├── 043-04-test-evm-approve-erc201.json
    ├── 043-05-test-evm-init-pool.json
  ```

That's it! You've successfully completed the steps for building and deploying the smart contracts.

### [**Step 5: Setting Up Local Development Network Services**](https://gist.github.com/rajesh-l1x/0789d1377933de9b786354fdbe9d5b6c#step-5-setting-up-local-development-network-services) <a href="#user-content-step-5-setting-up-local-development-network-services" id="user-content-step-5-setting-up-local-development-network-services"></a>

In this step, we will walk you through the process of configuring local development l1x-chain network.

* **5.1 Choose the Chain Type**: To begin, select the `"L1X_CFG_CHAIN_TYPE": "local_devnet"` option. Next, open a new terminal and activate the devbox shell:

  ```
  $ devbox shell
  ```
* **5.2 Start the Devnode Services**: While in the devbox shell, run the following command:

  ```
  (devbox)$ devbox run 02_start_devnode
  ```
* **5.3 Wait for Services to Initialize**: After executing the previous command, please wait for approximately 160 seconds. During this time, the services will start up and become operational. You will also observe the L1X node beginning to produce blocks.

[![Image](https://camo.githubusercontent.com/041f482cc6c18149d543f8d2e650cc3af3d85a59ca823233bdec2726efaaaa9c/68747470733a2f2f692e696d6775722e636f6d2f796d456d75426e2e706e67)](https://camo.githubusercontent.com/041f482cc6c18149d543f8d2e650cc3af3d85a59ca823233bdec2726efaaaa9c/68747470733a2f2f692e696d6775722e636f6d2f796d456d75426e2e706e67)

* **5.4 Verify DevNet Service Status**: To ensure that everything is running smoothly, use the following command to check the service status:

  ```
  (devbox)$ devbox run 02_check_chain_state
  ```

  [![Image](https://camo.githubusercontent.com/4f9f2b6601b457f613c464bd69220f01eb68aaee8b17d0665740031e66b378f0/68747470733a2f2f692e696d6775722e636f6d2f675357395739592e706e67)](https://camo.githubusercontent.com/4f9f2b6601b457f613c464bd69220f01eb68aaee8b17d0665740031e66b378f0/68747470733a2f2f692e696d6775722e636f6d2f675357395739592e706e67)

  ```
  (devbox)$ devbox run 02_check_devnet_db_state
  ```

  [![Image](https://camo.githubusercontent.com/91f84f5b2c656bea645882c39a122efd81c975b9640d9b4b6eba096f76fa4af4/68747470733a2f2f692e696d6775722e636f6d2f3463326d4a42642e706e67)](https://camo.githubusercontent.com/91f84f5b2c656bea645882c39a122efd81c975b9640d9b4b6eba096f76fa4af4/68747470733a2f2f692e696d6775722e636f6d2f3463326d4a42642e706e67)
* **5.5 Troubleshooting**: Occasionally, we might encounter a problem where the `l1x-node-client` server and the `cassandra` DB service do not sync properly, as indicated by the state shown in the image below.

[![Troubleshooting Image](https://camo.githubusercontent.com/c0d21a1ec8647574b31d422fa8957b0477811184ec02d61a467adffb21ca5109/68747470733a2f2f692e696d6775722e636f6d2f4a727441326a682e706e67)](https://camo.githubusercontent.com/c0d21a1ec8647574b31d422fa8957b0477811184ec02d61a467adffb21ca5109/68747470733a2f2f692e696d6775722e636f6d2f4a727441326a682e706e67)

* To fix this issue and get your setup back on track, follow these simple steps:

  ```
  (devbox)$ devbox run 02_stop_devnode
  (devbox)$ devbox run 02_prune_devnode
  (devbox)$ devbox run 02_start_devnode
  ```

These commands will help reset and restart the necessary components. Your setup should work smoothly after completing these steps.

### [**Step 6: Initializing the Deployed Pool**](https://gist.github.com/rajesh-l1x/0789d1377933de9b786354fdbe9d5b6c#step-6-initializing-the-deployed-pool) <a href="#user-content-step-6-initializing-the-deployed-pool" id="user-content-step-6-initializing-the-deployed-pool"></a>

**6.1 Obtain the PoolID**

* To retrieve the PoolID from the deployed pool instance, refer to the tag key `creationCodePool.txt` in the `l1x-conf/config-contract-address-registry.yaml` address registry file. In this case, use the address `09796da51ef92af5ccb4965d3fe10b9cae61db0c`. And update the file `l1x-conf/scripts/043-01-test-evm-pool-getpoolid.json` with noted info

[![](https://camo.githubusercontent.com/79db56c00af77c485ecac8350b51ec443b448b9f0a2cd003ed0e83822742443c/68747470733a2f2f692e696d6775722e636f6d2f5a4a47304344342e706e67)](https://camo.githubusercontent.com/79db56c00af77c485ecac8350b51ec443b448b9f0a2cd003ed0e83822742443c/68747470733a2f2f692e696d6775722e636f6d2f5a4a47304344342e706e67)

* In your devbox shell terminal, execute the following command:

```
(devbox)$ devbox run 43_01_test_cli_evm_getpoolid
```

[![](https://camo.githubusercontent.com/01dc07ad27ed5304e06688733e778993ec6f770b25d0ea014bc6472be89c1ee8/68747470733a2f2f692e696d6775722e636f6d2f665234485645542e706e67)](https://camo.githubusercontent.com/01dc07ad27ed5304e06688733e778993ec6f770b25d0ea014bc6472be89c1ee8/68747470733a2f2f692e696d6775722e636f6d2f665234485645542e706e67)

* Take note of the poolID, which is highlighted within the "data:" field. In this context, it is `0x8c9f70606ca7d0ba5639a002e1889a1c4a92bd54000000000000000000000000`.

**6.2 Obtain the TokenList**

* Update `input.json` in `l1x-eth-contracts/Balancer-v2/pkg/pool-stable/deploy/` with the PoolID you obtained.

[![Screenshot](https://camo.githubusercontent.com/feaac43ce57277a1326133d7f95f0fe80e7ab42ad6638f4ae10c7be1618e4adc/68747470733a2f2f692e696d6775722e636f6d2f74323831504c452e706e67)](https://camo.githubusercontent.com/feaac43ce57277a1326133d7f95f0fe80e7ab42ad6638f4ae10c7be1618e4adc/68747470733a2f2f692e696d6775722e636f6d2f74323831504c452e706e67)

* Generate ABI encoded calldata to retrieve the tokenlist from `creationVault.txt`.

```
(devbox)$ devbox run 43_02_gettokenlist_calldata
```

[![Screenshot](https://camo.githubusercontent.com/ab325cb0432e08167b2ba0e3d543b0e064aab8eb1aec3354228f20c91d61b496/68747470733a2f2f692e696d6775722e636f6d2f4f72454a4532572e706e67)](https://camo.githubusercontent.com/ab325cb0432e08167b2ba0e3d543b0e064aab8eb1aec3354228f20c91d61b496/68747470733a2f2f692e696d6775722e636f6d2f4f72454a4532572e706e67)

* Take note of the highlighted calldata, which you can find in the "data:" field. In this case, it is `0xf94d46688c9f70606ca7d0ba5639a002e1889a1c4a92bd54000000000000000000000000`.
* To obtain the TokenList from the deployed vault instance, refer to the tag key `creationVault.txt` in the `l1x-conf/config-contract-address-registry.yaml` address registry file. Use the address `199202a07fd7bd18e6f0cf252d694ec84f37f40b` for this context, and update `043-02-test-evm-pool-gettokenlist.json` in `l1x-conf/scripts/` with the information you noted.

[![Screenshot](https://camo.githubusercontent.com/076cd6b1585762d5838f948bc0e9553dcf6bd4759889182b05aae55d52486ad1/68747470733a2f2f692e696d6775722e636f6d2f696d687865616a2e706e67)](https://camo.githubusercontent.com/076cd6b1585762d5838f948bc0e9553dcf6bd4759889182b05aae55d52486ad1/68747470733a2f2f692e696d6775722e636f6d2f696d687865616a2e706e67)

* In your devbox shell terminal, run the following command:

```
(devbox)$ devbox run 43_03_test_cli_evm_gettokenlist
```

[![Screenshot](https://camo.githubusercontent.com/3fa710bbeaf188eb14718770e3a4b8d89e3986f352296224b745938728378972/68747470733a2f2f692e696d6775722e636f6d2f504d6e457761652e706e67)](https://camo.githubusercontent.com/3fa710bbeaf188eb14718770e3a4b8d89e3986f352296224b745938728378972/68747470733a2f2f692e696d6775722e636f6d2f504d6e457761652e706e67)

* Take note of the highlighted "data:" field, and then decode the ABI encoded raw data to get the following token address information:
  * ERC202: 0x25c77f9c598ecc4bc3eaeb58188c07d80605a9ea
  * Pool: 0x8c9f70606ca7d0ba5639a002e1889a1c4a92bd54
  * ERC20: 0xe088b9ad19e5766ecdab0a2e1ccdc7f061ffe155

**6.3 Approving ERC20 and ERC202 Tokens for the Vault**

* Open `input.json` located at `l1x-eth-contracts/Balancer-v2/pkg/pool-stable/deploy/`. Update the token balance to be approved for the Vault. For this demo, we'll approve a balance of **One hundred million** tokens.

[![](https://camo.githubusercontent.com/bb45041d62f724a167ffaef8e617279a8d657fd5af383be6cc8cf8a5414c94a1/68747470733a2f2f692e696d6775722e636f6d2f39544164304e532e706e67)](https://camo.githubusercontent.com/bb45041d62f724a167ffaef8e617279a8d657fd5af383be6cc8cf8a5414c94a1/68747470733a2f2f692e696d6775722e636f6d2f39544164304e532e706e67)

* Generate ABI encoded calldata to approve the tokens for the Vault using the following command:

```
(devbox)$ devbox run 43_04_approve_tokens_calldata
```

[![](https://camo.githubusercontent.com/9d20d06fc6fd8eb8979790fb1b2aeef8c34639a801fd72c311bfb944e80103f5/68747470733a2f2f692e696d6775722e636f6d2f766f4b797542562e706e67)](https://camo.githubusercontent.com/9d20d06fc6fd8eb8979790fb1b2aeef8c34639a801fd72c311bfb944e80103f5/68747470733a2f2f692e696d6775722e636f6d2f766f4b797542562e706e67)

Take note of the highlighted calldata and update the `l1x-conf/scripts/043-03-test-evm-approve-erc20.json` and `l1x-conf/scripts/043-04-test-evm-approve-erc201.json` files with the calldata and the appropriate token contract addresses.

[![](https://camo.githubusercontent.com/359f5290bd2d372b75a669d3905536528643f9d32401d8b7e638484806e97b76/68747470733a2f2f692e696d6775722e636f6d2f54736b637a4c702e706e67)](https://camo.githubusercontent.com/359f5290bd2d372b75a669d3905536528643f9d32401d8b7e638484806e97b76/68747470733a2f2f692e696d6775722e636f6d2f54736b637a4c702e706e67)

[![](https://camo.githubusercontent.com/dea87adaa4c1d19ccd1b9d216c6fc93b4a15ab04e654e31970df42bd82aa7e57/68747470733a2f2f692e696d6775722e636f6d2f584944476d62392e706e67)](https://camo.githubusercontent.com/dea87adaa4c1d19ccd1b9d216c6fc93b4a15ab04e654e31970df42bd82aa7e57/68747470733a2f2f692e696d6775722e636f6d2f584944476d62392e706e67)

* Execute the following command:

```
(devbox)$ devbox run 43_05_test_cli_evm_approve_tokens
```

[![Step 3](https://camo.githubusercontent.com/5b3613eda98c758a6ea577edbcdd07e351f501760a1e399241b7348ea8da35b4/68747470733a2f2f692e696d6775722e636f6d2f4e7873393559502e706e67)](https://camo.githubusercontent.com/5b3613eda98c758a6ea577edbcdd07e351f501760a1e399241b7348ea8da35b4/68747470733a2f2f692e696d6775722e636f6d2f4e7873393559502e706e67)

[![Step 3 - Continued](https://camo.githubusercontent.com/c8142aab9baf3f55741f482a5307cee4233a7edc345b2a90cbf32c57fea8e68f/68747470733a2f2f692e696d6775722e636f6d2f56453336317a442e706e67)](https://camo.githubusercontent.com/c8142aab9baf3f55741f482a5307cee4233a7edc345b2a90cbf32c57fea8e68f/68747470733a2f2f692e696d6775722e636f6d2f56453336317a442e706e67)

This process approves ERC20 and ERC202 tokens for the Vault.

**6.4 Initializing the Pool**

To kickstart your deployed pool, follow these simple steps:

* Open the `input.json` file found in `l1x-eth-contracts/Balancer-v2/pkg/pool-stable/deploy/`. Update it with the information you collected during **Step 6.2: Obtaining the TokenList**. The image below highlights the fields that need updating:

[![TokenList Information](https://camo.githubusercontent.com/25d2c7ba0cc97b5f9f1a18a4a8d4f3b5f854380e4ec87895da79ae706923a6ca/68747470733a2f2f692e696d6775722e636f6d2f7650615748596c2e706e67)](https://camo.githubusercontent.com/25d2c7ba0cc97b5f9f1a18a4a8d4f3b5f854380e4ec87895da79ae706923a6ca/68747470733a2f2f692e696d6775722e636f6d2f7650615748596c2e706e67)

* Now, let's generate ABI encoded calldata to initialize your pool. In your devbox shell terminal, use the following command:

  ```
  (devbox)$ devbox run 43_06_init_pool_calldata
  ```

[![](https://camo.githubusercontent.com/35798be46256722e994fed9b2a14a201b45043c4643f0faa771cb8a8a00462f1/68747470733a2f2f692e696d6775722e636f6d2f316573636265342e706e67)](https://camo.githubusercontent.com/35798be46256722e994fed9b2a14a201b45043c4643f0faa771cb8a8a00462f1/68747470733a2f2f692e696d6775722e636f6d2f316573636265342e706e67)

* You'll see the generated calldata, which is highlighted in the "data:" field.
* Find the `creationVault.txt` tag key in the `l1x-conf/config-contract-address-registry.yaml` address registry file. Depending on your situation, choose the appropriate address. For our example, we'll assume the address is `00578931a9d5b5ca359c5b9bcd0a4efb6cef1a7d`. Update the `043-05-test-evm-init-pool.json` file in `l1x-conf/scripts/` with this information:

[![Update Address Information](https://camo.githubusercontent.com/12c145a201b3ca9a8973ee024f7309c25ecc56029085681d99ed184d6c672514/68747470733a2f2f692e696d6775722e636f6d2f494578717570452e706e67)](https://camo.githubusercontent.com/12c145a201b3ca9a8973ee024f7309c25ecc56029085681d99ed184d6c672514/68747470733a2f2f692e696d6775722e636f6d2f494578717570452e706e67)

* Finally, to complete the initialization of your pool, run this command in your devbox shell terminal:

```
(devbox)$ devbox run 43_07_test_cli_evm_init_pool
```

[![](https://camo.githubusercontent.com/b2b3c3b112a8227a63c85d699afde570126ba8dcf600e03bcc41df4435ac9abf/68747470733a2f2f692e696d6775722e636f6d2f6b67624961654c2e706e67)](https://camo.githubusercontent.com/b2b3c3b112a8227a63c85d699afde570126ba8dcf600e03bcc41df4435ac9abf/68747470733a2f2f692e696d6775722e636f6d2f6b67624961654c2e706e67)

### [**Step 7: Joining the Deployed Pool**](https://gist.github.com/rajesh-l1x/0789d1377933de9b786354fdbe9d5b6c#step-7-joining-the-deployed-pool) <a href="#user-content-step-7-joining-the-deployed-pool" id="user-content-step-7-joining-the-deployed-pool"></a>

Now, let's join the pool using the `Ava` key from the default wallet.

* Open the `input.json` file in `l1x-eth-contracts/Balancer-v2/pkg/pool-stable/deploy/`. Update it with the `joinPoolCall::tokenlist` information from **Step 6.2: Obtaining the TokenList**. Just like before, the image below shows the fields that need your attention:

[![TokenList Information](https://camo.githubusercontent.com/3212a1dfae98d7b063b985e34aafd775a15584c5dec504ea2d6e3960851fca4b/68747470733a2f2f692e696d6775722e636f6d2f6f3074336635582e706e67)](https://camo.githubusercontent.com/3212a1dfae98d7b063b985e34aafd775a15584c5dec504ea2d6e3960851fca4b/68747470733a2f2f692e696d6775722e636f6d2f6f3074336635582e706e67)

* To generate the ABI encoded calldata for joining the pool, run this command in your devbox shell terminal:

```
(devbox)$ devbox run 43_08_join_pool_calldata
```

* Make a note of the highlighted calldata, located in the "data:" field.
* Find the `creationVault.txt` tag key in the `l1x-conf/config-contract-address-registry.yaml` address registry file, and, based on your context, select the appropriate address. For our example, let's stick with `00578931a9d5b5ca359c5b9bcd0a4efb6cef1a7d`. Update the `043-05-test-evm-init-pool.json` file in `l1x-conf/scripts/` with this information:

[![Update Address Information](https://camo.githubusercontent.com/a1dc5777d1dea2977999d8174591abacb2cb3c3470c69e4209a1ec8b0db4eb1e/68747470733a2f2f692e696d6775722e636f6d2f6f534b526973312e706e67)](https://camo.githubusercontent.com/a1dc5777d1dea2977999d8174591abacb2cb3c3470c69e4209a1ec8b0db4eb1e/68747470733a2f2f692e696d6775722e636f6d2f6f534b526973312e706e67)

* To finish the process of joining the pool, execute this command in your devbox shell terminal:

```
(devbox)$ devbox run 43_09_test_cli_evm_join_pool
```

[![](https://camo.githubusercontent.com/da174b7c8a959286b29b834a9c430852833ffd854cfb84dbf384a485df2b72ca/68747470733a2f2f692e696d6775722e636f6d2f7757394d3131772e706e67)](https://camo.githubusercontent.com/da174b7c8a959286b29b834a9c430852833ffd854cfb84dbf384a485df2b72ca/68747470733a2f2f692e696d6775722e636f6d2f7757394d3131772e706e67)

now user `Ava` is part of the pool!

By following these steps, you can successfully initialise and join the deployed pool.
