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
Contract Addresses
Administrative Addresses
Domain Configuration
Remote Bridge Configuration
Choose one of the following options: Option 1: Automatic (Recommended)- Add
REMOTE_TOKEN_MESSENGER_DEPLOYERto your.envfile - Run the precompute script:
REMOTE_TOKEN_MESSENGER_ADDRESS to your .env file.
Option 2: Manual
Manually add the remote token messenger address:
Deployment Steps
Simulate Deployment
Perform a dry run to verify your configuration:
Use an address from one of the private keys above as
SENDER. It is used to deploy the shared libraries that contracts use.Deploy Contracts
Deploy the contracts to your network:The deployment script will:
- Deploy MessageTransmitter contract
- Deploy TokenMessenger contract
- Deploy TokenMinter contract
- Configure cross-chain messaging
- Link remote token messenger
Deployment Script
The deployment script is located atscripts/v1/deploy.s.sol in the source repository.
Alternative: Docker Deployment
You can also deploy using Docker: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:- Record all deployed contract addresses
- Configure attesters and authorized callers
- Test the deployment with a cross-chain transfer
- 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