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:
This downloads dependencies like OpenZeppelin contracts and other libraries used by CCTP.
2

Install Dependencies

Install Node.js dependencies:
3

Install Foundry

Install Foundry CLI from the official website.For Linux and macOS:
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:

Verify Installation

Test that everything is set up correctly:

Run Unit Tests

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

Run Integration Tests

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

2

Run Foundry Commands in Docker

Execute any forge, anvil, or cast command:
For example:
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:

Development Tools

Testing

Linting

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

Static Analysis

Run Mythril security analysis on specific contracts:
Or analyze individual files:
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:
Ensure you’re using Solidity 0.7.6. Check your VSCode settings or run:
This is a known issue with Foundry’s Docker image. Consider using Foundry directly via foundryup instead of Docker.
Ensure all dependencies are installed:

Next Steps

Quickstart

Execute your first cross-chain USDC transfer

Deployment Guide

Learn how to deploy CCTP contracts to your chain