Skip to main content

Overview

CCTP V2 contracts use a CREATE2-based deployment strategy to ensure deterministic addresses across chains. The deployment process involves:
  1. Create2Factory: Deploy factory for deterministic deployments
  2. Implementation Contracts: Deploy logic contracts
  3. Proxy Contracts: Deploy proxies pointing to implementations
  4. Setup Remote Resources: Configure cross-chain connections
  5. Key Rotation (Mainnet only): Rotate administrative keys
  6. AddressUtilsExternal: Deploy helper library
All deployment scripts use Forge Scripts and are located in scripts/v2/ directory.

Prerequisites

  • Foundry CLI installed (forge 0.2.0)
  • Git submodules initialized: git submodule update --init --recursive
  • Node.js and Yarn installed: yarn install
  • Sufficient funds in deployer accounts for gas

Deployment Steps

Step 1: Deploy Create2Factory

The Create2Factory enables deterministic address deployment across chains.
1

Configure Environment

Add to your .env file:
Parameters:
  • CREATE2_FACTORY_OWNER: Address that will own the Create2Factory
2

Simulate Deployment

Perform a dry run:
SENDER should match the address derived from CREATE2_FACTORY_OWNER_KEY.
3

Deploy Factory

Deploy the Create2Factory:
Record the deployed factory address for subsequent steps.
Reference: scripts/v2/DeployCreate2Factory.s.sol

Step 2: Deploy V2 Implementation Contracts

Deploy the logic contracts that proxies will delegate to.
1

Configure Environment

Add to your .env file:
Parameters:
  • CREATE2_FACTORY_CONTRACT_ADDRESS: Address from Step 1
  • TOKEN_MINTER_V2_OWNER_KEY: Private key for TokenMinter owner
  • TOKEN_CONTROLLER_ADDRESS: Token controller address
  • DOMAIN: Local domain ID (e.g., 0 for Ethereum, 1 for Avalanche)
  • MESSAGE_BODY_VERSION: Message format version (typically 1)
  • VERSION: Protocol version (typically 2)
2

Simulate Deployment

3

Deploy Implementations

This deploys:
  • MessageTransmitterV2 implementation
  • TokenMessengerV2 implementation
  • TokenMinterV2 implementation
Record all implementation addresses.
Reference: scripts/v2/DeployImplementationsV2.s.sol

Step 3: Deploy V2 Proxies

Deploy proxy contracts with full initialization.
1

Configure Environment

Replace environment variables in .env:
Important: REMOTE_DOMAINS, REMOTE_USDC_CONTRACT_ADDRESSES, and REMOTE_TOKEN_MESSENGER_V2_ADDRESSES must correspond 1:1:1 in order.
New V2 Role Addresses:
  • TOKEN_MESSENGER_V2_FEE_RECIPIENT_ADDRESS: Receives collected fees
  • TOKEN_MESSENGER_V2_DENYLISTER_ADDRESS: Manages protocol denylist
  • TOKEN_MESSENGER_V2_MIN_FEE_CONTROLLER_ADDRESS: Sets minimum fees
  • TOKEN_MESSENGER_V2_MIN_FEE: Initial minimum fee in 1/1000 basis points
2

Simulate Deployment

3

Deploy Proxies

This deploys and initializes:
  • MessageTransmitterV2 proxy
  • TokenMessengerV2 proxy
  • TokenMinterV2 proxy
All contracts are fully initialized with roles and remote configurations.
Reference: scripts/v2/DeployProxiesV2.s.sol

Step 4: Setup Additional Remote Resources

Only perform steps 4-7 for additional remote resources NOT already configured in Step 3.
If you need to add more remote chains after initial deployment:
1

Configure Environment

Update .env with additional remote configuration:
Add one remote resource at a time, repeating these steps for each remote chain.
2

Simulate Setup

3

Setup Remote Resources

This:
  • Links remote TokenMessenger
  • Configures remote USDC token pair
4

Repeat for Each Remote Chain

Repeat steps 1-3 for each additional remote chain you want to support.
Reference: scripts/v2/SetupRemoteResourcesV2.s.sol

Step 5: Key Rotation (Mainnet Only)

Mainnet Only: This step should only be performed on mainnet deployments. Skip for testnets.
1

Configure Environment

Add to your .env file:
2

Simulate Key Rotation

3

Rotate Keys

This transfers ownership of all V2 contracts to new owner addresses.
Reference: scripts/v2/RotateKeysV2.s.sol

Step 6: Deploy AddressUtilsExternal

Deploy the helper library for easy integration.
1

Configure Environment

Ensure CREATE2_FACTORY_CONTRACT_ADDRESS is set in .env:
2

Simulate Deployment

3

Deploy AddressUtilsExternal

This deploys AddressUtilsExternal to a deterministic address for easy integration.
Reference: scripts/v2/DeployAddressUtilsExternal.s.sol

Predicting CREATE2 Addresses

You can predict deployment addresses before deploying:
Reference: scripts/v2/PredictCreate2Deployments.s.sol

Role Configuration Summary

MessageTransmitterV2 Roles

TokenMessengerV2 Roles

TokenMinterV2 Roles

Environment Variables Checklist

Post-Deployment Verification

After deployment, verify:
1

Contract Addresses

Record all deployed addresses:
  • Create2Factory
  • MessageTransmitterV2 (implementation & proxy)
  • TokenMessengerV2 (implementation & proxy)
  • TokenMinterV2 (implementation & proxy)
  • AddressUtilsExternal
2

Role Configuration

Verify all roles are set correctly:
3

Remote Configuration

Verify remote token messengers are linked:
4

Fee Configuration

Verify fee settings:

Troubleshooting

Simulation Fails

  • Verify all environment variables are set correctly
  • Check that SENDER has sufficient funds for gas
  • Ensure RPC_URL is accessible and correct
  • Verify private keys match expected addresses

CREATE2 Address Mismatch

  • Ensure Create2Factory address is consistent across chains
  • Verify constructor parameters match exactly
  • Check that salt values are identical

Initialization Fails

  • Verify all role addresses are non-zero
  • Check that remote arrays have equal length
  • Ensure owner address is set correctly

Remote Resources Not Linking

  • Verify remote domain IDs are correct
  • Check that remote TokenMessenger addresses are bytes32 format
  • Ensure TokenMinter has correct token pairs configured

Next Steps

Test Deployment

Test your V2 deployment

Integration Guide

Integrate V2 into your application

Migration Guide

Migrate from V1 to V2

API Reference

Complete V2 API documentation