- Introduction
- Developer Documentation
- run.sh Script Commands
- V1 Deployments
- V2 Deployments
- Deployment guide
Cross-Chain Transfer Protocol (CCTP) is a permissionless on-chain utility that facilitates USDC transfers securely between blockchains networks via native burning and minting. Circle created it to improve capital efficiency and minimize trust requirements when using USDC across blockchain networks. CCTP enables developers to build multi-chain applications that provide secure, 1:1 transfers of USDC across blockchains for their users.
To learn more about how to integrate with CCTP, please see our developer documentation: https://developers.circle.com/stablecoins/docs/cctp-getting-started.
Please see the examples directory for example scripts interacting with CCTP.
All commands check for installation of rust, solana CLI, and anchor CLI.
# One-time setup
source ./run.sh setup
# Build V1 programs
./run.sh build_v1
# Build V2 programs
./run.sh build_v2
# Clean V1 programs
./run.sh clean_v1
# Clean V2 programs
./run.sh clean_v2
# Run tests on V1 programs
./run.sh test_v1
# Run tests on V2 programs
./run.sh test_v2
Devnet | |
---|---|
MessageTransmitter | CCTPmbSD7gX1bxKPAmg77w8oFzNFpaQiQUWD43TKaecd |
TokenMessengerMinter | CCTPiPYPc6AsJuwueEnWgSgucamXDZwBd53dQ11YiKX3 |
Mainnet | |
---|---|
MessageTransmitter | CCTPmbSD7gX1bxKPAmg77w8oFzNFpaQiQUWD43TKaecd |
TokenMessengerMinter | CCTPiPYPc6AsJuwueEnWgSgucamXDZwBd53dQ11YiKX3 |
Mainnet on-chain progams can be verified with the following steps:
# Checkout deployed commit
git checkout 4b9da71265997e1f29e109837da34e6f783f1a22
# Build a verifiable build
anchor build --verifiable --docker-image backpackapp/build:v0.28.0
# Verify MessageTransmitter
anchor verify --program-name message_transmitter --provider.cluster mainnet --skip-build CCTPmbSD7gX1bxKPAmg77w8oFzNFpaQiQUWD43TKaecd
# Verify TokenMessengerMinter
anchor verify --program-name token_messenger_minter --provider.cluster mainnet --skip-build CCTPiPYPc6AsJuwueEnWgSgucamXDZwBd53dQ11YiKX3
All CCTP V2 code lives in the programs/v2
directory.
Devnet | |
---|---|
MessageTransmitterV2 | CCTPV2Sm4AdWt5296sk4P66VBZ7bEhcARwFaaS9YPbeC |
TokenMessengerMinterV2 | CCTPV2vPZJS2u2BBsUoscuikbYjnpFmbFsvVuJdgUMQe |
Mainnet | |
---|---|
MessageTransmitterV2 | CCTPV2Sm4AdWt5296sk4P66VBZ7bEhcARwFaaS9YPbeC |
TokenMessengerMinterV2 | CCTPV2vPZJS2u2BBsUoscuikbYjnpFmbFsvVuJdgUMQe |
Mainnet on-chain progams can be verified with the following steps:
# Checkout deployed commit
git checkout b37d577fc1dc317ce9bc0316c5063afe38744ce3
# Navigate to V2 directory
cd programs/v2
# Build a verifiable build
anchor build --verifiable
# Verify MessageTransmitter
anchor verify --program-name message_transmitter_v2 --provider.cluster mainnet --skip-build CCTPV2Sm4AdWt5296sk4P66VBZ7bEhcARwFaaS9YPbeC
# Verify TokenMessengerMinter
anchor verify --program-name token_messenger_minter_v2 --provider.cluster mainnet --skip-build CCTPV2vPZJS2u2BBsUoscuikbYjnpFmbFsvVuJdgUMQe
- Clone the repository from https://github.com/circlefin/solana-cctp-contracts.
- Setup dependencies and CLI tools:
./run.sh setup
- Execute
git config core.hooksPath .githooks
to activate pre-commit hooks.
- Install
rust-analyzer
extension
To build the program run ./run.sh build_v1
or ./run.sh build_v2
command from the root solana-cctp-contracts
directory.
V2 builds will be in programs/v2/target
To ensure with certainty that packages are not changed unexpectedly as well as to enable reproducible, verifiable builds, all Cargo dependencies are vendored locally in the vendor directory and enabled via the .cargo/config.toml file.
Tests can be started with:
./run.sh test_v1
or
./run.sh test_v2
By default, integration tests are executed on a local validator.
To deploy the program to the devnet and upload the IDL use the following commands:
anchor deploy --provider.cluster devnet --program-name message_transmitter --program-keypair <PROG_ID_JSON>
anchor deploy --provider.cluster devnet --program-name token_messenger_minter --program-keypair <PROG_ID_JSON>
anchor idl init --provider.cluster devnet --filepath ./target/idl/message_transmitter.json <PROGRAM ID>
anchor idl init --provider.cluster devnet --filepath ./target/idl/token_messenger_minter.json <PROGRAM ID>
Before the first use of the CCTP programs they must be initialized with the MessageTransmitter#initialize and TokenMessenger#initialize instructions. The same applies to V2 programs as well: MessageTransmitterV2#initialize and TokenMessenger#initialize.
License: LICENSE