-
Notifications
You must be signed in to change notification settings - Fork 21
SVM CCTP Token Pool #1004
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
SVM CCTP Token Pool #1004
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…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>
…lar contexts to real contract
…imilar to burnmint pool contexts
…rom switch statement to PDA state
…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
af4ca89 to
2dfd8e9
Compare
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
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes:
NoncePDA 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 newu64in itLockOrBurnInV1interface between the router & pools. The router must thus be upgraded before the pools are upgradedtarget/vendorfolder with compiled binaries, so we can deploy those contracts in our CI