# Deploy AVS

The Othentic CLI allows you to deploy AVS contracts on any supported network.&#x20;

#### Read More

* [AVS Contracts](https://docs.othentic.xyz/main/reference/contracts)
* [CLI Reference - deploy AVS contracts](https://docs.othentic.xyz/main/reference/othentic-cli/network/deploy)

## Prerequisites

1. [Othentic CLI installed](https://docs.othentic.xyz/main/welcome/getting-started/install-othentic-cli)
2. Deployer account with sufficient gas funds on all networks
3. Network names you want to deploy to (Supported chains)
4. (Optional) Rewards token address
5. (Optional) AVS governance multisig owner address

{% hint style="info" %}
&#x20;`--avs-governance-multisig-owner` Defines the address of the **AVS Governance Multisig role**. If not specified, the deployer address is set as the default owner.
{% endhint %}

### Deployment Options

These options refer only to the deployment step; all configurations can be changed later. You can choose from one of the following deployment options:

1. [Deploy an AVS with ERC20 rewards token](#id-1.-deploy-with-erc20-rewards-token)
2. [Deploy an AVS on multiple L2s ](#id-2.-deploy-an-avs-on-multiple-l2s)
3. [Deploy an AVS with rewards on L2](#id-3.-deploy-an-avs-with-rewards-on-l2)
4. [Deploy all AVS contracts on L1](#id-4.-deploy-all-avs-contracts-on-l1)
5. [Deploy an AVS with a specified owner address](#id-5.-deploy-an-avs-with-a-specified-owner-address)
6. [Deploy an AVS with native ETH as rewards token](#id-6.-deploy-with-native-eth-as-rewards-token)
7. [Deploy an AVS with browser wallet](#id-7.-deploy-an-avs-with-browser-wallet)

***

## 1. Deploy with ERC20 rewards token

Deploy AVS contracts to L1 and a **single L2 chain** where operators are rewarded in a specified **ERC20 token**.

* In this option, rewards are paid on L1.
* Replace `<ERC20_REWARDS_TOKEN_L1_ADDRESS>` with the ERC20 token contract address (on L1)

```bash
otcli network deploy \
  --l1-chain holesky \
  --l2-chain base-sepolia \
  --rewards-token <ERC20_REWARDS_TOKEN_L1_ADDRESS> \
  --l1-initial-deposit 10000000000000000 \
  --l2-initial-deposit 10000000000000000 \
  --name test-avs-name
```

***

## 2. Deploy an AVS on multiple L2s

Deploy the AVS contracts to **multiple L2 chains**, each managing its own rewards and seamlessly communicating with shared security on L1.

Separate each L2 by commas in `--l2-chain`.&#x20;

```bash
otcli network deploy \
  --l1-chain holesky \
  --l2-chain base-sepolia,amoy,arbitrum-one-sepolia \
  --rewards-token eth \
  --l1-initial-deposit 10000000000000000 \
  --l2-initial-deposit 10000000000000000 \
  --name multi-l2-avs
```

***

## 3. Deploy an AVS with rewards on L2

Specifying the `--l2-rewards` flag enables **reward distribution to operators on L2** instead of L1. If not specified, rewards will be distributed on L1 by default.&#x20;

{% hint style="success" %}
When specifying this flag for an AVS which has multiple L2 deployments, each deployment manages its own accounting and reward flows separately.
{% endhint %}

```bash
otcli network deploy \
    --l1-chain holesky \
    --l2-chain base-sepolia \
    --l2-rewards \
    --rewards-token eth \
    --l1-initial-deposit 10000000000000000 \
    --l2-initial-deposit 10000000000000000 \
    --name l2-rewards-avs 
```

***

## 4. Deploy all AVS contracts on L1

Deploy both L1 and L2 contracts on the **same L1 chain**.

```bash
otcli network deploy \
    --l1-chain holesky \
    --l2-chain holesky-l2 \
    --rewards-token eth \
    --l1-initial-deposit 10000000000000000 \
    --l2-initial-deposit 10000000000000000 \
    --name l1-avs
```

***

## 5. Deploy an AVS with a specified owner address

Deploy the AVS contracts and specify a specific address to serve as the owner or the AVS. **This address can be an EOA or Contract**, for example a Safe Smart Account or Multisig account.

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

```bash
otcli network deploy \
  --l1-chain holesky \
  --l2-chain base-sepolia \
  --rewards-token eth \
  --l1-initial-deposit 10000000000000000 \
  --l2-initial-deposit 10000000000000000 \
  --name multisig-owner-avs \
  --avs-governance-multisig-owner <OWNER_ADDRESS> \
  --browser-sign
```

***

## 6. Deploy with native ETH as rewards token

Deploy AVS contracts to L1 and a **single L2 chain** where operators are rewarded in **ETH**.

```bash
otcli network deploy \
  --l1-chain holesky \
  --l2-chain base-sepolia \
  --rewards-token eth \
  --l1-initial-deposit 10000000000000000 \
  --l2-initial-deposit 10000000000000000 \
  --name eth-rewards-avs
```

***

## 7. Deploy an AVS with browser wallet

This guide will walk you through how to execute CLI operations using a browser wallet.

{% stepper %}
{% step %}

### Run your CLI command with the `--browser-sign` flag

```bash
otcli network deploy \
    --l1-chain sepolia \
    --l2-chain base-sepolia \
    --rewards-token eth \
    --l1-initial-deposit 100000000000000000 \
    --l2-initial-deposit 100000000000000000 \
    --name test-avs-name-123 \
    --browser-sign 
```

{% endstep %}

{% step %}

### Connect Your wallet

If your wallet is not already connected, a browser prompt will appear asking you to connect.

<figure><img src="https://4144525652-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYlSi30nrcEOossIDFFua%2Fuploads%2FUOXLG72zdFwhxjsHj0NX%2FScreenshot%202025-06-10%20at%202.53.55%E2%80%AFPM.png?alt=media&#x26;token=54e1dbe4-5c82-4efc-9c77-a42c2c00d48a" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Select your wallet provider

A browser prompt will open. Select your **MetaMask** wallet

<figure><img src="https://4144525652-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYlSi30nrcEOossIDFFua%2Fuploads%2F9i1sLtr6Lp8giF5d3ZLz%2FScreenshot%202025-06-10%20at%204.03.38%E2%80%AFPM.png?alt=media&#x26;token=5ffa4231-2ef6-4e58-8ccb-dc9297b66084" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Connect to your desired wallet

Connect to the account you want to use for signing.

<figure><img src="https://4144525652-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYlSi30nrcEOossIDFFua%2Fuploads%2FdBH1k0Bv0WkswUSL3Xu8%2FScreenshot%202025-07-03%20at%202.48.19%E2%80%AFPM.png?alt=media&#x26;token=fb16b29b-9be0-4f83-8a55-8d78d9ac0855" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Sign the transaction

MetaMask will prompt you to sign the transaction. Review and approve it.

<figure><img src="https://4144525652-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYlSi30nrcEOossIDFFua%2Fuploads%2F8sojAdcTRFycEgyXOloM%2FScreenshot%202025-07-03%20at%202.54.21%E2%80%AFPM.png?alt=media&#x26;token=eb43c726-ced6-46d3-b947-2f139e8a1a19" alt=""><figcaption><p>Sign Transaction</p></figcaption></figure>

{% endstep %}

{% step %}

### View transaction hash

Once the transaction is signed, the **transaction hash** will be displayed in the browser.

<figure><img src="https://4144525652-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYlSi30nrcEOossIDFFua%2Fuploads%2FCg0OKI5MOxryWbfGDs7j%2FScreenshot%202025-06-10%20at%204.05.14%E2%80%AFPM.png?alt=media&#x26;token=937e619a-68fd-43e3-a4ed-a9b5b1a02bbf" alt=""><figcaption><p>sign transaction</p></figcaption></figure>
{% endstep %}
{% endstepper %}

## View Deployed Addresses

After deployment, view AVS contract addresses by running:

```bash
cat .othentic/state.output.json
```
