Skip to content

Conversation

@toblich
Copy link
Contributor

@toblich toblich commented Jun 11, 2025

Changes:

  • Adds a new CCTP Token Pool, which can use CCTP under the hood to bridge the tokens (e.g. USDC)
  • Adds a "full" counter in the onramp Nonce PDA that is always incremented. It is a quick way of uniquely identifying each message of a given sender to a given remote chain. This means migrating the PDA to accommodate a new u64 in it
  • Adds the new "full" nonce to the LockOrBurnInV1 interface between the router & pools. The router must thus be upgraded before the pools are upgraded
  • To run integration tests using the real CCTP contracts, this adds a target/vendor folder with compiled binaries, so we can deploy those contracts in our CI

devin-ai-integration bot and others added 23 commits June 11, 2025 14:46
…lizing CCTP (#1)

# Solana USDC Token Pool for CCIP utilizing CCTP

This PR adds a new Solana contract that acts as a USDC Token Pool for
CCIP, utilizing CCTP. The implementation follows the existing burnmint
token pool interface and integrates with CCTP for cross-chain USDC
transfers.

## Implementation Details

- Created a new Anchor program for the USDC Token Pool using Anchor 0.29
- Implemented the burnmint token pool interface for compatibility with
existing CCIP infrastructure
- Added CCTP integration for token burning and minting
- Utilized CCTP's `deposit_for_burn_with_caller` for token burning
during onramp
- Utilized CCTP's `receive_message` for token minting during offramp

## TODO

- Complete the implementation of the CCTP integration with actual
cross-program invocations
- Add unit tests for the USDC Token Pool
- Update the program ID with a proper ID when registered

## Link to Devin run
https://app.devin.ai/sessions/79017ec0e8f440208faf891fbf4eeef8

Requested by: tobias.lichtig@smartcontract.com

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: tobias.lichtig@smartcontract.com <toblich@gmail.com>
Co-authored-by: Tobías Lichtig <toblich@users.noreply.github.com>
…lana contract (#2)

# Mock CCTP Message Transmitter Contract for Solana

This PR adds a mock implementation of the CCTP message_transmitter
Solana contract for integration testing purposes. The mock adheres to
the same interface as the real contract but with minimal logic.

## Implementation Details

- Created a new Anchor program in
`chainlink-ccip/chains/solana/contracts/programs/cctp-message-transmitter-mock`
- Implemented all methods from the original contract with minimal logic
- Added proper account structures and instruction parameters to match
the original interface
- Used the same program ID as the real contract for easy substitution in
tests
- Added `/// CHECK:` comments for all unchecked accounts to satisfy
Anchor's safety requirements

## Testing

- Verified that the contract compiles successfully with `anchor build`

This will facilitate future integration tests where the CCTP contracts
are treated as external dependencies that require mocking.

Link to Devin run:
https://app.devin.ai/sessions/819f9620d87940b1968c0442e71881eb
Requested by: tobias.lichtig@smartcontract.com

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: tobias.lichtig@smartcontract.com <toblich@gmail.com>
Co-authored-by: Tobías Lichtig <toblich@users.noreply.github.com>
… Solana contract (#3)

# Mock CCTP Token Messenger Minter Contract for Solana

This PR adds a mock implementation of the CCTP token-messenger-minter
Solana contract for integration testing purposes. The mock adheres to
the same interface as the real contract but with minimal logic.

## Implementation Details

- Created a new Anchor program in
`chainlink-ccip/chains/solana/contracts/programs/cctp-token-messenger-minter-mock`
- Implemented all methods from the original contract with minimal logic
- Added proper account structures and instruction parameters to match
the original interface
- Used the same program ID as the real contract for easy substitution in
tests
- Added `/// CHECK:` comments for all unchecked accounts to satisfy
Anchor's safety requirements

## Testing

- Verified that the contract compiles successfully with `anchor build`

This will facilitate future integration tests where the CCTP contracts
are treated as external dependencies that require mocking.

Link to Devin run:
https://app.devin.ai/sessions/819f9620d87940b1968c0442e71881eb
Requested by: tobias.lichtig@smartcontract.com

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: tobias.lichtig@smartcontract.com <toblich@gmail.com>
Co-authored-by: Tobías Lichtig <toblich@users.noreply.github.com>
)

Removes the CCTP mocks. Instead, starts a tokenpool test suite that uses
the real CCTP contracts (deployed locally and initialized/configured),
so we can test the actual integration.
…e seed. Add new field in Nonce account (#8)

For CCTP, we need to derive the message-sent account address
deterministically so as to make discoverability for the offchain easy.
This adds a new full_nonce that is always incremented, and identifies
any message for a particular user to a particular destination chain.
This PR also includes (untested) code to migrate the Nonce account from
the single-counter schema to the new extended dual-counter one.
Because EVM does not have access to the token receiver's ATA, the CCTP
message cannot be sent from EVM with the right mint_recipient. Thus, the
workaround is to always send the CCTP funds to an intermediary TP-owned
ATA, and then have the TP transfer the funds to the actual token
receiver.
…of the cctp message event account (#10)

The offchain does not have easy access to the new `full_nonce` of the
message. So, emit a new event in the TP that allows it to get to CCTP's
message sent event
@toblich toblich force-pushed the tobi/cctp-tp-svm branch from af4ca89 to 2dfd8e9 Compare June 11, 2025 17:46
toblich added 4 commits June 12, 2025 22:43
Working on devnet, until the point where it fails to serialize from router -> tp

Able to send a message

On the way to fixing nonce migration

Improved nonce account handling

Cleanup
@github-actions
Copy link

Metric tobi/cctp-tp-svm main
Coverage 70.0% 69.9%

@toblich toblich closed this Jul 3, 2025
@toblich toblich deleted the tobi/cctp-tp-svm branch July 3, 2025 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant