-
Notifications
You must be signed in to change notification settings - Fork 21
SVM CCTP Token Pool + SVM accounts auto-derivation #1018
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
Conversation
…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
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
Support messaging accounts Integration tests for the message-only case Refactor and cleanup
* Add fund manager * Add fund retrieval * Add minimum signer funds and closure event * Address review comments * Address review comments
| /// again, including exactly these accounts as the `remaining_accounts`. | ||
| /// * `lookup_tables_to_save`: The caller must save those LUTs. They can be used for `ccip_execute`. | ||
| /// * `current_stage`: A string describing the current stage of the derivation process. When the stage | ||
| /// is "TokenTransferAccounts", it means the `accounts_to_save` block in this response contains |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow up: Update this comment.
| FinishMainAccountList, | ||
| RetrieveTokenLUTs, | ||
| RetrievePoolPrograms, | ||
| // N stages, one per token |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow up: Remove this line
| /// again, including exactly these accounts as the `remaining_accounts`. | ||
| /// * `lookup_tables_to_save`: The caller must save those LUTs. They can be used for `ccip_send`. | ||
| /// * `current_stage`: A string describing the current stage of the derivation process. When the stage | ||
| /// is "TokenTransferAccounts", it means the `accounts_to_save` block in this response contains |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update comment
|
Includes changes from #1004 and #982, and more. Main changes:
Other minor changes:
NoncePDAs andTokenAdminRegistryPDAs to their respective new versions