# Deposit

Before [distributing rewards](https://docs.othentic.xyz/main/user-guide/network-management/rewards/distribute) to the Operators, its essential to deposit Rewards funds in the AVS Treasury contracts.

Othentic CLI enables depositing rewards into the AVS treasury. It supports both ERC-20 tokens and native ETH, ensuring an automated approval check before initiating the deposit process.

#### Read More

* [Rewards](https://docs.othentic.xyz/main/learn/core-concepts/rewards)
* [CLI Command Reference - deposit rewards](https://docs.othentic.xyz/main/reference/othentic-cli/network/rewards#deposit-rewards-funds)

You can choose one of these options:

1. [Using CLI](#id-1.-using-cli)
2. [Using Contracts](#id-2.-using-contracts)

### 1. Using CLI

### Prerequisites

* [Othentic CLI installed](https://docs.othentic.xyz/main/welcome/getting-started/install-othentic-cli)
* Access to AVS governance multisig owner&#x20;
* L1/L2 chain name where [rewards are configured](https://docs.othentic.xyz/main/user-guide/deploy-avs#id-3.-deploy-an-avs-with-rewards-on-l2). Find the corresponding values for the Supported chains [here](https://docs.othentic.xyz/main/reference/supported-networks).

{% hint style="info" %}
For **Eigen Rewards v2**, the `calc-eigen-rewards-params` command in [Distribute Rewards Guide](https://docs.othentic.xyz/main/user-guide/network-management/rewards/distribute) outputs the **total reward amount required for your AVS** across all reward batches. Use this value to determine how much you need to deposit before proceeding with reward distribution.
{% endhint %}

Run the following command:

```bash
otcli network rewards deposit --l1-chain <chain> --amount <amount>
```

{% hint style="success" %}
Pass `--browser-sign`  flag to connect your wallet and sign using a web browser UI.
{% endhint %}

Follow these steps when prompted:

{% stepper %}
{% step %}

#### Provide the private key of the multi-sig address.

{% hint style="info" %}
Make sure to input the raw 32-byte private key that controls the Operator Account, **without** leading `0x`.
{% endhint %}
{% endstep %}

{% step %}

#### Enter the Attestation Center contract address.

{% endstep %}

{% step %}

#### Enter the AVS Governance Center contract address

{% endstep %}
{% endstepper %}

***

### 2. Using Contracts

You can directly deposit rewards into the L1/L2 AVS Treasury using contract methods.

{% stepper %}
{% step %}
**Get Reward Token Address**

Retrieve the Reward Token address, set during the AVS [contracts deployment](https://docs.othentic.xyz/main/user-guide/network-management/deploy-avs).
{% endstep %}

{% step %}
**Approve Token Transfer (ERC20)**

In case the Rewards token is ERC20, approve the token transfer to the AVS Treasury contract.

```javascript
const approveTx = await rewardTokenSmartContract.approve(
      avsTreasuryContractAddress,
      amount
    ); 
```

{% endstep %}

{% step %}
**Deposit Rewards**

Execute [**depositNative**](https://docs.othentic.xyz/main/reference/contracts/treasury#depositnative) or [**depositERC20**](https://docs.othentic.xyz/main/reference/contracts/treasury#depositnative) on the AVS Treasury contract, with the desired amount.

```javascript
const depositTx = await avsTreasuryContract.depositERC20(senderAddress, amount); 

// For ETH deposits 
const depositTx = await avsTreasuryContract.depositNative({ value: amount }) 
```

<figure><img src="https://4144525652-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYlSi30nrcEOossIDFFua%2Fuploads%2F3z1txegzvQbFAWkYOcHx%2Fimage.png?alt=media&#x26;token=afaf110c-e7b4-4592-9fe8-40937a159971" alt=""><figcaption><p>depositERC20 and depositNative</p></figcaption></figure>
{% endstep %}
{% endstepper %}

Once the transaction is confirmed, the deposit is complete.
