> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/circlefin/evm-cctp-contracts/llms.txt
> Use this file to discover all available pages before exploring further.

# V1 Deployment Guide

> Deploy EVM CCTP Contracts V1 to your network

## Overview

The CCTP V1 contracts are deployed using [Forge Scripts](https://book.getfoundry.sh/tutorials/solidity-scripting). This guide walks you through the deployment process step by step.

## Prerequisites

* Foundry CLI installed (forge 0.2.0)
* Git submodules initialized: `git submodule update --init --recursive`
* Node.js and Yarn installed: `yarn install`

## Environment Variables

Add the following environment variables to your `.env` file:

### Deployer Keys

```bash theme={null}
MESSAGE_TRANSMITTER_DEPLOYER_KEY=<private_key>
TOKEN_MESSENGER_DEPLOYER_KEY=<private_key>
TOKEN_MINTER_DEPLOYER_KEY=<private_key>
TOKEN_CONTROLLER_DEPLOYER_KEY=<private_key>
```

### Contract Addresses

```bash theme={null}
ATTESTER_ADDRESS=<address>
USDC_CONTRACT_ADDRESS=<address>
REMOTE_USDC_CONTRACT_ADDRESS=<address>
```

### Administrative Addresses

```bash theme={null}
MESSAGE_TRANSMITTER_PAUSER_ADDRESS=<address>
TOKEN_MINTER_PAUSER_ADDRESS=<address>
MESSAGE_TRANSMITTER_RESCUER_ADDRESS=<address>
TOKEN_MESSENGER_RESCUER_ADDRESS=<address>
TOKEN_MINTER_RESCUER_ADDRESS=<address>
TOKEN_CONTROLLER_ADDRESS=<address>
```

### Domain Configuration

```bash theme={null}
DOMAIN=<uint32>
REMOTE_DOMAIN=<uint32>
BURN_LIMIT_PER_MESSAGE=<uint256>
```

### Remote Bridge Configuration

Choose one of the following options:

**Option 1: Automatic (Recommended)**

1. Add `REMOTE_TOKEN_MESSENGER_DEPLOYER` to your `.env` file
2. Run the precompute script:

```bash theme={null}
python scripts/precomputeRemoteMessengerAddress.py --REMOTE_RPC_URL <url>
```

This will automatically add `REMOTE_TOKEN_MESSENGER_ADDRESS` to your `.env` file.

**Option 2: Manual**

Manually add the remote token messenger address:

```bash theme={null}
REMOTE_TOKEN_MESSENGER_ADDRESS=<address>
```

## Deployment Steps

<Steps>
  <Step title="Simulate Deployment">
    Perform a dry run to verify your configuration:

    ```bash theme={null}
    make simulate-deploy RPC_URL=<RPC_URL> SENDER=<SENDER>
    ```

    <Note>
      Use an address from one of the private keys above as `SENDER`. It is used to deploy the shared libraries that contracts use.
    </Note>
  </Step>

  <Step title="Deploy Contracts">
    Deploy the contracts to your network:

    ```bash theme={null}
    make deploy RPC_URL=<RPC_URL> SENDER=<SENDER>
    ```

    The deployment script will:

    * Deploy MessageTransmitter contract
    * Deploy TokenMessenger contract
    * Deploy TokenMinter contract
    * Configure cross-chain messaging
    * Link remote token messenger
  </Step>

  <Step title="Verify Deployment">
    After deployment, verify that:

    * All contracts are deployed successfully
    * Contract addresses are recorded
    * Administrative roles are configured correctly
    * Remote bridges are linked
  </Step>
</Steps>

## Deployment Script

The deployment script is located at `scripts/v1/deploy.s.sol` in the source repository.

## Alternative: Docker Deployment

You can also deploy using Docker:

```bash theme={null}
# Build Foundry Docker image
make build

# Run deployment in Docker
docker run --rm foundry "make deploy RPC_URL=<RPC_URL> SENDER=<SENDER>"
```

<Note>
  Some machines (including those with M1 chips) may be unable to build the Docker image locally. This is a known issue.
</Note>

## Next Steps

After deployment:

1. Record all deployed contract addresses
2. Configure attesters and authorized callers
3. Test the deployment with a [cross-chain transfer](/guides/cross-chain-transfer)
4. Set up monitoring and indexing for your contracts

## Troubleshooting

### Simulation Fails

* Verify all environment variables are set correctly
* Check that the SENDER address has sufficient funds
* Ensure RPC\_URL is accessible and points to the correct network

### Deployment Fails

* Check gas limits and network congestion
* Verify deployer keys have sufficient funds
* Review deployment logs for specific error messages

### Remote Bridge Configuration Issues

* Ensure REMOTE\_DOMAIN matches the destination chain's domain ID
* Verify REMOTE\_TOKEN\_MESSENGER\_ADDRESS is correct
* Check that remote chain contracts are deployed first if bidirectional
