Skip to main content

Overview

The CCTP V1 contracts are deployed using Forge Scripts. 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

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

ATTESTER_ADDRESS=<address>
USDC_CONTRACT_ADDRESS=<address>
REMOTE_USDC_CONTRACT_ADDRESS=<address>

Administrative Addresses

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

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:
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:
REMOTE_TOKEN_MESSENGER_ADDRESS=<address>

Deployment Steps

1

Simulate Deployment

Perform a dry run to verify your configuration:
make simulate-deploy RPC_URL=<RPC_URL> SENDER=<SENDER>
Use an address from one of the private keys above as SENDER. It is used to deploy the shared libraries that contracts use.
2

Deploy Contracts

Deploy the contracts to your network:
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
3

Verify Deployment

After deployment, verify that:
  • All contracts are deployed successfully
  • Contract addresses are recorded
  • Administrative roles are configured correctly
  • Remote bridges are linked

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:
# Build Foundry Docker image
make build

# Run deployment in Docker
docker run --rm foundry "make deploy RPC_URL=<RPC_URL> SENDER=<SENDER>"
Some machines (including those with M1 chips) may be unable to build the Docker image locally. This is a known issue.

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
  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

Build docs developers (and LLMs) love