Skip to main content

Installation & Setup

This guide covers setting up the development environment to work with the EVM CCTP Contracts.

Prerequisites

Before installing, ensure you have the following tools:

Quick Installation

1

Clone and Initialize Submodules

First, initialize and download all required libraries:
git submodule update --init --recursive
This downloads dependencies like OpenZeppelin contracts and other libraries used by CCTP.
2

Install Dependencies

Install Node.js dependencies:
yarn install
3

Install Foundry

Install Foundry CLI from the official website.For Linux and macOS:
curl -L https://foundry.paradigm.xyz | bash
foundryup
To install a specific version of Foundry, see the versioning guide.

VSCode IDE Setup

For the best development experience in Visual Studio Code:
1

Install Solidity Extension

Install the Solidity extension from the VSCode marketplace.
2

Configure Compiler Version

  1. Navigate to any .sol file in the project
  2. Right-click and select Solidity: Change global compiler version (Remote)
  3. Select version 0.7.6
The CCTP contracts are compiled with Solidity 0.7.6. Using a different version may cause compilation errors.
3

Install Solhint Extension

Install the Solhint extension for linting support.Run the linter:
yarn lint

Verify Installation

Test that everything is set up correctly:

Run Unit Tests

forge test
For verbose output with console logs:
forge test -vv
Log verbosity is controlled by the -v flag. Use -vvvvv for maximum verbosity. Learn more in the Foundry documentation.

Run Integration Tests

make anvil-test
This sets up an Anvil test node in a Docker container and runs integration tests.

Alternative Installation: Docker + Foundry

If you prefer using Docker for a containerized environment:
1

Build Foundry Docker Image

make build
2

Run Foundry Commands in Docker

Execute any forge, anvil, or cast command:
docker run --rm foundry "<COMMAND>"
For example:
docker run --rm foundry "forge test"
Some machines (including those with M1 chips) may encounter issues building the Docker image locally. This is a known issue.
3

Use Makefile Shortcuts

The repository includes predefined commands in the Makefile for common operations:
make test        # Run tests in Docker
make anvil-test  # Run integration tests

Development Tools

Testing

forge test

Linting

yarn lint
This lints all .sol files in the src and test directories.

Static Analysis

Run Mythril security analysis on specific contracts:
make analyze-message-transmitter
make analyze-token-messenger-minter
Or analyze individual files:
myth -v4 analyze $FILE_PATH --solc-json mythril.config.json --solv 0.7.6
Static analysis can take several minutes to complete.

Continuous Integration

The repository uses GitHub Actions for automated testing and linting. The workflow configuration is located in .github/workflows/ci.yml.

Security Scanning

Manually trigger Olympix.ai security scanning:
  1. Navigate to the Actions tab on GitHub
  2. Select Olympix Scan from the left sidebar
  3. Choose the branch and click Run workflow

Troubleshooting

If you encounter missing dependencies, re-run:
git submodule update --init --recursive
Ensure you’re using Solidity 0.7.6. Check your VSCode settings or run:
solc --version
This is a known issue with Foundry’s Docker image. Consider using Foundry directly via foundryup instead of Docker.
Ensure all dependencies are installed:
yarn install
git submodule update --init --recursive

Next Steps

Quickstart

Execute your first cross-chain USDC transfer

Deployment Guide

Learn how to deploy CCTP contracts to your chain

Build docs developers (and LLMs) love