Skip to main content

Overview

This guide helps you migrate your CCTP integration from V1 to V2 contracts. V2 introduces breaking changes in function signatures and event structures that require code updates.
V1 and V2 are separate protocol deployments. You cannot send V1 messages to V2 contracts or vice versa. Both versions can coexist on the same chain.

Migration Checklist

  • Review new V2 features and determine which to use
  • Update depositForBurn function calls with new parameters
  • Replace depositForBurnWithCaller usage
  • Update event listeners for new event signatures
  • Add fee calculation logic
  • Configure new role addresses
  • Update message handler interface (if applicable)
  • Deploy or connect to V2 contracts
  • Test integration thoroughly

API Changes

depositForBurn Function

The depositForBurn function signature has changed significantly.

V1 to V2 Comparison

Parameter Mapping

Migration Example

depositForBurnWithCaller Removal

depositForBurnWithCaller is removed in V2. Use depositForBurn with the destinationCaller parameter instead.

replaceDepositForBurn

replaceDepositForBurn() is not available in V2. Message replacement functionality has been removed.
If you rely on message replacement:
  1. Alternative 1: Send a new message with updated parameters
  2. Alternative 2: Implement application-level message invalidation logic
  3. Alternative 3: Use hook data to encode conditional logic

Event Changes

DepositForBurn Event

The event signature has changed significantly.

Event Structure Comparison

Migration Impact

Key Changes:
  • nonce removed (was indexed)
  • minFinalityThreshold added (indexed)
  • maxFee added
  • hookData added

Event Listener Migration

MintAndWithdraw Event

Migration: Update event listeners to include feeCollected field.

Fee Management

Calculating Fees

V2 requires fee calculation before calling depositForBurn.

Fee Recipient

Set up fee collection:

Zero Fee Transfers

To avoid fees entirely, use finalized messages:
Finalized messages take longer to process but don’t incur fees.

Message Handler Interface

If you implement custom message handlers, update your interface.

Interface Changes

Role Configuration

V2 introduces new administrative roles.

Required Role Addresses

Role Responsibilities

Contract Interface Differences

New Functions in V2

Removed Functions in V2

Smart Contract Migration Example

Complete example showing V1 to V2 migration:

Frontend Integration Changes

ethers.js v6 Example

Testing Your Migration

Test Checklist

1

Test Fee Calculation

2

Test Basic Transfer

3

Test Hook Transfer

4

Test Event Parsing

Common Migration Issues

Issue: “Insufficient max fee” Error

Cause: maxFee is less than the minimum required fee. Solution: Call getMinFeeAmount() before depositForBurn():

Issue: Missing Nonce in V2

Cause: V2 doesn’t return nonce from depositForBurn(). Solution: Use transaction hash or event filtering instead:

Issue: “Caller is denylisted” Error

Cause: Calling address is on the protocol denylist. Solution: Check denylist status:

Issue: Wrong destinationCaller Format

Cause: Using address instead of bytes32. Solution: Convert address to bytes32:

Next Steps

V2 Deployment

Deploy V2 contracts to your network

TokenMessengerV2 API

Complete V2 API reference

Integration Guide

Build on CCTP V2

Testing Guide

Test your V2 integration