async fn deposit_to_master(&mut self) -> anyhow::Result<()> {
        tracing::info!("Master Account: Performing an ERC-20 deposit to master");

        let balance = self
            .pool
            .master_wallet
            .get_balance(BlockNumber::Latest, self.l2_main_token)
            .await?;
        let necessary_balance =
            U256::from(self.erc20_transfer_amount() * self.config.accounts_amount as u128);

        tracing::info!(
            "Master account token balance on l2: {balance:?}, necessary balance \
             for initial transfers {necessary_balance:?}"
        );

        if balance > necessary_balance {
            tracing::info!(
                "Master account has enough money on l2, nothing to deposit. Current balance \
                 {balance:?}, necessary balance for initial transfers {necessary_balance:?}"
            );
            return Ok(());
        }

        let mut ethereum = self
            .pool
            .master_wallet
            .ethereum(&self.config.l1_rpc_address)
            .await?;
        ethereum.set_confirmation_timeout(ETH_CONFIRMATION_TIMEOUT);
        ethereum.set_polling_interval(ETH_POLLING_INTERVAL);

        let main_token = self.config.main_token;
        let deposits_allowed = ethereum.is_erc20_deposit_approved(main_token, None).await?;
        if !deposits_allowed {
            // Approve ERC20 deposits.
            let approve_tx_hash = ethereum
                .approve_erc20_token_deposits(main_token, None)
                .await?;
            let receipt = ethereum.wait_for_tx(approve_tx_hash).await?;
            self.assert_eth_tx_success(&receipt).await;
        }

        tracing::info!("Approved ERC20 deposits");
        let receipt = deposit_with_attempts(
            &ethereum,
            self.pool.master_wallet.address(),
            main_token,
            U256::from(self.amount_to_deposit()),
            3,
        )
        .await?;

        self.assert_eth_tx_success(&receipt).await;
        let mut priority_op_handle = receipt
            .priority_op_handle(&self.pool.master_wallet.provider)
            .unwrap_or_else(|| {
                panic!(
                    "Can't get the handle for the deposit operation: {:?}",
                    receipt
                );
            });

        priority_op_handle
            .polling_interval(POLLING_INTERVAL.end)
            .unwrap();
        priority_op_handle
            .commit_timeout(COMMIT_TIMEOUT)
            .wait_for_commit()
            .await?;

        tracing::info!("Master Account: ERC-20 deposit is OK");
        Ok(())
    }
Deposits the ERC-20 token to main wallet in L2.
core/tests/loadnext/src/executor.rs