> ## Documentation Index
> Fetch the complete documentation index at: https://docs.layerzero.network/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploying LayerZero Contracts

> Deploy LayerZero contracts to multiple chains using the CLI and hardhat-deploy plugin. Select chains and verify deployments easily. Deploy across multiple bl...

The LayerZero CLI tool uses the [hardhat-deploy](https://www.npmjs.com/package/hardhat-deploy) plugin to deploy contracts on multiple chains.

After adding your `MNEMONIC` or `PRIVATE_KEY` to your dotenv file and adding networks in your `hardhat.config.ts`, run the following command to deploy your LayerZero contracts:

```bash wrap theme={null}
npx hardhat lz:deploy
```

### Selecting Chains

You will be prompted to select which chains to deploy to:

```bash wrap theme={null}
info:    Compiling you hardhat project
Nothing to compile
? Which networks would you like to deploy? ›
Instructions:
    ↑/↓: Highlight option
    ←/→/[space]: Toggle selection
    [a,b,c]/delete: Filter choices
    enter/return: Complete answer

Filtered results for: Enter something to filter

◉  fuji
◉  amoy
◉  sepolia
```

If you wish to deploy to all blockchain networks selected, simply hit enter to continue deployment.

To deselect a chain for deployment, highlight the chain and toggle the selection using the space bar or arrow keys:

```bash wrap theme={null}
Filtered results for: Enter something to filter

◉  fuji
◯  amoy
◉  sepolia
```

### Adding Deploy Script Tags

Afterwards you'll be prompted to choose which deploy script tags to use. By default, each CLI example contains a starter deploy script, with the deploy script tag being the contract name:

```typescript wrap theme={null}
deploy.tags = [contractName];
```

<Tabs>
  <Tab title="OApp">
    The generic message passing standard for creating [Omnichain Applications (OApps)](../../developers/evm/oapp/overview):

    ```bash wrap theme={null}
    info:    Compiling you hardhat project
    Nothing to compile
    ✔ Which networks would you like to deploy? › bsc_testnet, amoy, sepolia
    ? Which deploy script tags would you like to use? › MyOApp
    ```
  </Tab>

  <Tab title="OFT">
    An ERC20 extended with core bridging logic from OApp, creating an [Omnichain Fungible Token (OFT)](../../developers/evm/oft/quickstart):

    ```bash wrap theme={null}
    info:    Compiling you hardhat project
    Nothing to compile
    ✔ Which networks would you like to deploy? › bsc_testnet, amoy, sepolia
    ? Which deploy script tags would you like to use? › MyOFT
    ```
  </Tab>

  <Tab title="OFT Adapter">
    Variant of OFT for adapting deployed ERC20 tokens as Omnichain Fungible Tokens, creating an [OFT Adapter](../../developers/evm/oft/quickstart):

    ```bash wrap theme={null}
    info:    Compiling you hardhat project
    Nothing to compile
    ✔ Which networks would you like to deploy? › bsc_testnet, amoy, sepolia
    ? Which deploy script tags would you like to use? › MyOFTAdapter
    ```
  </Tab>

  <Tab title="ONFT">
    An ERC721 extended with core bridging logic from OApp, creating an [Omnichain Non-Fungible Token (ONFT)](../../developers/evm/onft/quickstart):

    ```bash wrap theme={null}
    info:    Compiling you hardhat project
    Nothing to compile
    ✔ Which networks would you like to deploy? › bsc_testnet, amoy, sepolia
    ? Which deploy script tags would you like to use? › MyONFT
    ```
  </Tab>
</Tabs>

You will need to add a new deploy script for any new contracts added to the repo.

### Running the Deployer

After selecting either all or a specific deploy script, the deployer will those contracts on your specified chains.

```bash wrap theme={null}
warn:    Will use all deployment scripts
✔ Do you want to continue? … yes
Network: amoy
Deployer: 0x0000000000000000000000000000000000000000
Network: fuji
Deployer: 0x0000000000000000000000000000000000000000
Network: sepolia
Deployer: 0x0000000000000000000000000000000000000000
Deployed contract: MyOFT, network: amoy, address: 0x0000000000000000000000000000000000000000
Deployed contract: MyOFT, network: fuji, address: 0x0000000000000000000000000000000000000000
Deployed contract: MyOFT, network: sepolia, address: 0x0000000000000000000000000000000000000000
info:    ✓ Your contracts are now deployed
```

You should see an output in your `./deployments` folder, or have one generated, containing your contracts:

```typescript wrap theme={null}
contracts / // your contracts folder
  deploy / // hardhat-deploy scripts
  deployments / // your hardhat-deploy deployments
  amoy / // network name defined in hardhat.config.ts
  MyOFT.json; // deployed-contract json
fuji / MyOFT.json;
sepolia / MyOFT.json;
test / // unit-tests, both hardhat and foundry enabled
  foundry.toml; // normal foundry.toml for remappings and project configuration
hardhat.config.ts; // standard hardhat.config.ts, with layerzero endpoint mappings
layerzero.config.ts; // special LayerZero config file (more on this later)
```

Your contract deployments can now be configured in your `layerzero.config.ts`!
